@ichaingo/table 1.5.20 → 1.5.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +24 -24
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import { useLocale as xe, useTranslations as J } from "next-intl";
23
23
  import { X as W, Search as V } from "lucide-react";
24
24
  import * as Y from "@radix-ui/react-slider";
25
25
  import $ from "@ichaingo/number-like";
26
- import B from "@ichaingo/translation";
26
+ import S from "@ichaingo/translation";
27
27
  import _ from "@ichaingo/request";
28
28
  import { useParams as ee } from "next/navigation";
29
29
  import { Checkbox as te } from "@ichaingo/ui/checkbox";
@@ -63,7 +63,7 @@ function ve({
63
63
  k(!1);
64
64
  }, R = (o) => {
65
65
  o ? k(!0) : C(g);
66
- }, S = (o) => {
66
+ }, B = (o) => {
67
67
  if (!o) {
68
68
  b(null);
69
69
  return;
@@ -88,7 +88,7 @@ function ve({
88
88
  locale: d[m],
89
89
  allowClear: !1,
90
90
  value: g ?? [M(), M()],
91
- onCalendarChange: S,
91
+ onCalendarChange: B,
92
92
  onChange: n,
93
93
  getPopupContainer: () => y.current,
94
94
  style: { position: "absolute", opacity: 0, width: 0, height: 0, pointerEvents: "none" },
@@ -115,7 +115,7 @@ function je({ onChange: a, filterKey: i }) {
115
115
  const T = parseFloat(x);
116
116
  f([d[0], T]);
117
117
  }
118
- }, S = () => {
118
+ }, B = () => {
119
119
  a(k, g), m(!1);
120
120
  }, n = () => {
121
121
  m(!1);
@@ -128,16 +128,16 @@ function je({ onChange: a, filterKey: i }) {
128
128
  /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "w-[16px] h-[16px] flex items-center justify-center bg-[#000000] rounded-sm cursor-pointer", children: /* @__PURE__ */ e(D, { src: Ce, width: 12, height: 12, objectFit: "contain" }) }) }),
129
129
  /* @__PURE__ */ e(Q, { className: "bg-module", children: /* @__PURE__ */ l("div", { className: "w-full h-full", children: [
130
130
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-between h-9", children: [
131
- /* @__PURE__ */ e("span", { className: "text-sm", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.amount" }) }),
131
+ /* @__PURE__ */ e("span", { className: "text-sm", children: /* @__PURE__ */ e(S, { value: "label", parentKey: "common.filter.amount" }) }),
132
132
  /* @__PURE__ */ e("div", { className: "w-4 h-4 text-black text-sm cursor-pointer flex items-center justify-center", onClick: () => n(), children: /* @__PURE__ */ e(W, { className: "w-4 h-4" }) })
133
133
  ] }),
134
134
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-between gap-2 py-3", children: [
135
135
  /* @__PURE__ */ l("fieldset", { className: "w-1/2 h-full", children: [
136
- /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(B, { value: "form", parentKey: "common.filter.amount" }) }),
136
+ /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(S, { value: "form", parentKey: "common.filter.amount" }) }),
137
137
  /* @__PURE__ */ e("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: o, placeholder: A("filter.amount.min"), className: "w-full h-full bg-module text-sm border-1 border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: k, onChange: N })
138
138
  ] }),
139
139
  /* @__PURE__ */ l("fieldset", { className: "w-1/2 h-full", children: [
140
- /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(B, { value: "to", parentKey: "common.filter.amount" }) }),
140
+ /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(S, { value: "to", parentKey: "common.filter.amount" }) }),
141
141
  /* @__PURE__ */ e("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: h, placeholder: A("filter.amount.max"), className: "w-full h-full bg-module text-sm border-1 border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: g, onChange: R })
142
142
  ] })
143
143
  ] }),
@@ -165,7 +165,7 @@ function je({ onChange: a, filterKey: i }) {
165
165
  ] }),
166
166
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center", children: [
167
167
  /* @__PURE__ */ e("button", { className: "bg-module text-black text-sm px-3 py-1 border-1 border-stroke rounded-lg ml-3 cursor-pointer", onClick: n, children: A("button.cancel") }),
