@arcblock/ux 3.0.10 → 3.0.12
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/lib/ActivityIndicator/index.js +16 -16
- package/lib/Alert/index.js +17 -17
- package/lib/AnimationWaiter/index.js +13 -13
- package/lib/Blocklet/blocklet.js +15 -15
- package/lib/Blocklet/utils.d.ts +1 -1
- package/lib/Blocklet/utils.js +6 -5
- package/lib/BlockletNFT/index.js +23 -23
- package/lib/BlockletV2/utils.d.ts +1 -1
- package/lib/BlockletV2/utils.js +7 -6
- package/lib/Center/index.js +7 -6
- package/lib/CodeBlock/LightBox.d.ts +2 -3
- package/lib/CodeBlock/LightBox.js +3 -2
- package/lib/CookieConsent/index.js +1 -1
- package/lib/CountDown/index.js +24 -23
- package/lib/Datatable/CustomToolbar.js +71 -71
- package/lib/Datatable/TableSearch.js +18 -18
- package/lib/Datatable/index.js +77 -77
- package/lib/Earth/index.js +47 -46
- package/lib/Footer/index.js +8 -8
- package/lib/Icon/image.js +17 -16
- package/lib/InfoRow/index.js +11 -11
- package/lib/Layout/dashboard/index.js +2 -2
- package/lib/Layout/dashboard/sidebar.js +12 -12
- package/lib/Layout/dashboard-legacy/index.js +20 -20
- package/lib/Layout/dashboard-legacy/sidebar.js +16 -16
- package/lib/Layout/index.js +29 -29
- package/lib/Metric/index.js +9 -9
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +7 -6
- package/lib/PricingTable/index.js +9 -9
- package/lib/Result/result.js +14 -14
- package/lib/Screenshot/BaseScreenshot/index.js +10 -9
- package/lib/Screenshot/index.js +27 -26
- package/lib/Video/index.js +11 -11
- package/lib/Wallet/Action.js +12 -12
- package/lib/Wallet/Download.js +11 -11
- package/lib/WechatPrompt/index.js +1 -1
- package/package.json +8 -8
- package/src/ActivityIndicator/index.jsx +3 -2
- package/src/Address/Address.stories.jsx +2 -1
- package/src/Alert/index.jsx +2 -2
- package/src/AnimationWaiter/index.jsx +2 -2
- package/src/Blocklet/blocklet.jsx +2 -2
- package/src/Blocklet/utils.jsx +2 -1
- package/src/BlockletNFT/index.jsx +2 -2
- package/src/BlockletV2/utils.js +2 -1
- package/src/Center/index.tsx +2 -1
- package/src/CodeBlock/LightBox.tsx +2 -1
- package/src/Colors/Colors.stories.jsx +1 -1
- package/src/CookieConsent/index.tsx +1 -1
- package/src/CountDown/index.tsx +2 -2
- package/src/DID/DID.stories.jsx +2 -1
- package/src/Datatable/CustomToolbar.jsx +3 -2
- package/src/Datatable/TableSearch.jsx +2 -2
- package/src/Datatable/index.jsx +4 -4
- package/src/Earth/index.tsx +3 -2
- package/src/Footer/index.tsx +1 -1
- package/src/Icon/image.tsx +2 -1
- package/src/InfoRow/index.tsx +2 -2
- package/src/Layout/dashboard/index.tsx +1 -1
- package/src/Layout/dashboard/sidebar.tsx +2 -2
- package/src/Layout/dashboard-legacy/index.tsx +1 -1
- package/src/Layout/dashboard-legacy/sidebar.tsx +2 -2
- package/src/Layout/index.tsx +2 -1
- package/src/Metric/index.tsx +2 -2
- package/src/NFTDisplay/svg-embedder/inline-svg.tsx +2 -2
- package/src/PricingTable/index.tsx +2 -2
- package/src/Result/result.tsx +1 -1
- package/src/Screenshot/BaseScreenshot/index.tsx +2 -2
- package/src/Screenshot/index.tsx +3 -3
- package/src/Video/index.tsx +2 -2
- package/src/Wallet/Action.tsx +2 -2
- package/src/Wallet/Download.tsx +2 -2
- package/src/WechatPrompt/index.tsx +1 -1
@@ -1,86 +1,86 @@
|
|
1
1
|
import { jsx as t, jsxs as r, Fragment as S } from "react/jsx-runtime";
|
2
2
|
import { useState as T, useRef as V, isValidElement as v } from "react";
|
3
3
|
import i from "prop-types";
|
4
|
-
import { TableFilter as
|
5
|
-
import
|
6
|
-
import { MoreVert as
|
7
|
-
import { Popover as
|
8
|
-
import { useDeepCompareEffect as
|
9
|
-
import { handleCSVDownload as
|
10
|
-
import
|
11
|
-
import { useDatatableContext as
|
12
|
-
import { styled as
|
13
|
-
function
|
14
|
-
const s =
|
15
|
-
return
|
4
|
+
import { TableFilter as pe, TableViewCol as he } from "mui-datatables";
|
5
|
+
import me, { PrintContextConsumer as fe } from "react-to-print";
|
6
|
+
import { MoreVert as be, CloudDownload as Ce, ViewColumn as xe, FilterList as ge, Print as $ } from "@mui/icons-material";
|
7
|
+
import { Box as z, Popover as we, Tooltip as D, IconButton as R, ListItemIcon as L, ListItemText as j, MenuItem as U, Menu as ye, LinearProgress as Te, useTheme as ve, useMediaQuery as Re } from "@mui/material";
|
8
|
+
import { useDeepCompareEffect as ke } from "ahooks";
|
9
|
+
import { handleCSVDownload as Fe } from "./utils.js";
|
10
|
+
import Pe from "./TableSearch.js";
|
11
|
+
import { useDatatableContext as Ie } from "./DatatableContext.js";
|
12
|
+
import { styled as N } from "../Theme/index.js";
|
13
|
+
function Be() {
|
14
|
+
const s = ve();
|
15
|
+
return Re(s.breakpoints.down("sm"));
|
16
16
|
}
|
17
|
-
function
|
18
|
-
const [f, d] = T(null), k = V(null), F =
|
19
|
-
data:
|
17
|
+
function qe({ ...s }) {
|
18
|
+
const [f, d] = T(null), k = V(null), F = Be(), O = V(Math.random().toString(32).slice(2)), [A, Q] = T(!1), { customPreButtons: b, customButtons: C, loading: u, disabled: x } = Ie(), {
|
19
|
+
data: G = [],
|
20
20
|
options: o,
|
21
21
|
components: p = {},
|
22
22
|
columns: P,
|
23
|
-
filterList:
|
24
|
-
filterData:
|
25
|
-
filterUpdate:
|
26
|
-
resetFilters:
|
27
|
-
updateFilterByType:
|
28
|
-
toggleViewColumn:
|
29
|
-
updateColumns:
|
23
|
+
filterList: H = [],
|
24
|
+
filterData: J = [],
|
25
|
+
filterUpdate: K,
|
26
|
+
resetFilters: W,
|
27
|
+
updateFilterByType: X,
|
28
|
+
toggleViewColumn: Y,
|
29
|
+
updateColumns: Z,
|
30
30
|
title: I = "",
|
31
|
-
searchText:
|
32
|
-
searchTextUpdate:
|
33
|
-
searchClose:
|
34
|
-
} = s, [B, h] = T({}),
|
35
|
-
|
36
|
-
(u ||
|
37
|
-
}, [u,
|
38
|
-
const q = (e) => /* @__PURE__ */ t(
|
31
|
+
searchText: _ = null,
|
32
|
+
searchTextUpdate: ee,
|
33
|
+
searchClose: te
|
34
|
+
} = s, [B, h] = T({}), oe = o.customToolbar ? o.customToolbar(s) : "", { search: ie, downloadCsv: ne, print: m, viewColumns: le, filterTable: re } = o.textLabels.toolbar, se = o.search === !1 || o.search === "false", g = o.print === !1 || o.print === "false", ae = p.TableFilter || pe, ce = p.TableViewCol || he;
|
35
|
+
ke(() => {
|
36
|
+
(u || x) && h({});
|
37
|
+
}, [u, x]);
|
38
|
+
const q = (e) => /* @__PURE__ */ t(me, { content: () => s.tableRef(), children: /* @__PURE__ */ t(fe, { children: e }) }), w = (e) => `toolbar-pop-${O.current}-${e}`, a = [];
|
39
39
|
o.download === !1 || o.download === "false" || a.push({
|
40
|
-
icon: /* @__PURE__ */ t(
|
41
|
-
title:
|
40
|
+
icon: /* @__PURE__ */ t(Ce, {}),
|
41
|
+
title: ne,
|
42
42
|
onClick: () => {
|
43
|
-
|
43
|
+
Fe(s);
|
44
44
|
}
|
45
45
|
}), o.viewColumns === !1 || o.viewColumns === "false" || a.push({
|
46
|
-
icon: /* @__PURE__ */ t(
|
47
|
-
title:
|
46
|
+
icon: /* @__PURE__ */ t(xe, {}),
|
47
|
+
title: le,
|
48
48
|
// eslint-disable-next-line react/no-unstable-nested-components
|
49
49
|
popRender() {
|
50
50
|
return /* @__PURE__ */ t(
|
51
|
-
|
51
|
+
ce,
|
52
52
|
{
|
53
|
-
data:
|
53
|
+
data: G,
|
54
54
|
columns: P,
|
55
55
|
options: o,
|
56
|
-
onColumnUpdate:
|
57
|
-
updateColumns:
|
56
|
+
onColumnUpdate: Y,
|
57
|
+
updateColumns: Z,
|
58
58
|
components: p
|
59
59
|
}
|
60
60
|
);
|
61
61
|
}
|
62
62
|
}), o.filter === !1 || o.filter === "false" || a.push({
|
63
63
|
icon: /* @__PURE__ */ t(ge, {}),
|
64
|
-
title:
|
64
|
+
title: re,
|
65
65
|
// eslint-disable-next-line react/no-unstable-nested-components
|
66
66
|
popRender() {
|
67
67
|
return /* @__PURE__ */ t(
|
68
|
-
|
68
|
+
ae,
|
69
69
|
{
|
70
70
|
customFooter: o.customFilterDialogFooter,
|
71
71
|
columns: P,
|
72
72
|
options: o,
|
73
|
-
filterList:
|
74
|
-
filterData:
|
75
|
-
onFilterUpdate:
|
76
|
-
onFilterReset:
|
77
|
-
updateFilterByType:
|
73
|
+
filterList: H,
|
74
|
+
filterData: J,
|
75
|
+
onFilterUpdate: K,
|
76
|
+
onFilterReset: W,
|
77
|
+
updateFilterByType: X,
|
78
78
|
components: p
|
79
79
|
}
|
80
80
|
);
|
81
81
|
}
|
82
82
|
});
|
83
|
-
const E = [...b, !
|
83
|
+
const E = [...b, !g, ...a, ...C].filter((e) => !!e).length > 1 && F, M = [], de = [...b, ...a, ...C].map((e, c) => {
|
84
84
|
if (v(e))
|
85
85
|
return e;
|
86
86
|
const n = w(c);
|
@@ -88,7 +88,7 @@ function Be({ ...s }) {
|
|
88
88
|
const { popRender: l, icon: y } = e;
|
89
89
|
return l && M.push(
|
90
90
|
/* @__PURE__ */ t(
|
91
|
-
|
91
|
+
we,
|
92
92
|
{
|
93
93
|
open: !!B[n],
|
94
94
|
anchorEl: () => B[n],
|
@@ -119,7 +119,7 @@ function Be({ ...s }) {
|
|
119
119
|
) }, n);
|
120
120
|
}
|
121
121
|
return e;
|
122
|
-
}),
|
122
|
+
}), ue = [...b, ...a, ...C].map((e, c) => {
|
123
123
|
const n = w(c);
|
124
124
|
let l;
|
125
125
|
if (v(e))
|
@@ -145,28 +145,28 @@ function Be({ ...s }) {
|
|
145
145
|
);
|
146
146
|
});
|
147
147
|
return /* @__PURE__ */ r("div", { children: [
|
148
|
-
/* @__PURE__ */ r(
|
148
|
+
/* @__PURE__ */ r(Ee, { children: [
|
149
149
|
/* @__PURE__ */ t(
|
150
150
|
"div",
|
151
151
|
{
|
152
|
-
className: `custom-toobar-title ${F &&
|
152
|
+
className: `custom-toobar-title ${F && A && v(I) ? "toobar-title-hidden" : ""}`,
|
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 ||
|
157
|
-
!
|
158
|
-
|
156
|
+
/* @__PURE__ */ r("div", { className: `custom-toobar-btns ${u || x ? "toobar-btns-disabled" : ""}`, children: [
|
157
|
+
!se && /* @__PURE__ */ t(
|
158
|
+
Pe,
|
159
159
|
{
|
160
|
-
search:
|
160
|
+
search: ie,
|
161
161
|
options: o,
|
162
|
-
searchText:
|
163
|
-
searchTextUpdate:
|
164
|
-
searchClose:
|
165
|
-
onSearchOpen:
|
162
|
+
searchText: _,
|
163
|
+
searchTextUpdate: ee,
|
164
|
+
searchClose: te,
|
165
|
+
onSearchOpen: Q
|
166
166
|
}
|
167
167
|
),
|
168
168
|
!E && /* @__PURE__ */ r(S, { children: [
|
169
|
-
!
|
169
|
+
!g && q(({ handlePrint: e }) => /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(D, { title: m, children: /* @__PURE__ */ t(
|
170
170
|
R,
|
171
171
|
{
|
172
172
|
"data-testid": `${m}-iconButton`,
|
@@ -176,7 +176,7 @@ function Be({ ...s }) {
|
|
176
176
|
children: /* @__PURE__ */ t($, {})
|
177
177
|
}
|
178
178
|
) }) })),
|
179
|
-
|
179
|
+
de
|
180
180
|
] }),
|
181
181
|
E && /* @__PURE__ */ t(
|
182
182
|
R,
|
@@ -186,14 +186,14 @@ function Be({ ...s }) {
|
|
186
186
|
"aria-expanded": f ? "true" : void 0,
|
187
187
|
onClick: (e) => d(e.currentTarget),
|
188
188
|
style: { flexShrink: 0 },
|
189
|
-
children: /* @__PURE__ */ t(
|
189
|
+
children: /* @__PURE__ */ t(be, {})
|
190
190
|
}
|
191
191
|
)
|
192
192
|
] }),
|
193
|
-
|
193
|
+
oe
|
194
194
|
] }),
|
195
195
|
/* @__PURE__ */ r(
|
196
|
-
|
196
|
+
ye,
|
197
197
|
{
|
198
198
|
anchorEl: f,
|
199
199
|
open: !!f,
|
@@ -204,7 +204,7 @@ function Be({ ...s }) {
|
|
204
204
|
}
|
205
205
|
},
|
206
206
|
children: [
|
207
|
-
!
|
207
|
+
!g && q(({ handlePrint: e }) => /* @__PURE__ */ r(
|
208
208
|
U,
|
209
209
|
{
|
210
210
|
onClick: () => {
|
@@ -216,15 +216,15 @@ function Be({ ...s }) {
|
|
216
216
|
]
|
217
217
|
}
|
218
218
|
)),
|
219
|
-
|
219
|
+
ue
|
220
220
|
]
|
221
221
|
}
|
222
222
|
),
|
223
223
|
M.map((e, c) => /* @__PURE__ */ t("div", { children: e }, w(c))),
|
224
|
-
/* @__PURE__ */ t(
|
224
|
+
/* @__PURE__ */ t(Me, { children: u && /* @__PURE__ */ t(Te, { className: "toolbar-progress" }) })
|
225
225
|
] });
|
226
226
|
}
|
227
|
-
|
227
|
+
qe.propTypes = {
|
228
228
|
data: i.array,
|
229
229
|
options: i.object.isRequired,
|
230
230
|
components: i.object,
|
@@ -242,7 +242,7 @@ Be.propTypes = {
|
|
242
242
|
searchClose: i.func.isRequired,
|
243
243
|
tableRef: i.func.isRequired
|
244
244
|
};
|
245
|
-
const
|
245
|
+
const Ee = N(z)`
|
246
246
|
display: flex;
|
247
247
|
align-items: center;
|
248
248
|
height: 56px;
|
@@ -302,7 +302,7 @@ const qe = z("div")`
|
|
302
302
|
opacity: 0;
|
303
303
|
cursor: none;
|
304
304
|
}
|
305
|
-
`,
|
305
|
+
`, Me = N(z)`
|
306
306
|
width: 100%;
|
307
307
|
height: 2px;
|
308
308
|
.toolbar-progress {
|
@@ -310,5 +310,5 @@ const qe = z("div")`
|
|
310
310
|
}
|
311
311
|
`;
|
312
312
|
export {
|
313
|
-
|
313
|
+
qe as default
|
314
314
|
};
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
2
2
|
import { useState as x, useRef as I } from "react";
|
3
3
|
import o from "prop-types";
|
4
|
-
import {
|
5
|
-
import { Search as v, Clear as
|
6
|
-
import
|
4
|
+
import { Box as N, Tooltip as R, IconButton as w, TextField as g } from "@mui/material";
|
5
|
+
import { Search as v, Clear as q } from "@mui/icons-material";
|
6
|
+
import B from "clsx";
|
7
7
|
import E from "lodash/noop";
|
8
|
-
import { useDatatableContext as
|
9
|
-
import { styled as
|
10
|
-
function
|
8
|
+
import { useDatatableContext as D } from "./DatatableContext.js";
|
9
|
+
import { styled as M } from "../Theme/index.js";
|
10
|
+
function O({
|
11
11
|
search: t = "",
|
12
|
-
options:
|
12
|
+
options: i,
|
13
13
|
searchText: a = "",
|
14
14
|
searchTextUpdate: c,
|
15
15
|
searchClose: C,
|
16
16
|
onSearchOpen: d = E
|
17
17
|
}) {
|
18
|
-
const { searchOpen: T, searchPlaceholder: y, searchAlwaysOpen: r } =
|
18
|
+
const { searchOpen: T, searchPlaceholder: y, searchAlwaysOpen: r } = i, [k, h] = x(!!a || T || !1), [p, m] = x(a), u = I(null), { loading: b } = D(), { searchDebounceTime: n } = i, s = r || k, S = () => {
|
19
19
|
h(!0), d(!0);
|
20
20
|
}, F = (j) => {
|
21
21
|
const { value: l } = j.currentTarget;
|
@@ -26,24 +26,24 @@ function M({
|
|
26
26
|
h(!1), C(), m(""), d(!1);
|
27
27
|
};
|
28
28
|
return /* @__PURE__ */ f(
|
29
|
-
|
29
|
+
P,
|
30
30
|
{
|
31
|
-
className:
|
31
|
+
className: B({
|
32
32
|
"search-always-open": r
|
33
33
|
}),
|
34
34
|
children: [
|
35
|
-
|
35
|
+
s ? /* @__PURE__ */ e("div", { className: "toolbar-search-icon-placeholder", children: /* @__PURE__ */ e(v, {}) }) : /* @__PURE__ */ e(R, { title: t, disableFocusListener: !0, children: /* @__PURE__ */ e(
|
36
36
|
w,
|
37
37
|
{
|
38
38
|
"aria-label": t,
|
39
39
|
"data-testid": `${t}-iconButton`,
|
40
|
-
disabled:
|
40
|
+
disabled: i.search === "disabled",
|
41
41
|
onClick: S,
|
42
42
|
children: /* @__PURE__ */ e(v, {})
|
43
43
|
}
|
44
44
|
) }),
|
45
|
-
/* @__PURE__ */ f("div", { className: `toolbar-search-area ${
|
46
|
-
|
45
|
+
/* @__PURE__ */ f("div", { className: `toolbar-search-area ${s ? "toolbar-btn-show" : ""}`, children: [
|
46
|
+
s && !b && /* @__PURE__ */ e(
|
47
47
|
g,
|
48
48
|
{
|
49
49
|
variant: "standard",
|
@@ -64,12 +64,12 @@ function M({
|
|
64
64
|
}
|
65
65
|
)
|
66
66
|
] }),
|
67
|
-
!r && /* @__PURE__ */ e("div", { className: `toolbar-search-close ${
|
67
|
+
!r && /* @__PURE__ */ e("div", { className: `toolbar-search-close ${s ? "toolbar-btn-show" : ""}`, children: /* @__PURE__ */ e(w, { onClick: $, "aria-label": "click to close the search box", children: /* @__PURE__ */ e(q, {}) }) })
|
68
68
|
]
|
69
69
|
}
|
70
70
|
);
|
71
71
|
}
|
72
|
-
|
72
|
+
O.propTypes = {
|
73
73
|
search: o.string,
|
74
74
|
searchText: o.string,
|
75
75
|
onSearchOpen: o.func,
|
@@ -77,7 +77,7 @@ M.propTypes = {
|
|
77
77
|
searchTextUpdate: o.func.isRequired,
|
78
78
|
searchClose: o.func.isRequired
|
79
79
|
};
|
80
|
-
const
|
80
|
+
const P = M(N)`
|
81
81
|
display: flex;
|
82
82
|
align-items: center;
|
83
83
|
.toolbar-search-area {
|
@@ -129,5 +129,5 @@ const O = D("div")`
|
|
129
129
|
}
|
130
130
|
`;
|
131
131
|
export {
|
132
|
-
|
132
|
+
O as default
|
133
133
|
};
|
package/lib/Datatable/index.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import { jsx as i, jsxs as
|
2
|
-
import { useRef as
|
1
|
+
import { jsx as i, jsxs as oe } from "react/jsx-runtime";
|
2
|
+
import { useRef as re, isValidElement as ae } from "react";
|
3
3
|
import o from "prop-types";
|
4
|
-
import
|
5
|
-
import { TableFilterList as
|
6
|
-
import { css as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
4
|
+
import le, { TableFilterList as ie, TableFooter as se } from "mui-datatables";
|
5
|
+
import { TableFilterList as Ue, TableFooter as Ee } from "mui-datatables";
|
6
|
+
import { css as N } from "@emotion/react";
|
7
|
+
import R from "lodash/isObject";
|
8
|
+
import ne from "lodash/cloneDeep";
|
9
|
+
import de from "lodash/get";
|
10
10
|
import P from "clsx";
|
11
|
-
import { useCreation as
|
12
|
-
import { CircularProgress as
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import { DatatableProvider as
|
16
|
-
import { styled as
|
17
|
-
const
|
11
|
+
import { useCreation as ce, useDeepCompareEffect as h } from "ahooks";
|
12
|
+
import { Box as M, CircularProgress as pe } from "@mui/material";
|
13
|
+
import k from "../Empty/index.js";
|
14
|
+
import ue from "./CustomToolbar.js";
|
15
|
+
import { DatatableProvider as fe, useDatatableContext as $ } from "./DatatableContext.js";
|
16
|
+
import { styled as D } from "../Theme/index.js";
|
17
|
+
const be = D(M)`
|
18
18
|
display: flex;
|
19
19
|
align-items: center;
|
20
20
|
.toolbar-filter-content {
|
@@ -25,21 +25,21 @@ const fe = $("div")`
|
|
25
25
|
font-size: 14px;
|
26
26
|
}
|
27
27
|
`;
|
28
|
-
function
|
29
|
-
const { filterLabel: a } =
|
30
|
-
return r ? /* @__PURE__ */
|
28
|
+
function A({ ...e }) {
|
29
|
+
const { filterLabel: a } = $(), r = !!(e.filterList ?? []).filter((n) => n.length).length;
|
30
|
+
return r ? /* @__PURE__ */ oe(be, { children: [
|
31
31
|
r && /* @__PURE__ */ i("div", { className: "toolbar-filter-title", children: a }),
|
32
|
-
/* @__PURE__ */ i("div", { className: "toolbar-filter-content", children: /* @__PURE__ */ i(
|
32
|
+
/* @__PURE__ */ i("div", { className: "toolbar-filter-content", children: /* @__PURE__ */ i(ie, { ...e }) })
|
33
33
|
] }) : "";
|
34
34
|
}
|
35
|
-
|
35
|
+
A.propTypes = {
|
36
36
|
filterList: o.array
|
37
37
|
};
|
38
|
-
function
|
39
|
-
const { loading: a, disabled: r } =
|
40
|
-
return /* @__PURE__ */ i(
|
38
|
+
function ge(e) {
|
39
|
+
const { loading: a, disabled: r } = $();
|
40
|
+
return /* @__PURE__ */ i(Te, { children: /* @__PURE__ */ i("div", { className: `datatable-footer ${a || r ? "datatable-footer-disabled" : ""}`, children: /* @__PURE__ */ i(se, { ...e }) }) });
|
41
41
|
}
|
42
|
-
const
|
42
|
+
const me = (e) => {
|
43
43
|
const a = `datatable-durable-${e}`;
|
44
44
|
let r = localStorage[a];
|
45
45
|
if (r)
|
@@ -50,14 +50,14 @@ const ge = (e) => {
|
|
50
50
|
}
|
51
51
|
return r || {};
|
52
52
|
};
|
53
|
-
function
|
54
|
-
return /* @__PURE__ */ i(
|
53
|
+
function Ne(e) {
|
54
|
+
return /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(I, { ...e }) });
|
55
55
|
}
|
56
|
-
const
|
56
|
+
const L = (e, a) => {
|
57
57
|
const r = {};
|
58
58
|
e.align && (a.className = P(a.className, `pc-align-${e.align}`)), e.verticalKeyAlign && (a.className = P(a.className, `vertical-align-${e.verticalKeyAlign}`)), e.minWidth && (r.minWidth = e.minWidth), a.style = Object.assign({}, a.style, r);
|
59
59
|
};
|
60
|
-
function
|
60
|
+
function I({
|
61
61
|
data: e,
|
62
62
|
columns: a,
|
63
63
|
locale: r = "en",
|
@@ -69,27 +69,27 @@ function A({
|
|
69
69
|
onChange: m = "",
|
70
70
|
loading: c = !1,
|
71
71
|
disabled: C = !1,
|
72
|
-
stripped:
|
73
|
-
verticalKeyWidth:
|
74
|
-
hideTableHeader:
|
72
|
+
stripped: U = !1,
|
73
|
+
verticalKeyWidth: E = "",
|
74
|
+
hideTableHeader: B = !1,
|
75
75
|
components: _ = {},
|
76
76
|
emptyNode: T = "",
|
77
|
-
durable:
|
77
|
+
durable: x = "",
|
78
78
|
durableKeys: j = ["page", "rowsPerPage", "searchText", "sortOrder"],
|
79
|
-
bgColor:
|
80
|
-
hoverColor:
|
81
|
-
stripColor:
|
82
|
-
...
|
79
|
+
bgColor: O = "transparent",
|
80
|
+
hoverColor: W = "",
|
81
|
+
stripColor: z = "",
|
82
|
+
...K
|
83
83
|
}) {
|
84
|
-
const
|
84
|
+
const S = re(null), { setCustomPreButtons: J, setCustomButtons: V, setFilterLabel: q, setLoading: G, setDisabled: Q } = $(), X = {
|
85
85
|
cursor: "not-allowed",
|
86
86
|
pointerEvents: "none"
|
87
|
-
},
|
87
|
+
}, v = [], Y = a.map((s) => {
|
88
88
|
let t;
|
89
|
-
|
89
|
+
R(s) ? t = ne(s) : t = {
|
90
90
|
label: s,
|
91
91
|
name: s
|
92
|
-
},
|
92
|
+
}, v.push(t.name), t.align || (t.align = "left"), t.options || (t.options = {});
|
93
93
|
const { setCellHeaderProps: d, setCellProps: u } = t.options;
|
94
94
|
return t.options.setCellHeaderProps = (...f) => {
|
95
95
|
let l = {
|
@@ -98,7 +98,7 @@ function A({
|
|
98
98
|
return d && !d.__innerFunc && (l = {
|
99
99
|
...l,
|
100
100
|
...d(...f) || {}
|
101
|
-
}), (c || C) && (l = { ...l, style:
|
101
|
+
}), (c || C) && (l = { ...l, style: X }), t.width && (l.width = t.width), L(t, l), l;
|
102
102
|
}, t.options.setCellHeaderProps.__innerFunc = 1, (t.align || t.style) && (t.options.setCellProps = (...f) => {
|
103
103
|
let l = {
|
104
104
|
className: ""
|
@@ -106,12 +106,12 @@ function A({
|
|
106
106
|
return u && !u.__innerFunc && (l = {
|
107
107
|
...l,
|
108
108
|
...u(...f) || {}
|
109
|
-
}),
|
109
|
+
}), L(t, l), l;
|
110
110
|
}, t.options.setCellProps.__innerFunc = 1), t;
|
111
|
-
}),
|
112
|
-
h(() =>
|
111
|
+
}), Z = ce(() => e.map((s) => !Array.isArray(s) && R(s) ? v.map((t) => de(s, t)) : s), [e, v]);
|
112
|
+
h(() => V(g || []), [g]), h(() => J(b || []), [b]), h(() => G(c), [c]), h(() => Q(C), [C]);
|
113
113
|
let p;
|
114
|
-
c ? p = /* @__PURE__ */ i(
|
114
|
+
c ? p = /* @__PURE__ */ i(pe, { color: "primary" }) : ae(T) ? p = T : r === "zh" ? p = /* @__PURE__ */ i(k, { children: T || "没有找到匹配的记录" }) : p = /* @__PURE__ */ i(k, { children: T || "No matching records found" });
|
115
115
|
let y = {
|
116
116
|
body: {
|
117
117
|
noMatch: p,
|
@@ -154,13 +154,13 @@ function A({
|
|
154
154
|
filter: { all: "全部", title: "筛选器", reset: "重置" },
|
155
155
|
viewColumns: { title: "显示的列", titleAria: "显示/隐藏 表格的列" },
|
156
156
|
selectedRows: { text: "个已选项目", delete: "删除", deleteAria: "删除所选项目" }
|
157
|
-
}), h(() =>
|
158
|
-
const
|
157
|
+
}), h(() => q(y.filter.title), [y.filter.title]);
|
158
|
+
const ee = me(x), F = {
|
159
159
|
selectableRows: "none",
|
160
160
|
textLabels: y,
|
161
161
|
rowsPerPage: 10,
|
162
162
|
rowsPerPageOptions: [10, 20, 50],
|
163
|
-
...
|
163
|
+
...ee,
|
164
164
|
...n,
|
165
165
|
// Wrap the more friendly onChange callback by listening to onTableChange,
|
166
166
|
// which will only be triggered when the table key state changes
|
@@ -176,44 +176,44 @@ function A({
|
|
176
176
|
//
|
177
177
|
filterList: t.filterList
|
178
178
|
};
|
179
|
-
if (
|
179
|
+
if (x) {
|
180
180
|
const f = {};
|
181
181
|
j.forEach((l) => {
|
182
182
|
f[l] = d[l];
|
183
|
-
}), localStorage.setItem(`datatable-durable-${
|
183
|
+
}), localStorage.setItem(`datatable-durable-${x}`, JSON.stringify(f));
|
184
184
|
}
|
185
185
|
const u = JSON.stringify(d);
|
186
|
-
u !==
|
186
|
+
u !== S.current && (S.current = u, m && m(d, s));
|
187
187
|
}
|
188
188
|
};
|
189
|
-
m && (
|
190
|
-
const
|
191
|
-
options:
|
192
|
-
...
|
189
|
+
m && (F.serverSide = !0);
|
190
|
+
const te = {
|
191
|
+
options: F,
|
192
|
+
...K,
|
193
193
|
components: {
|
194
|
-
TableToolbar:
|
195
|
-
TableFooter:
|
196
|
-
TableFilterList:
|
194
|
+
TableToolbar: ue,
|
195
|
+
TableFooter: ge,
|
196
|
+
TableFilterList: A,
|
197
197
|
..._
|
198
198
|
}
|
199
199
|
};
|
200
200
|
return /* @__PURE__ */ i(
|
201
|
-
|
201
|
+
he,
|
202
202
|
{
|
203
|
-
verticalKeyWidth:
|
204
|
-
bgColor:
|
205
|
-
hoverColor:
|
206
|
-
stripColor:
|
203
|
+
verticalKeyWidth: E,
|
204
|
+
bgColor: O,
|
205
|
+
hoverColor: W,
|
206
|
+
stripColor: z,
|
207
207
|
className: P({
|
208
|
-
"datatable-stripped":
|
209
|
-
"datatable-hide-header":
|
208
|
+
"datatable-stripped": U,
|
209
|
+
"datatable-hide-header": B
|
210
210
|
}),
|
211
211
|
style: w,
|
212
|
-
children: /* @__PURE__ */ i(
|
212
|
+
children: /* @__PURE__ */ i(le, { data: Z, columns: Y, ...te })
|
213
213
|
}
|
214
214
|
);
|
215
215
|
}
|
216
|
-
|
216
|
+
I.propTypes = {
|
217
217
|
data: o.array.isRequired,
|
218
218
|
columns: o.array.isRequired,
|
219
219
|
options: o.object,
|
@@ -235,7 +235,7 @@ A.propTypes = {
|
|
235
235
|
hoverColor: o.string,
|
236
236
|
stripColor: o.string
|
237
237
|
};
|
238
|
-
const
|
238
|
+
const H = N`
|
239
239
|
.MuiTableCell-head {
|
240
240
|
[class*='MUIDataTableHeadCell-toolButton'] {
|
241
241
|
width: 100%;
|
@@ -268,7 +268,7 @@ const L = H`
|
|
268
268
|
text-align: right;
|
269
269
|
}
|
270
270
|
}
|
271
|
-
`,
|
271
|
+
`, he = D(M, {
|
272
272
|
shouldForwardProp: (e) => !["verticalKeyWidth", "bgColor", "hoverColor", "stripColor"].includes(e)
|
273
273
|
})(({ theme: e, verticalKeyWidth: a, bgColor: r, hoverColor: n, stripColor: w }) => {
|
274
274
|
const b = e.palette.text.primary, g = e.palette.action.hover, m = e.palette.grey[50], c = a ? `
|
@@ -286,7 +286,7 @@ const L = H`
|
|
286
286
|
}
|
287
287
|
}
|
288
288
|
` : "";
|
289
|
-
return
|
289
|
+
return N`
|
290
290
|
&.datatable-hide-header {
|
291
291
|
thead.MuiTableHead-root {
|
292
292
|
display: none;
|
@@ -341,11 +341,11 @@ const L = H`
|
|
341
341
|
}
|
342
342
|
}
|
343
343
|
${e.breakpoints.up("md")} {
|
344
|
-
${
|
344
|
+
${H}
|
345
345
|
}
|
346
346
|
${e.breakpoints.up("sm")} {
|
347
347
|
[class*='responsiveSimple'] {
|
348
|
-
${
|
348
|
+
${H}
|
349
349
|
}
|
350
350
|
}
|
351
351
|
|
@@ -385,7 +385,7 @@ const L = H`
|
|
385
385
|
}
|
386
386
|
}
|
387
387
|
`;
|
388
|
-
}),
|
388
|
+
}), Te = D(M)`
|
389
389
|
display: flex;
|
390
390
|
align-items: center;
|
391
391
|
.datatable-footer {
|
@@ -427,8 +427,8 @@ const L = H`
|
|
427
427
|
}
|
428
428
|
`;
|
429
429
|
export {
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
430
|
+
Ue as TableFilterList,
|
431
|
+
Ee as TableFooter,
|
432
|
+
Ne as default,
|
433
|
+
me as getDurableData
|
434
434
|
};
|