@0xchain/table 1.1.0-beta.30 → 1.1.0-beta.32

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":"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,2CA+CpF"}
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"}
@@ -1 +1 @@
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,2CA6E/G"}
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;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,2CAqG1B"}
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":"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,2CA2E9F"}
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":"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,2CAwEpG"}
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.js CHANGED
@@ -38,6 +38,7 @@ function DatePickerWithRange({
38
38
  const [open, setOpen] = React.useState(false);
39
39
  const containerRef = React.useRef(null);
40
40
  const [panelRange, setPanelRange] = React.useState(null);
41
+ const hasFilterValue = Boolean(panelRange?.[0] && panelRange?.[1]);
41
42
  const dpLocaleMap = {
42
43
  en: enUSPicker,
43
44
  "zh-hans": zhCNPicker,
@@ -99,7 +100,13 @@ function DatePickerWithRange({
99
100
  cancelPopover();
100
101
  };
101
102
  return /* @__PURE__ */ jsx("div", { className: twMerge("", className), ...props, children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: togglePopover, children: [
102
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(IconFont, { type: "icon-time1", style: { fontSize: "20px", color: "#2A6AF6" } }) }) }),
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
+ ) }) }),
103
110
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "center", side: "right", children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: "relative", children: /* @__PURE__ */ jsx(
104
111
  DatePicker.RangePicker,
105
112
  {
@@ -125,6 +132,7 @@ function Amount({ onChange }) {
125
132
  const [min, setMin] = useState("");
126
133
  const [max, setMax] = useState("");
127
134
  const [sliderValues, setSliderValues] = useState([0.01, 1e10]);
135
+ const hasFilterValue = Boolean(min || max);
128
136
  const handleFromChange = (e) => {
129
137
  const value = e.target.value;
130
138
  if (value === "" || /^\d*\.?\d{0,8}$/.test(value) && !value.startsWith(".")) {
@@ -161,7 +169,13 @@ function Amount({ onChange }) {
161
169
  }
162
170
  };
163
171
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
164
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(IconFont, { type: "icon-filter", style: { fontSize: "20px", color: "#2A6AF6" } }) }) }),
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
+ ) }) }),
165
179
  /* @__PURE__ */ jsx(PopoverContent, { className: "bg-card", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
166
180
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
167
181
  /* @__PURE__ */ jsx("span", { className: "text-sm", children: /* @__PURE__ */ jsx(Translation, { value: "label", parentKey: "common.filter.amount" }) }),
@@ -188,6 +202,7 @@ function Address({ onChange }) {
188
202
  const [open, setOpen] = useState(false);
189
203
  const t = useTranslations("common");
190
204
  const [address, setAddress] = useState("");
205
+ const hasFilterValue = Boolean(address);
191
206
  const handleAddressChange = (e) => {
192
207
  const value = e.target.value;
193
208
  if (value === "" || /^[a-zA-Z0-9]*$/.test(value)) {
@@ -202,7 +217,13 @@ function Address({ onChange }) {
202
217
  setOpen(false);
203
218
  };
204
219
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
205
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(IconFont, { type: "icon-serch", style: { fontSize: "20px", color: "#2A6AF6" } }) }) }),
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
+ ) }) }),
206
227
  /* @__PURE__ */ jsx(PopoverContent, { className: "bg-card", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
207
228
  /* @__PURE__ */ jsxs("fieldset", { className: "w-full h-full", children: [
208
229
  /* @__PURE__ */ jsxs("label", { className: "w-full h-full text-sm flex items-center justify-between", children: [
@@ -240,6 +261,7 @@ function Token({ onChange }) {
240
261
  const [token, setToken] = useState("");
241
262
  const [tokenList, setTokenList] = useState([]);
242
263
  const [selectedToken, setSelectedToken] = useState([]);
264
+ const hasFilterValue = selectedToken.length > 0;
243
265
  const handleCancel = () => {
244
266
  setOpen(false);
245
267
  };
@@ -267,7 +289,13 @@ function Token({ onChange }) {
267
289
  loadData.run();
268
290
  }, [chain, token]);
269
291
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
270
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(IconFont, { type: "icon-serch", style: { fontSize: "20px", color: "#2A6AF6" } }) }) }),
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
+ ) }) }),
271
299
  /* @__PURE__ */ jsxs(PopoverContent, { className: "py-5 bg-card", children: [
272
300
  /* @__PURE__ */ jsxs("div", { className: "w-full h-full", children: [
273
301
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
@@ -302,6 +330,7 @@ function TokenSearch({ onChange }) {
302
330
  const [token, setToken] = useState("");
303
331
  const [tokenList, setTokenList] = useState([]);
304
332
  const [selectedToken, setSelectedToken] = useState([]);
333
+ const hasFilterValue = selectedToken.length > 0;
305
334
  const handleCancel = () => {
306
335
  onChange([]);
307
336
  setToken("");
@@ -327,7 +356,13 @@ function TokenSearch({ onChange }) {
327
356
  loadData();
328
357
  }, [chain, token]);
329
358
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
330
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: " flex items-center justify-center bg-border rounded-sm cursor-pointer", children: /* @__PURE__ */ jsx(IconFont, { type: "icon-serch", style: { fontSize: "20px", color: "#2A6AF6" } }) }) }),
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
+ ) }) }),
331
366
  /* @__PURE__ */ jsxs(PopoverContent, { className: "py-5 bg-card", children: [
332
367
  /* @__PURE__ */ jsxs("div", { className: "w-full h-full bg-card", children: [
333
368
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between h-9", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xchain/table",
3
- "version": "1.1.0-beta.30",
3
+ "version": "1.1.0-beta.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -46,14 +46,14 @@
46
46
  "tailwind-merge": "3.3.1"
47
47
  },
48
48
  "dependencies": {
49
- "@0xchain/empty": "1.1.0-beta.30",
50
- "@0xchain/image": "1.1.0-beta.30",
51
- "@0xchain/ui": "1.1.0-beta.30",
52
- "@0xchain/loading": "1.1.0-beta.30",
53
- "@0xchain/translation": "1.1.0-beta.30",
54
- "@0xchain/number-like": "1.1.0-beta.30",
55
- "@0xchain/request": "1.1.0-beta.30",
56
- "@0xchain/iconfont": "1.1.0-beta.30"
49
+ "@0xchain/ui": "1.1.0-beta.32",
50
+ "@0xchain/loading": "1.1.0-beta.32",
51
+ "@0xchain/image": "1.1.0-beta.32",
52
+ "@0xchain/empty": "1.1.0-beta.32",
53
+ "@0xchain/number-like": "1.1.0-beta.32",
54
+ "@0xchain/translation": "1.1.0-beta.32",
55
+ "@0xchain/iconfont": "1.1.0-beta.32",
56
+ "@0xchain/request": "1.1.0-beta.32"
57
57
  },
58
58
  "nx": {
59
59
  "tags": [