@arcblock/ux 3.0.9 → 3.0.11
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/Address/did-address.js +47 -49
- package/lib/Address/responsive-did-address.js +53 -57
- package/lib/Avatar/index.js +16 -16
- package/lib/BlockletV2/blocklet.js +64 -64
- package/lib/BlockletV2/components/tooltip-icon.js +26 -27
- package/lib/CardSelector/index.js +1 -2
- package/lib/ClickToCopy/hook.js +10 -11
- package/lib/ClickToCopy/index.js +16 -16
- package/lib/Config/theme-mode-toggle.js +7 -8
- package/lib/DID/index.js +131 -133
- package/lib/DIDConnect/app-info-item.js +18 -18
- package/lib/DIDConnect/auth-apps/index.js +83 -84
- package/lib/DIDConnect/did-connect-container.js +89 -90
- package/lib/DIDConnect/did-connect-footer.js +25 -25
- package/lib/DIDConnect/landing-page.js +17 -17
- package/lib/DIDConnect/powered-by.js +11 -11
- package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
- package/lib/DIDConnect/with-container.js +66 -68
- package/lib/Dialog/use-confirm.js +40 -43
- package/lib/Earth/index.js +21 -22
- package/lib/Footer/index.js +15 -16
- package/lib/Header/responsive-header.js +23 -24
- package/lib/Layout/dashboard/index.js +63 -72
- package/lib/Layout/dashboard/sidebar.js +20 -21
- package/lib/Layout/dashboard-legacy/index.js +52 -52
- package/lib/Locale/context.js +36 -37
- package/lib/Locale/selector.js +40 -42
- package/lib/NFTDisplay/index.js +114 -118
- package/lib/NFTDisplay/render-svg.js +12 -12
- package/lib/NavMenu/nav-menu.js +159 -161
- package/lib/NavMenu/sub-container.js +25 -26
- package/lib/PageScroller/index.js +28 -32
- package/lib/Passport/passport.js +11 -11
- package/lib/PhoneInput/country-select.js +38 -38
- package/lib/PhoneInput/index.js +65 -66
- package/lib/Screenshot/index.js +26 -27
- package/lib/SessionBlocklet/index.js +87 -93
- package/lib/SessionPermission/index.js +5 -9
- package/lib/SessionUser/components/did-space.js +24 -25
- package/lib/SessionUser/components/logged-in.js +122 -127
- package/lib/SessionUser/components/quick-login-item.js +41 -42
- package/lib/SessionUser/components/session-user-item.js +35 -36
- package/lib/SessionUser/components/session-user-switch.js +81 -85
- package/lib/SessionUser/components/un-login.js +41 -41
- package/lib/SessionUser/components/user-info.js +43 -47
- package/lib/SessionUser/index.js +1 -1
- package/lib/SessionUser/libs/utils.js +24 -30
- package/lib/SharedBridge/index.js +35 -35
- package/lib/Theme/index.js +16 -16
- package/lib/Theme/theme.js +42 -43
- package/lib/Toast/index.js +24 -25
- package/lib/Typography/index.js +42 -42
- package/lib/UserCard/Content/basic.js +91 -93
- package/lib/UserCard/Content/shorten-label.js +9 -9
- package/lib/UserCard/components.js +15 -15
- package/lib/Util/deprecate.js +1 -1
- package/lib/Util/federated.js +28 -32
- package/lib/Util/iframe.js +9 -10
- package/lib/Util/index.js +134 -135
- package/lib/Util/security.js +9 -10
- package/lib/Util/wallet.js +6 -9
- package/lib/VerificationCode/index.js +26 -28
- package/lib/hooks/use-blocklet-logo.js +11 -14
- package/lib/ux.css +1 -1
- package/lib/withTracker/index.js +13 -14
- package/package.json +10 -11
@@ -1,44 +1,43 @@
|
|
1
|
-
import { jsx as o, jsxs as
|
2
|
-
import { useState as
|
3
|
-
import { useReactive as
|
4
|
-
import { Close as
|
5
|
-
import { Container as
|
6
|
-
import
|
7
|
-
import { styled as
|
8
|
-
function
|
9
|
-
const a =
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
2
|
+
import { useState as f } from "react";
|
3
|
+
import { useReactive as y, useCreation as v } from "ahooks";
|
4
|
+
import { Close as h, Menu as g } from "@mui/icons-material";
|
5
|
+
import { Container as b, useTheme as x, useMediaQuery as w, Drawer as P, Button as k } from "@mui/material";
|
6
|
+
import p from "./header.js";
|
7
|
+
import { styled as i } from "../Theme/index.js";
|
8
|
+
function z({ prepend: n, children: r = null, ...s }) {
|
9
|
+
const a = x(), l = w(a.breakpoints.down("md")), [t, m] = f(!1), u = typeof r == "function" ? r({ isMobile: l, closeMenu: () => m(!1) }) : r, e = y({
|
10
10
|
changed: !1,
|
11
11
|
value: "",
|
12
12
|
priority: ""
|
13
13
|
});
|
14
|
-
return
|
15
|
-
|
16
|
-
|
17
|
-
const p = () => {
|
14
|
+
return v(() => {
|
15
|
+
if (document.documentElement?.style) {
|
16
|
+
const d = () => {
|
18
17
|
e.changed && (e.value ? document.documentElement.style.setProperty("overflow", e.value, e.priority) : document.documentElement.style.removeProperty("overflow"), e.value = "", e.priority = "", e.changed = !1);
|
19
18
|
};
|
20
|
-
return t ? (e.changed = !0, e.value = document.documentElement.style.getPropertyValue("overflow"), e.priority = document.documentElement.style.getPropertyPriority("overflow"), document.documentElement.style.setProperty("overflow", "revert", "important")) :
|
19
|
+
return t ? (e.changed = !0, e.value = document.documentElement.style.getPropertyValue("overflow"), e.priority = document.documentElement.style.getPropertyPriority("overflow"), document.documentElement.style.setProperty("overflow", "revert", "important")) : d(), d;
|
21
20
|
}
|
22
21
|
return () => {
|
23
22
|
};
|
24
|
-
}, [t]), r ? /* @__PURE__ */
|
25
|
-
|
23
|
+
}, [t]), r ? /* @__PURE__ */ c(
|
24
|
+
C,
|
26
25
|
{
|
27
26
|
prepend: n || /* @__PURE__ */ o(
|
28
|
-
|
27
|
+
k,
|
29
28
|
{
|
30
29
|
sx: { color: a.palette.grey[500] },
|
31
30
|
className: "header-menu",
|
32
31
|
"aria-label": "header menu button",
|
33
32
|
onClick: () => m(!t),
|
34
|
-
children: t ? /* @__PURE__ */ o(
|
33
|
+
children: t ? /* @__PURE__ */ o(h, {}) : /* @__PURE__ */ o(g, {})
|
35
34
|
}
|
36
35
|
),
|
37
36
|
...s,
|
38
37
|
children: [
|
39
38
|
!l && u,
|
40
39
|
l && /* @__PURE__ */ o(
|
41
|
-
|
40
|
+
P,
|
42
41
|
{
|
43
42
|
open: t,
|
44
43
|
onClose: () => m(!1),
|
@@ -63,14 +62,14 @@ function D({ prepend: n, children: r = null, ...s }) {
|
|
63
62
|
}
|
64
63
|
}
|
65
64
|
},
|
66
|
-
children: /* @__PURE__ */ o(
|
65
|
+
children: /* @__PURE__ */ o(M, { children: u })
|
67
66
|
}
|
68
67
|
)
|
69
68
|
]
|
70
69
|
}
|
71
|
-
) : /* @__PURE__ */ o(
|
70
|
+
) : /* @__PURE__ */ o(p, { prepend: n, ...s });
|
72
71
|
}
|
73
|
-
const
|
72
|
+
const C = i(p)`
|
74
73
|
.header-menu {
|
75
74
|
display: none;
|
76
75
|
}
|
@@ -80,7 +79,7 @@ const M = c(i)`
|
|
80
79
|
margin-right: 12px;
|
81
80
|
}
|
82
81
|
}
|
83
|
-
`,
|
82
|
+
`, M = i(b)`
|
84
83
|
padding-top: 8px;
|
85
84
|
padding-bottom: 16px;
|
86
85
|
.navmenu {
|
@@ -92,5 +91,5 @@ const M = c(i)`
|
|
92
91
|
}
|
93
92
|
`;
|
94
93
|
export {
|
95
|
-
|
94
|
+
z as default
|
96
95
|
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { useMemo as M, useEffect as
|
3
|
-
import { useLocation as
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
2
|
+
import { useMemo as M, useEffect as f } from "react";
|
3
|
+
import { useLocation as p, matchPath as z } from "react-router-dom";
|
4
4
|
import D from "react-helmet";
|
5
|
-
import { useTheme as R, Box as
|
5
|
+
import { useTheme as R, Box as d, 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";
|
@@ -11,78 +11,69 @@ import G from "../../Header/responsive-header.js";
|
|
11
11
|
import O from "../../NavMenu/nav-menu.js";
|
12
12
|
import "../../NavMenu/products.js";
|
13
13
|
import q from "../../Footer/index.js";
|
14
|
-
import
|
15
|
-
import { styled as
|
16
|
-
import { Link as
|
14
|
+
import b from "./sidebar.js";
|
15
|
+
import { styled as u } from "../../Theme/index.js";
|
16
|
+
import { Link as x } from "./external-link.js";
|
17
17
|
import { FullPageProvider as A, useFullPage as J } from "./full-page.js";
|
18
|
-
function K({ closeMenu:
|
19
|
-
const
|
20
|
-
return
|
21
|
-
|
22
|
-
}, [
|
18
|
+
function K({ closeMenu: e, ...a }) {
|
19
|
+
const o = p();
|
20
|
+
return f(() => {
|
21
|
+
e();
|
22
|
+
}, [o]), /* @__PURE__ */ r(O, { ...a });
|
23
23
|
}
|
24
|
-
function
|
25
|
-
return
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
// external = true 时 active 状态由传入 links 的调用方决定 (适用于 blocklet ui dashboard 的情况)
|
35
|
-
active: e.external ? e.active : !!z({ path: e.url, end: !1 }, a.pathname)
|
36
|
-
};
|
24
|
+
function g(e, a) {
|
25
|
+
return e.map((o) => o.children?.length ? {
|
26
|
+
...o,
|
27
|
+
label: o.title,
|
28
|
+
children: g(o.children, a)
|
29
|
+
} : {
|
30
|
+
...o,
|
31
|
+
label: /* @__PURE__ */ r(x, { to: o.url, external: o.external, children: o.title }),
|
32
|
+
// external = true 时 active 状态由传入 links 的调用方决定 (适用于 blocklet ui dashboard 的情况)
|
33
|
+
active: o.external ? o.active : !!z({ path: o.url, end: !1 }, a.pathname)
|
37
34
|
});
|
38
35
|
}
|
39
36
|
function Q({
|
40
|
-
title:
|
37
|
+
title: e = "Home",
|
41
38
|
headerProps: a = {},
|
42
|
-
links:
|
43
|
-
sidebarWidth:
|
44
|
-
fullWidth:
|
45
|
-
dense:
|
46
|
-
footerProps:
|
47
|
-
sx:
|
48
|
-
children:
|
49
|
-
...
|
39
|
+
links: o = [],
|
40
|
+
sidebarWidth: v = 120,
|
41
|
+
fullWidth: w = !1,
|
42
|
+
dense: l = "auto",
|
43
|
+
footerProps: y = {},
|
44
|
+
sx: N = {},
|
45
|
+
children: P,
|
46
|
+
...h
|
50
47
|
}) {
|
51
|
-
const
|
52
|
-
|
53
|
-
return !!((d = t.children) != null && d.length);
|
54
|
-
}), n = c === "auto" ? l.length >= 8 || S : c, j = V("dashboard", { "dashboard-dense": n }, m.className), I = {
|
55
|
-
homeLink: (t) => {
|
56
|
-
var d;
|
57
|
-
return /* @__PURE__ */ r(v, { to: ((d = window.blocklet) == null ? void 0 : d.prefix) || "/", children: t });
|
58
|
-
},
|
48
|
+
const c = R(), { inFullPage: F, showToggleButton: L, headerVisible: W, footerVisible: $, sidebarVisible: C, toggleFullPage: H } = J(), m = p(), s = M(() => g(o, m), [m, o]), _ = s.some((t) => !!t.children?.length), i = l === "auto" ? s.length >= 8 || _ : l, S = V("dashboard", { "dashboard-dense": i }, h.className), j = {
|
49
|
+
homeLink: (t) => /* @__PURE__ */ r(x, { to: window.blocklet?.prefix || "/", children: t }),
|
59
50
|
...a
|
60
51
|
};
|
61
|
-
return
|
52
|
+
return f(() => {
|
62
53
|
const { searchParams: t } = new URL(window.location.href);
|
63
54
|
t.get("inviter") && window.localStorage.setItem("inviter", t.get("inviter"));
|
64
|
-
}, []), /* @__PURE__ */
|
65
|
-
/* @__PURE__ */ r(D, { title:
|
66
|
-
|
55
|
+
}, []), /* @__PURE__ */ n(X, { sx: N, ...h, className: S, sidebarWidth: v, children: [
|
56
|
+
/* @__PURE__ */ r(D, { title: e }, e),
|
57
|
+
W && /* @__PURE__ */ r(Y, { ...j, className: "dashboard-header", children: o?.length ? ({ isMobile: t, closeMenu: I }) => t ? /* @__PURE__ */ r(
|
67
58
|
K,
|
68
59
|
{
|
69
60
|
mode: "inline",
|
70
|
-
items:
|
71
|
-
closeMenu:
|
61
|
+
items: s,
|
62
|
+
closeMenu: I,
|
72
63
|
bgColor: "transparent",
|
73
|
-
activeTextColor:
|
64
|
+
activeTextColor: c.palette.primary.main
|
74
65
|
}
|
75
66
|
) : null : null }),
|
76
|
-
/* @__PURE__ */
|
77
|
-
|
67
|
+
/* @__PURE__ */ n(
|
68
|
+
d,
|
78
69
|
{
|
79
70
|
className: "dashboard-body",
|
80
71
|
sx: {
|
81
72
|
display: "flex"
|
82
73
|
},
|
83
74
|
children: [
|
84
|
-
!!
|
85
|
-
|
75
|
+
!!o?.length && C && /* @__PURE__ */ r(
|
76
|
+
d,
|
86
77
|
{
|
87
78
|
className: "dashboard-sidebar",
|
88
79
|
sx: {
|
@@ -91,12 +82,12 @@ function Q({
|
|
91
82
|
md: "block"
|
92
83
|
}
|
93
84
|
},
|
94
|
-
children:
|
85
|
+
children: i ? /* @__PURE__ */ r(b, { links: o, dense: i }) : /* @__PURE__ */ r(d, { className: "dashboard-sidebar-container", children: /* @__PURE__ */ r(b, { links: o, dense: i }) })
|
95
86
|
}
|
96
87
|
),
|
97
|
-
/* @__PURE__ */
|
98
|
-
|
99
|
-
|
88
|
+
/* @__PURE__ */ n(d, { className: "dashboard-main", id: "arc__dashboard-main", children: [
|
89
|
+
L && /* @__PURE__ */ r(
|
90
|
+
d,
|
100
91
|
{
|
101
92
|
sx: {
|
102
93
|
position: "absolute",
|
@@ -112,26 +103,26 @@ function Q({
|
|
112
103
|
borderRadius: 1,
|
113
104
|
cursor: "pointer"
|
114
105
|
},
|
115
|
-
onClick:
|
116
|
-
children:
|
106
|
+
onClick: H,
|
107
|
+
children: F ? /* @__PURE__ */ r(B, { style: { fontSize: 18 } }) : /* @__PURE__ */ r(U, { style: { fontSize: 18 } })
|
117
108
|
}
|
118
109
|
),
|
119
|
-
/* @__PURE__ */ r(T, { className: "dashboard-content", id: "arc__dashboard-content", ...
|
120
|
-
|
110
|
+
/* @__PURE__ */ r(T, { className: "dashboard-content", id: "arc__dashboard-content", ...w && { maxWidth: !1 }, children: P }),
|
111
|
+
$ && /* @__PURE__ */ r(q, { dark: c.palette.mode === "dark", ...y })
|
121
112
|
] })
|
122
113
|
]
|
123
114
|
}
|
124
115
|
)
|
125
116
|
] });
|
126
117
|
}
|
127
|
-
const X =
|
128
|
-
shouldForwardProp: (
|
118
|
+
const X = u("div", {
|
119
|
+
shouldForwardProp: (e) => e !== "sidebarWidth"
|
129
120
|
})`
|
130
121
|
&.dashboard {
|
131
122
|
display: flex;
|
132
123
|
flex-direction: column;
|
133
124
|
height: 100vh;
|
134
|
-
background-color: ${({ theme:
|
125
|
+
background-color: ${({ theme: e }) => e.palette.background.default};
|
135
126
|
}
|
136
127
|
.dashboard-body {
|
137
128
|
overflow: hidden;
|
@@ -140,14 +131,14 @@ const X = g("div", {
|
|
140
131
|
.dashboard-sidebar {
|
141
132
|
box-sizing: border-box;
|
142
133
|
flex: 0 0 auto;
|
143
|
-
width: ${(
|
134
|
+
width: ${(e) => e.sidebarWidth}px;
|
144
135
|
overflow: hidden;
|
145
136
|
&:hover {
|
146
137
|
overflow-y: auto;
|
147
138
|
}
|
148
139
|
}
|
149
140
|
.dashboard-sidebar-container {
|
150
|
-
width: ${(
|
141
|
+
width: ${(e) => e.sidebarWidth}px;
|
151
142
|
}
|
152
143
|
.dashboard-main {
|
153
144
|
display: flex;
|
@@ -162,15 +153,15 @@ const X = g("div", {
|
|
162
153
|
&.dashboard-dense {
|
163
154
|
.dashboard-header {
|
164
155
|
border-bottom: 1px solid;
|
165
|
-
border-color: ${({ theme:
|
156
|
+
border-color: ${({ theme: e }) => e.palette.divider};
|
166
157
|
}
|
167
158
|
.dashboard-sidebar {
|
168
159
|
width: 256px;
|
169
160
|
border-right: 1px solid;
|
170
|
-
border-color: ${({ theme:
|
161
|
+
border-color: ${({ theme: e }) => e.palette.divider};
|
171
162
|
}
|
172
163
|
}
|
173
|
-
${(
|
164
|
+
${(e) => e.theme.breakpoints.up("md")} {
|
174
165
|
.header-logo {
|
175
166
|
display: flex;
|
176
167
|
justify-content: center;
|
@@ -182,16 +173,16 @@ const X = g("div", {
|
|
182
173
|
}
|
183
174
|
}
|
184
175
|
}
|
185
|
-
`, Y =
|
176
|
+
`, Y = u(G)`
|
186
177
|
.header-container {
|
187
178
|
max-width: 100%;
|
188
179
|
}
|
189
180
|
`;
|
190
181
|
function ue({
|
191
|
-
legacy:
|
182
|
+
legacy: e = !0,
|
192
183
|
...a
|
193
184
|
}) {
|
194
|
-
return
|
185
|
+
return e ? /* @__PURE__ */ r(E, { ...a }) : /* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(Q, { ...a }) });
|
195
186
|
}
|
196
187
|
export {
|
197
188
|
ue as default
|
@@ -1,40 +1,39 @@
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { Typography as
|
3
|
-
import
|
4
|
-
import { styled as
|
5
|
-
import { NavLink as
|
6
|
-
function
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
const { url: a, icon: r, title: s, showBadge: u, external: l, active: g } = e;
|
2
|
+
import { Typography as x } from "@mui/material";
|
3
|
+
import n from "clsx";
|
4
|
+
import { styled as b } from "../../Theme/index.js";
|
5
|
+
import { NavLink as c } from "./external-link.js";
|
6
|
+
function d(e, i) {
|
7
|
+
if (e.children?.length)
|
8
|
+
return h(e, i);
|
9
|
+
const { url: a, icon: r, title: p, showBadge: s, external: l, active: u } = e;
|
11
10
|
return /* @__PURE__ */ t("li", { className: "layout-sidebar-item", children: /* @__PURE__ */ o(
|
12
|
-
|
11
|
+
c,
|
13
12
|
{
|
14
13
|
external: l,
|
15
14
|
to: a,
|
16
|
-
className: ({ isActive:
|
15
|
+
className: ({ isActive: g }) => n("layout-sidebar-link", { "layout-sidebar-link--active": l ? u : g }),
|
17
16
|
children: [
|
18
|
-
r && /* @__PURE__ */ t("span", { className: `layout-sidebar-icon ${
|
19
|
-
/* @__PURE__ */ t(
|
17
|
+
r && /* @__PURE__ */ t("span", { className: `layout-sidebar-icon ${s ? "layout-sidebar-badge" : ""}`, children: r }),
|
18
|
+
/* @__PURE__ */ t(x, { component: "span", className: "layout-sidebar-link-text", children: p })
|
20
19
|
]
|
21
20
|
}
|
22
21
|
) }, `${a}-${i}`);
|
23
22
|
}
|
24
|
-
function
|
23
|
+
function h(e, i) {
|
25
24
|
return /* @__PURE__ */ o("li", { className: "layout-sidebar-group", children: [
|
26
25
|
/* @__PURE__ */ t("span", { className: "layout-sidebar-group-title", children: e.title }),
|
27
|
-
/* @__PURE__ */ t("ul", { children: e.children.map(
|
26
|
+
/* @__PURE__ */ t("ul", { children: e.children.map(d) })
|
28
27
|
] }, `group-${e.title}-${i}`);
|
29
28
|
}
|
30
|
-
function
|
31
|
-
return /* @__PURE__ */ o(
|
32
|
-
/* @__PURE__ */ t("ul", { children: e.map(
|
29
|
+
function N({ links: e, addons: i = void 0, dense: a = !1, ...r }) {
|
30
|
+
return /* @__PURE__ */ o(y, { ...r, className: n({ "layout-sidebar-dense": a }), children: [
|
31
|
+
/* @__PURE__ */ t("ul", { children: e.map(d) }),
|
33
32
|
/* @__PURE__ */ t("div", { style: { flex: 1 } }),
|
34
33
|
i
|
35
34
|
] });
|
36
35
|
}
|
37
|
-
const
|
36
|
+
const m = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))", y = b("div")`
|
38
37
|
display: flex;
|
39
38
|
flex-direction: column;
|
40
39
|
ul {
|
@@ -53,7 +52,7 @@ const y = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230,
|
|
53
52
|
&:hover,
|
54
53
|
&.layout-sidebar-link--active {
|
55
54
|
color: ${(e) => e.theme.palette.primary.main};
|
56
|
-
background: ${
|
55
|
+
background: ${m};
|
57
56
|
border-left-color: ${(e) => e.theme.palette.primary.main};
|
58
57
|
}
|
59
58
|
}
|
@@ -161,5 +160,5 @@ const y = "linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230,
|
|
161
160
|
}
|
162
161
|
`;
|
163
162
|
export {
|
164
|
-
|
163
|
+
N as default
|
165
164
|
};
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useState as
|
3
|
-
import
|
4
|
-
import { Box as
|
5
|
-
import { useSize as
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import { styled as
|
10
|
-
const
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { useState as p, useEffect as $ } from "react";
|
3
|
+
import P from "react-helmet";
|
4
|
+
import { Box as c, Drawer as z, Container as H } from "@mui/material";
|
5
|
+
import { useSize as S } from "ahooks";
|
6
|
+
import W from "./sidebar.js";
|
7
|
+
import j from "./header.js";
|
8
|
+
import C from "../../Footer/index.js";
|
9
|
+
import { styled as F } from "../../Theme/index.js";
|
10
|
+
const O = F("div")`
|
11
11
|
&.dashboard {
|
12
12
|
display: flex;
|
13
13
|
flex-direction: column;
|
@@ -38,46 +38,46 @@ const B = T("div")`
|
|
38
38
|
`;
|
39
39
|
function R({
|
40
40
|
links: o = [],
|
41
|
-
brand:
|
42
|
-
description:
|
43
|
-
images:
|
44
|
-
title:
|
45
|
-
brandAddon:
|
46
|
-
headerAddon:
|
47
|
-
prefix:
|
48
|
-
fullWidth:
|
49
|
-
contentLayout:
|
50
|
-
className:
|
51
|
-
homeUrl:
|
52
|
-
logo:
|
53
|
-
children:
|
54
|
-
...
|
41
|
+
brand: t = "",
|
42
|
+
description: h = "",
|
43
|
+
images: f,
|
44
|
+
title: b = "Home",
|
45
|
+
brandAddon: u = void 0,
|
46
|
+
headerAddon: w = void 0,
|
47
|
+
prefix: x = "/images",
|
48
|
+
fullWidth: _ = !1,
|
49
|
+
contentLayout: g = "column",
|
50
|
+
className: y = "",
|
51
|
+
homeUrl: v = "/",
|
52
|
+
logo: d = void 0,
|
53
|
+
children: N,
|
54
|
+
...k
|
55
55
|
}) {
|
56
|
-
const r =
|
57
|
-
|
58
|
-
const
|
59
|
-
|
60
|
-
}, [
|
61
|
-
const
|
62
|
-
|
63
|
-
},
|
64
|
-
return /* @__PURE__ */
|
65
|
-
/* @__PURE__ */ e(
|
56
|
+
const r = S(document.body)?.width || 0, [s, M] = p(r >= 960 ? "permanent" : "temporary"), [n, i] = p(s === "permanent");
|
57
|
+
$(() => {
|
58
|
+
const m = r >= 960 ? "permanent" : "temporary";
|
59
|
+
M(m), i(m !== "temporary");
|
60
|
+
}, [r]);
|
61
|
+
const l = () => {
|
62
|
+
i(!n);
|
63
|
+
}, D = _ || g === "row";
|
64
|
+
return /* @__PURE__ */ a(O, { className: `dashboard ${y}`, ...k, children: [
|
65
|
+
/* @__PURE__ */ e(P, { title: `${b}-${t}` }),
|
66
66
|
/* @__PURE__ */ e(
|
67
|
-
|
67
|
+
j,
|
68
68
|
{
|
69
69
|
className: "dashboard__header",
|
70
|
-
onToggleMenu:
|
71
|
-
brand:
|
72
|
-
brandAddon:
|
73
|
-
description:
|
74
|
-
addons:
|
75
|
-
homeUrl:
|
76
|
-
logo:
|
70
|
+
onToggleMenu: l,
|
71
|
+
brand: t,
|
72
|
+
brandAddon: u,
|
73
|
+
description: h,
|
74
|
+
addons: w,
|
75
|
+
homeUrl: v,
|
76
|
+
logo: d
|
77
77
|
}
|
78
78
|
),
|
79
|
-
/* @__PURE__ */
|
80
|
-
|
79
|
+
/* @__PURE__ */ a(
|
80
|
+
c,
|
81
81
|
{
|
82
82
|
className: "dashboard__body",
|
83
83
|
sx: {
|
@@ -85,20 +85,20 @@ function R({
|
|
85
85
|
},
|
86
86
|
children: [
|
87
87
|
/* @__PURE__ */ e(
|
88
|
-
|
88
|
+
z,
|
89
89
|
{
|
90
|
-
variant:
|
90
|
+
variant: s,
|
91
91
|
className: "drawer",
|
92
92
|
classes: { paper: "drawerPaper" },
|
93
|
-
open:
|
94
|
-
onClose:
|
93
|
+
open: n,
|
94
|
+
onClose: l,
|
95
95
|
ModalProps: { disablePortal: !0, keepMounted: !0 },
|
96
|
-
children: /* @__PURE__ */ e(
|
96
|
+
children: /* @__PURE__ */ e(W, { className: "dashboard__sidebar", images: f, links: o, prefix: x, logo: d })
|
97
97
|
}
|
98
98
|
),
|
99
|
-
/* @__PURE__ */
|
100
|
-
/* @__PURE__ */ e(
|
101
|
-
/* @__PURE__ */ e(
|
99
|
+
/* @__PURE__ */ a(c, { className: "dashboard__main", children: [
|
100
|
+
/* @__PURE__ */ e(H, { maxWidth: D ? !1 : "lg", className: "dashboard__content", children: N }),
|
101
|
+
/* @__PURE__ */ e(C, {})
|
102
102
|
] })
|
103
103
|
]
|
104
104
|
}
|