@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
|
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
|
3
|
+
import n from "prop-types";
|
4
4
|
import { TableFilter as ue, TableViewCol as pe } from "mui-datatables";
|
5
|
-
import
|
6
|
-
import { MoreVert as
|
7
|
-
import { Popover as xe, Tooltip as D, IconButton as R, ListItemIcon as L, ListItemText as j, MenuItem as U, Menu as
|
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 [
|
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,
|
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 ||
|
37
|
-
}, [u,
|
38
|
-
const q = (e) => /* @__PURE__ */ t(
|
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:
|
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:
|
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(
|
64
|
-
title:
|
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
|
86
|
+
const i = g(c);
|
87
87
|
if (e.icon) {
|
88
|
-
const { popRender:
|
89
|
-
return
|
88
|
+
const { popRender: r, icon: y } = e;
|
89
|
+
return r && M.push(
|
90
90
|
/* @__PURE__ */ t(
|
91
91
|
xe,
|
92
92
|
{
|
93
|
-
open: !!B[
|
94
|
-
anchorEl: () => B[
|
93
|
+
open: !!B[i],
|
94
|
+
anchorEl: () => B[i],
|
95
95
|
onClose: () => {
|
96
|
-
|
96
|
+
m({});
|
97
97
|
},
|
98
98
|
anchorOrigin: {
|
99
99
|
vertical: "bottom",
|
100
100
|
horizontal: "right"
|
101
101
|
},
|
102
|
-
children: /* @__PURE__ */ t("div", { children:
|
102
|
+
children: /* @__PURE__ */ t("div", { children: r() })
|
103
103
|
},
|
104
|
-
|
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-${
|
110
|
+
id: `btn-${i}`,
|
111
111
|
"aria-label": e.title,
|
112
112
|
onClick: () => {
|
113
|
-
e.onClick && e.onClick(),
|
114
|
-
[
|
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
|
-
) },
|
119
|
+
) }, i);
|
120
120
|
}
|
121
121
|
return e;
|
122
122
|
}), de = [...b, ...a, ...C].map((e, c) => {
|
123
|
-
const
|
124
|
-
let
|
123
|
+
const i = g(c);
|
124
|
+
let r;
|
125
125
|
if (v(e))
|
126
|
-
|
126
|
+
r = e;
|
127
127
|
else if (e.icon) {
|
128
128
|
const { icon: y } = e;
|
129
|
-
|
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 &&
|
139
|
-
[
|
138
|
+
d(null), e.onClick && e.onClick(), e.popRender && m({
|
139
|
+
[i]: k.current
|
140
140
|
});
|
141
141
|
},
|
142
|
-
children:
|
142
|
+
children: r
|
143
143
|
},
|
144
|
-
|
144
|
+
i
|
145
145
|
);
|
146
146
|
});
|
147
|
-
return /* @__PURE__ */
|
148
|
-
/* @__PURE__ */
|
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__ */
|
157
|
-
!
|
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__ */
|
169
|
-
!x && q(({ handlePrint: e }) => /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(D, { title:
|
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": `${
|
173
|
-
"aria-label":
|
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":
|
186
|
+
"aria-expanded": h ? "true" : void 0,
|
187
187
|
onClick: (e) => d(e.currentTarget),
|
188
188
|
style: { flexShrink: 0 },
|
189
|
-
children: /* @__PURE__ */ t(
|
189
|
+
children: /* @__PURE__ */ t(he, {})
|
190
190
|
}
|
191
191
|
)
|
192
192
|
] }),
|
193
193
|
te
|
194
194
|
] }),
|
195
|
-
/* @__PURE__ */
|
196
|
-
|
195
|
+
/* @__PURE__ */ l(
|
196
|
+
ge,
|
197
197
|
{
|
198
|
-
anchorEl:
|
199
|
-
open: !!
|
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__ */
|
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:
|
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 },
|
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:
|
229
|
-
options:
|
230
|
-
components:
|
231
|
-
columns:
|
232
|
-
filterList:
|
233
|
-
filterData:
|
234
|
-
filterUpdate:
|
235
|
-
resetFilters:
|
236
|
-
updateFilterByType:
|
237
|
-
toggleViewColumn:
|
238
|
-
updateColumns:
|
239
|
-
title:
|
240
|
-
searchText:
|
241
|
-
searchTextUpdate:
|
242
|
-
searchClose:
|
243
|
-
tableRef:
|
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
|
-
|
248
|
+
flex-wrap: wrap;
|
249
249
|
.custom-toobar-title {
|
250
|
-
|
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%;
|
package/lib/package.json.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "3.1.
|
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": "
|
71
|
+
"gitHead": "8367c79c433cf59694b4aa72cbeef3b25185dd66",
|
72
72
|
"dependencies": {
|
73
|
-
"@arcblock/bridge": "3.1.
|
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.
|
77
|
-
"@arcblock/nft-display": "3.1.
|
78
|
-
"@arcblock/react-hooks": "3.1.
|
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.
|
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
|
-
|
356
|
+
flex-wrap: wrap;
|
357
357
|
.custom-toobar-title {
|
358
|
-
|
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%;
|