@arcblock/ux 3.1.50 → 3.1.51

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,10 +1,10 @@
1
- import { jsx as t, jsxs as r, Fragment as S } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as l, Fragment as S } from "react/jsx-runtime";
2
2
  import { useState as T, useRef as V, isValidElement as v } from "react";
3
- import i from "prop-types";
3
+ import n from "prop-types";
4
4
  import { TableFilter as ue, TableViewCol as pe } from "mui-datatables";
5
- import he, { PrintContextConsumer as me } from "react-to-print";
6
- import { MoreVert as fe, CloudDownload as be, ViewColumn as Ce, FilterList as ge, Print as $ } from "@mui/icons-material";
7
- import { Popover as xe, Tooltip as D, IconButton as R, ListItemIcon as L, ListItemText as j, MenuItem as U, Menu as we, LinearProgress as ye, useTheme as Te, useMediaQuery as ve } from "@mui/material";
5
+ import me, { PrintContextConsumer as fe } from "react-to-print";
6
+ import { MoreVert as he, CloudDownload as be, ViewColumn as Ce, FilterList as we, Print as $ } from "@mui/icons-material";
7
+ import { Popover as xe, Tooltip as D, IconButton as R, ListItemIcon as L, ListItemText as j, MenuItem as U, Menu as ge, LinearProgress as ye, useTheme as Te, useMediaQuery as ve } from "@mui/material";
8
8
  import { useDeepCompareEffect as Re } from "ahooks";
9
9
  import { handleCSVDownload as ke } from "./utils.js";
10
10
  import Fe from "./TableSearch.js";
@@ -15,7 +15,7 @@ function Ie() {
15
15
  return ve(s.breakpoints.down("sm"));
16
16
  }
