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