@0xchain/table 1.1.0-beta.5 → 1.1.0-beta.50
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/LICENSE +21 -0
- package/dist/filters/Address.d.ts.map +1 -1
- package/dist/filters/Amount.d.ts +1 -1
- package/dist/filters/Amount.d.ts.map +1 -1
- package/dist/filters/TimeRange.d.ts.map +1 -1
- package/dist/filters/Token.d.ts.map +1 -1
- package/dist/filters/TokenSearch.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +518 -321
- package/package.json +40 -22
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present 0xchain
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../src/filters/Address.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../src/filters/Address.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,2CAmDpF"}
|
package/dist/filters/Amount.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amount.d.ts","sourceRoot":"","sources":["../../src/filters/Amount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Amount.d.ts","sourceRoot":"","sources":["../../src/filters/Amount.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,2CAiF/G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeRange.d.ts","sourceRoot":"","sources":["../../src/filters/TimeRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TimeRange.d.ts","sourceRoot":"","sources":["../../src/filters/TimeRange.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,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,2CAyG1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/filters/Token.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Token.d.ts","sourceRoot":"","sources":["../../src/filters/Token.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASnE,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CA+E9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenSearch.d.ts","sourceRoot":"","sources":["../../src/filters/TokenSearch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TokenSearch.d.ts","sourceRoot":"","sources":["../../src/filters/TokenSearch.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQ/D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,KAAK,IAAI,CAAA;CAAE,2CA4EpG"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAUnD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;IAC7E,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;KACjC,CAAA;CACF;AACD,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC/E,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC9D,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAWD,eAAO,MAAM,iBAAiB,GAAI,cAAc,GAAG,QAkClD,CAAA;AACD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,UAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAgNvQ"}
|
package/dist/index.js
CHANGED
|
@@ -1,414 +1,611 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx
|
|
3
|
-
import { Table
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { startOfDay
|
|
7
|
-
import { twMerge
|
|
8
|
-
import { DatePicker
|
|
9
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from "@0xchain/ui/table";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import React__default, { useState, useEffect } from "react";
|
|
6
|
+
import { startOfDay, endOfDay } from "date-fns";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
import { DatePicker } from "antd";
|
|
9
|
+
import dayjs from "dayjs";
|
|
10
10
|
import "dayjs/locale/en";
|
|
11
11
|
import "dayjs/locale/zh-cn";
|
|
12
12
|
import "dayjs/locale/zh-tw";
|
|
13
13
|
import "dayjs/locale/ja";
|
|
14
14
|
import "dayjs/locale/ko";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { Popover
|
|
22
|
-
import { useLocale
|
|
23
|
-
import { X
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onChange: i,
|
|
37
|
-
...c
|
|
15
|
+
import enUSPicker from "antd/es/date-picker/locale/en_US";
|
|
16
|
+
import zhCNPicker from "antd/es/date-picker/locale/zh_CN";
|
|
17
|
+
import zhTWPicker from "antd/es/date-picker/locale/zh_TW";
|
|
18
|
+
import jaJPPicker from "antd/es/date-picker/locale/ja_JP";
|
|
19
|
+
import koKRPicker from "antd/es/date-picker/locale/ko_KR";
|
|
20
|
+
import IconFont from "@0xchain/iconfont";
|
|
21
|
+
import { Popover, PopoverTrigger, PopoverContent } from "@0xchain/ui/popover";
|
|
22
|
+
import { useLocale, useTranslations } from "@0xchain/i18n/react";
|
|
23
|
+
import { X, Search, RotateCcw } from "lucide-react";
|
|
24
|
+
import Translation from "@0xchain/translation";
|
|
25
|
+
import ImageBar from "@0xchain/image";
|
|
26
|
+
import request from "@0xchain/request";
|
|
27
|
+
import { useParams } from "next/navigation";
|
|
28
|
+
import { Checkbox } from "@0xchain/ui/checkbox";
|
|
29
|
+
import { useDebounceFn } from "ahooks";
|
|
30
|
+
import Empty from "@0xchain/empty";
|
|
31
|
+
import Loading from "@0xchain/loading";
|
|
32
|
+
function DatePickerWithRange({
|
|
33
|
+
className,
|
|
34
|
+
onChange,
|
|
35
|
+
...props
|
|
38
36
|
}) {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const locale = useLocale();
|
|
38
|
+
const [open, setOpen] = React.useState(false);
|
|
39
|
+
const containerRef = React.useRef(null);
|
|
40
|
+
const [panelRange, setPanelRange] = React.useState(null);
|
|
41
|
+
const hasFilterValue = Boolean(panelRange?.[0] && panelRange?.[1]);
|
|
42
|
+
const dpLocaleMap = {
|
|
43
|
+
en: enUSPicker,
|
|
44
|
+
"zh-hans": zhCNPicker,
|
|
45
|
+
"zh-hant": zhTWPicker,
|
|
46
|
+
ja: jaJPPicker,
|
|
47
|
+
ko: koKRPicker
|
|
48
|
+
};
|
|
49
|
+
const dayjsLocaleKeyMap = {
|
|
46
50
|
en: "en",
|
|
47
51
|
"zh-hans": "zh-cn",
|
|
48
52
|
"zh-hant": "zh-tw",
|
|
49
53
|
ja: "ja",
|
|
50
54
|
ko: "ko"
|
|
51
55
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
dayjs.locale(dayjsLocaleKeyMap[locale] ?? "en");
|
|
58
|
+
}, [locale]);
|
|
59
|
+
const closePopover = (selectedDate) => {
|
|
60
|
+
if (!selectedDate) {
|
|
61
|
+
onChange("", "");
|
|
62
|
+
cancelPopover();
|
|
58
63
|
return;
|
|
59
64
|
}
|
|
60
|
-
const [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const [from, to] = selectedDate;
|
|
66
|
+
const start = from ? startOfDay(from.toDate()) : void 0;
|
|
67
|
+
const end = to ? endOfDay(to.toDate()) : void 0;
|
|
68
|
+
onChange(start ? Math.floor(start.getTime() / 1e3) : "", end ? Math.floor(end.getTime() / 1e3) : "");
|
|
69
|
+
cancelPopover();
|
|
70
|
+
};
|
|
71
|
+
const cancelPopover = () => {
|
|
72
|
+
setOpen(false);
|
|
73
|
+
};
|
|
74
|
+
const togglePopover = (flag) => {
|
|
75
|
+
if (!flag) {
|
|
76
|
+
closePopover(panelRange);
|
|
77
|
+
} else {
|
|
78
|
+
setOpen(true);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const onAntdCalendarChange = (vals) => {
|
|
82
|
+
if (!vals) {
|
|
83
|
+
setPanelRange(null);
|
|
69
84
|
return;
|
|
70
85
|
}
|
|
71
|
-
const [
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
const [s, e] = vals;
|
|
87
|
+
setPanelRange([s, e]);
|
|
88
|
+
};
|
|
89
|
+
const onAntdChange = (vals) => {
|
|
90
|
+
if (!vals || !vals[0] || !vals[1]) {
|
|
91
|
+
setPanelRange(null);
|
|
92
|
+
onChange("", "");
|
|
93
|
+
cancelPopover();
|
|
76
94
|
return;
|
|
77
95
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
96
|
+
const sDate = startOfDay(vals[0].toDate());
|
|
97
|
+
const eDate = endOfDay(vals[1].toDate());
|
|
98
|
+
onChange(Math.floor(sDate.getTime() / 1e3), Math.floor(eDate.getTime() / 1e3));
|
|
99
|
+
setPanelRange([vals[0], vals[1]]);
|
|
100
|
+
cancelPopover();
|
|
80
101
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
return /* @__PURE__ */ jsx("div", { className: twMerge("", className), ...props, children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: togglePopover, children: [
|
|
103
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
104
|
+
IconFont,
|
|
105
|
+
{
|
|
106
|
+
type: "icon-time1",
|
|
107
|
+
style: { fontSize: "20px", color: hasFilterValue ? "var(--primary)" : "var(--title)" }
|
|
108
|
+
}
|
|
109
|
+
) }) }),
|
|
110
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "center", side: "right", children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: "relative", children: /* @__PURE__ */ jsx(
|
|
111
|
+
DatePicker.RangePicker,
|
|
85
112
|
{
|
|
86
|
-
open:
|
|
113
|
+
open: true,
|
|
87
114
|
size: "small",
|
|
88
|
-
locale:
|
|
89
|
-
allowClear:
|
|
90
|
-
value:
|
|
91
|
-
onCalendarChange:
|
|
92
|
-
onChange:
|
|
93
|
-
getPopupContainer: () =>
|
|
115
|
+
locale: dpLocaleMap[locale],
|
|
116
|
+
allowClear: false,
|
|
117
|
+
value: panelRange ?? [dayjs(), dayjs()],
|
|
118
|
+
onCalendarChange: onAntdCalendarChange,
|
|
119
|
+
onChange: onAntdChange,
|
|
120
|
+
getPopupContainer: () => containerRef.current,
|
|
94
121
|
style: { position: "absolute", opacity: 0, width: 0, height: 0, pointerEvents: "none" },
|
|
95
|
-
disabledDate: (
|
|
122
|
+
disabledDate: (current) => {
|
|
123
|
+
return current && current > dayjs().endOf("day");
|
|
124
|
+
}
|
|
96
125
|
}
|
|
97
126
|
) }) })
|
|
98
127
|
] }) });
|
|
99
128
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
129
|
+
function Amount({ onChange }) {
|
|
130
|
+
const [open, setOpen] = useState(false);
|
|
131
|
+
const t = useTranslations("common");
|
|
132
|
+
const [min, setMin] = useState("");
|
|
133
|
+
const [max, setMax] = useState("");
|
|
134
|
+
const [sliderValues, setSliderValues] = useState([0.01, 1e10]);
|
|
135
|
+
const hasFilterValue = Boolean(min || max);
|
|
136
|
+
const handleFromChange = (e) => {
|
|
137
|
+
const value = e.target.value;
|
|
138
|
+
if (value === "" || /^\d*\.?\d{0,8}$/.test(value) && !value.startsWith(".")) {
|
|
139
|
+
setMin(value);
|
|
140
|
+
const numValue = parseFloat(value) || 0;
|
|
141
|
+
setSliderValues([numValue, sliderValues[1]]);
|
|
110
142
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
143
|
+
};
|
|
144
|
+
const handleToChange = (e) => {
|
|
145
|
+
const value = e.target.value;
|
|
146
|
+
if (value === "" || /^\d*\.?\d{0,8}$/.test(value) && !value.startsWith(".")) {
|
|
147
|
+
setMax(value);
|
|
148
|
+
const numValue = parseFloat(value);
|
|
149
|
+
setSliderValues([sliderValues[0], numValue]);
|
|
117
150
|
}
|
|
118
|
-
}, B = () => {
|
|
119
|
-
a(k, g), m(!1);
|
|
120
|
-
}, n = () => {
|
|
121
|
-
m(!1);
|
|
122
|
-
}, o = (p) => {
|
|
123
|
-
p.target.value === "0" && w("0.01");
|
|
124
|
-
}, h = (p) => {
|
|
125
|
-
p.target.value === "0" && b("0.01");
|
|
126
151
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
const handleConfirm = () => {
|
|
153
|
+
onChange(min, max);
|
|
154
|
+
setOpen(false);
|
|
155
|
+
};
|
|
156
|
+
const handleCancel = () => {
|
|
157
|
+
setOpen(false);
|
|
158
|
+
};
|
|
159
|
+
const handleMinBlur = (e) => {
|
|
160
|
+
const value = e.target.value;
|
|
161
|
+
if (value === "0") {
|
|
162
|
+
setMin("0.01");
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const handleMaxBlur = (e) => {
|
|
166
|
+
const value = e.target.value;
|
|
167
|
+
if (value === "0") {
|
|
168
|
+
setMax("0.01");
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
172
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
173
|
+
IconFont,
|
|
174
|
+
{
|
|
175
|
+
type: "icon-filter",
|
|
176
|
+
style: { fontSize: "20px", color: hasFilterValue ? "var(--primary)" : "var(--title)" }
|
|
177
|
+
}
|
|
178
|
+
) }) }),
|
|
179
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "bg-card", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
|
|
180
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: /* @__PURE__ */ jsx(Translation, { value: "label", parentKey: "common.filter.amount" }) }),
|
|
182
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-4 text-foreground text-sm cursor-pointer flex items-center justify-center", onClick: () => handleCancel(), children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" }) })
|
|
133
183
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between gap-2 py-3", children: [
|
|
185
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "w-1/2 h-full", children: [
|
|
186
|
+
/* @__PURE__ */ jsx("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ jsx(Translation, { value: "form", parentKey: "common.filter.amount" }) }),
|
|
187
|
+
/* @__PURE__ */ jsx("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: handleMinBlur, placeholder: t("filter.amount.min"), className: "w-full h-full bg-card text-sm border-1 border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: min, onChange: handleFromChange })
|
|
138
188
|
] }),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "w-1/2 h-full", children: [
|
|
190
|
+
/* @__PURE__ */ jsx("label", { className: "w-full h-full text-sm", children: /* @__PURE__ */ jsx(Translation, { value: "to", parentKey: "common.filter.amount" }) }),
|
|
191
|
+
/* @__PURE__ */ jsx("input", { type: "text", inputMode: "decimal", pattern: "[0-9]*\\.?[0-9]{0,8}", onBlur: handleMaxBlur, placeholder: t("filter.amount.max"), className: "w-full h-full bg-card text-sm border-1 border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: max, onChange: handleToChange })
|
|
142
192
|
] })
|
|
143
193
|
] }),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
className: "w-full relative flex items-center justify-center h-1 grow bg-background rounded-sm touch-pan-y select-none",
|
|
149
|
-
value: d,
|
|
150
|
-
onValueChange: C,
|
|
151
|
-
max: 1e10,
|
|
152
|
-
min: 0.01,
|
|
153
|
-
step: 1,
|
|
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" })
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
),
|
|
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-muted-foreground", children: "$" }) : void 0, number: "0.01", minimumFractionDigits: 2, notation: "compact", maximumFractionDigits: 20 }),
|
|
163
|
-
/* @__PURE__ */ e($, { addonBefore: i === "valueUSD" ? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "$" }) : void 0, number: "10000000000", notation: "compact", maximumFractionDigits: 2 })
|
|
164
|
-
] })
|
|
165
|
-
] }),
|
|
166
|
-
/* @__PURE__ */ l("div", { className: "flex justify-end items-center", children: [
|
|
167
|
-
/* @__PURE__ */ e("button", { className: "bg-card text-black text-sm px-3 py-1 border border-border 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: B, children: A("button.confirm") })
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center", children: [
|
|
195
|
+
/* @__PURE__ */ jsx("button", { className: "bg-card text-foreground text-sm px-3 py-1 border border-border rounded-lg ml-3 cursor-pointer", onClick: handleCancel, children: t("button.cancel") }),
|
|
196
|
+
/* @__PURE__ */ jsx("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded-lg ml-3 cursor-pointer", onClick: handleConfirm, children: t("button.confirm") })
|
|
169
197
|
] })
|
|
170
198
|
] }) })
|
|
171
199
|
] });
|
|
172
200
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
201
|
+
function Address({ onChange }) {
|
|
202
|
+
const [open, setOpen] = useState(false);
|
|
203
|
+
const t = useTranslations("common");
|
|
204
|
+
const [address, setAddress] = useState("");
|
|
205
|
+
const hasFilterValue = Boolean(address);
|
|
206
|
+
const handleAddressChange = (e) => {
|
|
207
|
+
const value = e.target.value;
|
|
208
|
+
if (value === "" || /^[a-zA-Z0-9]*$/.test(value)) {
|
|
209
|
+
setAddress(value);
|
|
210
|
+
}
|
|
182
211
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
212
|
+
const handleConfirm = () => {
|
|
213
|
+
onChange(address);
|
|
214
|
+
setOpen(false);
|
|
215
|
+
};
|
|
216
|
+
const handleCancel = () => {
|
|
217
|
+
setOpen(false);
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
220
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
221
|
+
IconFont,
|
|
222
|
+
{
|
|
223
|
+
type: "icon-serch",
|
|
224
|
+
style: { fontSize: "20px", color: hasFilterValue ? "var(--primary)" : "var(--title)" }
|
|
225
|
+
}
|
|
226
|
+
) }) }),
|
|
227
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "bg-card", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
|
|
228
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "w-full h-full", children: [
|
|
229
|
+
/* @__PURE__ */ jsxs("label", { className: "w-full h-full text-sm flex items-center justify-between", children: [
|
|
230
|
+
t("filter.address.label"),
|
|
231
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-4 text-f text-sm cursor-pointer flex items-center justify-center", onClick: () => handleCancel(), children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" }) })
|
|
190
232
|
] }),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full relative text-sm ", children: [
|
|
234
|
+
/* @__PURE__ */ jsx(Search, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
|
|
235
|
+
/* @__PURE__ */ jsx("input", { placeholder: t("filter.amount.label"), type: "text", pattern: "[a-zA-Z0-9]*", className: "pl-6 w-full h-full bg-card text-sm border-1 border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: address, onChange: handleAddressChange })
|
|
194
236
|
] })
|
|
195
237
|
] }),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center mt-2", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("button", { className: "bg-card text-foreground text-sm px-3 py-1 border rounded ml-3 cursor-pointer", onClick: handleCancel, children: t("button.cancel") }),
|
|
240
|
+
/* @__PURE__ */ jsx("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: handleConfirm, children: t("button.confirm") })
|
|
199
241
|
] })
|
|
200
242
|
] }) })
|
|
201
243
|
] });
|
|
202
244
|
}
|
|
203
|
-
const
|
|
204
|
-
params: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
245
|
+
const getHotTokenList = (params) => {
|
|
246
|
+
return request.get(`/api/v2/tokens/hot-list`, { params: { ...params, limit: 100, page: 1 } });
|
|
247
|
+
};
|
|
248
|
+
const searchToken = (search) => {
|
|
249
|
+
return request.get(`/api/token/list/verified`, {
|
|
250
|
+
params: {
|
|
251
|
+
search,
|
|
252
|
+
page: 1,
|
|
253
|
+
size: 100
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
function Token({ onChange }) {
|
|
258
|
+
const { chain } = useParams();
|
|
259
|
+
const t = useTranslations("common.filter.amount");
|
|
260
|
+
const [open, setOpen] = useState(false);
|
|
261
|
+
const [token, setToken] = useState("");
|
|
262
|
+
const [tokenList, setTokenList] = useState([]);
|
|
263
|
+
const [selectedToken, setSelectedToken] = useState([]);
|
|
264
|
+
const hasFilterValue = selectedToken.length > 0;
|
|
265
|
+
const handleCancel = () => {
|
|
266
|
+
setOpen(false);
|
|
267
|
+
};
|
|
268
|
+
const handleConfirm = () => {
|
|
269
|
+
onChange(selectedToken);
|
|
270
|
+
setOpen(false);
|
|
271
|
+
};
|
|
272
|
+
const tokenChange = (item) => {
|
|
273
|
+
if (selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress)) {
|
|
274
|
+
setSelectedToken(selectedToken.filter((token2) => token2.tokenAddress !== item.tokenAddress));
|
|
275
|
+
} else {
|
|
276
|
+
setSelectedToken([...selectedToken, item]);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
const loadData = useDebounceFn(async () => {
|
|
280
|
+
const res = await getHotTokenList({
|
|
281
|
+
chain,
|
|
282
|
+
text: token,
|
|
221
283
|
limit: 100,
|
|
222
284
|
page: 1
|
|
223
285
|
});
|
|
224
|
-
|
|
286
|
+
setTokenList(res?.data || []);
|
|
225
287
|
}, { wait: 300 });
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}, [
|
|
229
|
-
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
loadData.run();
|
|
290
|
+
}, [chain, token]);
|
|
291
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
292
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
293
|
+
IconFont,
|
|
294
|
+
{
|
|
295
|
+
type: "icon-serch",
|
|
296
|
+
style: { fontSize: "20px", color: hasFilterValue ? "var(--primary)" : "var(--title)" }
|
|
297
|
+
}
|
|
298
|
+
) }) }),
|
|
299
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "py-5 bg-card", children: [
|
|
300
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
|
|
301
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
|
|
302
|
+
/* @__PURE__ */ jsx("span", { className: "text-base text-foreground", children: /* @__PURE__ */ jsx(Translation, { value: "label", parentKey: "common.filter.token" }) }),
|
|
303
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-4 text-foreground text-sm cursor-pointer flex items-center justify-center", onClick: () => handleCancel(), children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4 text-foreground" }) })
|
|
235
304
|
] }),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full relative text-sm py-3", children: [
|
|
306
|
+
/* @__PURE__ */ jsx(Search, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
|
|
307
|
+
/* @__PURE__ */ jsx("input", { type: "text", placeholder: t("label"), className: "pl-6 w-full h-full bg-card text-sm border border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: token, onChange: (e) => setToken(e.target.value) })
|
|
239
308
|
] })
|
|
240
309
|
] }),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ jsx("ul", { className: "max-h-30 min-h-30 overflow-y-auto overflow-x-hidden w-full", children: tokenList?.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => tokenChange(item), children: [
|
|
311
|
+
/* @__PURE__ */ jsx(ImageBar, { src: item.iconUrl, objectFit: "contain", alt: item.tokenSymbol, className: "rounded-full w-4 h-4 min-w-4 min-h-4 flex-shrink-0" }),
|
|
312
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm text-foreground text-left truncate min-w-0 flex-1 overflow-hidden", children: [
|
|
313
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground", children: item.tokenSymbol }),
|
|
245
314
|
" ",
|
|
246
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: item.tokenName })
|
|
247
316
|
] }),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
] },
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(Checkbox, { className: twMerge("w-4 h-4 cursor-pointer border border-gray-300 rounded-sm", selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress) ? "bg-primary" : "bg-card"), checked: selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress) }) })
|
|
318
|
+
] }, index)) }),
|
|
319
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center mt-2", children: [
|
|
320
|
+
/* @__PURE__ */ jsx("button", { className: "bg-card text-foreground text-sm px-3 py-1 border rounded ml-3 cursor-pointer", onClick: handleCancel, children: /* @__PURE__ */ jsx(Translation, { value: "button.cancel", parentKey: "common" }) }),
|
|
321
|
+
/* @__PURE__ */ jsx("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: handleConfirm, children: /* @__PURE__ */ jsx(Translation, { value: "button.confirm", parentKey: "common" }) })
|
|
253
322
|
] })
|
|
254
323
|
] })
|
|
255
324
|
] });
|
|
256
325
|
}
|
|
257
|
-
function
|
|
258
|
-
const { chain
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
326
|
+
function TokenSearch({ onChange }) {
|
|
327
|
+
const { chain = "" } = useParams();
|
|
328
|
+
const t = useTranslations("common.filter.amount");
|
|
329
|
+
const [open, setOpen] = useState(false);
|
|
330
|
+
const [token, setToken] = useState("");
|
|
331
|
+
const [tokenList, setTokenList] = useState([]);
|
|
332
|
+
const [selectedToken, setSelectedToken] = useState([]);
|
|
333
|
+
const hasFilterValue = selectedToken.length > 0;
|
|
334
|
+
const handleCancel = () => {
|
|
335
|
+
onChange([]);
|
|
336
|
+
setToken("");
|
|
337
|
+
setSelectedToken([]);
|
|
338
|
+
setOpen(false);
|
|
339
|
+
};
|
|
340
|
+
const handleConfirm = () => {
|
|
341
|
+
onChange(selectedToken);
|
|
342
|
+
setOpen(false);
|
|
343
|
+
};
|
|
344
|
+
const tokenChange = (item) => {
|
|
345
|
+
if (selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress)) {
|
|
346
|
+
setSelectedToken(selectedToken.filter((token2) => token2.tokenAddress !== item.tokenAddress));
|
|
347
|
+
} else {
|
|
348
|
+
setSelectedToken([...selectedToken, item]);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
const loadData = async () => {
|
|
352
|
+
const res = await searchToken(token);
|
|
353
|
+
setTokenList(res?.data?.content || []);
|
|
268
354
|
};
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}, [
|
|
272
|
-
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
loadData();
|
|
357
|
+
}, [chain, token]);
|
|
358
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
359
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(
|
|
360
|
+
IconFont,
|
|
361
|
+
{
|
|
362
|
+
type: "icon-serch",
|
|
363
|
+
style: { fontSize: "20px", color: hasFilterValue ? "var(--primary)" : "var(--title)" }
|
|
364
|
+
}
|
|
365
|
+
) }) }),
|
|
366
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "py-5 bg-card", children: [
|
|
367
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full h-full bg-card", children: [
|
|
368
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
|
|
369
|
+
/* @__PURE__ */ jsx("span", { className: "text-base text-foreground", children: /* @__PURE__ */ jsx(Translation, { value: "label", parentKey: "common.filter.token" }) }),
|
|
370
|
+
/* @__PURE__ */ jsx("div", { className: "w-4 h-4 text-foreground text-sm cursor-pointer flex items-center justify-center", onClick: () => handleCancel(), children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4 text-foreground" }) })
|
|
278
371
|
] }),
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full relative bg-card text-sm py-3", children: [
|
|
373
|
+
/* @__PURE__ */ jsx(Search, { className: "w-4 h-4 absolute left-2 top-1/2 -translate-y-1/2" }),
|
|
374
|
+
/* @__PURE__ */ jsx("input", { type: "text", placeholder: t("label"), className: "pl-6 w-full h-full bg-card text-sm border border-gray-300 rounded p-2 my-2 focus-visible:outline-primary placeholder:text-gray-400", value: token, onChange: (e) => setToken(e.target.value) })
|
|
282
375
|
] })
|
|
283
376
|
] }),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
] },
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ jsx("ul", { className: "max-h-50 min-h-25 overflow-y-auto overflow-x-hidden w-full", children: tokenList?.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex h-10 flex-row items-center gap-3 hover:bg-background hover:rounded-sm p-2 cursor-pointer overflow-hidden", onClick: () => tokenChange(item), children: [
|
|
378
|
+
/* @__PURE__ */ jsx(ImageBar, { src: item.iconUrl, objectFit: "contain", alt: item.tokenName, className: "rounded-full w-4 h-4 min-w-4 min-h-4 flex-shrink-0" }),
|
|
379
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-foreground text-left truncate min-w-0 flex-1 overflow-hidden", children: item.tokenName }),
|
|
380
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(Checkbox, { className: twMerge("w-4 h-4 cursor-pointer border border-gray-300 rounded-sm", selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress) ? "bg-primary" : "bg-white"), checked: selectedToken.some((token2) => token2.tokenAddress === item.tokenAddress) }) })
|
|
381
|
+
] }, index)) }),
|
|
382
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center mt-2", children: [
|
|
383
|
+
/* @__PURE__ */ jsx("button", { className: "bg-card text-foreground text-sm px-3 py-1 border rounded ml-3 cursor-pointer", onClick: handleCancel, children: /* @__PURE__ */ jsx(Translation, { value: "button.cancel", parentKey: "common" }) }),
|
|
384
|
+
/* @__PURE__ */ jsx("button", { className: "bg-primary text-white text-sm px-3 py-1 rounded ml-3 cursor-pointer", onClick: handleConfirm, children: /* @__PURE__ */ jsx(Translation, { value: "button.confirm", parentKey: "common" }) })
|
|
292
385
|
] })
|
|
293
386
|
] })
|
|
294
387
|
] });
|
|
295
388
|
}
|
|
296
|
-
const
|
|
297
|
-
|
|
389
|
+
const SortIcon = "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";
|
|
390
|
+
const formatValue = (value) => {
|
|
391
|
+
if (value === null || value === void 0) {
|
|
392
|
+
return "";
|
|
393
|
+
}
|
|
394
|
+
if (typeof value === "object") {
|
|
395
|
+
return JSON.stringify(value);
|
|
396
|
+
}
|
|
397
|
+
return value;
|
|
398
|
+
};
|
|
399
|
+
const formatFilterValue = (filterValues) => {
|
|
400
|
+
const obj = {
|
|
298
401
|
filters: {}
|
|
299
402
|
};
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
403
|
+
Object.keys(filterValues).forEach((key) => {
|
|
404
|
+
if (key === "timestamp") {
|
|
405
|
+
obj.filters.startTime = filterValues.timestamp.start;
|
|
406
|
+
obj.filters.endTime = filterValues.timestamp.end;
|
|
407
|
+
} else if (key === "fromAddress") {
|
|
408
|
+
obj.filters.fromAddress = filterValues.fromAddress.address;
|
|
409
|
+
} else if (key === "toAddress") {
|
|
410
|
+
obj.filters.toAddress = filterValues.toAddress.address;
|
|
411
|
+
} else if (key === "valueUsd") {
|
|
412
|
+
obj.filters.minValueUsd = filterValues.valueUsd.min;
|
|
413
|
+
obj.filters.maxValueUsd = filterValues.valueUsd.max;
|
|
414
|
+
} else if (key === "amount") {
|
|
415
|
+
obj.filters.minAmount = filterValues.amount.min;
|
|
416
|
+
obj.filters.maxAmount = filterValues.amount.max;
|
|
417
|
+
} else if (key === "token") {
|
|
418
|
+
obj.filters.tokenList = filterValues.token.map((item) => item.tokenAddress);
|
|
419
|
+
} else if (key === "tokenSearch") {
|
|
420
|
+
obj.filters.tokenList = filterValues.tokenSearch.map((item) => item.tokenAddress);
|
|
421
|
+
} else if (key === "inputAmount") {
|
|
422
|
+
obj.filters.minInputAmount = filterValues.inputAmount.min;
|
|
423
|
+
obj.filters.maxInputAmount = filterValues.inputAmount.max;
|
|
424
|
+
} else if (key === "outputAmount") {
|
|
425
|
+
obj.filters.minOutputAmount = filterValues.outputAmount.min;
|
|
426
|
+
obj.filters.maxOutputAmount = filterValues.outputAmount.max;
|
|
427
|
+
} else if (key === "fee") {
|
|
428
|
+
obj.filters.minFee = filterValues.fee.min;
|
|
429
|
+
obj.filters.maxFee = filterValues.fee.max;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
return obj.filters;
|
|
303
433
|
};
|
|
304
|
-
function
|
|
305
|
-
const [
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
434
|
+
function CustomTable({ data, columns, headerClassName, bodyClassName, rowClassName, tableClassName, showHeader = true, renderChildren, onFilterChange, loading, onSortChange, defaultOrder, defaultSortKey, emptyClassName, ...props }) {
|
|
435
|
+
const [filterValues, setFilterValues] = useState(null);
|
|
436
|
+
const [resetKey, setResetKey] = useState({});
|
|
437
|
+
const [sortKey, setSortKey] = useState(defaultSortKey || null);
|
|
438
|
+
const [sortOrder, setSortOrder] = useState(defaultOrder || null);
|
|
439
|
+
const handleFilterChange = (columnKey, value) => {
|
|
440
|
+
setFilterValues((prev) => ({
|
|
441
|
+
...prev,
|
|
442
|
+
[columnKey]: value
|
|
309
443
|
}));
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
444
|
+
};
|
|
445
|
+
const removeFilter = (columnKey) => {
|
|
446
|
+
setFilterValues((prev) => {
|
|
447
|
+
const newValues = { ...prev };
|
|
448
|
+
delete newValues[columnKey];
|
|
449
|
+
return newValues;
|
|
450
|
+
});
|
|
451
|
+
setResetKey((prev) => ({
|
|
452
|
+
...prev,
|
|
453
|
+
[columnKey]: (prev[columnKey] || 0) + 1
|
|
317
454
|
}));
|
|
318
|
-
}
|
|
319
|
-
|
|
455
|
+
};
|
|
456
|
+
const clearAllFilters = () => {
|
|
457
|
+
const nextResetKey = {};
|
|
458
|
+
columns.forEach((column) => {
|
|
459
|
+
if (column.filter) {
|
|
460
|
+
nextResetKey[column.key] = (resetKey[column.key] || 0) + 1;
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
setFilterValues({});
|
|
464
|
+
setResetKey((prev) => ({ ...prev, ...nextResetKey }));
|
|
465
|
+
};
|
|
466
|
+
const renderFilter = (column) => {
|
|
467
|
+
switch (column.filter) {
|
|
320
468
|
case "timeRange":
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
469
|
+
return /* @__PURE__ */ jsx(DatePickerWithRange, { onChange: (start, end) => {
|
|
470
|
+
if (start && end) {
|
|
471
|
+
handleFilterChange(column.key, { start, end });
|
|
472
|
+
column.filterProps?.onChange?.({ start, end });
|
|
473
|
+
} else {
|
|
474
|
+
removeFilter(column.key);
|
|
475
|
+
}
|
|
476
|
+
} }, resetKey[column.key]);
|
|
325
477
|
case "address":
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
478
|
+
return /* @__PURE__ */ jsx(Address, { onChange: (address) => {
|
|
479
|
+
if (address) {
|
|
480
|
+
handleFilterChange(column.key, { address });
|
|
481
|
+
column.filterProps?.onChange?.({ address });
|
|
482
|
+
} else {
|
|
483
|
+
removeFilter(column.key);
|
|
484
|
+
}
|
|
485
|
+
} }, resetKey[column.key]);
|
|
330
486
|
case "amount":
|
|
331
|
-
return /* @__PURE__ */
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
487
|
+
return /* @__PURE__ */ jsx(Amount, { filterKey: column.key, onChange: (min, max) => {
|
|
488
|
+
const obj = {};
|
|
489
|
+
if (min) {
|
|
490
|
+
obj.min = min;
|
|
491
|
+
}
|
|
492
|
+
if (max) {
|
|
493
|
+
obj.max = max;
|
|
494
|
+
}
|
|
495
|
+
if (Object.keys(obj).length > 0) {
|
|
496
|
+
handleFilterChange(column.key, obj);
|
|
497
|
+
column.filterProps?.onChange?.(obj);
|
|
498
|
+
} else {
|
|
499
|
+
removeFilter(column.key);
|
|
500
|
+
}
|
|
501
|
+
} }, resetKey[column.key]);
|
|
336
502
|
case "token":
|
|
337
|
-
return /* @__PURE__ */
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
503
|
+
return /* @__PURE__ */ jsx(Token, { onChange: (token) => {
|
|
504
|
+
if (token) {
|
|
505
|
+
handleFilterChange(column.key, token);
|
|
506
|
+
column.filterProps?.onChange?.(token);
|
|
507
|
+
} else {
|
|
508
|
+
removeFilter(column.key);
|
|
509
|
+
}
|
|
510
|
+
} }, resetKey[column.key]);
|
|
341
511
|
case "tokenSearch":
|
|
342
|
-
return /* @__PURE__ */
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
512
|
+
return /* @__PURE__ */ jsx(TokenSearch, { onChange: (token) => {
|
|
513
|
+
if (token) {
|
|
514
|
+
handleFilterChange(column.key, token);
|
|
515
|
+
column.filterProps?.onChange?.(token);
|
|
516
|
+
} else {
|
|
517
|
+
removeFilter(column.key);
|
|
518
|
+
}
|
|
519
|
+
} }, resetKey[column.key]);
|
|
346
520
|
default:
|
|
347
521
|
return null;
|
|
348
522
|
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
523
|
+
};
|
|
524
|
+
const renderAmount = (value) => {
|
|
525
|
+
if (value.min && !value.max) return `≥ ${value.min}`;
|
|
526
|
+
if (!value.min && value.max) return `≤ ${value.max}`;
|
|
527
|
+
return `${value.min} - ${value.max}`;
|
|
528
|
+
};
|
|
529
|
+
const renderFilterValue = (column, value) => {
|
|
530
|
+
if (!value) return null;
|
|
531
|
+
switch (column.filter) {
|
|
352
532
|
case "timeRange":
|
|
353
|
-
return `${
|
|
533
|
+
return `${dayjs(value.start * 1e3).format("YYYY-MM-DD") || ""} - ${dayjs(value.end * 1e3).format("YYYY-MM-DD") || ""}`;
|
|
354
534
|
case "address":
|
|
355
|
-
return
|
|
535
|
+
return value.address;
|
|
356
536
|
case "amount":
|
|
357
|
-
return
|
|
537
|
+
return renderAmount(value);
|
|
358
538
|
case "token":
|
|
359
|
-
return
|
|
539
|
+
return value.map((item) => item.tokenName).join(", ");
|
|
360
540
|
case "tokenSearch":
|
|
361
|
-
return
|
|
541
|
+
return value.map((item) => item.tokenName).join(", ");
|
|
362
542
|
default:
|
|
363
543
|
return null;
|
|
364
544
|
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
545
|
+
};
|
|
546
|
+
const handleSort = (key) => {
|
|
547
|
+
const so = sortOrder === "asc" ? "desc" : "asc";
|
|
548
|
+
setSortKey(key);
|
|
549
|
+
setSortOrder(so);
|
|
550
|
+
onSortChange?.(key, so);
|
|
551
|
+
};
|
|
552
|
+
const showColumn = columns.filter((column) => !column.hidden);
|
|
553
|
+
const showFilter = showColumn.some((column) => column.filter);
|
|
554
|
+
useEffect(() => {
|
|
555
|
+
if (filterValues !== null) {
|
|
556
|
+
onFilterChange?.(filterValues);
|
|
557
|
+
}
|
|
558
|
+
}, [filterValues]);
|
|
559
|
+
return /* @__PURE__ */ jsxs("div", { className: "overflow-auto min-w-full relative", ...props, children: [
|
|
560
|
+
/* @__PURE__ */ jsx(Loading, { loading }),
|
|
561
|
+
showFilter && filterValues && Object.keys(filterValues).length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-3 flex-nowrap overflow-x-auto scrollbar-hide pb-3", children: [
|
|
562
|
+
showColumn.map((column) => {
|
|
563
|
+
if (!filterValues) return null;
|
|
564
|
+
const filterValue = filterValues?.[column.key];
|
|
565
|
+
if (!filterValue) return null;
|
|
566
|
+
if (Array.isArray(filterValue) && filterValue.length === 0) return null;
|
|
567
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center flex-nowrap gap-2 text-[#C45D10] px-3 py-1 rounded-full border-1 border-[#FFD78D] max-w-full min-w-0 overflow-hidden", children: [
|
|
568
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm shrink-0", children: [
|
|
569
|
+
column.label,
|
|
570
|
+
":"
|
|
571
|
+
] }),
|
|
572
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm flex-1 min-w-0", children: /* @__PURE__ */ jsx("div", { className: "min-w-0 truncate", children: renderFilterValue(column, filterValue) }) }),
|
|
573
|
+
/* @__PURE__ */ jsx(
|
|
574
|
+
"button",
|
|
575
|
+
{
|
|
576
|
+
onClick: () => removeFilter(column.key),
|
|
577
|
+
className: "shrink-0 hover:bg-background rounded-full p-1",
|
|
578
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-3 h-3 cursor-pointer" })
|
|
579
|
+
}
|
|
580
|
+
)
|
|
581
|
+
] }, column.key);
|
|
582
|
+
}),
|
|
583
|
+
/* @__PURE__ */ jsxs(
|
|
584
|
+
"button",
|
|
585
|
+
{
|
|
586
|
+
onClick: clearAllFilters,
|
|
587
|
+
className: "shrink-0 inline-flex items-center gap-1 px-3 py-1 rounded-full border border-border bg-background text-sm text-foreground hover:bg-muted",
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ jsx(RotateCcw, { className: "h-4 w-4 text-foreground" }),
|
|
590
|
+
/* @__PURE__ */ jsx(Translation, { value: "button.clear", parentKey: "common" })
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
)
|
|
594
|
+
] }),
|
|
595
|
+
/* @__PURE__ */ jsxs(Table, { className: twMerge("", tableClassName), children: [
|
|
596
|
+
showHeader && /* @__PURE__ */ jsx(TableHeader, { className: twMerge("border-b border-border", headerClassName), children: /* @__PURE__ */ jsx(TableRow, { className: "border-b-0 hover:bg-transparent", children: showColumn.map((column, index) => /* @__PURE__ */ jsx(TableHead, { className: twMerge("text-left", "whitespace-nowrap"), style: { width: column.width }, children: /* @__PURE__ */ jsxs("div", { className: twMerge("flex items-center gap-1 min-w-fit w-full whitespace-nowrap", column.align === "center" && "justify-center", column.align === "right" && "justify-end", column.className?.(column, index)), children: [
|
|
597
|
+
column.label,
|
|
598
|
+
column.filter && renderFilter(column),
|
|
599
|
+
column.sort && /* @__PURE__ */ jsx(ImageBar, { src: SortIcon, alt: "sort", className: twMerge("w-4 h-4 cursor-pointer", sortKey === column.key && "opacity-100", sortOrder === "desc" && "rotate-180"), onClick: () => handleSort(column.key) })
|
|
600
|
+
] }) }, index)) }) }),
|
|
601
|
+
/* @__PURE__ */ jsx(TableBody, { className: twMerge("[&_tr:last-child]:border-b-0", bodyClassName), children: data?.length > 0 ? data.map((row, index) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
602
|
+
/* @__PURE__ */ jsx(TableRow, { className: twMerge("border-r-0 border-l-0 border-t-0 border-b border-border hover:bg-background", rowClassName), children: showColumn.map((column, columnIndex) => /* @__PURE__ */ jsx(TableCell, { className: twMerge("text-left min-w-fit py-4", column.align === "center" && "text-center", column.align === "right" && "text-right", "whitespace-nowrap", column.className?.(column, index, data[index])), style: { width: column.width }, children: column.render ? column.render(row[column.key], row, index) : formatValue(row[column.key]) }, columnIndex)) }, index),
|
|
603
|
+
renderChildren && /* @__PURE__ */ jsx(TableRow, { className: "border-b-0", children: /* @__PURE__ */ jsx(TableCell, { colSpan: showColumn.length, className: "p-0", children: renderChildren(row, index) }) })
|
|
604
|
+
] }, index)) : /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent data-[state=selected]:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: showColumn.length, className: "w-full text-center", children: /* @__PURE__ */ jsx(Empty, { className: twMerge("w-full h-38", emptyClassName) }) }) }) })
|
|
408
605
|
] })
|
|
409
606
|
] });
|
|
410
607
|
}
|
|
411
608
|
export {
|
|
412
|
-
|
|
413
|
-
|
|
609
|
+
CustomTable as default,
|
|
610
|
+
formatFilterValue
|
|
414
611
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xchain/table",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -17,31 +17,49 @@
|
|
|
17
17
|
"dist",
|
|
18
18
|
"!**/*.tsbuildinfo"
|
|
19
19
|
],
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@radix-ui/react-slider": "1.3.6",
|
|
22
|
+
"ahooks": "3.9.5",
|
|
23
|
+
"antd": "6.1.1",
|
|
24
|
+
"date-fns": "4.1.0",
|
|
25
|
+
"dayjs": "1.11.19",
|
|
26
|
+
"lucide-react": "0.539.0",
|
|
27
|
+
"next": "16.1.6",
|
|
28
|
+
"next-intl": "4.13.0",
|
|
24
29
|
"react": "19.1.1",
|
|
25
30
|
"react-dom": "19.1.1",
|
|
26
|
-
"tailwind-merge": "3.3.1"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"next-intl": "4.6.1",
|
|
30
|
-
"next": "15.5.6",
|
|
31
|
+
"tailwind-merge": "3.3.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
31
34
|
"@0xchain/next-themes": "1.0.0",
|
|
32
|
-
"date-fns": "4.1.0",
|
|
33
|
-
"antd": "6.1.1",
|
|
34
|
-
"ahooks": "3.9.5",
|
|
35
35
|
"@radix-ui/react-slider": "1.3.6",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
36
|
+
"ahooks": "3.9.5",
|
|
37
|
+
"antd": "6.1.1",
|
|
38
|
+
"date-fns": "4.1.0",
|
|
39
|
+
"dayjs": "1.11.19",
|
|
40
|
+
"lucide-react": "0.539.0",
|
|
41
|
+
"next": "16.1.6",
|
|
42
|
+
"next-intl": "4.13.0",
|
|
43
|
+
"react": "19.1.1",
|
|
44
|
+
"react-dom": "19.1.1",
|
|
45
|
+
"rollup-plugin-preserve-use-client": "3.0.1",
|
|
46
|
+
"tailwind-merge": "3.3.1"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@0xchain/i18n": "1.1.0-beta.50",
|
|
50
|
+
"@0xchain/ui": "1.1.0-beta.50",
|
|
51
|
+
"@0xchain/loading": "1.1.0-beta.50",
|
|
52
|
+
"@0xchain/empty": "1.1.0-beta.50",
|
|
53
|
+
"@0xchain/translation": "1.1.0-beta.50",
|
|
54
|
+
"@0xchain/request": "1.1.0-beta.50",
|
|
55
|
+
"@0xchain/number-like": "1.1.0-beta.50",
|
|
56
|
+
"@0xchain/iconfont": "1.1.0-beta.50",
|
|
57
|
+
"@0xchain/image": "1.1.0-beta.50"
|
|
58
|
+
},
|
|
59
|
+
"nx": {
|
|
60
|
+
"tags": [
|
|
61
|
+
"type:ui"
|
|
62
|
+
]
|
|
45
63
|
},
|
|
46
64
|
"publishConfig": {
|
|
47
65
|
"access": "public"
|