168
- /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded-lg ml-3 cursor-pointer", onClick: S, children: A("button.confirm") })
168
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded-lg ml-3 cursor-pointer", onClick: B, children: A("button.confirm") })
169
169
  ] })
170
170
  ] }) })
171
171
  ] });
@@ -200,7 +200,7 @@ function Re({ onChange: a }) {
200
200
  ] }) })
201
201
  ] });
202
202
  }
203
- const Se = (a) => _.get("/api/v2/tokens/hot-list", { params: { ...a, limit: 100, page: 1 } }), Be = (a) => _.get("/api/token/list/verified", {
203
+ const Be = (a) => _.get("/api/v2/tokens/hot-list", { params: { ...a, limit: 100, page: 1 } }), Se = (a) => _.get("/api/token/list/verified", {
204
204
  params: {
205
205
  search: a,
206
206
  page: 1,
@@ -214,8 +214,8 @@ function Te({ onChange: a }) {
214
214
  a(d), A(!1);
215
215
  }, R = (n) => {
216
216
  d.some((o) => o.tokenAddress === n.tokenAddress) ? f(d.filter((o) => o.tokenAddress !== n.tokenAddress)) : f([...d, n]);
217
- }, S = we(async () => {
218
- const n = await Se({
217
+ }, B = we(async () => {
218
+ const n = await Be({
219
219
  chain: i,
220
220
  text: k,
221
221
  limit: 100,
@@ -224,13 +224,13 @@ function Te({ onChange: a }) {
224
224
  b((n == null ? void 0 : n.data) || []);
225
225
  }, { wait: 300 });
226
226
  return z(() => {
227
- S.run();
227
+ B.run();
228
228
  }, [i, k]), /* @__PURE__ */ l(O, { open: m, onOpenChange: A, children: [
229
229
  /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "w-[16px] h-[16px] flex items-center justify-center bg-[#000000] rounded-sm cursor-pointer", children: /* @__PURE__ */ e(D, { src: H, width: 12, height: 12, objectFit: "contain" }) }) }),
230
230
  /* @__PURE__ */ l(Q, { className: "py-5 bg-module", children: [
231
231
  /* @__PURE__ */ l("div", { className: "w-full h-full", children: [
232
232
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-between h-9", children: [
233
- /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.token" }) }),
233
+ /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(S, { value: "label", parentKey: "common.filter.token" }) }),
234
234
  /* @__PURE__ */ e("div", { className: "w-4 h-4 text-black text-sm cursor-pointer flex items-center justify-center", onClick: () => C(), children: /* @__PURE__ */ e(W, { className: "w-4 h-4 text-title" }) })
235
235
  ] }),
236
236
  /* @__PURE__ */ l("div", { className: "w-full relative text-sm py-3", children: [
@@ -248,8 +248,8 @@ function Te({ onChange: a }) {
248
248
  /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(te, { className: v("w-4 h-4 cursor-pointer border-1 border-gray-300 rounded-sm", d.some((h) => h.tokenAddress === n.tokenAddress) ? "bg-primary" : "bg-module"), checked: d.some((h) => h.tokenAddress === n.tokenAddress) }) })
249
249
  ] }, o)) }),
250
250
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center mt-2", children: [
251
- /* @__PURE__ */ e("button", { className: "bg-module text-black text-sm px-3 py-1 border-1 border-gray-300 rounded ml-3 cursor-pointer", onClick: C, children: /* @__PURE__ */ e(B, { value: "button.cancel", parentKey: "common" }) }),
252
- /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: N, children: /* @__PURE__ */ e(B, { value: "button.confirm", parentKey: "common" }) })
251
+ /* @__PURE__ */ e("button", { className: "bg-module text-black text-sm px-3 py-1 border-1 border-gray-300 rounded ml-3 cursor-pointer", onClick: C, children: /* @__PURE__ */ e(S, { value: "button.cancel", parentKey: "common" }) }),
252
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: N, children: /* @__PURE__ */ e(S, { value: "button.confirm", parentKey: "common" }) })
253
253
  ] })
254
254
  ] })
255
255
  ] });
