@blocklet/launcher-layout 2.13.69 → 3.0.0
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/compact-layout.js +27 -78
- package/lib/content.js +16 -18
- package/lib/context/step.js +61 -126
- package/lib/header.js +107 -203
- package/lib/index.js +153 -219
- package/lib/info-list.js +54 -41
- package/lib/launch-result-message.js +39 -63
- package/lib/locale.js +9 -8
- package/lib/markdown-body.js +15 -19
- package/lib/nav.js +138 -190
- package/lib/page-header.js +22 -38
- package/lib/small-circle-progress.js +38 -45
- package/lib/theme-provider.js +21 -38
- package/lib/wizard/hotkey-submit.js +19 -35
- package/lib/wizard/server-eula.js +50 -65
- package/lib/wizard/wizard-desc.js +147 -240
- package/package.json +14 -24
- package/lib/LaunchResultMessage/demo/default.js +0 -82
- package/lib/LaunchResultMessage/result-message.stories.js +0 -27
- package/lib/Layout/demo/child-progress-in-memory-mode.js +0 -70
- package/lib/Layout/demo/child-progress.js +0 -54
- package/lib/Layout/demo/constants.js +0 -76
- package/lib/Layout/demo/default.js +0 -54
- package/lib/Layout/demo/extra-nav.js +0 -108
- package/lib/Layout/demo/logo-url.js +0 -31
- package/lib/Layout/demo/longest-steps-for-launch.js +0 -95
- package/lib/Layout/demo/memory-mode.js +0 -49
- package/lib/Layout/demo/old-code-compatible.js +0 -36
- package/lib/Layout/demo/optional-step.js +0 -61
- package/lib/Layout/demo/show-child.js +0 -93
- package/lib/Layout/demo/static-demo-data.json +0 -85
- package/lib/Layout/layout.stories.js +0 -28
package/lib/nav.js
CHANGED
|
@@ -1,178 +1,132 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
blockletMeta,
|
|
10
|
-
logoUrl,
|
|
11
|
-
locale,
|
|
12
|
-
useOfSkeleton,
|
|
13
|
-
subTitle,
|
|
14
|
-
loading,
|
|
15
|
-
extraNav
|
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import k from "@emotion/styled";
|
|
3
|
+
import { Check as B } from "@mui/icons-material";
|
|
4
|
+
import { Box as x, Skeleton as A, Tooltip as P, Button as g, Typography as I } from "@mui/material";
|
|
5
|
+
import s from "prop-types";
|
|
6
|
+
import { useStepContext as M } from "./context/step.js";
|
|
7
|
+
import N from "./header.js";
|
|
8
|
+
function _({
|
|
9
|
+
blockletMeta: e,
|
|
10
|
+
logoUrl: f = "",
|
|
11
|
+
locale: u = "",
|
|
12
|
+
useOfSkeleton: y = !1,
|
|
13
|
+
subTitle: w = "",
|
|
14
|
+
loading: d = !1,
|
|
15
|
+
extraNav: t = null,
|
|
16
|
+
sx: v
|
|
16
17
|
}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
canBackToStep
|
|
24
|
-
} = useStepContext();
|
|
25
|
-
const showSkeleton = useOfSkeleton ? loading : false;
|
|
26
|
-
const getNodeClassName = (step, index) => {
|
|
27
|
-
const classNameList = ['step-block'];
|
|
28
|
-
const status = getStepStatus(step.key);
|
|
29
|
-
switch (status) {
|
|
30
|
-
case 'current':
|
|
31
|
-
classNameList.push('step-active');
|
|
18
|
+
var m, b;
|
|
19
|
+
const { steps: $, activeStep: S, setActiveStepByKey: C, setActiveStepByIndex: z, getStepStatus: h, canBackToStep: T } = M(), c = y ? d : !1, j = (i, p) => {
|
|
20
|
+
const n = ["step-block"], a = h(i.key);
|
|
21
|
+
switch (a) {
|
|
22
|
+
case "current":
|
|
23
|
+
n.push("step-active");
|
|
32
24
|
break;
|
|
33
|
-
case
|
|
34
|
-
|
|
25
|
+
case "before":
|
|
26
|
+
n.push("step-checked");
|
|
35
27
|
break;
|
|
36
|
-
case 'after':
|
|
37
|
-
default:
|
|
38
28
|
}
|
|
39
|
-
switch (
|
|
40
|
-
case
|
|
41
|
-
|
|
42
|
-
classNameList.push('hide-step-child');
|
|
43
|
-
}
|
|
29
|
+
switch (i.showChild) {
|
|
30
|
+
case "activated":
|
|
31
|
+
a === "after" && n.push("hide-step-child");
|
|
44
32
|
break;
|
|
45
|
-
case
|
|
46
|
-
|
|
47
|
-
classNameList.push('hide-step-child');
|
|
48
|
-
}
|
|
33
|
+
case "activating":
|
|
34
|
+
(a === "after" || a === "before") && n.push("hide-step-child");
|
|
49
35
|
break;
|
|
50
|
-
case
|
|
51
|
-
|
|
36
|
+
case "always":
|
|
37
|
+
n.push("always-step-child");
|
|
52
38
|
break;
|
|
53
|
-
default:
|
|
54
39
|
}
|
|
55
|
-
|
|
56
|
-
classNameList.push('step-optional'); // optional在没有匹配到路由情况下会隐藏;超越这个步骤后就会一直出现
|
|
57
|
-
}
|
|
58
|
-
return classNameList.join(' ');
|
|
40
|
+
return i.optional === !0 && S < p && n.push("step-optional"), n.join(" ");
|
|
59
41
|
};
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
className: getNodeClassName(step, index),
|
|
73
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
74
|
-
className: "step-icon",
|
|
75
|
-
children: /*#__PURE__*/_jsx(Check, {
|
|
76
|
-
style: {
|
|
77
|
-
fontSize: 16
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
81
|
-
className: "step-line"
|
|
82
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
83
|
-
className: "step-content",
|
|
84
|
-
title: step.name,
|
|
85
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
86
|
-
className: `step-content-name ${canBack ? ' step-clickable' : ''}`,
|
|
42
|
+
return /* @__PURE__ */ l(q, { sx: v, children: [
|
|
43
|
+
/* @__PURE__ */ o(N, { blockletMeta: e, loading: d, logoUrl: f, locale: u, subTitle: w }),
|
|
44
|
+
/* @__PURE__ */ o(D, { className: `${c ? "hide-child-step-desc" : ""}`, children: $.map((i, p) => {
|
|
45
|
+
const n = !c && T(p);
|
|
46
|
+
return /* @__PURE__ */ l("div", { className: j(i, p), children: [
|
|
47
|
+
/* @__PURE__ */ o("div", { className: "step-icon", children: /* @__PURE__ */ o(B, { style: { fontSize: 16 } }) }),
|
|
48
|
+
/* @__PURE__ */ o("div", { className: "step-line" }),
|
|
49
|
+
/* @__PURE__ */ l("div", { className: "step-content", title: i.name, children: [
|
|
50
|
+
/* @__PURE__ */ o(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: `step-content-name ${n ? " step-clickable" : ""}`,
|
|
87
54
|
onClick: () => {
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
90
|
-
|
|
55
|
+
if (n) {
|
|
56
|
+
if (i.key) {
|
|
57
|
+
C(i.key);
|
|
91
58
|
return;
|
|
92
59
|
}
|
|
93
|
-
|
|
60
|
+
z(p);
|
|
94
61
|
}
|
|
95
62
|
},
|
|
96
|
-
children:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case 'before':
|
|
110
|
-
className = 'step-child-block-checked';
|
|
111
|
-
break;
|
|
112
|
-
case 'current':
|
|
113
|
-
className = 'step-child-block-active';
|
|
114
|
-
break;
|
|
115
|
-
case 'after':
|
|
116
|
-
default:
|
|
117
|
-
}
|
|
118
|
-
return /*#__PURE__*/_jsx("div", {
|
|
119
|
-
className: `step-child-block ${className}`,
|
|
120
|
-
children: e.name
|
|
121
|
-
}, e.key);
|
|
122
|
-
})
|
|
123
|
-
})]
|
|
124
|
-
})]
|
|
125
|
-
}, step.key);
|
|
126
|
-
})
|
|
127
|
-
}), extraNav && /*#__PURE__*/_jsxs("div", {
|
|
128
|
-
className: "extra-nav",
|
|
129
|
-
children: [extraNav.tooltipText ? /*#__PURE__*/_jsx(Tooltip, {
|
|
130
|
-
title: extraNav.tooltipText,
|
|
131
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
132
|
-
variant: extraNav.buttonProps?.variant || 'text',
|
|
133
|
-
onClick: () => {
|
|
134
|
-
if (extraNav.link) {
|
|
135
|
-
window.open(extraNav.link, '_blank');
|
|
63
|
+
children: c ? /* @__PURE__ */ o(A, { variant: "text", width: 100 }) : i.name
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
i.description && /* @__PURE__ */ o("div", { className: "step-desc", children: i.description }),
|
|
67
|
+
i.children && i.children.length && /* @__PURE__ */ o("div", { className: "step-children", children: i.children.map((a) => {
|
|
68
|
+
let r = "";
|
|
69
|
+
switch (h(a.key)) {
|
|
70
|
+
case "before":
|
|
71
|
+
r = "step-child-block-checked";
|
|
72
|
+
break;
|
|
73
|
+
case "current":
|
|
74
|
+
r = "step-child-block-active";
|
|
75
|
+
break;
|
|
136
76
|
}
|
|
77
|
+
return /* @__PURE__ */ o("div", { className: `step-child-block ${r}`, children: a.name }, a.key);
|
|
78
|
+
}) })
|
|
79
|
+
] })
|
|
80
|
+
] }, i.key);
|
|
81
|
+
}) }),
|
|
82
|
+
t && /* @__PURE__ */ l("div", { className: "extra-nav", children: [
|
|
83
|
+
t.tooltipText ? /* @__PURE__ */ o(P, { title: t.tooltipText, children: /* @__PURE__ */ o(
|
|
84
|
+
g,
|
|
85
|
+
{
|
|
86
|
+
variant: ((m = t.buttonProps) == null ? void 0 : m.variant) || "text",
|
|
87
|
+
onClick: () => {
|
|
88
|
+
t.link && window.open(t.link, "_blank");
|
|
137
89
|
},
|
|
138
|
-
startIcon:
|
|
90
|
+
startIcon: t.icon,
|
|
139
91
|
className: "extra-nav-button",
|
|
140
92
|
size: "small",
|
|
141
|
-
...
|
|
142
|
-
children:
|
|
143
|
-
}
|
|
144
|
-
}) :
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
93
|
+
...t.buttonProps,
|
|
94
|
+
children: t.text
|
|
95
|
+
}
|
|
96
|
+
) }) : /* @__PURE__ */ o(
|
|
97
|
+
g,
|
|
98
|
+
{
|
|
99
|
+
variant: ((b = t.buttonProps) == null ? void 0 : b.variant) || "text",
|
|
100
|
+
onClick: () => {
|
|
101
|
+
t.link && window.open(t.link, "_blank");
|
|
102
|
+
},
|
|
103
|
+
startIcon: t.icon,
|
|
104
|
+
size: "small",
|
|
105
|
+
className: "extra-nav-button",
|
|
106
|
+
...t.buttonProps,
|
|
107
|
+
children: t.text
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
t.description && /* @__PURE__ */ o(
|
|
111
|
+
I,
|
|
112
|
+
{
|
|
113
|
+
variant: "caption",
|
|
114
|
+
sx: { color: "text.secondary", mt: 0.5 },
|
|
115
|
+
component: "p",
|
|
116
|
+
className: "extra-nav-description",
|
|
117
|
+
children: t.description
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] })
|
|
121
|
+
] });
|
|
168
122
|
}
|
|
169
|
-
const
|
|
123
|
+
const q = k(x)`
|
|
170
124
|
overflow-y: auto;
|
|
171
125
|
display: flex;
|
|
172
126
|
flex-direction: column;
|
|
173
|
-
${
|
|
127
|
+
${(e) => e.theme.breakpoints.up("md")} {
|
|
174
128
|
padding: 24px;
|
|
175
|
-
border-right: 1px solid ${
|
|
129
|
+
border-right: 1px solid ${(e) => e.theme.palette.divider};
|
|
176
130
|
flex: 0 0 280px;
|
|
177
131
|
min-height: 48px;
|
|
178
132
|
|
|
@@ -181,7 +135,7 @@ const Div = styled.div`
|
|
|
181
135
|
}
|
|
182
136
|
}
|
|
183
137
|
|
|
184
|
-
${
|
|
138
|
+
${(e) => e.theme.breakpoints.down("md")} {
|
|
185
139
|
padding: 16px;
|
|
186
140
|
|
|
187
141
|
.MuiStepConnector-lineVertical {
|
|
@@ -193,11 +147,11 @@ const Div = styled.div`
|
|
|
193
147
|
padding: 0 !important;
|
|
194
148
|
background: transparent;
|
|
195
149
|
|
|
196
|
-
${
|
|
150
|
+
${(e) => e.theme.breakpoints.up("sm")} {
|
|
197
151
|
margin-top: 100px;
|
|
198
152
|
}
|
|
199
153
|
|
|
200
|
-
${
|
|
154
|
+
${(e) => e.theme.breakpoints.down("md")} {
|
|
201
155
|
margin-top: 40px;
|
|
202
156
|
}
|
|
203
157
|
|
|
@@ -214,8 +168,7 @@ const Div = styled.div`
|
|
|
214
168
|
.extra-nav-button {
|
|
215
169
|
cursor: pointer;
|
|
216
170
|
}
|
|
217
|
-
|
|
218
|
-
const StepContainer = styled.div`
|
|
171
|
+
`, D = k(x)`
|
|
219
172
|
display: flex;
|
|
220
173
|
flex-direction: column;
|
|
221
174
|
margin-top: 60px;
|
|
@@ -225,13 +178,13 @@ const StepContainer = styled.div`
|
|
|
225
178
|
margin-top: 32px;
|
|
226
179
|
}
|
|
227
180
|
|
|
228
|
-
${
|
|
181
|
+
${(e) => e.theme.breakpoints.down("md")} {
|
|
229
182
|
margin-top: 30px;
|
|
230
183
|
}
|
|
231
184
|
.step-clickable {
|
|
232
185
|
cursor: pointer;
|
|
233
186
|
&:hover {
|
|
234
|
-
color: ${
|
|
187
|
+
color: ${(e) => e.theme.palette.primary.main};
|
|
235
188
|
}
|
|
236
189
|
}
|
|
237
190
|
.step-line {
|
|
@@ -243,7 +196,7 @@ const StepContainer = styled.div`
|
|
|
243
196
|
width: 2px;
|
|
244
197
|
height: 100%;
|
|
245
198
|
opacity: 0.5;
|
|
246
|
-
background-color: ${
|
|
199
|
+
background-color: ${(e) => e.theme.palette.grey[400]};
|
|
247
200
|
transition: all ease 0.2s;
|
|
248
201
|
}
|
|
249
202
|
.step-icon {
|
|
@@ -256,9 +209,9 @@ const StepContainer = styled.div`
|
|
|
256
209
|
box-sizing: border-box;
|
|
257
210
|
width: 24px;
|
|
258
211
|
height: 24px;
|
|
259
|
-
border: 4px solid ${
|
|
212
|
+
border: 4px solid ${(e) => e.theme.palette.grey[400]};
|
|
260
213
|
border-radius: 13px;
|
|
261
|
-
color: ${
|
|
214
|
+
color: ${(e) => e.theme.palette.common.white};
|
|
262
215
|
transition: all ease 0.3s;
|
|
263
216
|
|
|
264
217
|
& > * {
|
|
@@ -272,7 +225,7 @@ const StepContainer = styled.div`
|
|
|
272
225
|
padding-top: 1px;
|
|
273
226
|
margin-left: 22px;
|
|
274
227
|
font-size: 16px;
|
|
275
|
-
color: ${
|
|
228
|
+
color: ${(e) => e.theme.palette.grey[700]};
|
|
276
229
|
white-space: nowrap;
|
|
277
230
|
}
|
|
278
231
|
.step-desc {
|
|
@@ -280,11 +233,11 @@ const StepContainer = styled.div`
|
|
|
280
233
|
font-size: 12px;
|
|
281
234
|
font-weight: 500;
|
|
282
235
|
height: 17px;
|
|
283
|
-
color: ${
|
|
236
|
+
color: ${(e) => e.theme.palette.grey[700]};
|
|
284
237
|
transition: all ease 0.3s;
|
|
285
238
|
overflow: hidden;
|
|
286
239
|
}
|
|
287
|
-
${
|
|
240
|
+
${(e) => e.theme.breakpoints.up("md")} {
|
|
288
241
|
.step-content-name {
|
|
289
242
|
position: absolute;
|
|
290
243
|
left: 0;
|
|
@@ -330,16 +283,16 @@ const StepContainer = styled.div`
|
|
|
330
283
|
&.step-checked {
|
|
331
284
|
opacity: 1;
|
|
332
285
|
.step-icon {
|
|
333
|
-
color: ${
|
|
334
|
-
border-color: ${
|
|
335
|
-
background-color: ${
|
|
286
|
+
color: ${(e) => e.theme.palette.primary.white};
|
|
287
|
+
border-color: ${(e) => e.theme.palette.primary.main};
|
|
288
|
+
background-color: ${(e) => e.theme.palette.primary.main};
|
|
336
289
|
& > * {
|
|
337
290
|
transform: scale(1);
|
|
338
291
|
}
|
|
339
292
|
}
|
|
340
293
|
|
|
341
294
|
.step-line {
|
|
342
|
-
background-color: ${
|
|
295
|
+
background-color: ${(e) => e.theme.palette.primary.main};
|
|
343
296
|
opacity: 1;
|
|
344
297
|
}
|
|
345
298
|
}
|
|
@@ -347,10 +300,10 @@ const StepContainer = styled.div`
|
|
|
347
300
|
&.step-active {
|
|
348
301
|
opacity: 1;
|
|
349
302
|
.step-icon {
|
|
350
|
-
border-color: ${
|
|
303
|
+
border-color: ${(e) => e.theme.palette.primary.main};
|
|
351
304
|
}
|
|
352
305
|
.step-content {
|
|
353
|
-
color: ${
|
|
306
|
+
color: ${(e) => e.theme.palette.primary.main};
|
|
354
307
|
}
|
|
355
308
|
}
|
|
356
309
|
|
|
@@ -386,7 +339,7 @@ const StepContainer = styled.div`
|
|
|
386
339
|
height: 24px;
|
|
387
340
|
line-height: 24px;
|
|
388
341
|
font-size: 14px;
|
|
389
|
-
color: ${
|
|
342
|
+
color: ${(e) => e.theme.palette.grey[500]};
|
|
390
343
|
transition: all ease 0.3s;
|
|
391
344
|
&:first-of-type {
|
|
392
345
|
margin-top: 8px;
|
|
@@ -395,11 +348,11 @@ const StepContainer = styled.div`
|
|
|
395
348
|
padding-bottom: 40px;
|
|
396
349
|
}
|
|
397
350
|
&.step-child-block-active {
|
|
398
|
-
color: ${
|
|
351
|
+
color: ${(e) => e.theme.palette.text.primary};
|
|
399
352
|
font-weight: 700;
|
|
400
353
|
}
|
|
401
354
|
&.step-child-block-checked {
|
|
402
|
-
color: ${
|
|
355
|
+
color: ${(e) => e.theme.palette.text.primary};
|
|
403
356
|
}
|
|
404
357
|
}
|
|
405
358
|
}
|
|
@@ -419,21 +372,16 @@ const StepContainer = styled.div`
|
|
|
419
372
|
}
|
|
420
373
|
}
|
|
421
374
|
`;
|
|
422
|
-
|
|
423
|
-
blockletMeta:
|
|
424
|
-
logoUrl:
|
|
425
|
-
locale:
|
|
426
|
-
useOfSkeleton:
|
|
427
|
-
subTitle:
|
|
428
|
-
loading:
|
|
429
|
-
extraNav:
|
|
375
|
+
_.propTypes = {
|
|
376
|
+
blockletMeta: s.object.isRequired,
|
|
377
|
+
logoUrl: s.string,
|
|
378
|
+
locale: s.string,
|
|
379
|
+
useOfSkeleton: s.bool,
|
|
380
|
+
subTitle: s.string,
|
|
381
|
+
loading: s.bool,
|
|
382
|
+
extraNav: s.object,
|
|
383
|
+
sx: s.any
|
|
430
384
|
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
locale: '',
|
|
434
|
-
useOfSkeleton: false,
|
|
435
|
-
subTitle: '',
|
|
436
|
-
loading: false,
|
|
437
|
-
extraNav: null
|
|
385
|
+
export {
|
|
386
|
+
_ as default
|
|
438
387
|
};
|
|
439
|
-
export default Nav;
|
package/lib/page-header.js
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})
|
|
11
|
-
return /*#__PURE__*/_jsxs(Content, {
|
|
12
|
-
...rest,
|
|
13
|
-
children: [onClickBack && /*#__PURE__*/_jsx(ArrowBackIosIcon, {
|
|
14
|
-
className: "back-btn",
|
|
15
|
-
onClick: onClickBack
|
|
16
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
17
|
-
className: "title",
|
|
18
|
-
children: title
|
|
19
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
20
|
-
className: "sub-title",
|
|
21
|
-
children: subTitle
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import p from "@emotion/styled";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import { ArrowBackIos as l } from "@mui/icons-material";
|
|
5
|
+
function a({ title: t = "", subTitle: r = "", onClickBack: i = "", ...n }) {
|
|
6
|
+
return /* @__PURE__ */ s(c, { ...n, children: [
|
|
7
|
+
i && /* @__PURE__ */ o(l, { className: "back-btn", onClick: i }),
|
|
8
|
+
/* @__PURE__ */ o("div", { className: "title", children: t }),
|
|
9
|
+
/* @__PURE__ */ o("div", { className: "sub-title", children: r })
|
|
10
|
+
] });
|
|
24
11
|
}
|
|
25
|
-
const
|
|
12
|
+
const c = p.div`
|
|
26
13
|
position: relative;
|
|
27
14
|
width: 100%;
|
|
28
15
|
text-align: center;
|
|
@@ -30,16 +17,16 @@ const Content = styled.div`
|
|
|
30
17
|
.title {
|
|
31
18
|
font-size: 24px;
|
|
32
19
|
font-weight: 700;
|
|
33
|
-
color: ${
|
|
20
|
+
color: ${(t) => t.theme.palette.text.primary};
|
|
34
21
|
|
|
35
|
-
${
|
|
22
|
+
${(t) => t.theme.breakpoints.down("md")} {
|
|
36
23
|
font-size: 20px;
|
|
37
24
|
}
|
|
38
25
|
}
|
|
39
26
|
|
|
40
27
|
.sub-title {
|
|
41
28
|
font-size: 14px;
|
|
42
|
-
color: ${
|
|
29
|
+
color: ${(t) => t.theme.palette.text.secondary};
|
|
43
30
|
padding: 0 14px;
|
|
44
31
|
font-weight: 400;
|
|
45
32
|
}
|
|
@@ -48,19 +35,16 @@ const Content = styled.div`
|
|
|
48
35
|
position: absolute;
|
|
49
36
|
left: 0;
|
|
50
37
|
top: 8px;
|
|
51
|
-
color: ${
|
|
38
|
+
color: ${(t) => t.theme.palette.grey[500]};
|
|
52
39
|
font-size: 18px;
|
|
53
40
|
cursor: pointer;
|
|
54
41
|
}
|
|
55
42
|
`;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
43
|
+
a.propTypes = {
|
|
44
|
+
title: e.string,
|
|
45
|
+
subTitle: e.string,
|
|
46
|
+
onClickBack: e.oneOfType([e.func, e.string])
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
a as default
|
|
61
50
|
};
|
|
62
|
-
PageHeader.defaultProps = {
|
|
63
|
-
title: '',
|
|
64
|
-
subTitle: '',
|
|
65
|
-
onClickBack: ''
|
|
66
|
-
};
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...rest,
|
|
18
|
-
children: [/*#__PURE__*/_jsx(CircularProgress, {
|
|
19
|
-
variant: "determinate",
|
|
20
|
-
role: "progressbar",
|
|
21
|
-
value: 100,
|
|
22
|
-
size: size,
|
|
23
|
-
"aria-label": "decorative progress bar",
|
|
24
|
-
thickness: 10,
|
|
25
|
-
sx: {
|
|
26
|
-
color: 'grey.300'
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import n from "@emotion/styled";
|
|
4
|
+
import { CircularProgress as o } from "@mui/material";
|
|
5
|
+
function p({ value: s, size: r = 10, style: i = {}, ...a }) {
|
|
6
|
+
return /* @__PURE__ */ l(m, { style: { width: r, height: r, ...i }, ...a, children: [
|
|
7
|
+
/* @__PURE__ */ t(
|
|
8
|
+
o,
|
|
9
|
+
{
|
|
10
|
+
variant: "determinate",
|
|
11
|
+
role: "progressbar",
|
|
12
|
+
value: 100,
|
|
13
|
+
size: r,
|
|
14
|
+
"aria-label": "decorative progress bar",
|
|
15
|
+
thickness: 10,
|
|
16
|
+
sx: { color: "grey.300" }
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ t(
|
|
20
|
+
o,
|
|
21
|
+
{
|
|
22
|
+
variant: "determinate",
|
|
23
|
+
value: s,
|
|
24
|
+
role: "progressbar",
|
|
25
|
+
size: r,
|
|
26
|
+
thickness: 10,
|
|
27
|
+
"aria-label": "main progress bar"
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
value:
|
|
40
|
-
size:
|
|
41
|
-
style:
|
|
42
|
-
};
|
|
43
|
-
SmallCircleProgress.defaultProps = {
|
|
44
|
-
size: 10,
|
|
45
|
-
style: {}
|
|
32
|
+
p.propTypes = {
|
|
33
|
+
value: e.number.isRequired,
|
|
34
|
+
size: e.number,
|
|
35
|
+
style: e.object
|
|
46
36
|
};
|
|
47
|
-
const
|
|
37
|
+
const m = n.span`
|
|
48
38
|
display: inline-block;
|
|
49
39
|
position: relative;
|
|
50
40
|
> * {
|
|
@@ -54,4 +44,7 @@ const Content = styled.span`
|
|
|
54
44
|
width: 100%;
|
|
55
45
|
height: 100%;
|
|
56
46
|
}
|
|
57
|
-
`;
|
|
47
|
+
`;
|
|
48
|
+
export {
|
|
49
|
+
p as default
|
|
50
|
+
};
|