@blocklet/payment-react 1.18.15 → 1.18.16
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/components/over-due-invoice-payment.d.ts +20 -7
- package/es/components/over-due-invoice-payment.js +213 -74
- package/es/contexts/payment.js +14 -1
- package/es/history/invoice/list.js +28 -10
- package/es/locales/en.js +13 -4
- package/es/locales/zh.js +13 -4
- package/es/payment/form/address.js +63 -65
- package/lib/components/over-due-invoice-payment.d.ts +20 -7
- package/lib/components/over-due-invoice-payment.js +208 -75
- package/lib/contexts/payment.js +14 -1
- package/lib/history/invoice/list.js +50 -20
- package/lib/locales/en.js +13 -4
- package/lib/locales/zh.js +13 -4
- package/lib/payment/form/address.js +46 -50
- package/package.json +8 -7
- package/src/components/over-due-invoice-payment.tsx +267 -81
- package/src/contexts/payment.tsx +15 -1
- package/src/history/invoice/list.tsx +36 -15
- package/src/locales/en.tsx +11 -2
- package/src/locales/zh.tsx +11 -1
- package/src/payment/form/address.tsx +36 -38
package/lib/contexts/payment.js
CHANGED
|
@@ -15,6 +15,19 @@ var _api = _interopRequireDefault(require("../libs/api"));
|
|
|
15
15
|
var _util = require("../libs/util");
|
|
16
16
|
var _cachedRequest = require("../libs/cached-request");
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
const formatData = data => {
|
|
19
|
+
if (!data) {
|
|
20
|
+
return {
|
|
21
|
+
paymentMethods: [],
|
|
22
|
+
baseCurrency: {}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
...data,
|
|
27
|
+
paymentMethods: data.paymentMethods || [],
|
|
28
|
+
baseCurrency: data.baseCurrency || {}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
18
31
|
const PaymentContext = exports.PaymentContext = (0, _react.createContext)({
|
|
19
32
|
api: _api.default
|
|
20
33
|
});
|
|
@@ -80,7 +93,7 @@ function PaymentProvider({
|
|
|
80
93
|
connect,
|
|
81
94
|
prefix,
|
|
82
95
|
livemode: !!livemode,
|
|
83
|
-
settings: data,
|
|
96
|
+
settings: formatData(data),
|
|
84
97
|
getCurrency: currencyId => getCurrency(currencyId, data?.paymentMethods || []),
|
|
85
98
|
getMethod: methodId => getMethod(methodId, data?.paymentMethods || []),
|
|
86
99
|
refresh: run,
|
|
@@ -149,10 +149,14 @@ const InvoiceTable = _react.default.memo(props => {
|
|
|
149
149
|
options: {
|
|
150
150
|
customBodyRenderLite: (_, index) => {
|
|
151
151
|
const invoice = data?.list[index];
|
|
152
|
+
const isVoid = invoice.status === "void";
|
|
152
153
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
153
154
|
onClick: e => handleLinkClick(e, invoice),
|
|
154
155
|
sx: linkStyle,
|
|
155
156
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
157
|
+
sx: isVoid ? {
|
|
158
|
+
textDecoration: "line-through"
|
|
159
|
+
} : {},
|
|
156
160
|
children: [(0, _util.formatBNStr)(invoice.total, invoice.paymentCurrency.decimal), "\xA0", invoice.paymentCurrency.symbol]
|
|
157
161
|
})
|
|
158
162
|
});
|
|
@@ -223,6 +227,7 @@ const InvoiceTable = _react.default.memo(props => {
|
|
|
223
227
|
const {
|
|
224
228
|
connect
|
|
225
229
|
} = getInvoiceLink(invoice, action);
|
|
230
|
+
const isVoid = invoice.status === "void";
|
|
226
231
|
if (action && !hidePay) {
|
|
227
232
|
return connect ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
228
233
|
variant: "text",
|
|
@@ -247,7 +252,17 @@ const InvoiceTable = _react.default.memo(props => {
|
|
|
247
252
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
248
253
|
onClick: e => handleLinkClick(e, invoice),
|
|
249
254
|
sx: linkStyle,
|
|
250
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
255
|
+
children: isVoid ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
256
|
+
title: t("payment.customer.invoice.noPaymentRequired"),
|
|
257
|
+
arrow: true,
|
|
258
|
+
placement: "top",
|
|
259
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
|
|
260
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_status.default, {
|
|
261
|
+
label: invoice.status,
|
|
262
|
+
color: (0, _util.getInvoiceStatusColor)(invoice.status)
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
}) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_status.default, {
|
|
251
266
|
label: invoice.status,
|
|
252
267
|
color: (0, _util.getInvoiceStatusColor)(invoice.status)
|
|
253
268
|
})
|
|
@@ -432,6 +447,7 @@ const InvoiceList = _react.default.memo(props => {
|
|
|
432
447
|
link,
|
|
433
448
|
connect
|
|
434
449
|
} = getInvoiceLink(invoice, action);
|
|
450
|
+
const isVoid = invoice.status === "void";
|
|
435
451
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
436
452
|
direction: "row",
|
|
437
453
|
sx: {
|
|
@@ -458,14 +474,15 @@ const InvoiceList = _react.default.memo(props => {
|
|
|
458
474
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
459
475
|
component: "span",
|
|
460
476
|
children: invoice.number
|
|
461
|
-
}), link.external && /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
477
|
+
}), link.external && /* @__PURE__ */(0, _jsxRuntime.jsx)(_iconsMaterial.OpenInNewOutlined, {
|
|
478
|
+
fontSize: "small",
|
|
479
|
+
sx: {
|
|
480
|
+
color: "text.secondary",
|
|
481
|
+
display: {
|
|
482
|
+
xs: "none",
|
|
483
|
+
md: "inline-flex"
|
|
467
484
|
}
|
|
468
|
-
}
|
|
485
|
+
}
|
|
469
486
|
})]
|
|
470
487
|
})
|
|
471
488
|
})
|
|
@@ -473,6 +490,9 @@ const InvoiceList = _react.default.memo(props => {
|
|
|
473
490
|
flex: 1,
|
|
474
491
|
textAlign: "right",
|
|
475
492
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
493
|
+
sx: isVoid ? {
|
|
494
|
+
textDecoration: "line-through"
|
|
495
|
+
} : {},
|
|
476
496
|
children: [(0, _util.formatBNStr)(invoice.total, invoice.paymentCurrency.decimal), "\xA0", invoice.paymentCurrency.symbol]
|
|
477
497
|
})
|
|
478
498
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
@@ -481,15 +501,18 @@ const InvoiceList = _react.default.memo(props => {
|
|
|
481
501
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
482
502
|
children: (0, _util.formatToDate)(invoice.created_at, locale, "HH:mm:ss")
|
|
483
503
|
})
|
|
484
|
-
}), !action && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
504
|
+
}), !action && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
505
|
+
flex: 2,
|
|
506
|
+
className: "invoice-description",
|
|
507
|
+
textAlign: "right",
|
|
508
|
+
sx: {
|
|
509
|
+
display: {
|
|
510
|
+
xs: "none",
|
|
511
|
+
lg: "inline-flex"
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
515
|
+
children: invoice.description || invoice.id
|
|
493
516
|
})
|
|
494
517
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
495
518
|
flex: 1,
|
|
@@ -513,6 +536,16 @@ const InvoiceList = _react.default.memo(props => {
|
|
|
513
536
|
},
|
|
514
537
|
rel: "noreferrer",
|
|
515
538
|
children: t("payment.customer.invoice.pay")
|
|
539
|
+
}) : isVoid ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
540
|
+
title: t("payment.customer.invoice.noPaymentRequired"),
|
|
541
|
+
arrow: true,
|
|
542
|
+
placement: "top",
|
|
543
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
|
|
544
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_status.default, {
|
|
545
|
+
label: invoice.status,
|
|
546
|
+
color: (0, _util.getInvoiceStatusColor)(invoice.status)
|
|
547
|
+
})
|
|
548
|
+
})
|
|
516
549
|
}) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_status.default, {
|
|
517
550
|
label: invoice.status,
|
|
518
551
|
color: (0, _util.getInvoiceStatusColor)(invoice.status)
|
|
@@ -624,9 +657,6 @@ const Root = (0, _system.styled)(_material.Stack)`
|
|
|
624
657
|
@media (max-width: ${({
|
|
625
658
|
theme
|
|
626
659
|
}) => theme.breakpoints.values.md}px) {
|
|
627
|
-
.invoice-description {
|
|
628
|
-
display: none !important;
|
|
629
|
-
}
|
|
630
660
|
svg.MuiSvgIcon-root {
|
|
631
661
|
display: none !important;
|
|
632
662
|
}
|
package/lib/locales/en.js
CHANGED
|
@@ -244,12 +244,13 @@ module.exports = (0, _flat.default)({
|
|
|
244
244
|
pastDue: {
|
|
245
245
|
button: "Pay",
|
|
246
246
|
invoices: "Past Due Invoices",
|
|
247
|
-
warning: "Past due invoices need to be paid immediately, otherwise you can not make new purchases anymore.
|
|
247
|
+
warning: "Past due invoices need to be paid immediately, otherwise you can not make new purchases anymore.",
|
|
248
248
|
alert: {
|
|
249
249
|
title: "You have unpaid invoices",
|
|
250
250
|
description: "Seems you have unpaid invoices from previous subscriptions, new purchases are not allowed unless you have paid all past due invoices.",
|
|
251
251
|
confirm: "Pay Now"
|
|
252
|
-
}
|
|
252
|
+
},
|
|
253
|
+
view: "View Due Invoices"
|
|
253
254
|
},
|
|
254
255
|
recover: {
|
|
255
256
|
button: "Resume Subscription",
|
|
@@ -298,7 +299,8 @@ module.exports = (0, _flat.default)({
|
|
|
298
299
|
empty: "There are no invoices",
|
|
299
300
|
next: "No invoices yet, next invoice will be generated on {date}",
|
|
300
301
|
invoiceNumber: "Invoice Number",
|
|
301
|
-
emptyList: "No Invoice"
|
|
302
|
+
emptyList: "No Invoice",
|
|
303
|
+
noPaymentRequired: "No Payment Required"
|
|
302
304
|
},
|
|
303
305
|
payment: {
|
|
304
306
|
empty: "There are no payments",
|
|
@@ -319,6 +321,11 @@ module.exports = (0, _flat.default)({
|
|
|
319
321
|
changePayment: "Change payment method",
|
|
320
322
|
trialLeft: "Trail Left",
|
|
321
323
|
owner: "Subscription Owner"
|
|
324
|
+
},
|
|
325
|
+
overdue: {
|
|
326
|
+
title: "You have {count} due invoices for {subscriptionCount} subscriptions, totaling {total} {symbol}. Please pay immediately to avoid service disruption.",
|
|
327
|
+
simpleTitle: "You have {count} due invoices. Please pay now to ensure uninterrupted service.",
|
|
328
|
+
empty: "Great! You have no due invoices."
|
|
322
329
|
}
|
|
323
330
|
},
|
|
324
331
|
invoice: {
|
|
@@ -358,7 +365,9 @@ module.exports = (0, _flat.default)({
|
|
|
358
365
|
pastDue: "Past Due Invoices",
|
|
359
366
|
description: "If you have any questions, you can choose ",
|
|
360
367
|
list: "Past Due Invoices:",
|
|
361
|
-
empty: "There are no overdue invoices for your subscription {name}."
|
|
368
|
+
empty: "There are no overdue invoices for your subscription {name}.",
|
|
369
|
+
retry: "Retry",
|
|
370
|
+
paid: "Paid"
|
|
362
371
|
}
|
|
363
372
|
}
|
|
364
373
|
},
|
package/lib/locales/zh.js
CHANGED
|
@@ -244,12 +244,13 @@ module.exports = (0, _flat.default)({
|
|
|
244
244
|
pastDue: {
|
|
245
245
|
button: "\u7EED\u8D39",
|
|
246
246
|
invoices: "\u6B20\u8D39\u5E10\u5355",
|
|
247
|
-
warning: "\u8BF7\u5C3D\u5FEB\u652F\u4ED8\u6B20\u8D39\u8D26\u5355\uFF0C\u5426\u5219\u4F60\u5C06\u65E0\u6CD5\u7EE7\u7EED\u4F7F\u7528\u670D\u52A1\u6216\u8D2D\u4E70\u65B0\u670D\u52A1\
|
|
247
|
+
warning: "\u8BF7\u5C3D\u5FEB\u652F\u4ED8\u6B20\u8D39\u8D26\u5355\uFF0C\u5426\u5219\u4F60\u5C06\u65E0\u6CD5\u7EE7\u7EED\u4F7F\u7528\u670D\u52A1\u6216\u8D2D\u4E70\u65B0\u670D\u52A1\u3002",
|
|
248
248
|
alert: {
|
|
249
249
|
title: "\u4F60\u6709\u6B20\u8D39\u8D26\u5355",
|
|
250
250
|
description: "\u770B\u8D77\u6765\u4F60\u6709\u6B20\u8D39\u7684\u8D26\u5355\uFF0C\u5728\u4F60\u652F\u4ED8\u6240\u6709\u6B20\u8D39\u8D26\u5355\u4E4B\u524D\uFF0C\u65B0\u7684\u8D2D\u4E70\u6216\u8005\u8BA2\u9605\u5C06\u88AB\u7981\u6B62\uFF0C\u8BF7\u4E0D\u8981\u8C03\u76AE\u3002",
|
|
251
251
|
confirm: "\u53BB\u652F\u4ED8"
|
|
252
|
-
}
|
|
252
|
+
},
|
|
253
|
+
view: "\u67E5\u770B\u6B20\u8D39\u660E\u7EC6"
|
|
253
254
|
},
|
|
254
255
|
recover: {
|
|
255
256
|
button: "\u6062\u590D\u8BA2\u9605",
|
|
@@ -298,7 +299,8 @@ module.exports = (0, _flat.default)({
|
|
|
298
299
|
empty: "\u6CA1\u6709\u4EFB\u4F55\u8D26\u5355",
|
|
299
300
|
next: "\u8FD8\u6CA1\u6709\u8D26\u5355\uFF0C\u4E0B\u6B21\u8D26\u5355\u5C06\u5728 {date} \u751F\u6210",
|
|
300
301
|
invoiceNumber: "\u8D26\u5355\u7F16\u53F7",
|
|
301
|
-
emptyList: "\u6CA1\u6709\u8D26\u5355"
|
|
302
|
+
emptyList: "\u6CA1\u6709\u8D26\u5355",
|
|
303
|
+
noPaymentRequired: "\u65E0\u9700\u652F\u4ED8"
|
|
302
304
|
},
|
|
303
305
|
payment: {
|
|
304
306
|
empty: "\u6CA1\u6709\u652F\u4ED8\u8BB0\u5F55",
|
|
@@ -319,6 +321,11 @@ module.exports = (0, _flat.default)({
|
|
|
319
321
|
changePayment: "\u5207\u6362\u652F\u4ED8\u65B9\u5F0F",
|
|
320
322
|
trialLeft: "\u5269\u4F59\u8BD5\u7528\u65F6\u957F",
|
|
321
323
|
owner: "\u8BA2\u9605\u62E5\u6709\u8005"
|
|
324
|
+
},
|
|
325
|
+
overdue: {
|
|
326
|
+
title: "\u60A8\u6709 {count} \u5F20\u6B20\u8D39\u8D26\u5355\uFF0C\u6D89\u53CA {subscriptionCount} \u4E2A\u8BA2\u9605\uFF0C\u603B\u91D1\u989D {total} {symbol}\u3002\u8BF7\u7ACB\u5373\u652F\u4ED8\uFF0C\u4EE5\u514D\u5F71\u54CD\u60A8\u7684\u4F7F\u7528\u3002",
|
|
327
|
+
simpleTitle: "\u60A8\u6709 {count} \u5F20\u6B20\u8D39\u8D26\u5355\uFF0C\u8BF7\u7ACB\u5373\u652F\u4ED8\uFF0C\u4EE5\u514D\u5F71\u54CD\u60A8\u7684\u4F7F\u7528\u3002",
|
|
328
|
+
empty: "\u606D\u559C\uFF01\u60A8\u5F53\u524D\u6CA1\u6709\u6B20\u8D39\u8D26\u5355\u3002"
|
|
322
329
|
}
|
|
323
330
|
},
|
|
324
331
|
invoice: {
|
|
@@ -358,7 +365,9 @@ module.exports = (0, _flat.default)({
|
|
|
358
365
|
viewNow: "\u7ACB\u5373\u67E5\u770B",
|
|
359
366
|
description: "\u5982\u679C\u60A8\u6709\u4EFB\u4F55\u7591\u95EE\uFF0C\u53EF\u4EE5\u9009\u62E9 ",
|
|
360
367
|
list: "\u6B20\u8D39\u8D26\u5355\uFF1A",
|
|
361
|
-
empty: "\u60A8\u7684\u3010{name}\u3011\u8BA2\u9605\u5F53\u524D\u6CA1\u6709\u6B20\u8D39\u8D26\u5355"
|
|
368
|
+
empty: "\u60A8\u7684\u3010{name}\u3011\u8BA2\u9605\u5F53\u524D\u6CA1\u6709\u6B20\u8D39\u8D26\u5355",
|
|
369
|
+
retry: "\u91CD\u65B0\u652F\u4ED8",
|
|
370
|
+
paid: "\u5DF2\u652F\u4ED8"
|
|
362
371
|
}
|
|
363
372
|
}
|
|
364
373
|
},
|
|
@@ -28,86 +28,82 @@ function AddressForm({
|
|
|
28
28
|
if (mode === "required") {
|
|
29
29
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Fade, {
|
|
30
30
|
in: true,
|
|
31
|
-
children: /* @__PURE__ */(0, _jsxRuntime.
|
|
31
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
32
32
|
className: "cko-payment-address cko-payment-form",
|
|
33
33
|
sx,
|
|
34
|
-
children:
|
|
35
|
-
className: "base-label",
|
|
36
|
-
children: t(`payment.checkout.billing.${mode}`)
|
|
37
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
34
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
38
35
|
direction: "column",
|
|
39
36
|
className: "cko-payment-form",
|
|
40
37
|
spacing: 0,
|
|
41
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
InputProps: {
|
|
53
|
-
startAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
54
|
-
position: "start",
|
|
55
|
-
style: {
|
|
56
|
-
marginRight: "2px",
|
|
57
|
-
marginLeft: "-8px"
|
|
58
|
-
},
|
|
59
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactHookForm.Controller, {
|
|
60
|
-
name: "billing_address.country",
|
|
61
|
-
control,
|
|
62
|
-
render: ({
|
|
63
|
-
field
|
|
64
|
-
}) => /* @__PURE__ */(0, _jsxRuntime.jsx)(_countrySelect.default, {
|
|
65
|
-
...field,
|
|
66
|
-
sx: {
|
|
67
|
-
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
68
|
-
borderColor: "transparent"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
})
|
|
38
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
39
|
+
className: "base-label",
|
|
40
|
+
children: t("payment.checkout.billing.line1")
|
|
41
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
42
|
+
name: "billing_address.line1",
|
|
43
|
+
rules: {
|
|
44
|
+
required: t("payment.checkout.required")
|
|
45
|
+
},
|
|
46
|
+
errorPosition: "right",
|
|
47
|
+
variant: "outlined",
|
|
48
|
+
placeholder: t("payment.checkout.billing.line1")
|
|
76
49
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
77
50
|
className: "base-label",
|
|
78
|
-
children: t("payment.checkout.billing.
|
|
51
|
+
children: t("payment.checkout.billing.city")
|
|
79
52
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
80
|
-
name: "billing_address.
|
|
53
|
+
name: "billing_address.city",
|
|
81
54
|
rules: {
|
|
82
55
|
required: t("payment.checkout.required")
|
|
83
56
|
},
|
|
84
57
|
errorPosition: "right",
|
|
85
58
|
variant: "outlined",
|
|
86
|
-
placeholder: t("payment.checkout.billing.
|
|
59
|
+
placeholder: t("payment.checkout.billing.city")
|
|
87
60
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
88
61
|
className: "base-label",
|
|
89
|
-
children: t("payment.checkout.billing.
|
|
62
|
+
children: t("payment.checkout.billing.state")
|
|
90
63
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
91
|
-
name: "billing_address.
|
|
64
|
+
name: "billing_address.state",
|
|
92
65
|
rules: {
|
|
93
66
|
required: t("payment.checkout.required")
|
|
94
67
|
},
|
|
95
68
|
errorPosition: "right",
|
|
96
69
|
variant: "outlined",
|
|
97
|
-
placeholder: t("payment.checkout.billing.
|
|
70
|
+
placeholder: t("payment.checkout.billing.state")
|
|
98
71
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
99
72
|
className: "base-label",
|
|
100
|
-
children: t("payment.checkout.billing.
|
|
73
|
+
children: t("payment.checkout.billing.postal_code")
|
|
101
74
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
102
|
-
name: "billing_address.
|
|
75
|
+
name: "billing_address.postal_code",
|
|
103
76
|
rules: {
|
|
104
77
|
required: t("payment.checkout.required")
|
|
105
78
|
},
|
|
106
79
|
errorPosition: "right",
|
|
107
80
|
variant: "outlined",
|
|
108
|
-
placeholder: t("payment.checkout.billing.
|
|
81
|
+
placeholder: t("payment.checkout.billing.postal_code"),
|
|
82
|
+
InputProps: {
|
|
83
|
+
startAdornment: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.InputAdornment, {
|
|
84
|
+
position: "start",
|
|
85
|
+
style: {
|
|
86
|
+
marginRight: "2px",
|
|
87
|
+
marginLeft: "-8px"
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_reactHookForm.Controller, {
|
|
90
|
+
name: "billing_address.country",
|
|
91
|
+
control,
|
|
92
|
+
render: ({
|
|
93
|
+
field
|
|
94
|
+
}) => /* @__PURE__ */(0, _jsxRuntime.jsx)(_countrySelect.default, {
|
|
95
|
+
...field,
|
|
96
|
+
sx: {
|
|
97
|
+
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
98
|
+
borderColor: "transparent"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
}
|
|
109
105
|
})]
|
|
110
|
-
})
|
|
106
|
+
})
|
|
111
107
|
})
|
|
112
108
|
});
|
|
113
109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.16",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"lint": "tsc --noEmit && eslint src tests --ext js --ext jsx --ext ts --ext tsx",
|
|
20
20
|
"lint:fix": "pnpm run lint --fix",
|
|
21
|
-
"
|
|
21
|
+
"clean": "rm -rf es lib",
|
|
22
|
+
"build": "pnpm run clean && tsc --noEmit && unbuild && node tools/auto-exports.js && pnpm run cpfiles",
|
|
22
23
|
"watch": "CONSOLA_LEVEL=1 nodemon -e .jsx,.js,.ts,.tsx -w src -x 'yalc publish --push'",
|
|
23
24
|
"precommit": "CI=1 pnpm run lint",
|
|
24
25
|
"prepush": "CI=1 pnpm run lint",
|
|
@@ -53,10 +54,10 @@
|
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@arcblock/did-connect": "^2.12.
|
|
57
|
-
"@arcblock/ux": "^2.12.
|
|
57
|
+
"@arcblock/did-connect": "^2.12.17",
|
|
58
|
+
"@arcblock/ux": "^2.12.17",
|
|
58
59
|
"@arcblock/ws": "^1.19.15",
|
|
59
|
-
"@blocklet/ui-react": "^2.12.
|
|
60
|
+
"@blocklet/ui-react": "^2.12.17",
|
|
60
61
|
"@mui/icons-material": "^5.16.6",
|
|
61
62
|
"@mui/lab": "^5.0.0-alpha.173",
|
|
62
63
|
"@mui/material": "^5.16.6",
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
"@babel/core": "^7.25.2",
|
|
93
94
|
"@babel/preset-env": "^7.25.2",
|
|
94
95
|
"@babel/preset-react": "^7.24.7",
|
|
95
|
-
"@blocklet/payment-types": "1.18.
|
|
96
|
+
"@blocklet/payment-types": "1.18.16",
|
|
96
97
|
"@storybook/addon-essentials": "^7.6.20",
|
|
97
98
|
"@storybook/addon-interactions": "^7.6.20",
|
|
98
99
|
"@storybook/addon-links": "^7.6.20",
|
|
@@ -123,5 +124,5 @@
|
|
|
123
124
|
"vite-plugin-babel": "^1.2.0",
|
|
124
125
|
"vite-plugin-node-polyfills": "^0.21.0"
|
|
125
126
|
},
|
|
126
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "676b921c6fc399d3a031b848bfbe0fbffee430a1"
|
|
127
128
|
}
|