17
17
  function Be({ ...s }) {
18
- const [f, d] = T(null), k = V(null), F = Ie(), N = V(Math.random().toString(32).slice(2)), [O, A] = T(!1), { customPreButtons: b, customButtons: C, loading: u, disabled: g } = Pe(), {
18
+ const [h, d] = T(null), k = V(null), F = Ie(), N = V(Math.random().toString(32).slice(2)), [O, A] = T(!1), { customPreButtons: b, customButtons: C, loading: u, disabled: w } = Pe(), {
19
19
  data: Q = [],
20
20
  options: o,
21
21
  components: p = {},
@@ -31,20 +31,20 @@ function Be({ ...s }) {
31
31
  searchText: Z = null,
32
32
  searchTextUpdate: _,
33
33
  searchClose: ee
34
- } = s, [B, h] = T({}), te = o.customToolbar ? o.customToolbar(s) : "", { search: oe, downloadCsv: ie, print: m, viewColumns: ne, filterTable: le } = o.textLabels.toolbar, re = o.search === !1 || o.search === "false", x = o.print === !1 || o.print === "false", se = p.TableFilter || ue, ae = p.TableViewCol || pe;
34
+ } = s, [B, m] = T({}), te = o.customToolbar ? o.customToolbar(s) : "", { search: oe, downloadCsv: ne, print: f, viewColumns: ie, filterTable: re } = o.textLabels.toolbar, le = o.search === !1 || o.search === "false", x = o.print === !1 || o.print === "false", se = p.TableFilter || ue, ae = p.TableViewCol || pe;
35
35
  Re(() => {
36
- (u || g) && h({});
37
- }, [u, g]);
38
- const q = (e) => /* @__PURE__ */ t(he, { content: () => s.tableRef(), children: /* @__PURE__ */ t(me, { children: e }) }), w = (e) => `toolbar-pop-${N.current}-${e}`, a = [];
36
+ (u || w) && m({});
37
+ }, [u, w]);
38
+ const q = (e) => /* @__PURE__ */ t(me, { content: () => s.tableRef(), children: /* @__PURE__ */ t(fe, { children: e }) }), g = (e) => `toolbar-pop-${N.current}-${e}`, a = [];
39
39
  o.download === !1 || o.download === "false" || a.push({
40
40
  icon: /* @__PURE__ */ t(be, {}),
41
- title: ie,
41
+ title: ne,
42
42
  onClick: () => {
43
43
  ke(s);
44
44
  }
45
45
  }), o.viewColumns === !1 || o.viewColumns === "false" || a.push({
46
46
  icon: /* @__PURE__ */ t(Ce, {}),
47
- title: ne,
47
+ title: ie,
48
48
  // eslint-disable-next-line react/no-unstable-nested-components
49
49
  popRender() {
50
50
  return /* @__PURE__ */ t(
@@ -60,8 +60,8 @@ function Be({ ...s }) {
60
60
  );
61
61
  }
62
62
  }), o.filter === !1 || o.filter === "false" || a.push({
63
- icon: /* @__PURE__ */ t(ge, {}),
64
- title: le,
63
+ icon: /* @__PURE__ */ t(we, {}),
64
+ title: re,
65
65
  // eslint-disable-next-line react/no-unstable-nested-components
66
66
  popRender() {
67
67
  return /* @__PURE__ */ t(
@@ -83,50 +83,50 @@ function Be({ ...s }) {
83
83
  const E = [...b, !x, ...a, ...C].filter((e) => !!e).length > 1 && F, M = [], ce = [...b, ...a, ...C].map((e, c) => {
84
84
  if (v(e))
85
85
  return e;
86
- const n = w(c);
86
+ const i = g(c);
87
87
  if (e.icon) {
88
- const { popRender: l, icon: y } = e;
89
- return l && M.push(
88
+ const { popRender: r, icon: y } = e;
89
+ return r && M.push(
90
90
  /* @__PURE__ */ t(
91
91
  xe,
92
92
  {
93
- open: !!B[n],
94
- anchorEl: () => B[n],
93
+ open: !!B[i],
94
+ anchorEl: () => B[i],
95
95
  onClose: () => {
96
- h({});
96
+ m({});
97
97
  },
98
98
  anchorOrigin: {
99
99
  vertical: "bottom",
100
100
  horizontal: "right"
101
101
  },
102
- children: /* @__PURE__ */ t("div", { children: l() })
102
+ children: /* @__PURE__ */ t("div", { children: r() })
103
103
  },
104
- n
104
+ i
105
105
  )
106
106
  ), /* @__PURE__ */ t(D, { title: e.title, children: /* @__PURE__ */ t(
107
107
  R,
108
108
  {
109
109
  "data-testid": `${e.title}-iconButton`,
110
- id: `btn-${n}`,
110
+ id: `btn-${i}`,
111
111
  "aria-label": e.title,
112
112
  onClick: () => {
113
- e.onClick && e.onClick(), l && h({
114
- [n]: document.getElementById(`btn-${n}`)
113
+ e.onClick && e.onClick(), r && m({
114
+ [i]: document.getElementById(`btn-${i}`)
115
115
  });
116
116
  },
117
117
  children: /* @__PURE__ */ t("div", { className: "custom-toolbar-icon", children: y })
118
118
  }
119
- ) }, n);
119
+ ) }, i);
120
120
  }
121
121
  return e;
122
122
  }), de = [...b, ...a, ...C].map((e, c) => {
123
- const n = w(c);
124
- let l;
123
+ const i = g(c);
124
+ let r;
125
125
  if (v(e))
126
- l = e;
126
+ r = e;
127
127
  else if (e.icon) {
128
128
  const { icon: y } = e;
129
- l = /* @__PURE__ */ r(S, { children: [
129
+ r = /* @__PURE__ */ l(S, { children: [
130
130
  /* @__PURE__ */ t(L, { children: y }),
131
131
  /* @__PURE__ */ t(j, { children: e.title })
132
132
  ] });
@@ -135,17 +135,17 @@ function Be({ ...s }) {
135
135
  U,
136
136
  {
137
137
  onClick: () => {
138
- d(null), e.onClick && e.onClick(), e.popRender && h({
139
- [n]: k.current
138
+ d(null), e.onClick && e.onClick(), e.popRender && m({
139
+ [i]: k.current
140
140
  });
141
141
  },
142
- children: l
142
+ children: r
143
143
  },
144
- n
144
+ i
145
145
  );
146
146
  });
147
- return /* @__PURE__ */ r("div", { children: [
148
- /* @__PURE__ */ r(qe, { children: [
147
+ return /* @__PURE__ */ l("div", { children: [
148
+ /* @__PURE__ */ l(qe, { children: [
149
149
  /* @__PURE__ */ t(
150
150
  "div",
151
151
  {
@@ -153,8 +153,8 @@ function Be({ ...s }) {
153
153
  children: /* @__PURE__ */ t("div", { className: "custom-toobar-title-inner", children: /* @__PURE__ */ t("span", { children: I }) })
154
154
  }
155
155
  ),
156
- /* @__PURE__ */ r("div", { className: `custom-toobar-btns ${u || g ? "toobar-btns-disabled" : ""}`, children: [
157
- !re && /* @__PURE__ */ t(
156
+ /* @__PURE__ */ l("div", { className: `custom-toobar-btns ${u || w ? "toobar-btns-disabled" : ""}`, children: [
157
+ !le && /* @__PURE__ */ t(
158
158
  Fe,
159
159
  {
160
160
  search: oe,
@@ -165,12 +165,12 @@ function Be({ ...s }) {
165
165
  onSearchOpen: A
166
166
  }
167
167
  ),
168
- !E && /* @__PURE__ */ r(S, { children: [
169
- !x && q(({ handlePrint: e }) => /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(D, { title: m, children: /* @__PURE__ */ t(
168
+ !E && /* @__PURE__ */ l(S, { children: [
169
+ !x && q(({ handlePrint: e }) => /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(D, { title: f, children: /* @__PURE__ */ t(
170
170
  R,
171
171
  {
172
- "data-testid": `${m}-iconButton`,
173
- "aria-label": m,
172
+ "data-testid": `${f}-iconButton`,
173
+ "aria-label": f,
174
174
  disabled: o.print === "disabled",
175
175
  onClick: e,
176
176
  children: /* @__PURE__ */ t($, {})
@@ -183,20 +183,20 @@ function Be({ ...s }) {
183
183
  {
184
184
  ref: k,
185
185
  "aria-haspopup": "true",
186
- "aria-expanded": f ? "true" : void 0,
186
+ "aria-expanded": h ? "true" : void 0,
187
187
  onClick: (e) => d(e.currentTarget),
188
188
  style: { flexShrink: 0 },
189
- children: /* @__PURE__ */ t(fe, {})
189
+ children: /* @__PURE__ */ t(he, {})
190
190
  }
191
191
  )
192
192
  ] }),
193
193
  te
194
194
  ] }),
195
- /* @__PURE__ */ r(
196
- we,
195
+ /* @__PURE__ */ l(
196
+ ge,
197
197
  {
198
- anchorEl: f,
199
- open: !!f,
198
+ anchorEl: h,
199
+ open: !!h,
200
200
  onClose: () => d(null),
201
201
  slotProps: {
202
202
  list: {
@@ -204,7 +204,7 @@ function Be({ ...s }) {
204
204
  }
205
205
  },
206
206
  children: [
207
- !x && q(({ handlePrint: e }) => /* @__PURE__ */ r(
207
+ !x && q(({ handlePrint: e }) => /* @__PURE__ */ l(
208
208
  U,
209
209
  {
210
210
  onClick: () => {
@@ -212,7 +212,7 @@ function Be({ ...s }) {
212
212
  },
213
213
  children: [
214
214
  /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t($, { fontSize: "small" }) }),
215
- /* @__PURE__ */ t(j, { children: m })
215
+ /* @__PURE__ */ t(j, { children: f })
216
216
  ]
217
217
  }
218
218
  )),
@@ -220,46 +220,39 @@ function Be({ ...s }) {
220
220
  ]
221
221
  }
222
222
  ),
223
- M.map((e, c) => /* @__PURE__ */ t("div", { children: e }, w(c))),
223
+ M.map((e, c) => /* @__PURE__ */ t("div", { children: e }, g(c))),
224
224
  /* @__PURE__ */ t(Ee, { children: u && /* @__PURE__ */ t(ye, { className: "toolbar-progress" }) })
225
225
  ] });
226
226
  }
227
227
  Be.propTypes = {
228
- data: i.array,
229
- options: i.object.isRequired,
230
- components: i.object,
231
- columns: i.array.isRequired,
232
- filterList: i.array,
233
- filterData: i.array,
234
- filterUpdate: i.func.isRequired,
235
- resetFilters: i.func.isRequired,
236
- updateFilterByType: i.func.isRequired,
237
- toggleViewColumn: i.func.isRequired,
238
- updateColumns: i.func.isRequired,
239
- title: i.any,
240
- searchText: i.any,
241
- searchTextUpdate: i.func.isRequired,
242
- searchClose: i.func.isRequired,
243
- tableRef: i.func.isRequired
228
+ data: n.array,
229
+ options: n.object.isRequired,
230
+ components: n.object,
231
+ columns: n.array.isRequired,
232
+ filterList: n.array,
233
+ filterData: n.array,
234
+ filterUpdate: n.func.isRequired,
235
+ resetFilters: n.func.isRequired,
236
+ updateFilterByType: n.func.isRequired,
237
+ toggleViewColumn: n.func.isRequired,
238
+ updateColumns: n.func.isRequired,
239
+ title: n.any,
240
+ searchText: n.any,
241
+ searchTextUpdate: n.func.isRequired,
242
+ searchClose: n.func.isRequired,
243
+ tableRef: n.func.isRequired
244
244
  };
245
245
  const qe = z("div")`
246
246
  display: flex;
247
247
  align-items: center;
248
- height: 56px;
248
+ flex-wrap: wrap;
249
249
  .custom-toobar-title {
250
- position: relative;
251
- flex: 1;
250
+ flex: 1 1 auto;
252
251
  font-size: 18px;
253
252
  font-weight: 800;
254
- height: 56px;
255
253
  transition: all ease 0.3s;
256
254
  &-inner {
257
- line-height: 56px;
258
255
  width: 100%;
259
- height: 56px;
260
- position: absolute;
261
- left: 0;
262
- top: 0;
263
256
  span {
264
257
  display: inline-block;
265
258
  max-width: 100%;
@@ -1,4 +1,4 @@
1
- const e = "3.1.50", s = { "@blocklet/js-sdk": "1.16.52" }, n = {
1
+ const e = "3.1.51", s = { "@blocklet/js-sdk": "1.16.52" }, n = {
2
2
  version: e,
3
3
  dependencies: s
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.1.50",
3
+ "version": "3.1.51",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -68,16 +68,16 @@
68
68
  "react": "^19.0.0",
69
69
  "react-router-dom": "^6.22.3"
70
70
  },
71
- "gitHead": "6840e9cab92d5ba54c9435924007c49f3e860c92",
71
+ "gitHead": "8367c79c433cf59694b4aa72cbeef3b25185dd66",
72
72
  "dependencies": {
73
- "@arcblock/bridge": "3.1.50",
73
+ "@arcblock/bridge": "3.1.51",
74
74
  "@arcblock/did": "^1.25.6",
75
75
  "@arcblock/did-motif": "^1.1.14",
76
- "@arcblock/icons": "3.1.50",
77
- "@arcblock/nft-display": "3.1.50",
78
- "@arcblock/react-hooks": "3.1.50",
76
+ "@arcblock/icons": "3.1.51",
77
+ "@arcblock/nft-display": "3.1.51",
78
+ "@arcblock/react-hooks": "3.1.51",
79
79
  "@blocklet/js-sdk": "1.16.52",
80
- "@blocklet/theme": "3.1.50",
80
+ "@blocklet/theme": "3.1.51",
81
81
  "@fontsource/roboto": "~5.1.1",
82
82
  "@fontsource/ubuntu-mono": "^5.2.6",
83
83
  "@iconify-icons/logos": "^1.2.36",
@@ -353,21 +353,14 @@ CustomToolbar.propTypes = {
353
353
  const Container = styled('div')`
354
354
  display: flex;
355
355
  align-items: center;
356
- height: 56px;
356
+ flex-wrap: wrap;
357
357
  .custom-toobar-title {
358
- position: relative;
359
- flex: 1;
358
+ flex: 1 1 auto;
360
359
  font-size: 18px;
361
360
  font-weight: 800;
362
- height: 56px;
363
361
  transition: all ease 0.3s;
364
362
  &-inner {
365
- line-height: 56px;
366
363
  width: 100%;
367
- height: 56px;
368
- position: absolute;
369
- left: 0;
370
- top: 0;
371
364
  span {
372
365
  display: inline-block;
373
366
  max-width: 100%;