@@ -261,19 +261,19 @@ function De({ onChange: a }) {
261
261
  a(d), A(!1);
262
262
  }, R = (n) => {
263
263
  d.some((o) => o.tokenAddress === n.tokenAddress) ? f(d.filter((o) => o.tokenAddress !== n.tokenAddress)) : f([...d, n]);
264
- }, S = async () => {
264
+ }, B = async () => {
265
265
  var o;
266
- const n = await Be(k);
266
+ const n = await Se(k);
267
267
  b(((o = n == null ? void 0 : n.data) == null ? void 0 : o.content) || []);
268
268
  };
269
269
  return z(() => {
270
- S();
270
+ B();
271
271
  }, [i, k]), /* @__PURE__ */ l(O, { open: m, onOpenChange: A, children: [
272
272
  /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "w-[16px] h-[16px] flex items-center justify-center bg-[#000000] rounded-sm cursor-pointer", children: /* @__PURE__ */ e(D, { src: H, width: 12, height: 12, objectFit: "contain" }) }) }),
273
273
  /* @__PURE__ */ l(Q, { className: "py-5 bg-module", children: [
274
274
  /* @__PURE__ */ l("div", { className: "w-full h-full bg-module", children: [
275
275
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-between h-9", children: [
276
- /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.token" }) }),
276
+ /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(S, { value: "label", parentKey: "common.filter.token" }) }),
277
277
  /* @__PURE__ */ e("div", { className: "w-4 h-4 text-black text-sm cursor-pointer flex items-center justify-center", onClick: () => C(), children: /* @__PURE__ */ e(W, { className: "w-4 h-4 text-title" }) })
278
278
  ] }),
279
279
  /* @__PURE__ */ l("div", { className: "w-full relative bg-module text-sm py-3", children: [
@@ -287,8 +287,8 @@ function De({ onChange: a }) {
287
287
  /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(te, { className: v("w-4 h-4 cursor-pointer border-1 border-gray-300 rounded-sm", d.some((h) => h.tokenAddress === n.tokenAddress) ? "bg-primary" : "bg-white"), checked: d.some((h) => h.tokenAddress === n.tokenAddress) }) })
288
288
  ] }, o)) }),
289
289
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center mt-2", children: [
290
- /* @__PURE__ */ e("button", { className: "bg-module text-black text-sm px-3 py-1 border-1 border-gray-300 rounded ml-3 cursor-pointer", onClick: C, children: /* @__PURE__ */ e(B, { value: "button.cancel", parentKey: "common" }) }),
291
- /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: N, children: /* @__PURE__ */ e(B, { value: "button.confirm", parentKey: "common" }) })
290
+ /* @__PURE__ */ e("button", { className: "bg-module text-black text-sm px-3 py-1 border-1 border-gray-300 rounded ml-3 cursor-pointer", onClick: C, children: /* @__PURE__ */ e(S, { value: "button.cancel", parentKey: "common" }) }),
291
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: N, children: /* @__PURE__ */ e(S, { value: "button.confirm", parentKey: "common" }) })
292
292
  ] })
293
293
  ] })
294
294
  ] });
@@ -298,10 +298,10 @@ const Pe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAA
298
298
  filters: {}
299
299
  };
