@edu-tosel/design 1.0.235 → 1.0.236
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/layout/template/Transcript/design/Transcript.d.ts +3 -0
- package/layout/template/Transcript/design/Transcript.design.js +2 -2
- package/layout/template/Transcript/design/molecule/CircularGauge.d.ts +2 -1
- package/layout/template/Transcript/design/molecule/CircularGauge.js +25 -8
- package/layout/template/Transcript/design/organism/ResultGaugeCard.d.ts +2 -1
- package/layout/template/Transcript/design/organism/ResultGaugeCard.js +2 -2
- package/package.json +1 -1
- package/version.txt +1 -1
|
@@ -27,7 +27,7 @@ export function getStringfromType(ExamType) {
|
|
|
27
27
|
return examTypeMap[ExamType] || "Unknown";
|
|
28
28
|
}
|
|
29
29
|
function TranscriptDesign({ props }, ref) {
|
|
30
|
-
const { info, result, data } = props;
|
|
30
|
+
const { info, result, data, option } = props;
|
|
31
31
|
const section1Data = SectionBarGraphProps("section1", data.analysis.user.section1, 50, data.script.section1, undefined, 10, data.analysis.nationalAverage.section1);
|
|
32
32
|
const section2Data = SectionBarGraphProps("section2", data.analysis.user.section2, 50, data.script.section2, undefined, 10, data.analysis.nationalAverage.section2);
|
|
33
33
|
const container = {
|
|
@@ -42,7 +42,7 @@ function TranscriptDesign({ props }, ref) {
|
|
|
42
42
|
spacings: "px-5 py-2",
|
|
43
43
|
backgrounds: "bg-gradient-to-r from-crimson-burgundy to-green-dark",
|
|
44
44
|
};
|
|
45
|
-
return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsx(NationalPositionCard, { result: result }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultGaugeCard, { result: result, theme: "green" }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { section1: section1Data, section2: section2Data, theme: "green" }), _jsx(SectionRadarCard, { data: data, section: "section1", info: info, theme: "red" }), _jsx(SectionRadarCard, { data: data, section: "section2", info: info, theme: "red" }), _jsx(IntelligenceCard, { data: data.multipleIntelligence, theme: "green" }), _jsx(MIChart, {})] }));
|
|
45
|
+
return (_jsxs("div", { ref: ref, className: cn(container), children: [_jsxs("div", { className: cn(headerBox), children: [_jsx("img", { src: "images/logos/logo-tosel-white.svg", alt: "", className: "h-10" }), _jsxs("div", { className: "text-white font-bold text-base", children: [getStringfromType(info.examType), " \uC131\uC801\uD45C"] })] }), _jsx(IdCard, { info: info }), _jsx(NationalPositionCard, { result: result }), _jsxs("div", { className: "flex flex-col gap-5 xs:flex-row mt-5 items-stretch", children: [_jsx(ResultGaugeCard, { result: result, theme: "green", noAnimation: option?.noAnimation ?? false }), _jsx(HonorCard, { result: result })] }), _jsx(PerformanceCard, { data: data, info: info }), _jsx(ScoreCard, { data: data }), _jsx(BarCardRow, { section1: section1Data, section2: section2Data, theme: "green" }), _jsx(SectionRadarCard, { data: data, section: "section1", info: info, theme: "red" }), _jsx(SectionRadarCard, { data: data, section: "section2", info: info, theme: "red" }), _jsx(IntelligenceCard, { data: data.multipleIntelligence, theme: "green" }), _jsx(MIChart, {})] }));
|
|
46
46
|
}
|
|
47
47
|
export default forwardRef(TranscriptDesign);
|
|
48
48
|
function SectionBarGraphProps(title, score, total, script, subScripts, scale, subScore) {
|
|
@@ -4,6 +4,7 @@ interface GaugeProps {
|
|
|
4
4
|
maxScore: number;
|
|
5
5
|
isGrade?: boolean;
|
|
6
6
|
theme: Theme;
|
|
7
|
+
noAnimation: Boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const CircularGauge: ({ score, maxScore, isGrade, theme, }: GaugeProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const CircularGauge: ({ score, maxScore, isGrade, theme, noAnimation, }: GaugeProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Cell, Pie, PieChart, ResponsiveContainer } from "recharts";
|
|
3
3
|
import { cn } from "../../../../../util";
|
|
4
|
-
export const CircularGauge = ({ score, maxScore, isGrade, theme, }) => {
|
|
4
|
+
export const CircularGauge = ({ score, maxScore, isGrade, theme, noAnimation, }) => {
|
|
5
|
+
const prepareNoAnimationPercentage = () => {
|
|
6
|
+
if (isGrade) {
|
|
7
|
+
return ((10 - score) / 9) * 100;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return (score / maxScore) * 100;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const widthPercentage = prepareNoAnimationPercentage();
|
|
5
14
|
const pieStyles = {
|
|
6
15
|
cx: "50%",
|
|
7
16
|
cy: "50%",
|
|
@@ -37,14 +46,22 @@ export const CircularGauge = ({ score, maxScore, isGrade, theme, }) => {
|
|
|
37
46
|
];
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
// 단체 성적표에 대한 분기 처리: svg 요소의 렌더 실패를 방지하기 위함
|
|
50
|
+
if (noAnimation) {
|
|
51
|
+
return (_jsxs("div", { className: "w-full aspect-square flex items-center justify-center relative", children: [_jsx("div", { className: "absolute top-5 left-0 w-full h-fit flex justify-center items-end font-bold text-gray-dark text-4xl", children: score }), _jsx("div", { className: "absolute bottom-5 left-0 w-full h-full flex flex-col justify-end items-start", children: _jsx("div", { className: "w-full h-5 bg-green-light rounded-full" }) }), _jsx("div", { className: "absolute bottom-5 left-0 w-full h-full flex flex-col justify-end items-start", children: _jsx("div", { className: "h-5 bg-green-dark rounded-full", style: {
|
|
52
|
+
width: `${widthPercentage}%`,
|
|
53
|
+
} }) })] }));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return (_jsxs("div", { className: "w-full aspect-square flex items-center justify-center relative", children: [_jsx("div", { className: "absolute top-0 left-0 w-full aspect-square", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsx(Pie, { data: [{ name: "Background", value: 100 }], cx: "50%", cy: "50%", innerRadius: "70%", outerRadius: "90%", fill: "rgba(128, 128, 128, 0.2)" // 회색 배경 색상
|
|
57
|
+
, dataKey: "value", stroke: "rgb(255,255,255,0)", animationDuration: 0 }) }) }) }), _jsx("div", { className: "absolute top-0 left-0 w-full aspect-square opacity-0 print:opacity-100", children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsxs(Pie, { data: preparePieChartData(), ...pieStyles, animationDuration: 0, children: [_jsx(Cell, { fill: theme == "green" ? "#105652" : "#910023", ...cellStyles, style: {
|
|
58
|
+
filter: theme == "green"
|
|
59
|
+
? "drop-shadow(0px 3px 5px rgba(16, 86, 82, 0.38))"
|
|
60
|
+
: "drop-shadow(0px 3px 5px rgba(145, 0, 35, 0.38))",
|
|
61
|
+
} }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) }) }), _jsx(ResponsiveContainer, { width: "100%", height: "100%", aspect: 1, children: _jsx(PieChart, { children: _jsxs(Pie, { data: preparePieChartData(), ...pieStyles, children: [_jsx(Cell, { fill: theme == "green" ? "#105652" : "#910023", ...cellStyles, style: {
|
|
42
62
|
filter: theme == "green"
|
|
43
63
|
? "drop-shadow(0px 3px 5px rgba(16, 86, 82, 0.38))"
|
|
44
64
|
: "drop-shadow(0px 3px 5px rgba(145, 0, 35, 0.38))",
|
|
45
|
-
} }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) })
|
|
46
|
-
|
|
47
|
-
? "drop-shadow(0px 3px 5px rgba(16, 86, 82, 0.38))"
|
|
48
|
-
: "drop-shadow(0px 3px 5px rgba(145, 0, 35, 0.38))",
|
|
49
|
-
} }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) }), _jsx("div", { className: cn(scoreText), children: score })] }));
|
|
65
|
+
} }), _jsx(Cell, { fill: "rgba(255, 255, 255, 0)", ...cellStyles })] }) }) }), _jsx("div", { className: cn(scoreText), children: score })] }));
|
|
66
|
+
}
|
|
50
67
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Theme } from "../../interface";
|
|
2
2
|
import { Result } from "../Transcript";
|
|
3
|
-
export default function ResultGaugeCard({ result, theme, }: {
|
|
3
|
+
export default function ResultGaugeCard({ result, theme, noAnimation, }: {
|
|
4
4
|
result: Result;
|
|
5
5
|
theme: Theme;
|
|
6
|
+
noAnimation: boolean;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../../../../../util";
|
|
3
3
|
import { printBoxStyles } from "../atom/PrintBoxStyles";
|
|
4
4
|
import { CircularGauge } from "../molecule/CircularGauge";
|
|
5
|
-
export default function ResultGaugeCard({ result, theme, }) {
|
|
5
|
+
export default function ResultGaugeCard({ result, theme, noAnimation, }) {
|
|
6
6
|
const cardWrapper = {
|
|
7
7
|
displays: "flex flex-col self-auto flex-2 md:flex-1 overflow-hidden",
|
|
8
8
|
sizes: "w-full h-fit rounded-lg",
|
|
@@ -15,5 +15,5 @@ export default function ResultGaugeCard({ result, theme, }) {
|
|
|
15
15
|
bg: "bg-green-dark",
|
|
16
16
|
textStyles: "text-white font-medium text-sm",
|
|
17
17
|
};
|
|
18
|
-
return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsxs("div", { className: cn(cardTitle), children: [_jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uCDE8\uB4DD \uC810\uC218" }), _jsx("div", { className: "w-0.5 h-7 bg-white" }), _jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uC778\uC99D \uB4F1\uAE09" })] }), _jsxs("div", { className: "flex flex-row gap-10 p-5", children: [_jsx(CircularGauge, { score: result.score, maxScore: 100, isGrade: false, theme: theme }), _jsx(CircularGauge, { score: result.grade, maxScore: 9, isGrade: true, theme: theme })] })] }));
|
|
18
|
+
return (_jsxs("div", { className: cn(cardWrapper, printBoxStyles), children: [_jsxs("div", { className: cn(cardTitle), children: [_jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uCDE8\uB4DD \uC810\uC218" }), _jsx("div", { className: "w-0.5 h-7 bg-white" }), _jsx("div", { className: "w-full text-center h-full flex justify-center items-center", children: "\uC778\uC99D \uB4F1\uAE09" })] }), _jsxs("div", { className: "flex flex-row gap-10 p-5 w-full", children: [_jsx(CircularGauge, { score: result.score, maxScore: 100, isGrade: false, theme: theme, noAnimation: noAnimation }), _jsx(CircularGauge, { score: result.grade, maxScore: 9, isGrade: true, theme: theme, noAnimation: noAnimation })] })] }));
|
|
19
19
|
}
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.236
|