@blocklet/payment-react 1.13.163 → 1.13.165

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.
@@ -2,18 +2,22 @@
2
2
  type Props = {
3
3
  customer_id?: string;
4
4
  subscription_id?: string;
5
+ currency_id?: string;
5
6
  status?: string;
6
7
  pageSize?: number;
7
8
  target?: string;
9
+ action?: string;
8
10
  };
9
- declare function CustomerInvoiceList({ customer_id, subscription_id, status, pageSize, target }: Props): import("react").JSX.Element;
11
+ declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, status, pageSize, target, action, }: Props): import("react").JSX.Element;
10
12
  declare namespace CustomerInvoiceList {
11
13
  var defaultProps: {
12
14
  customer_id: string;
13
15
  subscription_id: string;
16
+ currency_id: string;
14
17
  status: string;
15
18
  pageSize: number;
16
19
  target: string;
20
+ action: string;
17
21
  };
18
22
  }
19
23
  export default CustomerInvoiceList;
@@ -27,13 +27,21 @@ const fetchData = (params = {}) => {
27
27
  });
28
28
  return api.get(`/api/invoices?${search.toString()}`).then((res) => res.data);
29
29
  };
30
- export default function CustomerInvoiceList({ customer_id, subscription_id, status, pageSize, target }) {
30
+ export default function CustomerInvoiceList({
31
+ customer_id,
32
+ subscription_id,
33
+ currency_id,
34
+ status,
35
+ pageSize,
36
+ target,
37
+ action
38
+ }) {
31
39
  const { t } = useLocaleContext();
32
40
  const size = pageSize || 10;
33
41
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll(
34
42
  (d) => {
35
43
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
36
- return fetchData({ page, pageSize: size, status, customer_id, subscription_id });
44
+ return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id });
37
45
  },
38
46
  {
39
47
  reloadDeps: [customer_id]
@@ -68,7 +76,11 @@ export default function CustomerInvoiceList({ customer_id, subscription_id, stat
68
76
  /* @__PURE__ */ jsx(Box, { flex: 3, children: /* @__PURE__ */ jsx(
69
77
  "a",
70
78
  {
71
- href: joinURL(window.location.origin, getPrefix(), `/customer/invoice/${invoice.id}`),
79
+ href: joinURL(
80
+ window.location.origin,
81
+ getPrefix(),
82
+ `/customer/invoice/${invoice.id}?action=${invoice.status === "uncollectible" ? action : ""}`
83
+ ),
72
84
  target,
73
85
  children: /* @__PURE__ */ jsx(Typography, { component: "span", children: invoice.number })
74
86
  }
@@ -95,7 +107,9 @@ export default function CustomerInvoiceList({ customer_id, subscription_id, stat
95
107
  CustomerInvoiceList.defaultProps = {
96
108
  customer_id: "",
97
109
  subscription_id: "",
110
+ currency_id: "",
98
111
  status: "open,paid,uncollectible",
99
112
  pageSize: 10,
100
- target: "_self"
113
+ target: "_self",
114
+ action: ""
101
115
  };
package/es/locales/zh.js CHANGED
@@ -148,7 +148,7 @@ export default flat({
148
148
  },
149
149
  customer: {
150
150
  payments: "\u652F\u4ED8\u5386\u53F2",
151
- invoices: "\u53D1\u7968\u5386\u53F2",
151
+ invoices: "\u8D26\u5355\u5386\u53F2",
152
152
  details: "\u8D26\u6237\u8BE6\u60C5",
153
153
  summary: "\u8BA1\u8D39\u6458\u8981",
154
154
  update: "\u66F4\u65B0\u5BA2\u6237\u4FE1\u606F",
@@ -217,13 +217,13 @@ export default flat({
217
217
  amountPaid: "\u5DF2\u652F\u4ED8",
218
218
  amountDue: "\u5F85\u652F\u4ED8",
219
219
  amountApplied: "\u4F59\u989D\u53D8\u66F4",
220
- pay: "\u652F\u4ED8\u6B64\u53D1\u7968",
220
+ pay: "\u652F\u4ED8\u6B64\u8D26\u5355",
221
221
  paySuccess: "\u652F\u4ED8\u6210\u529F",
222
222
  payError: "\u652F\u4ED8\u5931\u8D25",
223
223
  renew: "\u6062\u590D\u8BA2\u9605",
224
224
  renewSuccess: "\u8BA2\u9605\u6062\u590D\u6210\u529F",
225
225
  renewError: "\u8BA2\u9605\u6062\u590D\u5931\u8D25",
226
- empty: "\u6CA1\u6709\u4EFB\u4F55\u53D1\u7968"
226
+ empty: "\u6CA1\u6709\u4EFB\u4F55\u8D26\u5355"
227
227
  },
228
228
  payment: {
229
229
  empty: "\u6CA1\u6709\u652F\u4ED8\u8BB0\u5F55"
@@ -233,7 +233,7 @@ export default flat({
233
233
  },
234
234
  subscriptions: {
235
235
  plan: "\u8BA2\u9605",
236
- nextInvoice: "\u4E0B\u4E00\u5F20\u53D1\u7968",
236
+ nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
237
237
  title: "\u8BA2\u9605\u7BA1\u7406",
238
238
  current: "\u5F53\u524D\u8BA2\u9605",
239
239
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
@@ -2,18 +2,22 @@
2
2
  type Props = {
3
3
  customer_id?: string;
4
4
  subscription_id?: string;
5
+ currency_id?: string;
5
6
  status?: string;
6
7
  pageSize?: number;
7
8
  target?: string;
9
+ action?: string;
8
10
  };
9
- declare function CustomerInvoiceList({ customer_id, subscription_id, status, pageSize, target }: Props): import("react").JSX.Element;
11
+ declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, status, pageSize, target, action, }: Props): import("react").JSX.Element;
10
12
  declare namespace CustomerInvoiceList {
11
13
  var defaultProps: {
12
14
  customer_id: string;
13
15
  subscription_id: string;
16
+ currency_id: string;
14
17
  status: string;
15
18
  pageSize: number;
16
19
  target: string;
20
+ action: string;
17
21
  };
18
22
  }
19
23
  export default CustomerInvoiceList;
@@ -37,9 +37,11 @@ const fetchData = (params = {}) => {
37
37
  function CustomerInvoiceList({
38
38
  customer_id,
39
39
  subscription_id,
40
+ currency_id,
40
41
  status,
41
42
  pageSize,
42
- target
43
+ target,
44
+ action
43
45
  }) {
44
46
  const {
45
47
  t
@@ -57,6 +59,7 @@ function CustomerInvoiceList({
57
59
  pageSize: size,
58
60
  status,
59
61
  customer_id,
62
+ currency_id,
60
63
  subscription_id
61
64
  });
62
65
  }, {
@@ -105,7 +108,7 @@ function CustomerInvoiceList({
105
108
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
106
109
  flex: 3,
107
110
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)("a", {
108
- href: (0, _ufo.joinURL)(window.location.origin, (0, _util2.getPrefix)(), `/customer/invoice/${invoice.id}`),
111
+ href: (0, _ufo.joinURL)(window.location.origin, (0, _util2.getPrefix)(), `/customer/invoice/${invoice.id}?action=${invoice.status === "uncollectible" ? action : ""}`),
109
112
  target,
110
113
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
111
114
  component: "span",
@@ -160,7 +163,9 @@ function CustomerInvoiceList({
160
163
  CustomerInvoiceList.defaultProps = {
161
164
  customer_id: "",
162
165
  subscription_id: "",
166
+ currency_id: "",
163
167
  status: "open,paid,uncollectible",
164
168
  pageSize: 10,
165
- target: "_self"
169
+ target: "_self",
170
+ action: ""
166
171
  };
package/lib/locales/zh.js CHANGED
@@ -155,7 +155,7 @@ module.exports = (0, _flat.default)({
155
155
  },
156
156
  customer: {
157
157
  payments: "\u652F\u4ED8\u5386\u53F2",
158
- invoices: "\u53D1\u7968\u5386\u53F2",
158
+ invoices: "\u8D26\u5355\u5386\u53F2",
159
159
  details: "\u8D26\u6237\u8BE6\u60C5",
160
160
  summary: "\u8BA1\u8D39\u6458\u8981",
161
161
  update: "\u66F4\u65B0\u5BA2\u6237\u4FE1\u606F",
@@ -224,13 +224,13 @@ module.exports = (0, _flat.default)({
224
224
  amountPaid: "\u5DF2\u652F\u4ED8",
225
225
  amountDue: "\u5F85\u652F\u4ED8",
226
226
  amountApplied: "\u4F59\u989D\u53D8\u66F4",
227
- pay: "\u652F\u4ED8\u6B64\u53D1\u7968",
227
+ pay: "\u652F\u4ED8\u6B64\u8D26\u5355",
228
228
  paySuccess: "\u652F\u4ED8\u6210\u529F",
229
229
  payError: "\u652F\u4ED8\u5931\u8D25",
230
230
  renew: "\u6062\u590D\u8BA2\u9605",
231
231
  renewSuccess: "\u8BA2\u9605\u6062\u590D\u6210\u529F",
232
232
  renewError: "\u8BA2\u9605\u6062\u590D\u5931\u8D25",
233
- empty: "\u6CA1\u6709\u4EFB\u4F55\u53D1\u7968"
233
+ empty: "\u6CA1\u6709\u4EFB\u4F55\u8D26\u5355"
234
234
  },
235
235
  payment: {
236
236
  empty: "\u6CA1\u6709\u652F\u4ED8\u8BB0\u5F55"
@@ -240,7 +240,7 @@ module.exports = (0, _flat.default)({
240
240
  },
241
241
  subscriptions: {
242
242
  plan: "\u8BA2\u9605",
243
- nextInvoice: "\u4E0B\u4E00\u5F20\u53D1\u7968",
243
+ nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
244
244
  title: "\u8BA2\u9605\u7BA1\u7406",
245
245
  current: "\u5F53\u524D\u8BA2\u9605",
246
246
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.163",
3
+ "version": "1.13.165",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -89,7 +89,7 @@
89
89
  "@babel/core": "^7.23.9",
90
90
  "@babel/preset-env": "^7.23.9",
91
91
  "@babel/preset-react": "^7.23.3",
92
- "@blocklet/payment-types": "1.13.163",
92
+ "@blocklet/payment-types": "1.13.165",
93
93
  "@storybook/addon-essentials": "^7.6.13",
94
94
  "@storybook/addon-interactions": "^7.6.13",
95
95
  "@storybook/addon-links": "^7.6.13",
@@ -118,5 +118,5 @@
118
118
  "vite-plugin-babel": "^1.2.0",
119
119
  "vite-plugin-node-polyfills": "^0.19.0"
120
120
  },
121
- "gitHead": "2f485afbabe92bb6e63b09c4e69cb2ae06d3d2be"
121
+ "gitHead": "24fadab6620ca13856393399efd6a1dffc431d66"
122
122
  }
@@ -35,19 +35,29 @@ const fetchData = (params: Record<string, any> = {}): Promise<Paginated<TInvoice
35
35
  type Props = {
36
36
  customer_id?: string;
37
37
  subscription_id?: string;
38
+ currency_id?: string;
38
39
  status?: string;
39
40
  pageSize?: number;
40
41
  target?: string;
42
+ action?: string;
41
43
  };
42
44
 
43
- export default function CustomerInvoiceList({ customer_id, subscription_id, status, pageSize, target }: Props) {
45
+ export default function CustomerInvoiceList({
46
+ customer_id,
47
+ subscription_id,
48
+ currency_id,
49
+ status,
50
+ pageSize,
51
+ target,
52
+ action,
53
+ }: Props) {
44
54
  const { t } = useLocaleContext();
45
55
  const size = pageSize || 10;
46
56
 
47
57
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll<Paginated<TInvoiceExpanded>>(
48
58
  (d) => {
49
59
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
50
- return fetchData({ page, pageSize: size, status, customer_id, subscription_id });
60
+ return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id });
51
61
  },
52
62
  {
53
63
  reloadDeps: [customer_id],
@@ -87,7 +97,11 @@ export default function CustomerInvoiceList({ customer_id, subscription_id, stat
87
97
  flexWrap="nowrap">
88
98
  <Box flex={3}>
89
99
  <a
90
- href={joinURL(window.location.origin, getPrefix(), `/customer/invoice/${invoice.id}`)}
100
+ href={joinURL(
101
+ window.location.origin,
102
+ getPrefix(),
103
+ `/customer/invoice/${invoice.id}?action=${invoice.status === 'uncollectible' ? action : ''}`
104
+ )}
91
105
  target={target}>
92
106
  <Typography component="span">{invoice.number}</Typography>
93
107
  </a>
@@ -132,7 +146,9 @@ export default function CustomerInvoiceList({ customer_id, subscription_id, stat
132
146
  CustomerInvoiceList.defaultProps = {
133
147
  customer_id: '',
134
148
  subscription_id: '',
149
+ currency_id: '',
135
150
  status: 'open,paid,uncollectible',
136
151
  pageSize: 10,
137
152
  target: '_self',
153
+ action: '',
138
154
  };
@@ -149,7 +149,7 @@ export default flat({
149
149
  },
150
150
  customer: {
151
151
  payments: '支付历史',
152
- invoices: '发票历史',
152
+ invoices: '账单历史',
153
153
  details: '账户详情',
154
154
  summary: '计费摘要',
155
155
  update: '更新客户信息',
@@ -219,13 +219,13 @@ export default flat({
219
219
  amountPaid: '已支付',
220
220
  amountDue: '待支付',
221
221
  amountApplied: '余额变更',
222
- pay: '支付此发票',
222
+ pay: '支付此账单',
223
223
  paySuccess: '支付成功',
224
224
  payError: '支付失败',
225
225
  renew: '恢复订阅',
226
226
  renewSuccess: '订阅恢复成功',
227
227
  renewError: '订阅恢复失败',
228
- empty: '没有任何发票',
228
+ empty: '没有任何账单',
229
229
  },
230
230
  payment: {
231
231
  empty: '没有支付记录',
@@ -235,7 +235,7 @@ export default flat({
235
235
  },
236
236
  subscriptions: {
237
237
  plan: '订阅',
238
- nextInvoice: '下一张发票',
238
+ nextInvoice: '下一张账单',
239
239
  title: '订阅管理',
240
240
  current: '当前订阅',
241
241
  empty: '没有任何订阅',