300
300
  return Object.keys(a).forEach((c) => {
301
- c === "timestamp" ? (i.filters.startTime = a.timestamp.start, i.filters.endTime = a.timestamp.end) : c === "fromAddress" ? i.filters.fromAddress = a.fromAddress.address : c === "toAddress" ? i.filters.toAddress = a.toAddress.address : c === "valueUSD" ? (i.filters.minValueUSD = a.valueUSD.min, i.filters.maxValueUSD = a.valueUSD.max) : c === "amount" ? (i.filters.minAmount = a.amount.min, i.filters.maxAmount = a.amount.max) : c === "token" ? i.filters.tokenList = a.token.map((m) => m.tokenAddress) : c === "tokenSearch" ? i.filters.tokenList = a.tokenSearch.map((m) => m.tokenAddress) : c === "inputAmount" ? (i.filters.minInputAmount = a.inputAmount.min, i.filters.maxInputAmount = a.inputAmount.max) : c === "outputAmount" ? (i.filters.minOutputAmount = a.outputAmount.min, i.filters.maxOutputAmount = a.outputAmount.max) : c === "fee" && (i.filters.minFee = a.fee.min, i.filters.maxFee = a.fee.max);
301
+ c === "timestamp" ? (i.filters.startTime = a.timestamp.start, i.filters.endTime = a.timestamp.end) : c === "fromAddress" ? i.filters.fromAddress = a.fromAddress.address : c === "toAddress" ? i.filters.toAddress = a.toAddress.address : c === "valueUsd" ? (i.filters.minValueUsd = a.valueUsd.min, i.filters.maxValueUsd = a.valueUsd.max) : c === "amount" ? (i.filters.minAmount = a.amount.min, i.filters.maxAmount = a.amount.max) : c === "token" ? i.filters.tokenList = a.token.map((m) => m.tokenAddress) : c === "tokenSearch" ? i.filters.tokenList = a.tokenSearch.map((m) => m.tokenAddress) : c === "inputAmount" ? (i.filters.minInputAmount = a.inputAmount.min, i.filters.maxInputAmount = a.inputAmount.max) : c === "outputAmount" ? (i.filters.minOutputAmount = a.outputAmount.min, i.filters.maxOutputAmount = a.outputAmount.max) : c === "fee" && (i.filters.minFee = a.fee.min, i.filters.maxFee = a.fee.max);
302
302
  }), i.filters;
303
303
  };
304
- function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClassName: A, tableClassName: k, showHeader: y = !0, renderChildren: g, onFilterChange: b, loading: d, onSortChange: f, defaultOrder: C, defaultSortKey: N, emptyClassName: R, ...S }) {
304
+ function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClassName: A, tableClassName: k, showHeader: y = !0, renderChildren: g, onFilterChange: b, loading: d, onSortChange: f, defaultOrder: C, defaultSortKey: N, emptyClassName: R, ...B }) {
305
305
  const [n, o] = w(null), [h, p] = w({}), [x, T] = w(N || null), [L, re] = w(C || null), I = (t, r) => {
306
306
  o((s) => ({
307
307
  ...s,
@@ -382,7 +382,7 @@ function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClas
382
382
  }, F = i.filter((t) => !t.hidden), oe = F.some((t) => t.filter);
383
383
  return z(() => {
384
384
  n !== null && (b == null || b(n));
385
- }, [n]), /* @__PURE__ */ l("div", { className: "overflow-auto min-w-full relative", ...S, children: [
385
+ }, [n]), /* @__PURE__ */ l("div", { className: "overflow-auto min-w-full relative", ...B, children: [
386
386
  /* @__PURE__ */ e(ye, { loading: d }),
387
387
  oe && n && Object.keys(n).length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-row gap-3 flex-nowrap overflow-x-auto scrollbar-hide pb-3", children: F.map((t) => {
388
388
  if (!n) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/table",
3
- "version": "1.5.20",
3
+ "version": "1.5.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -33,14 +33,14 @@
33
33
  "antd": "6.1.1",
34
34
  "ahooks": "3.9.5",
35
35
  "@radix-ui/react-slider": "1.3.6",
36
- "@ichaingo/empty": "1.5.20",
37
- "@ichaingo/image": "1.5.20",
38
- "@ichaingo/translation": "1.5.20",
39
- "@ichaingo/loading": "1.5.20",
40
- "@ichaingo/i18n": "1.5.20",
41
- "@ichaingo/ui": "1.5.20",
42
- "@ichaingo/iconfont": "1.5.20",
43
- "@ichaingo/request": "1.5.20",
44
- "@ichaingo/number-like": "1.5.20"
36
+ "@ichaingo/empty": "1.5.22",
37
+ "@ichaingo/image": "1.5.22",
38
+ "@ichaingo/loading": "1.5.22",
39
+ "@ichaingo/i18n": "1.5.22",
40
+ "@ichaingo/translation": "1.5.22",
41
+ "@ichaingo/request": "1.5.22",
42
+ "@ichaingo/iconfont": "1.5.22",
43
+ "@ichaingo/ui": "1.5.22",
44
+ "@ichaingo/number-like": "1.5.22"
45
45
  }
46
46
  }