@ichaingo/table 1.5.6 → 1.5.7-beta

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRange.d.ts","sourceRoot":"","sources":["../../src/filters/TimeRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,iBAAiB,CAAA;AACxB,OAAO,oBAAoB,CAAA;AAC3B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAexB,UAAU,wBAAyB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC/F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;CACjE;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAqG1B"}
1
+ {"version":3,"file":"TimeRange.d.ts","sourceRoot":"","sources":["../../src/filters/TimeRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,iBAAiB,CAAA;AACxB,OAAO,oBAAoB,CAAA;AAC3B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAexB,UAAU,wBAAyB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC/F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;CACjE;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAsG1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/filters/Token.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQnE,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CA2E9F"}
1
+ {"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/filters/Token.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQnE,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CA2E9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSearch.d.ts","sourceRoot":"","sources":["../../src/filters/TokenSearch.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAO/D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CAwEpG"}
1
+ {"version":3,"file":"TokenSearch.d.ts","sourceRoot":"","sources":["../../src/filters/TokenSearch.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAO/D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CAwEpG"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
3
- import { Table as ie, TableHeader as ce, TableRow as E, TableHead as de, TableBody as me, TableCell as K } from "@ichaingo/ui/table";
4
- import * as Z from "react";
5
- import he, { useState as w, useEffect as z } from "react";
3
+ import { Table as ie, TableHeader as ce, TableRow as Z, TableHead as de, TableBody as me, TableCell as z } from "@ichaingo/ui/table";
4
+ import * as J from "react";
5
+ import he, { useState as x, useEffect as V } from "react";
6
6
  import { startOfDay as q, endOfDay as X } from "date-fns";
7
7
  import { twMerge as v } from "tailwind-merge";
8
8
  import { DatePicker as ue } from "antd";
@@ -18,10 +18,10 @@ import Ae from "antd/es/date-picker/locale/zh_TW";
18
18
  import be from "antd/es/date-picker/locale/ja_JP";
19
19
  import ge from "antd/es/date-picker/locale/ko_KR";
20
20
  import D from "@ichaingo/image";
21
- import { Popover as O, PopoverTrigger as U, PopoverContent as Q } from "@ichaingo/ui/popover";
22
- import { useLocale as xe, useTranslations as J } from "next-intl";
23
- import { X as W, Search as V } from "lucide-react";
24
- import * as Y from "@radix-ui/react-slider";
21
+ import { Popover as U, PopoverTrigger as Q, PopoverContent as W } from "@ichaingo/ui/popover";
22
+ import { useTolgee as xe, useTranslate as K } from "@ichaingo/tolgee/client";
23
+ import { X as E, Search as H } from "lucide-react";
24
+ import * as O from "@radix-ui/react-slider";
25
25
  import $ from "@ichaingo/number-like";
26
26
  import B from "@ichaingo/translation";
27
27
  import _ from "@ichaingo/request";
@@ -33,169 +33,169 @@ import ye from "@ichaingo/loading";
33
33
  const Ne = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAZCAYAAAArK+5dAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADWSURBVHgB7ZPhDcIgEIUP0wEcQTdwAxjBERzBDcSJdAPbDdwANznBQnIih6TQP02/hJDmwb274wqwaBDRuDVVd3TksLKbivSd1zRzn9PvQognzeSA7VG0gqPfe7sGksnF71dIk9IljJ1QPt5YonfV9HZIhQme1ONYHeR5Vep5A/tQ+xo9ZSCRn5hSZM5Awe+oVhEb9PA9RVMIU5Q0GGxfNVTgW6zC9yZz0EQ/jinRYliDVrBjmhvBkvEMzF7B+gZ/mb2CD7aHZ2zPiRps7bphOx4uJiyCNyogpaxjuzr+AAAAAElFTkSuQmCC";
34
34
  function ve({
35
35
  className: a,
36
- onChange: i,
37
- ...c
36
+ onChange: o,
37
+ ...d
38
38
  }) {
39
- const m = xe(), [A, k] = Z.useState(!1), y = Z.useRef(null), [g, b] = Z.useState(null), d = {
39
+ const { getLanguage: p } = xe(), h = p() || "", [k, y] = J.useState(!1), g = J.useRef(null), [w, c] = J.useState(null), A = {
40
40
  en: fe,
41
41
  "zh-hans": pe,
42
42
  "zh-hant": Ae,
43
43
  ja: be,
44
44
  ko: ge
45
- }, f = {
45
+ }, C = {
46
46
  en: "en",
47
47
  "zh-hans": "zh-cn",
48
48
  "zh-hant": "zh-tw",
49
49
  ja: "ja",
50
50
  ko: "ko"
51
51
  };
52
- Z.useEffect(() => {
53
- M.locale(f[m] ?? "en");
54
- }, [m]);
55
- const C = (o) => {
56
- if (!o) {
57
- i("", ""), N();
52
+ J.useEffect(() => {
53
+ M.locale(C[h] ?? "en");
54
+ }, [h]);
55
+ const R = (i) => {
56
+ if (!i) {
57
+ o("", ""), N();
58
58
  return;
59
59
  }
60
- const [h, p] = o, x = h ? q(h.toDate()) : void 0, T = p ? X(p.toDate()) : void 0;
61
- i(x ? Math.floor(x.getTime() / 1e3) : "", T ? Math.floor(T.getTime() / 1e3) : ""), N();
60
+ const [b, m] = i, T = b ? q(b.toDate()) : void 0, I = m ? X(m.toDate()) : void 0;
61
+ o(T ? Math.floor(T.getTime() / 1e3) : "", I ? Math.floor(I.getTime() / 1e3) : ""), N();
62
62
  }, N = () => {
63
- k(!1);
64
- }, R = (o) => {
65
- o ? k(!0) : C(g);
66
- }, S = (o) => {
67
- if (!o) {
68
- b(null);
63
+ y(!1);
64
+ }, S = (i) => {
65
+ i ? y(!0) : R(w);
66
+ }, n = (i) => {
67
+ if (!i) {
68
+ c(null);
69
69
  return;
70
70
  }
71
- const [h, p] = o;
72
- b([h, p]);
73
- }, n = (o) => {
74
- if (!o || !o[0] || !o[1]) {
75
- b(null), i("", ""), N();
71
+ const [b, m] = i;
72
+ c([b, m]);
73
+ }, u = (i) => {
74
+ if (!i || !i[0] || !i[1]) {
75
+ c(null), o("", ""), N();
76
76
  return;
77
77
  }
78
- const h = q(o[0].toDate()), p = X(o[1].toDate());
79
- i(Math.floor(h.getTime() / 1e3), Math.floor(p.getTime() / 1e3)), b([o[0], o[1]]), N();
78
+ const b = q(i[0].toDate()), m = X(i[1].toDate());
79
+ o(Math.floor(b.getTime() / 1e3), Math.floor(m.getTime() / 1e3)), c([i[0], i[1]]), N();
80
80
  };
81
- return /* @__PURE__ */ e("div", { className: v(a), ...c, children: /* @__PURE__ */ l(O, { open: A, onOpenChange: R, children: [
82
- /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e("i", { className: "w-4 h-4 p-[2px] cursor-pointer flex items-center justify-center bg-[#000000] rounded-sm", children: /* @__PURE__ */ e(D, { src: Ne, width: 12, height: 12 }) }) }),
83
- /* @__PURE__ */ e(Q, { className: "w-auto p-0", align: "center", side: "right", children: /* @__PURE__ */ e("div", { ref: y, className: "relative", children: /* @__PURE__ */ e(
81
+ return /* @__PURE__ */ e("div", { className: v(a), ...d, children: /* @__PURE__ */ l(U, { open: k, onOpenChange: S, children: [
82
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e("i", { className: "w-4 h-4 p-[2px] cursor-pointer flex items-center justify-center bg-[#000000] rounded-sm", children: /* @__PURE__ */ e(D, { src: Ne, width: 12, height: 12 }) }) }),
83
+ /* @__PURE__ */ e(W, { className: "w-auto p-0", align: "center", side: "right", children: /* @__PURE__ */ e("div", { ref: g, className: "relative", children: /* @__PURE__ */ e(
84
84
  ue.RangePicker,
85
85
  {
86
86
  open: !0,
87
87
  size: "small",
88
- locale: d[m],
88
+ locale: A[h],
89
89
  allowClear: !1,
90
- value: g ?? [M(), M()],
91
- onCalendarChange: S,
92
- onChange: n,
93
- getPopupContainer: () => y.current,
90
+ value: w ?? [M(), M()],
91
+ onCalendarChange: n,
92
+ onChange: u,
93
+ getPopupContainer: () => g.current,
94
94
  style: { position: "absolute", opacity: 0, width: 0, height: 0, pointerEvents: "none" },
95
- disabledDate: (o) => o && o > M().endOf("day")
95
+ disabledDate: (i) => i && i > M().endOf("day")
96
96
  }
97
97
  ) }) })
98
98
  ] }) });
99
99
  }
100
100
  const Ce = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADZSURBVHgB7ZTbDcIwDEVvUAfoCN2AjsAI3YBu0jABGYER2KAjABPABrBBcMARFkjNo/krR7IaWfZ1nDoB/gRQfmGt7enToAw3pdThu4BFQajAS7sSvh3ZwOsj2QVprMk6ofULNWHsmytZg0hcLOc4TCh4FEVqhMVrIT6idELqhnySbHk/ETfkHKlPbsnuLDBMiLuYFjm4u2E/bIW/E/4ecyABLXZa8/H5zjRKQEInFtywxU0MsUIcD2QSWyCb5RVInvcqMs7/ZHerzygNz74Wz0f0mM4pZLAInpppFh6wLb8LAAAAAElFTkSuQmCC";
101
- function je({ onChange: a, filterKey: i }) {
102
- const [c, m] = w(!1), A = J("common"), [k, y] = w(""), [g, b] = w(""), [d, f] = w([0.01, 1e10]), C = (p) => {
103
- f(p), y(p[0].toString()), b(p[1].toString());
104
- }, N = (p) => {
105
- const x = p.target.value;
106
- if (x === "" || /^\d*\.?\d{0,8}$/.test(x) && !x.startsWith(".")) {
107
- y(x);
108
- const T = parseFloat(x) || 0;
109
- f([T, d[1]]);
101
+ function je({ onChange: a, filterKey: o }) {
102
+ const [d, p] = x(!1), { t: h } = K(), [k, y] = x(""), [g, w] = x(""), [c, A] = x([0.01, 1e10]), C = (b) => {
103
+ A(b), y(b[0].toString()), w(b[1].toString());
104
+ }, R = (b) => {
105
+ const m = b.target.value;
106
+ if (m === "" || /^\d*\.?\d{0,8}$/.test(m) && !m.startsWith(".")) {
107
+ y(m);
108
+ const T = parseFloat(m) || 0;
109
+ A([T, c[1]]);
110
110
  }
111
- }, R = (p) => {
112
- const x = p.target.value;
113
- if (x === "" || /^\d*\.?\d{0,8}$/.test(x) && !x.startsWith(".")) {
114
- b(x);
115
- const T = parseFloat(x);
116
- f([d[0], T]);
111
+ }, N = (b) => {
112
+ const m = b.target.value;
113
+ if (m === "" || /^\d*\.?\d{0,8}$/.test(m) && !m.startsWith(".")) {
114
+ w(m);
115
+ const T = parseFloat(m);
116
+ A([c[0], T]);
117
117
  }
118
118
  }, S = () => {
119
- a(k, g), m(!1);
119
+ a(k, g), p(!1);
120
120
  }, n = () => {
121
- m(!1);
122
- }, o = (p) => {
123
- p.target.value === "0" && y("0.01");
124
- }, h = (p) => {
125
- p.target.value === "0" && b("0.01");
121
+ p(!1);
122
+ }, u = (b) => {
123
+ b.target.value === "0" && y("0.01");
124
+ }, i = (b) => {
125
+ b.target.value === "0" && w("0.01");
126
126
  };
127
- return /* @__PURE__ */ l(O, { open: c, onOpenChange: m, children: [
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
- /* @__PURE__ */ e(Q, { className: "bg-module", children: /* @__PURE__ */ l("div", { className: "w-full h-full", children: [
127
+ return /* @__PURE__ */ l(U, { open: d, onOpenChange: p, children: [
128
+ /* @__PURE__ */ e(Q, { 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
+ /* @__PURE__ */ e(W, { 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
131
  /* @__PURE__ */ e("span", { className: "text-sm", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.amount" }) }),
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" }) })
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(E, { 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
136
  /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(B, { value: "form", parentKey: "common.filter.amount" }) }),
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 })
137
+ /* @__PURE__ */ e("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: u, placeholder: h("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: R })
138
138
  ] }),
139
139
  /* @__PURE__ */ l("fieldset", { className: "w-1/2 h-full", children: [
140
140
  /* @__PURE__ */ e("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ e(B, { value: "to", parentKey: "common.filter.amount" }) }),
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 })
141
+ /* @__PURE__ */ e("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: i, placeholder: h("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: N })
142
142
  ] })
143
143
  ] }),
144
144
  /* @__PURE__ */ l("div", { className: " w-full pb-4", children: [
145
145
  /* @__PURE__ */ l(
146
- Y.Root,
146
+ O.Root,
147
147
  {
148
148
  className: "w-full relative flex items-center justify-center h-1 flex-grow bg-background rounded-sm touch-pan-y select-none",
149
- value: d,
149
+ value: c,
150
150
  onValueChange: C,
151
151
  max: 1e10,
152
152
  min: 0.01,
153
153
  step: 1,
154
154
  children: [
155
- /* @__PURE__ */ e(Y.Track, { className: "h-1 rounded-full bg-primary", children: /* @__PURE__ */ e(Y.Range, { className: "h-1 absolute bg-primary rounded-full" }) }),
156
- /* @__PURE__ */ e(Y.Thumb, { className: "block w-3 h-3 bg-primary rounded-full cursor-pointer touch-none", "aria-label": "Min value" }),
157
- /* @__PURE__ */ e(Y.Thumb, { className: "block w-3 h-3 bg-primary rounded-full cursor-pointer touch-none", "aria-label": "Max value" })
155
+ /* @__PURE__ */ e(O.Track, { className: "h-1 rounded-full bg-primary", children: /* @__PURE__ */ e(O.Range, { className: "h-1 absolute bg-primary rounded-full" }) }),
156
+ /* @__PURE__ */ e(O.Thumb, { className: "block w-3 h-3 bg-primary rounded-full cursor-pointer touch-none", "aria-label": "Min value" }),
157
+ /* @__PURE__ */ e(O.Thumb, { className: "block w-3 h-3 bg-primary rounded-full cursor-pointer touch-none", "aria-label": "Max value" })
158
158
  ]
159
159
  }
160
160
  ),
161
161
  /* @__PURE__ */ l("div", { className: "flex justify-between text-xs text-gray-500 mt-2", children: [
162
- /* @__PURE__ */ e($, { addonBefore: i === "valueUSD" ? /* @__PURE__ */ e("span", { className: "text-subtitle", children: "$" }) : void 0, number: "0.01", minimumFractionDigits: 2, notation: "compact", maximumFractionDigits: 20 }),
163
- /* @__PURE__ */ e($, { addonBefore: i === "valueUSD" ? /* @__PURE__ */ e("span", { className: "text-subtitle", children: "$" }) : void 0, number: "10000000000", notation: "compact", maximumFractionDigits: 2 })
162
+ /* @__PURE__ */ e($, { addonBefore: o === "valueUSD" ? /* @__PURE__ */ e("span", { className: "text-subtitle", children: "$" }) : void 0, number: "0.01", minimumFractionDigits: 2, notation: "compact", maximumFractionDigits: 20 }),
163
+ /* @__PURE__ */ e($, { addonBefore: o === "valueUSD" ? /* @__PURE__ */ e("span", { className: "text-subtitle", children: "$" }) : void 0, number: "10000000000", notation: "compact", maximumFractionDigits: 2 })
164
164
  ] })
165
165
  ] }),
166
166
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center", children: [
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") })
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: h("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: h("button.confirm") })
169
169
  ] })
170
170
  ] }) })
171
171
  ] });
172
172
  }
173
- const H = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFFSURBVHgB5VVRccMwDFV2A+AxCIOZwQyhDGYGC4OGQcegYzAIgZANgcsgY6DJd9Kquk4Te9ef9t3pkpOf/CTFigHuAojoyPZkAY+YyAYyD/8BbdDyRksIVWIU9MrZStY9mSUzvB7fPdmoxLYlAlYFvsvGF/hdsRAee98rn+PWSXWjbhGvC9ySgJc+Z3w57BWvZ9+wJBKYuMkE/7WOhUOSjFGVujmBlglTbi3jM5h8L04kokv5j/xs+fmVEpqmOWR8P3AOiX1OFx4SkQNcASIimT1BPcySiJT6AvWQNn3PMtTpclABFW8vkeS4jlAusF07J0Zls4P1Anri7ZoAq4Zql5uRhP+m+AOsRZx4FRgr63SGPLhx6gc8R9HfuMXTi2oOEyfhq4RYLPb7A0/vjkD2yZsbxa0XKkxKC3m4Fvibxso3cHP4BWMxfN1YKiXJAAAAAElFTkSuQmCC";
173
+ const L = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFFSURBVHgB5VVRccMwDFV2A+AxCIOZwQyhDGYGC4OGQcegYzAIgZANgcsgY6DJd9Kquk4Te9ef9t3pkpOf/CTFigHuAojoyPZkAY+YyAYyD/8BbdDyRksIVWIU9MrZStY9mSUzvB7fPdmoxLYlAlYFvsvGF/hdsRAee98rn+PWSXWjbhGvC9ySgJc+Z3w57BWvZ9+wJBKYuMkE/7WOhUOSjFGVujmBlglTbi3jM5h8L04kokv5j/xs+fmVEpqmOWR8P3AOiX1OFx4SkQNcASIimT1BPcySiJT6AvWQNn3PMtTpclABFW8vkeS4jlAusF07J0Zls4P1Anri7ZoAq4Zql5uRhP+m+AOsRZx4FRgr63SGPLhx6gc8R9HfuMXTi2oOEyfhq4RYLPb7A0/vjkD2yZsbxa0XKkxKC3m4Fvibxso3cHP4BWMxfN1YKiXJAAAAAElFTkSuQmCC";
174
174
  function Re({ onChange: a }) {
175
- const [i, c] = w(!1), m = J("common"), [A, k] = w(""), y = (d) => {
176
- const f = d.target.value;
177
- (f === "" || /^[a-zA-Z0-9]*$/.test(f)) && k(f);
175
+ const [o, d] = x(!1), { t: p } = K(), [h, k] = x(""), y = (c) => {
176
+ const A = c.target.value;
177
+ (A === "" || /^[a-zA-Z0-9]*$/.test(A)) && k(A);
178
178
  }, g = () => {
179
- a(A), c(!1);
180
- }, b = () => {
181
- c(!1);
179
+ a(h), d(!1);
180
+ }, w = () => {
181
+ d(!1);
182
182
  };
183
- return /* @__PURE__ */ l(O, { open: i, onOpenChange: c, children: [
184
- /* @__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" }) }) }),
185
- /* @__PURE__ */ e(Q, { className: "bg-module", children: /* @__PURE__ */ l("div", { className: "w-full h-full", children: [
183
+ return /* @__PURE__ */ l(U, { open: o, onOpenChange: d, children: [
184
+ /* @__PURE__ */ e(Q, { 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: L, width: 12, height: 12, objectFit: "contain" }) }) }),
185
+ /* @__PURE__ */ e(W, { className: "bg-module", children: /* @__PURE__ */ l("div", { className: "w-full h-full", children: [
186
186
  /* @__PURE__ */ l("fieldset", { className: "w-full h-full", children: [
187
187
  /* @__PURE__ */ l("label", { className: "w-full h-full text-sm flex items-center justify-between", children: [
188
- m("filter.address.label"),
189
- /* @__PURE__ */ e("div", { className: "w-4 h-4 text-black text-sm cursor-pointer flex items-center justify-center", onClick: () => b(), children: /* @__PURE__ */ e(W, { className: "w-4 h-4" }) })
188
+ p("filter.address.label"),
189
+ /* @__PURE__ */ e("div", { className: "w-4 h-4 text-black text-sm cursor-pointer flex items-center justify-center", onClick: () => w(), children: /* @__PURE__ */ e(E, { className: "w-4 h-4" }) })
190
190
  ] }),
191
191
  /* @__PURE__ */ l("div", { className: "w-full relative text-sm ", children: [
192
- /* @__PURE__ */ e(V, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
193
- /* @__PURE__ */ e("input", { placeholder: m("filter.amount.label"), type: "text", pattern: "[a-zA-Z0-9]*", className: "pl-6 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: A, onChange: y })
192
+ /* @__PURE__ */ e(H, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
193
+ /* @__PURE__ */ e("input", { placeholder: p("filter.amount.label"), type: "text", pattern: "[a-zA-Z0-9]*", className: "pl-6 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: h, onChange: y })
194
194
  ] })
195
195
  ] }),
196
196
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center mt-2", children: [
197
- /* @__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: b, children: m("button.cancel") }),
198
- /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: g, children: m("button.confirm") })
197
+ /* @__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: w, children: p("button.cancel") }),
198
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: g, children: p("button.confirm") })
199
199
  ] })
200
200
  ] }) })
201
201
  ] });
@@ -208,110 +208,110 @@ const Se = (a) => _.get("/api/v2/tokens/hot-list", { params: { ...a, limit: 100,
208
208
  }
209
209
  });
210
210
  function Te({ onChange: a }) {
211
- const { chain: i } = ee(), c = J("common.filter.amount"), [m, A] = w(!1), [k, y] = w(""), [g, b] = w([]), [d, f] = w([]), C = () => {
212
- A(!1);
213
- }, N = () => {
214
- a(d), A(!1);
215
- }, R = (n) => {
216
- d.some((o) => o.tokenAddress === n.tokenAddress) ? f(d.filter((o) => o.tokenAddress !== n.tokenAddress)) : f([...d, n]);
211
+ const { chain: o } = ee(), { t: d } = K(), [p, h] = x(!1), [k, y] = x(""), [g, w] = x([]), [c, A] = x([]), C = () => {
212
+ h(!1);
213
+ }, R = () => {
214
+ a(c), h(!1);
215
+ }, N = (n) => {
216
+ c.some((u) => u.tokenAddress === n.tokenAddress) ? A(c.filter((u) => u.tokenAddress !== n.tokenAddress)) : A([...c, n]);
217
217
  }, S = we(async () => {
218
218
  const n = await Se({
219
- chain: i,
219
+ chain: o,
220
220
  text: k,
221
221
  limit: 100,
222
222
  page: 1
223
223
  });
224
- b((n == null ? void 0 : n.data) || []);
224
+ w((n == null ? void 0 : n.data) || []);
225
225
  }, { wait: 300 });
226
- return z(() => {
226
+ return V(() => {
227
227
  S.run();
228
- }, [i, k]), /* @__PURE__ */ l(O, { open: m, onOpenChange: A, children: [
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
- /* @__PURE__ */ l(Q, { className: "py-5 bg-module", children: [
228
+ }, [o, k]), /* @__PURE__ */ l(U, { open: p, onOpenChange: h, children: [
229
+ /* @__PURE__ */ e(Q, { 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: L, width: 12, height: 12, objectFit: "contain" }) }) }),
230
+ /* @__PURE__ */ l(W, { 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
233
  /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.token" }) }),
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" }) })
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(E, { className: "w-4 h-4 text-title" }) })
235
235
  ] }),
236
236
  /* @__PURE__ */ l("div", { className: "w-full relative text-sm py-3", children: [
237
- /* @__PURE__ */ e(V, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
238
- /* @__PURE__ */ e("input", { type: "text", placeholder: c("label"), className: "pl-6 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) => y(n.target.value) })
237
+ /* @__PURE__ */ e(H, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
238
+ /* @__PURE__ */ e("input", { type: "text", placeholder: d("label"), className: "pl-6 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) => y(n.target.value) })
239
239
  ] })
240
240
  ] }),
241
- /* @__PURE__ */ e("ul", { className: "max-h-30 min-h-30 overflow-y-auto overflow-x-hidden w-full", children: g == null ? void 0 : g.map((n, o) => /* @__PURE__ */ l("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => R(n), children: [
241
+ /* @__PURE__ */ e("ul", { className: "max-h-30 min-h-30 overflow-y-auto overflow-x-hidden w-full", children: g == null ? void 0 : g.map((n, u) => /* @__PURE__ */ l("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => N(n), children: [
242
242
  /* @__PURE__ */ e(D, { src: n.iconUrl, objectFit: "contain", alt: n.tokenSymbol, className: "rounded-full w-4 h-4 min-w-4 min-h-4 flex-shrink-0" }),
243
243
  /* @__PURE__ */ l("div", { className: "text-sm text-title text-left truncate min-w-0 flex-1 overflow-hidden", children: [
244
244
  /* @__PURE__ */ e("span", { className: "text-title", children: n.tokenSymbol }),
245
245
  " ",
246
246
  /* @__PURE__ */ e("span", { className: "text-subtitle text-xs", children: n.tokenName })
247
247
  ] }),
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
- ] }, o)) }),
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", c.some((i) => i.tokenAddress === n.tokenAddress) ? "bg-primary" : "bg-module"), checked: c.some((i) => i.tokenAddress === n.tokenAddress) }) })
249
+ ] }, u)) }),
250
250
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center mt-2", children: [
251
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" }) })
252
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: R, children: /* @__PURE__ */ e(B, { value: "button.confirm", parentKey: "common" }) })
253
253
  ] })
254
254
  ] })
255
255
  ] });
256
256
  }
257
257
  function De({ onChange: a }) {
258
- const { chain: i = "" } = ee(), c = J("common.filter.amount"), [m, A] = w(!1), [k, y] = w(""), [g, b] = w([]), [d, f] = w([]), C = () => {
259
- a([]), y(""), f([]), A(!1);
260
- }, N = () => {
261
- a(d), A(!1);
262
- }, R = (n) => {
263
- d.some((o) => o.tokenAddress === n.tokenAddress) ? f(d.filter((o) => o.tokenAddress !== n.tokenAddress)) : f([...d, n]);
258
+ const { chain: o = "" } = ee(), { t: d } = K("common.filter.amount"), [p, h] = x(!1), [k, y] = x(""), [g, w] = x([]), [c, A] = x([]), C = () => {
259
+ a([]), y(""), A([]), h(!1);
260
+ }, R = () => {
261
+ a(c), h(!1);
262
+ }, N = (n) => {
263
+ c.some((u) => u.tokenAddress === n.tokenAddress) ? A(c.filter((u) => u.tokenAddress !== n.tokenAddress)) : A([...c, n]);
264
264
  }, S = async () => {
265
- var o;
265
+ var u;
266
266
  const n = await Be(k);
267
- b(((o = n == null ? void 0 : n.data) == null ? void 0 : o.content) || []);
267
+ w(((u = n == null ? void 0 : n.data) == null ? void 0 : u.content) || []);
268
268
  };
269
- return z(() => {
269
+ return V(() => {
270
270
  S();
271
- }, [i, k]), /* @__PURE__ */ l(O, { open: m, onOpenChange: A, children: [
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
- /* @__PURE__ */ l(Q, { className: "py-5 bg-module", children: [
271
+ }, [o, k]), /* @__PURE__ */ l(U, { open: p, onOpenChange: h, children: [
272
+ /* @__PURE__ */ e(Q, { 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: L, width: 12, height: 12, objectFit: "contain" }) }) }),
273
+ /* @__PURE__ */ l(W, { 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
276
  /* @__PURE__ */ e("span", { className: "text-base text-title", children: /* @__PURE__ */ e(B, { value: "label", parentKey: "common.filter.token" }) }),
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" }) })
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(E, { 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: [
280
- /* @__PURE__ */ e(V, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
281
- /* @__PURE__ */ e("input", { type: "text", placeholder: c("label"), className: "pl-6 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) => y(n.target.value) })
280
+ /* @__PURE__ */ e(H, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
281
+ /* @__PURE__ */ e("input", { type: "text", placeholder: d("label"), className: "pl-6 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) => y(n.target.value) })
282
282
  ] })
283
283
  ] }),
284
- /* @__PURE__ */ e("ul", { className: "max-h-50 min-h-25 overflow-y-auto overflow-x-hidden w-full", children: g == null ? void 0 : g.map((n, o) => /* @__PURE__ */ l("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => R(n), children: [
284
+ /* @__PURE__ */ e("ul", { className: "max-h-50 min-h-25 overflow-y-auto overflow-x-hidden w-full", children: g == null ? void 0 : g.map((n, u) => /* @__PURE__ */ l("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => N(n), children: [
285
285
  /* @__PURE__ */ e(D, { src: n.iconUrl, objectFit: "contain", alt: n.tokenName, className: "rounded-full w-4 h-4 min-w-4 min-h-4 flex-shrink-0" }),
286
286
  /* @__PURE__ */ e("div", { className: "text-sm text-title text-left truncate min-w-0 flex-1 overflow-hidden", children: n.tokenName }),
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
- ] }, o)) }),
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", c.some((i) => i.tokenAddress === n.tokenAddress) ? "bg-primary" : "bg-white"), checked: c.some((i) => i.tokenAddress === n.tokenAddress) }) })
288
+ ] }, u)) }),
289
289
  /* @__PURE__ */ l("div", { className: "flex justify-end items-center mt-2", children: [
290
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" }) })
291
+ /* @__PURE__ */ e("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: R, children: /* @__PURE__ */ e(B, { value: "button.confirm", parentKey: "common" }) })
292
292
  ] })
293
293
  ] })
294
294
  ] });
295
295
  }
296
296
  const Pe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHtSURBVHgB7ZfBalNBFIb/M7cmaBGuT2BcCNZVHsG+QWNw3Qw00qyMT5DbJ9Buiujipnsl+gZ5A3EjLu8bNIIVzSVzOhNaKGnTe86EQhf5IARyD8M388/cMwHW3CEIK/Bs/6RhTG3kh2n6T/bz6P4BIoiWaPRP0gf/69/9CI2L35ybbf/68HAMJQaRbJb1wWWB+WAmyYMclERJbPVOd5jRv+ZRw69ODiVqibAPCPRuaQFhZ6v3tw8Fagmie9liDFdrMAiyuA2J5/t/OkRmV1CaJiSPRSwxnxmZgbSeCS+ksYgl5jOriGERaSwiiRBDmBn0pMbUR1VFIgmW7YNlNJ92p02sKkHkfiASBopy87S4qWYDAmq1MptOaxPv/BhKqJwdFkePJlgjQNRF83yUug284ZnuiAZKxkHPtgqsKvHp+POQEH1CJon7/cRau3RfyE4Hk3pDXiL9h/TG9i57TzC+IZ6iKg6RRNe233uTMSIoHW1X1Yh7R8nG+i/VeWdw5aYMqO6YH/MvHWNI1qL9yu112pWrEFDdJ17b9tA3kq+C0uJ85USob1YJIwxeVJRlkhiiJaxtTdjNls+Sabi3+/IYCqJu2137agzHh9c8KsIbEkqi/3ckMBmuxqKKYWWJEItz1DoX8RHxW20MaxY5AxD/nDkC92cTAAAAAElFTkSuQmCC", Fe = (a) => a == null ? "" : typeof a == "object" ? JSON.stringify(a) : a, ct = (a) => {
297
- const i = {
297
+ const o = {
298
298
  filters: {}
299
299
  };
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);
302
- }), i.filters;
300
+ return Object.keys(a).forEach((d) => {
301
+ d === "timestamp" ? (o.filters.startTime = a.timestamp.start, o.filters.endTime = a.timestamp.end) : d === "fromAddress" ? o.filters.fromAddress = a.fromAddress.address : d === "toAddress" ? o.filters.toAddress = a.toAddress.address : d === "valueUSD" ? (o.filters.minValueUSD = a.valueUSD.min, o.filters.maxValueUSD = a.valueUSD.max) : d === "amount" ? (o.filters.minAmount = a.amount.min, o.filters.maxAmount = a.amount.max) : d === "token" ? o.filters.tokenList = a.token.map((p) => p.tokenAddress) : d === "tokenSearch" ? o.filters.tokenList = a.tokenSearch.map((p) => p.tokenAddress) : d === "inputAmount" ? (o.filters.minInputAmount = a.inputAmount.min, o.filters.maxInputAmount = a.inputAmount.max) : d === "outputAmount" ? (o.filters.minOutputAmount = a.outputAmount.min, o.filters.maxOutputAmount = a.outputAmount.max) : d === "fee" && (o.filters.minFee = a.fee.min, o.filters.maxFee = a.fee.max);
302
+ }), o.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 }) {
305
- const [n, o] = w(null), [h, p] = w({}), [x, T] = w(N || null), [L, re] = w(C || null), I = (t, r) => {
306
- o((s) => ({
304
+ function dt({ data: a, columns: o, headerClassName: d, bodyClassName: p, rowClassName: h, tableClassName: k, showHeader: y = !0, renderChildren: g, onFilterChange: w, loading: c, onSortChange: A, defaultOrder: C, defaultSortKey: R, emptyClassName: N, ...S }) {
305
+ const [n, u] = x(null), [i, b] = x({}), [m, T] = x(R || null), [I, re] = x(C || null), Y = (t, r) => {
306
+ u((s) => ({
307
307
  ...s,
308
308
  [t]: r
309
309
  }));
310
310
  }, P = (t) => {
311
- o((r) => {
311
+ u((r) => {
312
312
  const s = { ...r };
313
313
  return delete s[t], s;
314
- }), p((r) => ({
314
+ }), b((r) => ({
315
315
  ...r,
316
316
  [t]: (r[t] || 0) + 1
317
317
  }));
@@ -319,30 +319,30 @@ function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClas
319
319
  switch (t.filter) {
320
320
  case "timeRange":
321
321
  return /* @__PURE__ */ e(ve, { onChange: (r, s) => {
322
- var u, j;
323
- r && s ? (I(t.key, { start: r, end: s }), (j = (u = t.filterProps) == null ? void 0 : u.onChange) == null || j.call(u, { start: r, end: s })) : P(t.key);
324
- } }, h[t.key]);
322
+ var f, j;
323
+ r && s ? (Y(t.key, { start: r, end: s }), (j = (f = t.filterProps) == null ? void 0 : f.onChange) == null || j.call(f, { start: r, end: s })) : P(t.key);
324
+ } }, i[t.key]);
325
325
  case "address":
326
326
  return /* @__PURE__ */ e(Re, { onChange: (r) => {
327
- var s, u;
328
- r ? (I(t.key, { address: r }), (u = (s = t.filterProps) == null ? void 0 : s.onChange) == null || u.call(s, { address: r })) : P(t.key);
329
- } }, h[t.key]);
327
+ var s, f;
328
+ r ? (Y(t.key, { address: r }), (f = (s = t.filterProps) == null ? void 0 : s.onChange) == null || f.call(s, { address: r })) : P(t.key);
329
+ } }, i[t.key]);
330
330
  case "amount":
331
331
  return /* @__PURE__ */ e(je, { filterKey: t.key, onChange: (r, s) => {
332
332
  var j, G;
333
- const u = {};
334
- r && (u.min = r), s && (u.max = s), Object.keys(u).length > 0 ? (I(t.key, u), (G = (j = t.filterProps) == null ? void 0 : j.onChange) == null || G.call(j, u)) : P(t.key);
335
- } }, h[t.key]);
333
+ const f = {};
334
+ r && (f.min = r), s && (f.max = s), Object.keys(f).length > 0 ? (Y(t.key, f), (G = (j = t.filterProps) == null ? void 0 : j.onChange) == null || G.call(j, f)) : P(t.key);
335
+ } }, i[t.key]);
336
336
  case "token":
337
337
  return /* @__PURE__ */ e(Te, { onChange: (r) => {
338
- var s, u;
339
- r ? (I(t.key, r), (u = (s = t.filterProps) == null ? void 0 : s.onChange) == null || u.call(s, r)) : P(t.key);
340
- } }, h[t.key]);
338
+ var s, f;
339
+ r ? (Y(t.key, r), (f = (s = t.filterProps) == null ? void 0 : s.onChange) == null || f.call(s, r)) : P(t.key);
340
+ } }, i[t.key]);
341
341
  case "tokenSearch":
342
342
  return /* @__PURE__ */ e(De, { onChange: (r) => {
343
- var s, u;
344
- r ? (I(t.key, r), (u = (s = t.filterProps) == null ? void 0 : s.onChange) == null || u.call(s, r)) : P(t.key);
345
- } }, h[t.key]);
343
+ var s, f;
344
+ r ? (Y(t.key, r), (f = (s = t.filterProps) == null ? void 0 : s.onChange) == null || f.call(s, r)) : P(t.key);
345
+ } }, i[t.key]);
346
346
  default:
347
347
  return null;
348
348
  }
@@ -377,13 +377,13 @@ function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClas
377
377
  return null;
378
378
  }
379
379
  }, le = (t) => {
380
- const r = L === "asc" ? "desc" : "asc";
381
- T(t), re(r), f == null || f(t, r);
382
- }, F = i.filter((t) => !t.hidden), oe = F.some((t) => t.filter);
383
- return z(() => {
384
- n !== null && (b == null || b(n));
380
+ const r = I === "asc" ? "desc" : "asc";
381
+ T(t), re(r), A == null || A(t, r);
382
+ }, F = o.filter((t) => !t.hidden), oe = F.some((t) => t.filter);
383
+ return V(() => {
384
+ n !== null && (w == null || w(n));
385
385
  }, [n]), /* @__PURE__ */ l("div", { className: "overflow-auto min-w-full relative", ...S, children: [
386
- /* @__PURE__ */ e(ye, { loading: d }),
386
+ /* @__PURE__ */ e(ye, { loading: c }),
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;
389
389
  const r = n == null ? void 0 : n[t.key];
@@ -398,27 +398,27 @@ function dt({ data: a, columns: i, headerClassName: c, bodyClassName: m, rowClas
398
398
  {
399
399
  onClick: () => P(t.key),
400
400
  className: "hover:bg-gray-200 rounded-full p-1",
401
- children: /* @__PURE__ */ e(W, { className: "w-3 h-3 cursor-pointer" })
401
+ children: /* @__PURE__ */ e(E, { className: "w-3 h-3 cursor-pointer" })
402
402
  }
403
403
  )
404
404
  ] }, t.key);
405
405
  }) }),
406
406
  /* @__PURE__ */ l(ie, { className: v("", k), children: [
407
- y && /* @__PURE__ */ e(ce, { className: v("border-b border-stroke", c), children: /* @__PURE__ */ e(E, { className: "border-b-0 hover:bg-transparent", children: F.map((t, r) => {
407
+ y && /* @__PURE__ */ e(ce, { className: v("border-b border-stroke", d), children: /* @__PURE__ */ e(Z, { className: "border-b-0 hover:bg-transparent", children: F.map((t, r) => {
408
408
  var s;
409
409
  return /* @__PURE__ */ e(de, { className: v("text-left", "whitespace-nowrap"), style: { width: t.width }, children: /* @__PURE__ */ l("div", { className: v("flex items-center gap-1 min-w-fit w-full whitespace-nowrap", t.align === "center" && "justify-center", t.align === "right" && "justify-end", (s = t.className) == null ? void 0 : s.call(t, t, r)), children: [
410
410
  t.label,
411
411
  t.filter && ne(t),
412
- t.sort && /* @__PURE__ */ e(D, { src: Pe, alt: "sort", className: v("w-4 h-4 cursor-pointer", x === t.key && "opacity-100", L === "desc" && "rotate-180"), onClick: () => le(t.key) })
412
+ t.sort && /* @__PURE__ */ e(D, { src: Pe, alt: "sort", className: v("w-4 h-4 cursor-pointer", m === t.key && "opacity-100", I === "desc" && "rotate-180"), onClick: () => le(t.key) })
413
413
  ] }) }, r);
414
414
  }) }) }),
415
- /* @__PURE__ */ e(me, { className: v("[&_tr:last-child]:border-b-0", m), children: (a == null ? void 0 : a.length) > 0 ? a.map((t, r) => /* @__PURE__ */ l(he.Fragment, { children: [
416
- /* @__PURE__ */ e(E, { className: v("border-r-0 border-l-0 border-t-0 border-b border-stroke hover:bg-background", A), children: F.map((s, u) => {
415
+ /* @__PURE__ */ e(me, { className: v("[&_tr:last-child]:border-b-0", p), children: (a == null ? void 0 : a.length) > 0 ? a.map((t, r) => /* @__PURE__ */ l(he.Fragment, { children: [
416
+ /* @__PURE__ */ e(Z, { className: v("border-r-0 border-l-0 border-t-0 border-b border-stroke hover:bg-background", h), children: F.map((s, f) => {
417
417
  var j;
418
- return /* @__PURE__ */ e(K, { className: v("text-left min-w-fit py-4", s.align === "center" && "text-center", s.align === "right" && "text-right", "whitespace-nowrap", (j = s.className) == null ? void 0 : j.call(s, s, r, a[r])), style: { width: s.width }, children: s.render ? s.render(t[s.key], t, r) : Fe(t[s.key]) }, u);
418
+ return /* @__PURE__ */ e(z, { className: v("text-left min-w-fit py-4", s.align === "center" && "text-center", s.align === "right" && "text-right", "whitespace-nowrap", (j = s.className) == null ? void 0 : j.call(s, s, r, a[r])), style: { width: s.width }, children: s.render ? s.render(t[s.key], t, r) : Fe(t[s.key]) }, f);
419
419
  }) }, r),
420
- g && /* @__PURE__ */ e(E, { className: "border-b-0", children: /* @__PURE__ */ e(K, { colSpan: F.length, className: "p-0", children: g(t, r) }) })
421
- ] }, r)) : /* @__PURE__ */ e(E, { className: "hover:bg-transparent data-[state=selected]:bg-transparent", children: /* @__PURE__ */ e(K, { colSpan: F.length, className: "w-full text-center", children: /* @__PURE__ */ e(ke, { className: v("w-full h-38", R) }) }) }) })
420
+ g && /* @__PURE__ */ e(Z, { className: "border-b-0", children: /* @__PURE__ */ e(z, { colSpan: F.length, className: "p-0", children: g(t, r) }) })
421
+ ] }, r)) : /* @__PURE__ */ e(Z, { className: "hover:bg-transparent data-[state=selected]:bg-transparent", children: /* @__PURE__ */ e(z, { colSpan: F.length, className: "w-full text-center", children: /* @__PURE__ */ e(ke, { className: v("w-full h-38", N) }) }) }) })
422
422
  ] })
423
423
  ] });
424
424
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/table",
3
- "version": "1.5.6",
3
+ "version": "1.5.7-beta",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,21 +26,21 @@
26
26
  "tailwind-merge": "3.3.1",
27
27
  "lucide-react": "0.539.0",
28
28
  "dayjs": "1.11.19",
29
- "next-intl": "4.6.1",
30
29
  "next": "15.5.6",
31
30
  "@ichaingo/next-themes": "0.5.0",
32
31
  "date-fns": "4.1.0",
33
32
  "antd": "6.1.1",
34
33
  "ahooks": "3.9.5",
35
34
  "@radix-ui/react-slider": "1.3.6",
36
- "@ichaingo/ui": "1.5.6",
37
- "@ichaingo/image": "1.5.6",
38
- "@ichaingo/translation": "1.5.6",
39
- "@ichaingo/iconfont": "1.5.6",
40
- "@ichaingo/request": "1.5.6",
41
- "@ichaingo/loading": "1.5.6",
42
- "@ichaingo/i18n": "1.5.6",
43
- "@ichaingo/empty": "1.5.6",
44
- "@ichaingo/number-like": "1.5.6"
35
+ "@ichaingo/empty": "1.5.7-beta",
36
+ "@ichaingo/image": "1.5.7-beta",
37
+ "@ichaingo/tolgee": "1.5.7-beta",
38
+ "@ichaingo/i18n": "1.5.7-beta",
39
+ "@ichaingo/translation": "1.5.7-beta",
40
+ "@ichaingo/ui": "1.5.7-beta",
41
+ "@ichaingo/loading": "1.5.7-beta",
42
+ "@ichaingo/request": "1.5.7-beta",
43
+ "@ichaingo/iconfont": "1.5.7-beta",
44
+ "@ichaingo/number-like": "1.5.7-beta"
45
45
  }
46
46
  }