@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
package/lib/Earth/index.js
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useReducer as
|
3
|
-
import
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { useReducer as H, useRef as w, useEffect as J } from "react";
|
3
|
+
import V from "react-use/lib/useSpring";
|
4
4
|
import * as N from "d3-geo";
|
5
|
-
import * as
|
5
|
+
import * as X from "topojson-client";
|
6
6
|
import D from "versor";
|
7
|
-
import R from "
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import {
|
11
|
-
|
7
|
+
import { Box as R } from "@mui/material";
|
8
|
+
import B from "./countries.json.js";
|
9
|
+
import Y from "./util.js";
|
10
|
+
import { withDeprecated as K } from "../Util/deprecate.js";
|
11
|
+
import { styled as I } from "../Theme/index.js";
|
12
|
+
const F = X.feature(B, B.objects.ne_110m_admin_0_countries), Q = {
|
12
13
|
light: {
|
13
14
|
ocean: "#EDF4F4",
|
14
15
|
graticule: "#EDF4F4",
|
@@ -28,7 +29,7 @@ const F = V.feature(R, R.objects.ne_110m_admin_0_countries), K = {
|
|
28
29
|
activeMarker: "#FFD159"
|
29
30
|
}
|
30
31
|
};
|
31
|
-
function
|
32
|
+
function W(e, s) {
|
32
33
|
switch (s.type) {
|
33
34
|
case "dragEnd":
|
34
35
|
return { ...e, isDragging: !1 };
|
@@ -46,17 +47,17 @@ function Q(e, s) {
|
|
46
47
|
return e;
|
47
48
|
}
|
48
49
|
}
|
49
|
-
function
|
50
|
+
function Z({
|
50
51
|
theme: e = "dark",
|
51
52
|
width: s = 1200,
|
52
53
|
height: g = 600,
|
53
|
-
enableRotation:
|
54
|
-
rotationSpeed:
|
54
|
+
enableRotation: M = !1,
|
55
|
+
rotationSpeed: L = 5,
|
55
56
|
activeMarkerId: i = void 0,
|
56
57
|
markers: y = [],
|
57
|
-
colors:
|
58
|
+
colors: S = {}
|
58
59
|
}) {
|
59
|
-
const $ = Object.assign(
|
60
|
+
const $ = Object.assign(S, Q[e]), [r, d] = H(W, {
|
60
61
|
rotation: [0, 0, 0],
|
61
62
|
isDragging: !1,
|
62
63
|
animateDuration: 1,
|
@@ -70,7 +71,7 @@ function W({
|
|
70
71
|
step: 0,
|
71
72
|
markerId: null,
|
72
73
|
iv: null
|
73
|
-
}), C =
|
74
|
+
}), C = V(r.animateDuration, 170, 26), T = i && k.current.markerId !== i && y.some((t) => t.id === i), p = N.geoOrthographic().fitExtent(
|
74
75
|
[
|
75
76
|
[30, 30],
|
76
77
|
[s - 30, g - 30]
|
@@ -79,18 +80,18 @@ function W({
|
|
79
80
|
).rotate(
|
80
81
|
C <= 1 || r.isDragging || !i ? r.rotation : k.current.iv(C / r.animateDuration)
|
81
82
|
), P = N.geoPath().projection(p).pointRadius(2);
|
82
|
-
|
83
|
-
if (
|
84
|
-
let { p1: t, p2: o, r1: a, r2:
|
83
|
+
J(() => {
|
84
|
+
if (T) {
|
85
|
+
let { p1: t, p2: o, r1: a, r2: m, markerId: c } = k.current;
|
85
86
|
if (c !== i && !r.isDragging) {
|
86
87
|
const l = y.find((v) => v.id === i);
|
87
|
-
t = o, o = [l.longitude, l.latitude], a =
|
88
|
-
const h =
|
88
|
+
t = o, o = [l.longitude, l.latitude], a = m, m = [-o[0], 20 - o[1], p.rotate()[2]];
|
89
|
+
const h = Y.interpolateAngles(a, m);
|
89
90
|
Object.assign(k.current, {
|
90
91
|
p1: t,
|
91
92
|
p2: o,
|
92
93
|
r1: a,
|
93
|
-
r2:
|
94
|
+
r2: m,
|
94
95
|
iv: h,
|
95
96
|
markerId: i
|
96
97
|
});
|
@@ -102,9 +103,9 @@ function W({
|
|
102
103
|
}
|
103
104
|
});
|
104
105
|
}
|
105
|
-
} else if (
|
106
|
+
} else if (M) {
|
106
107
|
const t = window.requestAnimationFrame(() => {
|
107
|
-
const o = [r.rotation[0] + 2 /
|
108
|
+
const o = [r.rotation[0] + 2 / L, r.rotation[1], r.rotation[2]];
|
108
109
|
d({ type: "rotate", payload: { rotation: o } });
|
109
110
|
});
|
110
111
|
return function() {
|
@@ -115,13 +116,13 @@ function W({
|
|
115
116
|
const b = (t) => {
|
116
117
|
const o = E.current, a = o?.getBoundingClientRect();
|
117
118
|
return [t.clientX - a.left - o.clientLeft, t.clientY - a.top - o.clientTop];
|
118
|
-
},
|
119
|
+
}, z = (t) => {
|
119
120
|
const o = b(t);
|
120
121
|
o[0] && (x.current.v0 = D.cartesian(p.invert(o)), x.current.r0 = p.rotate(), x.current.q0 = D(x.current.r0), d({ type: "dragStart", payload: { mousePosition: o } }));
|
121
|
-
},
|
122
|
+
}, G = (t) => {
|
122
123
|
if (r.isDragging === !1)
|
123
124
|
return;
|
124
|
-
const o = b(t), { r0: a, v0:
|
125
|
+
const o = b(t), { r0: a, v0: m, q0: c } = x.current, l = D.cartesian(p.rotate(a).invert(o)), h = D.multiply(c, D.delta(m, l)), f = D.rotation(h);
|
125
126
|
d({ type: "rotate", payload: { rotation: f, mousePosition: o } });
|
126
127
|
}, j = () => {
|
127
128
|
setTimeout(() => {
|
@@ -130,9 +131,9 @@ function W({
|
|
130
131
|
}, A = (t, o) => d({
|
131
132
|
type: "tooltip",
|
132
133
|
payload: { tooltipIndex: o, mousePosition: b(t) }
|
133
|
-
}), O = () => d({ type: "tooltip", payload: { tooltipIndex: -1, mousePosition: null } }),
|
134
|
-
const a = [t.longitude, t.latitude],
|
135
|
-
return /* @__PURE__ */
|
134
|
+
}), O = () => d({ type: "tooltip", payload: { tooltipIndex: -1, mousePosition: null } }), q = () => y.map((t, o) => {
|
135
|
+
const a = [t.longitude, t.latitude], m = N.geoDistance(a, p.invert([s / 2, g / 2])), c = p(a), l = i === t.id, h = m > 1.57 ? "none" : l ? $.activeMarker : $.marker, f = l ? 9 : 6;
|
136
|
+
return /* @__PURE__ */ u(
|
136
137
|
"g",
|
137
138
|
{
|
138
139
|
className: `marker ${l ? "marker--active" : ""}`,
|
@@ -173,13 +174,13 @@ function W({
|
|
173
174
|
},
|
174
175
|
t.id
|
175
176
|
);
|
176
|
-
}),
|
177
|
+
}), U = () => {
|
177
178
|
if (r.tooltipIndex >= 0) {
|
178
179
|
const t = y[r.tooltipIndex];
|
179
|
-
return /* @__PURE__ */
|
180
|
+
return /* @__PURE__ */ u(to, { style: { left: r.mousePosition?.[0] ?? 0, top: r.mousePosition?.[1] ?? 0 }, children: [
|
180
181
|
/* @__PURE__ */ n("p", { className: "title", children: t.title }),
|
181
182
|
/* @__PURE__ */ n("p", { className: "description", children: t.description }),
|
182
|
-
/* @__PURE__ */
|
183
|
+
/* @__PURE__ */ u("p", { className: "description", children: [
|
183
184
|
"ID: ",
|
184
185
|
t.id
|
185
186
|
] })
|
@@ -193,16 +194,16 @@ function W({
|
|
193
194
|
(o) => o.properties && o.properties.name && o.properties.name === t.country
|
194
195
|
);
|
195
196
|
}
|
196
|
-
return /* @__PURE__ */
|
197
|
-
|
198
|
-
/* @__PURE__ */
|
197
|
+
return /* @__PURE__ */ u(oo, { width: s, height: g, $theme: e, colors: $, onMouseLeave: j, children: [
|
198
|
+
U(),
|
199
|
+
/* @__PURE__ */ u(
|
199
200
|
"svg",
|
200
201
|
{
|
201
202
|
className: "earth",
|
202
203
|
width: s,
|
203
204
|
height: g,
|
204
|
-
onMouseDown:
|
205
|
-
onMouseMove:
|
205
|
+
onMouseDown: z,
|
206
|
+
onMouseMove: G,
|
206
207
|
onMouseUp: j,
|
207
208
|
ref: E,
|
208
209
|
children: [
|
@@ -217,7 +218,7 @@ function W({
|
|
217
218
|
},
|
218
219
|
t.properties.name
|
219
220
|
)) }),
|
220
|
-
/* @__PURE__ */ n("g", { className: "markers", children:
|
221
|
+
/* @__PURE__ */ n("g", { className: "markers", children: q() }),
|
221
222
|
r.isDragging && r.mousePosition && /* @__PURE__ */ n(
|
222
223
|
"path",
|
223
224
|
{
|
@@ -231,12 +232,12 @@ function W({
|
|
231
232
|
]
|
232
233
|
}
|
233
234
|
),
|
234
|
-
/* @__PURE__ */ n("svg", { className: "defs", children: /* @__PURE__ */
|
235
|
-
/* @__PURE__ */
|
235
|
+
/* @__PURE__ */ n("svg", { className: "defs", children: /* @__PURE__ */ u("defs", { children: [
|
236
|
+
/* @__PURE__ */ u("linearGradient", { id: "gradBlue", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
236
237
|
/* @__PURE__ */ n("stop", { offset: "0%", style: { stopColor: "#005C99", stopOpacity: 1 } }),
|
237
238
|
/* @__PURE__ */ n("stop", { offset: "100%", style: { stopColor: "#0099FF", stopOpacity: 1 } })
|
238
239
|
] }),
|
239
|
-
/* @__PURE__ */
|
240
|
+
/* @__PURE__ */ u("filter", { id: "glow", children: [
|
240
241
|
/* @__PURE__ */ n(
|
241
242
|
"feColorMatrix",
|
242
243
|
{
|
@@ -248,7 +249,7 @@ function W({
|
|
248
249
|
}
|
249
250
|
),
|
250
251
|
/* @__PURE__ */ n("feGaussianBlur", { stdDeviation: "5.5", result: "coloredBlur" }),
|
251
|
-
/* @__PURE__ */
|
252
|
+
/* @__PURE__ */ u("feMerge", { children: [
|
252
253
|
/* @__PURE__ */ n("feMergeNode", { in: "coloredBlur" }),
|
253
254
|
/* @__PURE__ */ n("feMergeNode", { in: "SourceGraphic" })
|
254
255
|
] })
|
@@ -256,7 +257,7 @@ function W({
|
|
256
257
|
] }) })
|
257
258
|
] });
|
258
259
|
}
|
259
|
-
const
|
260
|
+
const mo = K(Z, { name: "Earth" }), oo = I(R)`
|
260
261
|
background-color: ${(e) => e.$theme === "light" ? "#f7f7f7" : "#222"};
|
261
262
|
width: ${(e) => e.width}px;
|
262
263
|
height: ${(e) => e.height}px;
|
@@ -337,7 +338,7 @@ const lo = Y(W, { name: "Earth" }), Z = B("div")`
|
|
337
338
|
transform: scale3d(1.5, 1.5, 1.5);
|
338
339
|
}
|
339
340
|
}
|
340
|
-
`,
|
341
|
+
`, to = I(R)`
|
341
342
|
position: absolute;
|
342
343
|
width: auto;
|
343
344
|
min-width: 90px;
|
@@ -375,5 +376,5 @@ const lo = Y(W, { name: "Earth" }), Z = B("div")`
|
|
375
376
|
}
|
376
377
|
`;
|
377
378
|
export {
|
378
|
-
|
379
|
+
mo as default
|
379
380
|
};
|
package/lib/Footer/index.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { Box as s, Container as h, Typography as r } from "@mui/material";
|
3
3
|
import { mergeProps as g } from "../Util/index.js";
|
4
4
|
import w from "../Logo/index.js";
|
5
5
|
import { styled as y } from "../Theme/index.js";
|
6
6
|
function u({ ...e }) {
|
7
|
-
const
|
8
|
-
return /* @__PURE__ */ o(b, { className:
|
9
|
-
/* @__PURE__ */ t(
|
7
|
+
const p = g(e, u, ["dark", "style"]), { className: d = "", copyStart: m = "2017", style: c = {}, brand: x = "ArcBlock", dark: n = !1, addon: a = null } = p, i = `${(/* @__PURE__ */ new Date()).getFullYear()}`, l = `${m}`, f = i === l ? i : `${l}-${i}`;
|
8
|
+
return /* @__PURE__ */ o(b, { className: d, style: c, dark: n, children: [
|
9
|
+
/* @__PURE__ */ t(h, { maxWidth: !1, children: /* @__PURE__ */ o(r, { component: "div", className: "footer", children: [
|
10
10
|
/* @__PURE__ */ o(r, { component: "p", className: "footer-item", children: [
|
11
11
|
/* @__PURE__ */ o("span", { className: "footer-copy", children: [
|
12
12
|
"Copyright © ",
|
13
|
-
|
13
|
+
f,
|
14
14
|
" "
|
15
15
|
] }),
|
16
|
-
/* @__PURE__ */ t("span", { className: "footer-brand", children:
|
16
|
+
/* @__PURE__ */ t("span", { className: "footer-brand", children: x })
|
17
17
|
] }),
|
18
18
|
a && /* @__PURE__ */ t(
|
19
19
|
r,
|
@@ -30,7 +30,7 @@ function u({ ...e }) {
|
|
30
30
|
] })
|
31
31
|
] }) }),
|
32
32
|
/* @__PURE__ */ t(
|
33
|
-
|
33
|
+
s,
|
34
34
|
{
|
35
35
|
sx: {
|
36
36
|
position: "absolute",
|
@@ -45,7 +45,7 @@ function u({ ...e }) {
|
|
45
45
|
)
|
46
46
|
] });
|
47
47
|
}
|
48
|
-
const b = y(
|
48
|
+
const b = y(s, {
|
49
49
|
shouldForwardProp: (e) => e !== "dark"
|
50
50
|
})`
|
51
51
|
position: relative;
|
package/lib/Icon/image.js
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import h from "
|
3
|
-
import
|
4
|
-
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { Box as h } from "@mui/material";
|
3
|
+
import n from "../Img/index.js";
|
4
|
+
import { styled as l } from "../Theme/index.js";
|
5
|
+
function w({
|
5
6
|
name: o,
|
6
7
|
size: t = 36,
|
7
|
-
alt:
|
8
|
-
color:
|
8
|
+
alt: i = "",
|
9
|
+
color: p = "#000000",
|
9
10
|
prefix: e = "/images",
|
10
11
|
showBadge: a = !1,
|
11
12
|
style: s = {},
|
12
|
-
...
|
13
|
+
...x
|
13
14
|
}) {
|
14
|
-
const g = `${e}/${o}-${
|
15
|
-
return /* @__PURE__ */
|
16
|
-
/* @__PURE__ */
|
17
|
-
|
15
|
+
const g = `${e}/${o}-${p.replace(/^#/, "")}.png`;
|
16
|
+
return /* @__PURE__ */ d(c, { style: { width: t, height: t }, children: [
|
17
|
+
/* @__PURE__ */ r(
|
18
|
+
n,
|
18
19
|
{
|
19
20
|
width: t,
|
20
21
|
height: t,
|
21
|
-
alt:
|
22
|
+
alt: i || o,
|
22
23
|
src: g,
|
23
24
|
style: Object.assign({ width: t }, s),
|
24
|
-
...
|
25
|
+
...x
|
25
26
|
}
|
26
27
|
),
|
27
|
-
a && /* @__PURE__ */
|
28
|
+
a && /* @__PURE__ */ r("i", { className: "badge-point" })
|
28
29
|
] });
|
29
30
|
}
|
30
|
-
const
|
31
|
+
const c = l(h)`
|
31
32
|
position: relative;
|
32
33
|
.badge-point {
|
33
34
|
position: absolute;
|
@@ -43,5 +44,5 @@ const l = n("div")`
|
|
43
44
|
}
|
44
45
|
`;
|
45
46
|
export {
|
46
|
-
|
47
|
+
w as default
|
47
48
|
};
|
package/lib/InfoRow/index.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
import { jsxs as p, jsx as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { Typography as
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
2
|
+
import x from "lodash/camelCase";
|
3
|
+
import c from "lodash/upperFirst";
|
4
|
+
import { Box as u, Typography as i } from "@mui/material";
|
5
5
|
import { styled as d } from "../Theme/index.js";
|
6
|
-
function
|
6
|
+
function $({
|
7
7
|
name: t,
|
8
|
-
nameFormatter: a = (o) => typeof o == "string" ? o.split(" ").map((s) => x(
|
8
|
+
nameFormatter: a = (o) => typeof o == "string" ? o.split(" ").map((s) => c(x(s))).join(" ") : o,
|
9
9
|
layout: n = "horizontal",
|
10
10
|
children: r,
|
11
11
|
valueComponent: l = "div",
|
12
12
|
nameWidth: m = 90,
|
13
13
|
...f
|
14
14
|
}) {
|
15
|
-
return /* @__PURE__ */ p(
|
16
|
-
/* @__PURE__ */ i
|
17
|
-
r && /* @__PURE__ */ i
|
15
|
+
return /* @__PURE__ */ p(w, { layout: n, width: m, ...f, children: [
|
16
|
+
/* @__PURE__ */ e(i, { color: "textSecondary", className: "info-row__name", children: a(t) }),
|
17
|
+
r && /* @__PURE__ */ e(i, { color: "textPrimary", component: l, className: "info-row__value", children: r })
|
18
18
|
] });
|
19
19
|
}
|
20
|
-
const
|
20
|
+
const w = d(u)`
|
21
21
|
display: flex;
|
22
22
|
flex-direction: ${(t) => t.layout === "vertical" ? "column" : "row"};
|
23
23
|
justify-content: flex-start;
|
@@ -54,5 +54,5 @@ const u = d("div")`
|
|
54
54
|
}
|
55
55
|
`;
|
56
56
|
export {
|
57
|
-
|
57
|
+
$ as default
|
58
58
|
};
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M, useEffect as f } from "react";
|
3
3
|
import { useLocation as p, matchPath as z } from "react-router-dom";
|
4
4
|
import D from "react-helmet";
|
5
|
-
import {
|
5
|
+
import { Box as d, useTheme as R, Container as T } from "@mui/material";
|
6
6
|
import V from "clsx";
|
7
7
|
import { CloseFullscreen as B, OpenInFull as U } from "@mui/icons-material";
|
8
8
|
import E from "../dashboard-legacy/index.js";
|
@@ -115,7 +115,7 @@ function Q({
|
|
115
115
|
)
|
116
116
|
] });
|
117
117
|
}
|
118
|
-
const X = u(
|
118
|
+
const X = u(d, {
|
119
119
|
shouldForwardProp: (e) => e !== "sidebarWidth"
|
120
120
|
})`
|
121
121
|
&.dashboard {
|
@@ -1,39 +1,39 @@
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { Box as x, Typography as b } from "@mui/material";
|
3
3
|
import n from "clsx";
|
4
|
-
import { styled as
|
5
|
-
import { NavLink as
|
4
|
+
import { styled as c } from "../../Theme/index.js";
|
5
|
+
import { NavLink as h } from "./external-link.js";
|
6
6
|
function d(e, i) {
|
7
7
|
if (e.children?.length)
|
8
|
-
return
|
8
|
+
return m(e, i);
|
9
9
|
const { url: a, icon: r, title: p, showBadge: s, external: l, active: u } = e;
|
10
10
|
return /* @__PURE__ */ t("li", { className: "layout-sidebar-item", children: /* @__PURE__ */ o(
|
11
|
-
|
11
|
+
h,
|
12
12
|
{
|
13
13
|
external: l,
|
14
14
|
to: a,
|
15
15
|
className: ({ isActive: g }) => n("layout-sidebar-link", { "layout-sidebar-link--active": l ? u : g }),
|
16
16
|
children: [
|
17
17
|
r && /* @__PURE__ */ t("span", { className: `layout-sidebar-icon ${s ? "layout-sidebar-badge" : ""}`, children: r }),
|
18
|
-
/* @__PURE__ */ t(
|
18
|
+
/* @__PURE__ */ t(b, { component: "span", className: "layout-sidebar-link-text", children: p })
|
19
19
|
]
|
20
20
|
}
|
21
21
|
) }, `${a}-${i}`);
|
22
22
|
}
|
23
|
-
function
|
23
|
+
function m(e, i) {
|
24
24
|
return /* @__PURE__ */ o("li", { className: "layout-sidebar-group", children: [
|
25
25
|
/* @__PURE__ */ t("span", { className: "layout-sidebar-group-title", children: e.title }),
|
26
26
|
/* @__PURE__ */ t("ul", { children: e.children.map(d) })
|
27
27
|
] }, `group-${e.title}-${i}`);
|
28
28
|
}
|
29
|
-
function
|
30
|
-
return /* @__PURE__ */ o(
|
29
|
+
function z({ links: e, addons: i = void 0, dense: a = !1, ...r }) {
|
30
|
+
return /* @__PURE__ */ o(f, { ...r, className: n({ "layout-sidebar-dense": a }), children: [
|
31
31
|
/* @__PURE__ */ t("ul", { children: e.map(d) }),
|
32
32
|
/* @__PURE__ */ t("div", { style: { flex: 1 } }),
|
33
33
|
i
|
34
34
|
] });
|
35
35
|
}
|
36
|
-
const
|
36
|
+
const y = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))", f = c(x)`
|
37
37
|
display: flex;
|
38
38
|
flex-direction: column;
|
39
39
|
ul {
|
@@ -52,7 +52,7 @@ const m = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230,
|
|
52
52
|
&:hover,
|
53
53
|
&.layout-sidebar-link--active {
|
54
54
|
color: ${(e) => e.theme.palette.primary.main};
|
55
|
-
background: ${
|
55
|
+
background: ${y};
|
56
56
|
border-left-color: ${(e) => e.theme.palette.primary.main};
|
57
57
|
}
|
58
58
|
}
|
@@ -160,5 +160,5 @@ const m = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230,
|
|
160
160
|
}
|
161
161
|
`;
|
162
162
|
export {
|
163
|
-
|
163
|
+
z as default
|
164
164
|
};
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { useState as
|
2
|
+
import { useState as c, useEffect as $ } from "react";
|
3
3
|
import P from "react-helmet";
|
4
|
-
import { Box as
|
4
|
+
import { Box as t, Drawer as z, Container as H } from "@mui/material";
|
5
5
|
import { useSize as S } from "ahooks";
|
6
6
|
import W from "./sidebar.js";
|
7
7
|
import j from "./header.js";
|
8
8
|
import C from "../../Footer/index.js";
|
9
9
|
import { styled as F } from "../../Theme/index.js";
|
10
|
-
const O = F(
|
10
|
+
const O = F(t)`
|
11
11
|
&.dashboard {
|
12
12
|
display: flex;
|
13
13
|
flex-direction: column;
|
@@ -38,7 +38,7 @@ const O = F("div")`
|
|
38
38
|
`;
|
39
39
|
function R({
|
40
40
|
links: o = [],
|
41
|
-
brand:
|
41
|
+
brand: d = "",
|
42
42
|
description: h = "",
|
43
43
|
images: f,
|
44
44
|
title: b = "Home",
|
@@ -49,35 +49,35 @@ function R({
|
|
49
49
|
contentLayout: g = "column",
|
50
50
|
className: y = "",
|
51
51
|
homeUrl: v = "/",
|
52
|
-
logo:
|
52
|
+
logo: s = void 0,
|
53
53
|
children: N,
|
54
54
|
...k
|
55
55
|
}) {
|
56
|
-
const r = S(document.body)?.width || 0, [
|
56
|
+
const r = S(document.body)?.width || 0, [n, M] = c(r >= 960 ? "permanent" : "temporary"), [i, l] = c(n === "permanent");
|
57
57
|
$(() => {
|
58
|
-
const
|
59
|
-
M(
|
58
|
+
const p = r >= 960 ? "permanent" : "temporary";
|
59
|
+
M(p), l(p !== "temporary");
|
60
60
|
}, [r]);
|
61
|
-
const
|
62
|
-
|
61
|
+
const m = () => {
|
62
|
+
l(!i);
|
63
63
|
}, D = _ || g === "row";
|
64
64
|
return /* @__PURE__ */ a(O, { className: `dashboard ${y}`, ...k, children: [
|
65
|
-
/* @__PURE__ */ e(P, { title: `${b}-${
|
65
|
+
/* @__PURE__ */ e(P, { title: `${b}-${d}` }),
|
66
66
|
/* @__PURE__ */ e(
|
67
67
|
j,
|
68
68
|
{
|
69
69
|
className: "dashboard__header",
|
70
|
-
onToggleMenu:
|
71
|
-
brand:
|
70
|
+
onToggleMenu: m,
|
71
|
+
brand: d,
|
72
72
|
brandAddon: u,
|
73
73
|
description: h,
|
74
74
|
addons: w,
|
75
75
|
homeUrl: v,
|
76
|
-
logo:
|
76
|
+
logo: s
|
77
77
|
}
|
78
78
|
),
|
79
79
|
/* @__PURE__ */ a(
|
80
|
-
|
80
|
+
t,
|
81
81
|
{
|
82
82
|
className: "dashboard__body",
|
83
83
|
sx: {
|
@@ -87,16 +87,16 @@ function R({
|
|
87
87
|
/* @__PURE__ */ e(
|
88
88
|
z,
|
89
89
|
{
|
90
|
-
variant:
|
90
|
+
variant: n,
|
91
91
|
className: "drawer",
|
92
92
|
classes: { paper: "drawerPaper" },
|
93
|
-
open:
|
94
|
-
onClose:
|
93
|
+
open: i,
|
94
|
+
onClose: m,
|
95
95
|
ModalProps: { disablePortal: !0, keepMounted: !0 },
|
96
|
-
children: /* @__PURE__ */ e(W, { className: "dashboard__sidebar", images: f, links: o, prefix: x, logo:
|
96
|
+
children: /* @__PURE__ */ e(W, { className: "dashboard__sidebar", images: f, links: o, prefix: x, logo: s })
|
97
97
|
}
|
98
98
|
),
|
99
|
-
/* @__PURE__ */ a(
|
99
|
+
/* @__PURE__ */ a(t, { className: "dashboard__main", children: [
|
100
100
|
/* @__PURE__ */ e(H, { maxWidth: D ? !1 : "lg", className: "dashboard__content", children: N }),
|
101
101
|
/* @__PURE__ */ e(C, {})
|
102
102
|
] })
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
2
2
|
import { memo as k } from "react";
|
3
3
|
import { useLocation as $, Link as s } from "react-router-dom";
|
4
|
-
import {
|
4
|
+
import { Box as w, Button as z, useTheme as v, Typography as I } from "@mui/material";
|
5
5
|
import { teal as l } from "@mui/material/colors";
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { styled as
|
9
|
-
function
|
6
|
+
import j from "../../Icon/image.js";
|
7
|
+
import L from "../../Logo/index.js";
|
8
|
+
import { styled as d } from "../../Theme/index.js";
|
9
|
+
function C({
|
10
10
|
images: e,
|
11
11
|
links: m,
|
12
12
|
prefix: p = "/images",
|
@@ -14,14 +14,14 @@ function q({
|
|
14
14
|
logo: f = void 0,
|
15
15
|
...x
|
16
16
|
}) {
|
17
|
-
const u =
|
18
|
-
return /* @__PURE__ */ a(
|
19
|
-
/* @__PURE__ */ t(s, { to: "/", className: "sidebar-logo", children: f || /* @__PURE__ */ t(
|
17
|
+
const u = v(), b = $(), h = (o, n) => new RegExp(`/${n}`).test(b.pathname);
|
18
|
+
return /* @__PURE__ */ a(T, { ...x, children: [
|
19
|
+
/* @__PURE__ */ t(s, { to: "/", className: "sidebar-logo", children: f || /* @__PURE__ */ t(L, { showText: !1, size: 20 }) }),
|
20
20
|
m.map(({ url: o, name: n, title: r, showBadge: y }) => {
|
21
21
|
const i = h(o, n);
|
22
|
-
return /* @__PURE__ */ a(
|
22
|
+
return /* @__PURE__ */ a(A, { component: s, selected: i, to: o, children: [
|
23
23
|
/* @__PURE__ */ t(
|
24
|
-
|
24
|
+
j,
|
25
25
|
{
|
26
26
|
name: e[n],
|
27
27
|
size: 36,
|
@@ -30,14 +30,14 @@ function q({
|
|
30
30
|
showBadge: y
|
31
31
|
}
|
32
32
|
),
|
33
|
-
/* @__PURE__ */ t(
|
33
|
+
/* @__PURE__ */ t(I, { component: "span", className: "menu-title", children: r })
|
34
34
|
] }, o);
|
35
35
|
}),
|
36
36
|
/* @__PURE__ */ t("div", { style: { flex: 1 } }),
|
37
37
|
g
|
38
38
|
] });
|
39
39
|
}
|
40
|
-
const
|
40
|
+
const T = k(d(w)`
|
41
41
|
flex: 1;
|
42
42
|
display: flex;
|
43
43
|
flex-direction: column;
|
@@ -58,7 +58,7 @@ const L = k(c("div")`
|
|
58
58
|
display: block;
|
59
59
|
}
|
60
60
|
}
|
61
|
-
`),
|
61
|
+
`), c = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))", A = d(z)`
|
62
62
|
&& {
|
63
63
|
display: flex;
|
64
64
|
flex-direction: column;
|
@@ -66,13 +66,13 @@ const L = k(c("div")`
|
|
66
66
|
align-items: center;
|
67
67
|
width: 100%;
|
68
68
|
transition: all 200ms ease-in-out;
|
69
|
-
background: ${(e) => e.selected ?
|
69
|
+
background: ${(e) => e.selected ? c : ""};
|
70
70
|
padding: 24px 0;
|
71
71
|
border-left: 2px solid ${(e) => e.selected ? l.A700 : "transparent"};
|
72
72
|
border-radius: 0;
|
73
73
|
|
74
74
|
&:hover {
|
75
|
-
background: ${
|
75
|
+
background: ${c};
|
76
76
|
border-left-color: ${l.A700};
|
77
77
|
}
|
78
78
|
|
@@ -89,5 +89,5 @@ const L = k(c("div")`
|
|
89
89
|
}
|
90
90
|
`;
|
91
91
|
export {
|
92
|
-
|
92
|
+
C as default
|
93
93
|
};
|