@blocklet/payment-react 1.18.55 → 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.
- 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 +28 -7
- 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/input.d.ts +11 -20
- package/es/components/input.js +46 -43
- 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/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +151 -73
- 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/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.js +2 -4
- package/es/libs/validator.js +2 -4
- 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 +107 -65
- 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 +5 -14
- 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 +2 -9
- package/es/payment/product-item.js +185 -142
- 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 +2 -17
- package/es/payment/summary.js +184 -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 +11 -7
- 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/input.d.ts +11 -20
- package/lib/components/input.js +20 -23
- 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/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +49 -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.js +2 -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.js +1 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +1 -1
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +1 -1
- 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 +19 -15
- 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 +7 -16
- 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 +2 -9
- package/lib/payment/product-item.js +24 -25
- 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 +2 -17
- package/lib/payment/summary.js +44 -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 +22 -8
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/input.tsx +49 -45
- 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/invoice/list.tsx +74 -35
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- 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 +30 -12
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +10 -21
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +46 -24
- 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 +74 -42
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
package/lib/checkout/form.js
CHANGED
|
@@ -14,7 +14,7 @@ var _util = require("../libs/util");
|
|
|
14
14
|
var _payment = _interopRequireDefault(require("../payment"));
|
|
15
15
|
var _theme = require("../theme");
|
|
16
16
|
var _donationForm = _interopRequireDefault(require("../payment/donation-form"));
|
|
17
|
-
function _interopRequireDefault(
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
18
|
const promises = {};
|
|
19
19
|
const startFromPaymentLink = (id, params) => {
|
|
20
20
|
if (!promises[id]) {
|
|
@@ -34,13 +34,13 @@ const fetchCheckoutSession = async id => {
|
|
|
34
34
|
};
|
|
35
35
|
function CheckoutForm({
|
|
36
36
|
id,
|
|
37
|
-
mode,
|
|
38
|
-
onPaid,
|
|
39
|
-
onError,
|
|
37
|
+
mode = "inline",
|
|
38
|
+
onPaid = _noop.default,
|
|
39
|
+
onError = console.error,
|
|
40
40
|
onChange,
|
|
41
41
|
goBack,
|
|
42
|
-
extraParams,
|
|
43
|
-
action,
|
|
42
|
+
extraParams = {},
|
|
43
|
+
action = "",
|
|
44
44
|
theme = "default",
|
|
45
45
|
formType = "payment",
|
|
46
46
|
...restProps
|
|
@@ -119,12 +119,4 @@ function CheckoutForm({
|
|
|
119
119
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_theme.PaymentThemeProvider, {
|
|
120
120
|
children: Checkout
|
|
121
121
|
});
|
|
122
|
-
}
|
|
123
|
-
CheckoutForm.defaultProps = {
|
|
124
|
-
onPaid: _noop.default,
|
|
125
|
-
onError: console.error,
|
|
126
|
-
mode: "inline",
|
|
127
|
-
action: "",
|
|
128
|
-
extraParams: {},
|
|
129
|
-
formType: "payment"
|
|
130
|
-
};
|
|
122
|
+
}
|
package/lib/checkout/table.js
CHANGED
|
@@ -18,7 +18,7 @@ var _util = require("../libs/util");
|
|
|
18
18
|
var _form = _interopRequireDefault(require("./form"));
|
|
19
19
|
var _theme = require("../theme");
|
|
20
20
|
var _truncatedText = _interopRequireDefault(require("../components/truncated-text"));
|
|
21
|
-
function _interopRequireDefault(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
const fetchData = async id => {
|
|
23
23
|
const {
|
|
24
24
|
data
|
|
@@ -103,8 +103,8 @@ function CheckoutTableInner({
|
|
|
103
103
|
if (mode === "standalone") {
|
|
104
104
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
105
105
|
direction: "column",
|
|
106
|
-
alignItems: "center",
|
|
107
106
|
sx: {
|
|
107
|
+
alignItems: "center",
|
|
108
108
|
overflow: {
|
|
109
109
|
xs: "auto",
|
|
110
110
|
md: "hidden"
|
|
@@ -140,9 +140,9 @@ function CheckoutTableInner({
|
|
|
140
140
|
ml: 0
|
|
141
141
|
}
|
|
142
142
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
143
|
-
color: "text.primary",
|
|
144
|
-
fontWeight: 600,
|
|
145
143
|
sx: {
|
|
144
|
+
color: "text.primary",
|
|
145
|
+
fontWeight: 600,
|
|
146
146
|
lineHeight: "32px",
|
|
147
147
|
fontSize: "24px"
|
|
148
148
|
},
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
|
|
2
|
-
|
|
2
|
+
export default function TxGas(props: {
|
|
3
3
|
details: PaymentDetails;
|
|
4
4
|
method: TPaymentMethod;
|
|
5
5
|
}): import("react").JSX.Element;
|
|
6
|
-
declare namespace TxGas {
|
|
7
|
-
var defaultProps: {};
|
|
8
|
-
}
|
|
9
|
-
export default TxGas;
|
|
@@ -10,7 +10,6 @@ var _material = require("@mui/material");
|
|
|
10
10
|
var _util = require("@ocap/util");
|
|
11
11
|
var _payment = require("../../contexts/payment");
|
|
12
12
|
var _util2 = require("../../libs/util");
|
|
13
|
-
TxGas.defaultProps = {};
|
|
14
13
|
function TxGas(props) {
|
|
15
14
|
const {
|
|
16
15
|
t
|
|
@@ -31,7 +30,9 @@ function TxGas(props) {
|
|
|
31
30
|
}
|
|
32
31
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
33
32
|
component: "small",
|
|
34
|
-
|
|
33
|
+
sx: {
|
|
34
|
+
color: "text.secondary"
|
|
35
|
+
},
|
|
35
36
|
children: t("common.none")
|
|
36
37
|
});
|
|
37
38
|
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
|
|
2
|
-
|
|
2
|
+
export default function TxLink(rawProps: {
|
|
3
3
|
details: PaymentDetails;
|
|
4
4
|
method: TPaymentMethod;
|
|
5
5
|
mode?: 'customer' | 'dashboard';
|
|
6
6
|
align?: 'left' | 'right';
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
|
-
declare namespace TxLink {
|
|
9
|
-
var defaultProps: {
|
|
10
|
-
mode: string;
|
|
11
|
-
align: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default TxLink;
|
|
@@ -10,18 +10,20 @@ var _iconsMaterial = require("@mui/icons-material");
|
|
|
10
10
|
var _material = require("@mui/material");
|
|
11
11
|
var _system = require("@mui/system");
|
|
12
12
|
var _util = require("../../libs/util");
|
|
13
|
-
TxLink
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
function TxLink(rawProps) {
|
|
14
|
+
const props = Object.assign({
|
|
15
|
+
mode: "dashboard",
|
|
16
|
+
align: "left"
|
|
17
|
+
}, rawProps);
|
|
18
18
|
const {
|
|
19
19
|
t
|
|
20
20
|
} = (0, _context.useLocaleContext)();
|
|
21
21
|
if (!props.details || props.mode === "customer" && props.method.type === "stripe") {
|
|
22
22
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
23
23
|
component: "small",
|
|
24
|
-
|
|
24
|
+
sx: {
|
|
25
|
+
color: "text.secondary"
|
|
26
|
+
},
|
|
25
27
|
children: t("common.none")
|
|
26
28
|
});
|
|
27
29
|
}
|
|
@@ -56,7 +58,9 @@ function TxLink(props) {
|
|
|
56
58
|
}
|
|
57
59
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
58
60
|
component: "small",
|
|
59
|
-
|
|
61
|
+
sx: {
|
|
62
|
+
color: "text.secondary"
|
|
63
|
+
},
|
|
60
64
|
children: t("common.none")
|
|
61
65
|
});
|
|
62
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventHandler } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, color, cancel, loading, }: {
|
|
3
3
|
onConfirm: EventHandler<any>;
|
|
4
4
|
onCancel: EventHandler<any>;
|
|
5
5
|
title: string | React.ReactNode;
|
|
@@ -9,12 +9,3 @@ declare function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, c
|
|
|
9
9
|
cancel?: boolean | string | React.ReactNode;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
12
|
-
declare namespace ConfirmDialog {
|
|
13
|
-
var defaultProps: {
|
|
14
|
-
loading: boolean;
|
|
15
|
-
confirm: string;
|
|
16
|
-
cancel: string;
|
|
17
|
-
color: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export default ConfirmDialog;
|
|
@@ -13,10 +13,10 @@ function ConfirmDialog({
|
|
|
13
13
|
onCancel,
|
|
14
14
|
title,
|
|
15
15
|
message,
|
|
16
|
-
confirm,
|
|
17
|
-
color,
|
|
18
|
-
cancel,
|
|
19
|
-
loading
|
|
16
|
+
confirm = "",
|
|
17
|
+
color = "error",
|
|
18
|
+
cancel = "",
|
|
19
|
+
loading = false
|
|
20
20
|
}) {
|
|
21
21
|
const {
|
|
22
22
|
t
|
|
@@ -47,10 +47,4 @@ function ConfirmDialog({
|
|
|
47
47
|
children: message
|
|
48
48
|
})
|
|
49
49
|
});
|
|
50
|
-
}
|
|
51
|
-
ConfirmDialog.defaultProps = {
|
|
52
|
-
loading: false,
|
|
53
|
-
confirm: "",
|
|
54
|
-
cancel: "",
|
|
55
|
-
color: "error"
|
|
56
|
-
};
|
|
50
|
+
}
|
|
@@ -7,5 +7,6 @@ export type CountrySelectProps = {
|
|
|
7
7
|
sx?: SxProps;
|
|
8
8
|
showDialCode?: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export default function CountrySelect({ ref, value, onChange, name, sx, showDialCode, }: CountrySelectProps & {
|
|
11
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -3,28 +3,32 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
module.exports = CountrySelect;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _reactHookForm = require("react-hook-form");
|
|
11
11
|
var _reactInternationalPhone = require("react-international-phone");
|
|
12
12
|
var _mobile = require("../hooks/mobile");
|
|
13
|
-
|
|
13
|
+
function Transition({
|
|
14
|
+
ref,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
14
17
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Slide, {
|
|
15
18
|
direction: "up",
|
|
16
19
|
ref,
|
|
17
20
|
timeout: 200,
|
|
18
21
|
...props
|
|
19
22
|
});
|
|
20
|
-
}
|
|
21
|
-
|
|
23
|
+
}
|
|
24
|
+
function CountrySelect({
|
|
25
|
+
ref = void 0,
|
|
22
26
|
value,
|
|
23
27
|
onChange,
|
|
24
28
|
name,
|
|
25
|
-
sx,
|
|
29
|
+
sx = {},
|
|
26
30
|
showDialCode = false
|
|
27
|
-
}
|
|
31
|
+
}) {
|
|
28
32
|
const {
|
|
29
33
|
setValue
|
|
30
34
|
} = (0, _reactHookForm.useFormContext)();
|
|
@@ -237,16 +241,18 @@ const CountrySelect = (0, _react.forwardRef)(({
|
|
|
237
241
|
children: parsed.name
|
|
238
242
|
}), showDialCode && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
239
243
|
sx: {
|
|
244
|
+
color: "text.secondary",
|
|
240
245
|
ml: 1
|
|
241
246
|
},
|
|
242
|
-
color: "text.secondary",
|
|
243
247
|
children: `+${parsed.dialCode}`
|
|
244
248
|
})]
|
|
245
249
|
}, parsed.iso2);
|
|
246
250
|
}) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
247
251
|
disabled: true,
|
|
248
252
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
249
|
-
|
|
253
|
+
sx: {
|
|
254
|
+
color: "text.secondary"
|
|
255
|
+
},
|
|
250
256
|
children: "No countries found"
|
|
251
257
|
})
|
|
252
258
|
})
|
|
@@ -313,11 +319,11 @@ const CountrySelect = (0, _react.forwardRef)(({
|
|
|
313
319
|
setValue(name, e.target.value);
|
|
314
320
|
},
|
|
315
321
|
renderValue: code => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
316
|
-
display: "flex",
|
|
317
|
-
alignItems: "center",
|
|
318
|
-
flexWrap: "nowrap",
|
|
319
|
-
gap: 0.5,
|
|
320
322
|
sx: {
|
|
323
|
+
display: "flex",
|
|
324
|
+
alignItems: "center",
|
|
325
|
+
flexWrap: "nowrap",
|
|
326
|
+
gap: 0.5,
|
|
321
327
|
cursor: "pointer"
|
|
322
328
|
},
|
|
323
329
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
|
|
@@ -339,11 +345,11 @@ const CountrySelect = (0, _react.forwardRef)(({
|
|
|
339
345
|
},
|
|
340
346
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
341
347
|
onClick: () => setOpen(true),
|
|
342
|
-
display: "flex",
|
|
343
|
-
alignItems: "center",
|
|
344
|
-
flexWrap: "nowrap",
|
|
345
|
-
gap: 0.5,
|
|
346
348
|
sx: {
|
|
349
|
+
display: "flex",
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
flexWrap: "nowrap",
|
|
352
|
+
gap: 0.5,
|
|
347
353
|
cursor: "pointer",
|
|
348
354
|
padding: "8px",
|
|
349
355
|
paddingRight: "24px",
|
|
@@ -421,9 +427,4 @@ const CountrySelect = (0, _react.forwardRef)(({
|
|
|
421
427
|
})]
|
|
422
428
|
})]
|
|
423
429
|
});
|
|
424
|
-
}
|
|
425
|
-
CountrySelect.defaultProps = {
|
|
426
|
-
sx: {},
|
|
427
|
-
showDialCode: false
|
|
428
|
-
};
|
|
429
|
-
module.exports = CountrySelect;
|
|
430
|
+
}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { TextFieldProps } from '@mui/material';
|
|
2
3
|
import type { RegisterOptions } from 'react-hook-form';
|
|
3
|
-
|
|
4
|
+
type InputProps = TextFieldProps & {
|
|
4
5
|
name: string;
|
|
5
6
|
label?: ReactNode;
|
|
6
7
|
placeholder?: string;
|
|
7
|
-
errorPosition?:
|
|
8
|
+
errorPosition?: 'right' | 'bottom';
|
|
8
9
|
rules?: RegisterOptions;
|
|
9
|
-
wrapperStyle?:
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
wrapperStyle?: any;
|
|
17
|
-
}, "ref"> | Omit<import("@mui/material").StandardTextFieldProps & {
|
|
18
|
-
name: string;
|
|
19
|
-
label?: ReactNode;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
errorPosition?: "right" | "bottom";
|
|
22
|
-
rules?: RegisterOptions;
|
|
23
|
-
wrapperStyle?: any;
|
|
24
|
-
}, "ref">) & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
|
-
export default FormInput;
|
|
10
|
+
wrapperStyle?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
export default function FormInput({ ref, name, label, placeholder, rules, errorPosition, wrapperStyle, inputProps, ...rest }: InputProps & {
|
|
13
|
+
ref?: React.RefObject<HTMLInputElement>;
|
|
14
|
+
inputProps?: TextFieldProps['inputProps'];
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
export {};
|
package/lib/components/input.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
module.exports = FormInput;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
11
|
var _reactHookForm = require("react-hook-form");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function FormInputError({
|
|
14
14
|
error
|
|
15
15
|
}) {
|
|
@@ -22,15 +22,17 @@ function FormInputError({
|
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
function FormInput({
|
|
26
|
+
ref = void 0,
|
|
26
27
|
name,
|
|
27
|
-
label,
|
|
28
|
-
placeholder,
|
|
29
|
-
rules,
|
|
30
|
-
errorPosition,
|
|
31
|
-
wrapperStyle,
|
|
28
|
+
label = "",
|
|
29
|
+
placeholder = "",
|
|
30
|
+
rules = {},
|
|
31
|
+
errorPosition = "bottom",
|
|
32
|
+
wrapperStyle = {},
|
|
33
|
+
inputProps = {},
|
|
32
34
|
...rest
|
|
33
|
-
}
|
|
35
|
+
}) {
|
|
34
36
|
const {
|
|
35
37
|
control,
|
|
36
38
|
formState
|
|
@@ -65,20 +67,15 @@ const FormInput = (0, _react.forwardRef)(({
|
|
|
65
67
|
...field,
|
|
66
68
|
...rest,
|
|
67
69
|
inputRef,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
slotProps: {
|
|
71
|
+
htmlInput: inputProps,
|
|
72
|
+
input: Object.assign(rest.InputProps || {}, errorPosition === "right" && error ? {
|
|
73
|
+
endAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(FormInputError, {
|
|
74
|
+
error
|
|
75
|
+
})
|
|
76
|
+
} : {})
|
|
77
|
+
}
|
|
73
78
|
})]
|
|
74
79
|
})
|
|
75
80
|
});
|
|
76
|
-
}
|
|
77
|
-
FormInput.defaultProps = {
|
|
78
|
-
label: "",
|
|
79
|
-
placeholder: "",
|
|
80
|
-
errorPosition: "bottom",
|
|
81
|
-
rules: {},
|
|
82
|
-
wrapperStyle: {}
|
|
83
|
-
};
|
|
84
|
-
module.exports = FormInput;
|
|
81
|
+
}
|
|
@@ -8,7 +8,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _Center = _interopRequireDefault(require("@arcblock/ux/lib/Center"));
|
|
10
10
|
var _material = require("@mui/material");
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
function createLazyComponent(loader, options = {}) {
|
|
13
13
|
let loadPromise = null;
|
|
14
14
|
const {
|
package/lib/components/link.d.ts
CHANGED
|
@@ -6,12 +6,5 @@ interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
6
6
|
target?: string;
|
|
7
7
|
outLink?: boolean;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
replace: boolean;
|
|
13
|
-
target: undefined;
|
|
14
|
-
outLink: boolean;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export default Link;
|
|
9
|
+
export default function Link({ to, children, onClick, replace, target, outLink, ...props }: LinkProps): JSX.Element;
|
|
10
|
+
export {};
|
package/lib/components/link.js
CHANGED
|
@@ -10,8 +10,8 @@ function Link({
|
|
|
10
10
|
to,
|
|
11
11
|
children,
|
|
12
12
|
onClick,
|
|
13
|
-
replace,
|
|
14
|
-
target,
|
|
13
|
+
replace = false,
|
|
14
|
+
target = void 0,
|
|
15
15
|
outLink = false,
|
|
16
16
|
...props
|
|
17
17
|
}) {
|
|
@@ -38,9 +38,4 @@ function Link({
|
|
|
38
38
|
...props,
|
|
39
39
|
children
|
|
40
40
|
});
|
|
41
|
-
}
|
|
42
|
-
Link.defaultProps = {
|
|
43
|
-
replace: false,
|
|
44
|
-
target: void 0,
|
|
45
|
-
outLink: false
|
|
46
|
-
};
|
|
41
|
+
}
|
|
@@ -3,11 +3,5 @@ type Props = {
|
|
|
3
3
|
color?: string;
|
|
4
4
|
backgroundColor?: string;
|
|
5
5
|
} & ChipOwnProps;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var defaultProps: {
|
|
9
|
-
color: string;
|
|
10
|
-
backgroundColor: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export default Livemode;
|
|
6
|
+
export default function Livemode({ color, backgroundColor, sx }: Props): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -8,8 +8,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
function Livemode({
|
|
11
|
-
color,
|
|
12
|
-
backgroundColor,
|
|
11
|
+
color = "#bb5504",
|
|
12
|
+
backgroundColor = "#ffde92",
|
|
13
13
|
sx
|
|
14
14
|
}) {
|
|
15
15
|
const {
|
|
@@ -32,8 +32,4 @@ function Livemode({
|
|
|
32
32
|
...sx
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
}
|
|
36
|
-
Livemode.defaultProps = {
|
|
37
|
-
color: "#bb5504",
|
|
38
|
-
backgroundColor: "#ffde92"
|
|
39
|
-
};
|
|
35
|
+
}
|
|
@@ -6,5 +6,10 @@ export interface LoadingButtonProps extends ButtonProps {
|
|
|
6
6
|
loadingProps?: Partial<CircularProgressProps>;
|
|
7
7
|
loadingOnly?: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare
|
|
9
|
+
declare function LoadingButton({ ref, children, loading, loadingPosition, loadingIndicator, loadingProps, loadingOnly, onClick, sx, ...props }: LoadingButtonProps & {
|
|
10
|
+
ref?: React.RefObject<HTMLButtonElement>;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
declare namespace LoadingButton {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
10
15
|
export default LoadingButton;
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
6
|
+
module.exports = LoadingButton;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
function LoadingButton({
|
|
10
|
+
ref = void 0,
|
|
11
11
|
children,
|
|
12
|
-
loading,
|
|
12
|
+
loading = false,
|
|
13
13
|
loadingPosition = "start",
|
|
14
|
-
loadingIndicator,
|
|
14
|
+
loadingIndicator = void 0,
|
|
15
15
|
loadingProps = {},
|
|
16
|
+
loadingOnly = false,
|
|
16
17
|
onClick,
|
|
17
18
|
sx,
|
|
18
|
-
loadingOnly = false,
|
|
19
19
|
...props
|
|
20
|
-
}
|
|
20
|
+
}) {
|
|
21
21
|
const handleClick = e => {
|
|
22
22
|
if (loading) {
|
|
23
23
|
return;
|
|
@@ -74,13 +74,5 @@ const LoadingButton = (0, _react.forwardRef)(({
|
|
|
74
74
|
children
|
|
75
75
|
}), loading && loadingPosition === "center" && indicator, loading && loadingPosition === "end" && indicator]
|
|
76
76
|
});
|
|
77
|
-
}
|
|
78
|
-
LoadingButton.displayName = "LoadingButton";
|
|
79
|
-
LoadingButton.defaultProps = {
|
|
80
|
-
loading: false,
|
|
81
|
-
loadingIndicator: void 0,
|
|
82
|
-
loadingPosition: "start",
|
|
83
|
-
loadingProps: {},
|
|
84
|
-
loadingOnly: false
|
|
85
|
-
};
|
|
86
|
-
module.exports = LoadingButton;
|
|
77
|
+
}
|
|
78
|
+
LoadingButton.displayName = "LoadingButton";
|
|
@@ -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;
|