@tipp/ui 2.3.10 → 2.3.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/dist/app/index.cjs +46 -42
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +88 -88
- package/dist/app/platform/coach-question-list.js +31 -31
- package/dist/app/platform/contents-card.js +31 -31
- package/dist/app/platform/curriculum-card.js +5 -5
- package/dist/app/platform/edit-coaching-time.cjs +19 -15
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +70 -70
- package/dist/app/platform/edit-service-type.cjs +14 -10
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +71 -71
- package/dist/app/platform/goal-manage-card-edit.cjs +16 -12
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +70 -70
- package/dist/app/platform/goal-manage-card-read.js +31 -31
- package/dist/app/platform/on-offline-radio-card.cjs +111 -107
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +70 -70
- package/dist/app/platform/report-card.js +31 -31
- package/dist/app/platform/reservation-card.cjs +21 -17
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +71 -71
- package/dist/app/platform/session-card.cjs +25 -21
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +73 -73
- package/dist/app/platform/session-review-simple-read.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +36 -36
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +31 -31
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +31 -31
- package/dist/app/platform/userInfos/session-user-info-detail.js +31 -31
- package/dist/app/platform/userInfos/utils.js +30 -30
- package/dist/atoms/bullet-text.js +2 -2
- package/dist/atoms/dialog.js +2 -2
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.js +62 -62
- package/dist/atoms/list.js +2 -2
- package/dist/atoms/pagination.js +3 -3
- package/dist/chunk-2QFLNAGL.js +100 -0
- package/dist/chunk-2QFLNAGL.js.map +1 -0
- package/dist/chunk-3FKAH2RB.js +105 -0
- package/dist/chunk-3FKAH2RB.js.map +1 -0
- package/dist/chunk-3OCAVV5Z.js +151 -0
- package/dist/chunk-3OCAVV5Z.js.map +1 -0
- package/dist/chunk-3PE6OFB3.js +70 -0
- package/dist/chunk-3PE6OFB3.js.map +1 -0
- package/dist/chunk-3QNIJCKK.js +98 -0
- package/dist/chunk-3QNIJCKK.js.map +1 -0
- package/dist/chunk-4OFVNWKB.js +100 -0
- package/dist/chunk-4OFVNWKB.js.map +1 -0
- package/dist/chunk-4SSWZQPC.js +89 -0
- package/dist/chunk-4SSWZQPC.js.map +1 -0
- package/dist/chunk-5JUYOJVM.js +77 -0
- package/dist/chunk-5JUYOJVM.js.map +1 -0
- package/dist/chunk-5SECMWKA.js +196 -0
- package/dist/chunk-5SECMWKA.js.map +1 -0
- package/dist/chunk-65FJZWXV.js +49 -0
- package/dist/chunk-65FJZWXV.js.map +1 -0
- package/dist/chunk-7UUHYDMJ.js +43 -0
- package/dist/chunk-7UUHYDMJ.js.map +1 -0
- package/dist/chunk-B5W5HY62.js +196 -0
- package/dist/chunk-B5W5HY62.js.map +1 -0
- package/dist/chunk-B63TOIOA.js +29 -0
- package/dist/chunk-B63TOIOA.js.map +1 -0
- package/dist/chunk-DTUYT5S2.js +98 -0
- package/dist/chunk-DTUYT5S2.js.map +1 -0
- package/dist/chunk-EI232M7E.js +196 -0
- package/dist/chunk-EI232M7E.js.map +1 -0
- package/dist/chunk-FDJPEXOU.js +222 -0
- package/dist/chunk-FDJPEXOU.js.map +1 -0
- package/dist/chunk-FGBFER5X.js +196 -0
- package/dist/chunk-FGBFER5X.js.map +1 -0
- package/dist/chunk-FNRYQLCC.js +64 -0
- package/dist/chunk-FNRYQLCC.js.map +1 -0
- package/dist/chunk-G7EN5QQR.js +64 -0
- package/dist/chunk-G7EN5QQR.js.map +1 -0
- package/dist/chunk-GDCDEPJO.js +64 -0
- package/dist/chunk-GDCDEPJO.js.map +1 -0
- package/dist/chunk-HHZ4HLP6.js +221 -0
- package/dist/chunk-HHZ4HLP6.js.map +1 -0
- package/dist/chunk-I4OEBZDH.js +64 -0
- package/dist/chunk-I4OEBZDH.js.map +1 -0
- package/dist/chunk-I5NKMQOT.js +64 -0
- package/dist/chunk-I5NKMQOT.js.map +1 -0
- package/dist/chunk-J5IKAPJM.js +69 -0
- package/dist/chunk-J5IKAPJM.js.map +1 -0
- package/dist/chunk-JJQM3MW3.js +98 -0
- package/dist/chunk-JJQM3MW3.js.map +1 -0
- package/dist/chunk-JKJUBJ65.js +70 -0
- package/dist/chunk-JKJUBJ65.js.map +1 -0
- package/dist/chunk-KLIEFXWN.js +100 -0
- package/dist/chunk-KLIEFXWN.js.map +1 -0
- package/dist/chunk-NDC72OWR.js +37 -0
- package/dist/chunk-NDC72OWR.js.map +1 -0
- package/dist/chunk-NMGLSEZ3.js +152 -0
- package/dist/chunk-NMGLSEZ3.js.map +1 -0
- package/dist/chunk-NMKIFFKE.js +63 -0
- package/dist/chunk-NMKIFFKE.js.map +1 -0
- package/dist/chunk-NMRNR5OA.js +221 -0
- package/dist/chunk-NMRNR5OA.js.map +1 -0
- package/dist/chunk-OX4OPOPI.js +82 -0
- package/dist/chunk-OX4OPOPI.js.map +1 -0
- package/dist/chunk-POFUBAXM.js +77 -0
- package/dist/chunk-POFUBAXM.js.map +1 -0
- package/dist/chunk-QBBF5V24.js +70 -0
- package/dist/chunk-QBBF5V24.js.map +1 -0
- package/dist/chunk-QMPSKZJ2.js +221 -0
- package/dist/chunk-QMPSKZJ2.js.map +1 -0
- package/dist/chunk-QPTWBPAQ.js +87 -0
- package/dist/chunk-QPTWBPAQ.js.map +1 -0
- package/dist/chunk-R7NTFLYB.js +98 -0
- package/dist/chunk-R7NTFLYB.js.map +1 -0
- package/dist/chunk-RAK5LEBO.js +70 -0
- package/dist/chunk-RAK5LEBO.js.map +1 -0
- package/dist/chunk-RWXNQPE7.js +151 -0
- package/dist/chunk-RWXNQPE7.js.map +1 -0
- package/dist/chunk-SGJFPJMV.js +100 -0
- package/dist/chunk-SGJFPJMV.js.map +1 -0
- package/dist/chunk-SYUWHIFX.js +98 -0
- package/dist/chunk-SYUWHIFX.js.map +1 -0
- package/dist/chunk-TDBCQSTJ.js +61 -0
- package/dist/chunk-TDBCQSTJ.js.map +1 -0
- package/dist/chunk-TGCLWLPY.js +51 -0
- package/dist/chunk-TGCLWLPY.js.map +1 -0
- package/dist/chunk-UFWZAT6E.js +89 -0
- package/dist/chunk-UFWZAT6E.js.map +1 -0
- package/dist/chunk-VN7IU4XW.js +64 -0
- package/dist/chunk-VN7IU4XW.js.map +1 -0
- package/dist/chunk-W3NTNHA4.js +196 -0
- package/dist/chunk-W3NTNHA4.js.map +1 -0
- package/dist/chunk-WGQGVPGZ.js +222 -0
- package/dist/chunk-WGQGVPGZ.js.map +1 -0
- package/dist/chunk-XDPRIBTV.js +101 -0
- package/dist/chunk-XDPRIBTV.js.map +1 -0
- package/dist/chunk-XU7H43IG.js +196 -0
- package/dist/chunk-XU7H43IG.js.map +1 -0
- package/dist/chunk-YEGT662X.js +221 -0
- package/dist/chunk-YEGT662X.js.map +1 -0
- package/dist/chunk-ZBZ7IGBT.js +222 -0
- package/dist/chunk-ZBZ7IGBT.js.map +1 -0
- package/dist/chunk-ZFWZAZPG.js +153 -0
- package/dist/chunk-ZFWZAZPG.js.map +1 -0
- package/dist/context/index.js +5 -5
- package/dist/index.cjs +148 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +17 -11
- package/dist/index.js +137 -137
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +18 -18
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +11 -11
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-header.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-layout.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +6 -6
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +5 -5
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +21 -21
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +6 -6
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +24 -24
- package/dist/molecules/curriculumV2/CurriculumContents/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +28 -28
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-item-title.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.cjs +54 -17
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +8 -8
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +5 -5
- package/dist/molecules/curriculumV2/curriculum-context.cjs +29 -21
- package/dist/molecules/curriculumV2/curriculum-context.cjs.map +1 -1
- package/dist/molecules/curriculumV2/curriculum-context.d.cts +7 -1
- package/dist/molecules/curriculumV2/curriculum-context.d.ts +7 -1
- package/dist/molecules/curriculumV2/curriculum-context.js +1 -1
- package/dist/molecules/curriculumV2/curriculum-sub-nav.cjs.map +1 -1
- package/dist/molecules/curriculumV2/curriculum-sub-nav.js +5 -5
- package/dist/molecules/curriculumV2/curriculum-v2-layout.js +2 -2
- package/dist/molecules/curriculumV2/index.cjs +85 -38
- package/dist/molecules/curriculumV2/index.cjs.map +1 -1
- package/dist/molecules/curriculumV2/index.js +35 -35
- package/dist/molecules/date-picker/date-picker-button.js +6 -6
- package/dist/molecules/date-picker/index.js +5 -5
- package/dist/molecules/download-card.js +2 -2
- package/dist/molecules/dynamic-field.js +5 -5
- package/dist/molecules/dynamic-form.js +6 -6
- package/dist/molecules/expand-table/index.cjs +4 -3
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +5 -5
- package/dist/molecules/force-refresh.js +2 -2
- package/dist/molecules/ghost-post.js +4 -4
- package/dist/molecules/index.cjs +253 -205
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +65 -65
- package/dist/molecules/learning-post.js +6 -6
- package/dist/molecules/navigation.js +3 -3
- package/dist/molecules/one-on-one-guide-list.js +3 -3
- package/dist/molecules/stepper.js +4 -4
- package/dist/molecules/tag-selector.js +5 -5
- package/package.json +3 -3
- package/src/molecules/curriculumV2/CurriculumSidebar/index.tsx +47 -13
- package/src/molecules/curriculumV2/curriculum-context.tsx +62 -39
- package/src/molecules/expand-table/index.tsx +13 -12
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Row
|
|
3
|
+
} from "./chunk-JCG2AUFJ.js";
|
|
4
|
+
import {
|
|
5
|
+
Spinner
|
|
6
|
+
} from "./chunk-FR2GDOU2.js";
|
|
7
|
+
import {
|
|
8
|
+
Pagination
|
|
9
|
+
} from "./chunk-SBJOKO35.js";
|
|
10
|
+
import {
|
|
11
|
+
Flex
|
|
12
|
+
} from "./chunk-25HMMI7R.js";
|
|
13
|
+
import {
|
|
14
|
+
TriangleArrowUpIcon
|
|
15
|
+
} from "./chunk-2O45FRFQ.js";
|
|
16
|
+
import {
|
|
17
|
+
TriangleArrowDownIcon
|
|
18
|
+
} from "./chunk-776WBOKL.js";
|
|
19
|
+
import {
|
|
20
|
+
Typo
|
|
21
|
+
} from "./chunk-PMJIFLDT.js";
|
|
22
|
+
|
|
23
|
+
// src/molecules/expand-table/index.tsx
|
|
24
|
+
import {
|
|
25
|
+
flexRender,
|
|
26
|
+
getCoreRowModel,
|
|
27
|
+
useReactTable,
|
|
28
|
+
getSortedRowModel,
|
|
29
|
+
createColumnHelper,
|
|
30
|
+
getPaginationRowModel
|
|
31
|
+
} from "@tanstack/react-table";
|
|
32
|
+
import { useCallback, useMemo, useState } from "react";
|
|
33
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
|
+
var sortButtonColorMapper = {
|
|
35
|
+
card: {
|
|
36
|
+
selected: "var(--iris-10)",
|
|
37
|
+
unselected: "var(--iris-6)"
|
|
38
|
+
},
|
|
39
|
+
sprite: {
|
|
40
|
+
// selected: 'var(--gray-a12)',
|
|
41
|
+
// unselected: 'var(--gray-a6)',
|
|
42
|
+
selected: "var(--iris-10)",
|
|
43
|
+
unselected: "var(--iris-6)"
|
|
44
|
+
},
|
|
45
|
+
"sprite-border": {
|
|
46
|
+
selected: "var(--iris-10)",
|
|
47
|
+
unselected: "var(--iris-6)"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function ExpandTable(props) {
|
|
51
|
+
const {
|
|
52
|
+
data,
|
|
53
|
+
columns,
|
|
54
|
+
ExpandComp,
|
|
55
|
+
placeholder,
|
|
56
|
+
onRowClick,
|
|
57
|
+
tableStyle,
|
|
58
|
+
showPagination = true,
|
|
59
|
+
isLoading,
|
|
60
|
+
pageIndex = 0,
|
|
61
|
+
pageSize = 10,
|
|
62
|
+
siblingCount = 2,
|
|
63
|
+
getRowStyle,
|
|
64
|
+
getCellStyle,
|
|
65
|
+
variant = "card"
|
|
66
|
+
} = props;
|
|
67
|
+
const defaultAlign = "left";
|
|
68
|
+
const [pagination, setPagination] = useState({
|
|
69
|
+
pageIndex: pageIndex || 0,
|
|
70
|
+
pageSize: pageSize || 9999
|
|
71
|
+
});
|
|
72
|
+
const [sorting, setSorting] = useState([]);
|
|
73
|
+
const { getRowModel, getHeaderGroups, setPageIndex } = useReactTable({
|
|
74
|
+
data: data || [],
|
|
75
|
+
columns,
|
|
76
|
+
getCoreRowModel: getCoreRowModel(),
|
|
77
|
+
getSortedRowModel: getSortedRowModel(),
|
|
78
|
+
state: {
|
|
79
|
+
sorting,
|
|
80
|
+
pagination
|
|
81
|
+
},
|
|
82
|
+
onSortingChange: setSorting,
|
|
83
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
84
|
+
onPaginationChange: setPagination
|
|
85
|
+
});
|
|
86
|
+
const gridTemplateColumns = useMemo(() => {
|
|
87
|
+
return columns.map((col) => {
|
|
88
|
+
var _a;
|
|
89
|
+
if ((_a = col.meta) == null ? void 0 : _a.autoSize) return `minmax(${col.size || 50}px, 1fr)`;
|
|
90
|
+
return `${col.size || 150}px`;
|
|
91
|
+
}).join(" ");
|
|
92
|
+
}, [columns]);
|
|
93
|
+
const rowModels = getRowModel();
|
|
94
|
+
const onChangePagination = useCallback(
|
|
95
|
+
(page) => {
|
|
96
|
+
setPageIndex(page - 1);
|
|
97
|
+
},
|
|
98
|
+
[setPageIndex]
|
|
99
|
+
);
|
|
100
|
+
const helpCompRender = useCallback(
|
|
101
|
+
(rowLength) => {
|
|
102
|
+
if (isLoading) {
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
Flex,
|
|
105
|
+
{
|
|
106
|
+
align: "center",
|
|
107
|
+
height: "100%",
|
|
108
|
+
justify: "center",
|
|
109
|
+
p: "5",
|
|
110
|
+
width: "100%",
|
|
111
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
if (rowLength === 0) {
|
|
116
|
+
return /* @__PURE__ */ jsx("div", { className: "tr", children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", children: placeholder || /* @__PURE__ */ jsx(Typo, { color: "gray", mb: "6", mt: "6", variant: "body", children: "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }) }) }, "expand_placeholder");
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
},
|
|
120
|
+
[isLoading, placeholder]
|
|
121
|
+
);
|
|
122
|
+
const pageCount = useMemo(() => {
|
|
123
|
+
if (!data) return 0;
|
|
124
|
+
return Math.ceil(data.length / pageSize);
|
|
125
|
+
}, [data, pageSize]);
|
|
126
|
+
return /* @__PURE__ */ jsxs("div", { className: `expand-table-wrapper ${variant}`, children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "expand-table", style: tableStyle, children: [
|
|
128
|
+
/* @__PURE__ */ jsx("div", { className: "thead", children: getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
className: "tr",
|
|
132
|
+
style: { gridTemplateColumns },
|
|
133
|
+
children: headerGroup.headers.map((header) => {
|
|
134
|
+
var _a;
|
|
135
|
+
const sortable = header.column.getCanSort();
|
|
136
|
+
const sortedState = header.column.getIsSorted();
|
|
137
|
+
const justifyContent = ((_a = header.column.columnDef.meta) == null ? void 0 : _a.align) || defaultAlign;
|
|
138
|
+
if (sortable) {
|
|
139
|
+
return /* @__PURE__ */ jsx("div", { className: `${justifyContent} th`, children: /* @__PURE__ */ jsxs(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
143
|
+
style: { cursor: "pointer" },
|
|
144
|
+
type: "button",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsx(Typo, { as: "div", variant: "body", children: flexRender(
|
|
147
|
+
header.column.columnDef.header,
|
|
148
|
+
header.getContext()
|
|
149
|
+
) }),
|
|
150
|
+
/* @__PURE__ */ jsxs(
|
|
151
|
+
Flex,
|
|
152
|
+
{
|
|
153
|
+
direction: "column",
|
|
154
|
+
style: { marginLeft: "var(--space-2)" },
|
|
155
|
+
children: [
|
|
156
|
+
sortedState === false && /* @__PURE__ */ jsx(
|
|
157
|
+
TriangleArrowDownIcon,
|
|
158
|
+
{
|
|
159
|
+
color: sortButtonColorMapper[variant].unselected
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
sortedState === "asc" && /* @__PURE__ */ jsx(
|
|
163
|
+
TriangleArrowUpIcon,
|
|
164
|
+
{
|
|
165
|
+
color: sortButtonColorMapper[variant].selected
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
sortedState === "desc" && /* @__PURE__ */ jsx(
|
|
169
|
+
TriangleArrowDownIcon,
|
|
170
|
+
{
|
|
171
|
+
color: sortButtonColorMapper[variant].selected
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
) }, header.id);
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ jsx("div", { className: `${justifyContent} th`, children: /* @__PURE__ */ jsx("div", { style: { cursor: "default" }, children: /* @__PURE__ */ jsx(Typo, { as: "div", variant: "body", children: flexRender(
|
|
182
|
+
header.column.columnDef.header,
|
|
183
|
+
header.getContext()
|
|
184
|
+
) }) }) }, header.id);
|
|
185
|
+
})
|
|
186
|
+
},
|
|
187
|
+
headerGroup.id
|
|
188
|
+
)) }),
|
|
189
|
+
/* @__PURE__ */ jsx("div", { className: "tbody", children: helpCompRender(rowModels.rows.length) || rowModels.rows.map((row) => {
|
|
190
|
+
return /* @__PURE__ */ jsx(
|
|
191
|
+
Row,
|
|
192
|
+
{
|
|
193
|
+
ExpandComp,
|
|
194
|
+
defaultAlign,
|
|
195
|
+
getCellStyle,
|
|
196
|
+
getRowStyle,
|
|
197
|
+
gridTemplateColumns,
|
|
198
|
+
onRowClick,
|
|
199
|
+
row
|
|
200
|
+
},
|
|
201
|
+
`row_${row.id}`
|
|
202
|
+
);
|
|
203
|
+
}) })
|
|
204
|
+
] }),
|
|
205
|
+
showPagination ? /* @__PURE__ */ jsx(Flex, { justify: "end", pt: "4", width: "100%", children: /* @__PURE__ */ jsx(
|
|
206
|
+
Pagination,
|
|
207
|
+
{
|
|
208
|
+
count: pageCount,
|
|
209
|
+
onChange: onChangePagination,
|
|
210
|
+
page: pagination.pageIndex + 1,
|
|
211
|
+
siblingCount
|
|
212
|
+
}
|
|
213
|
+
) }) : null
|
|
214
|
+
] });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export {
|
|
218
|
+
createColumnHelper,
|
|
219
|
+
ExpandTable
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=chunk-QMPSKZJ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/expand-table/index.tsx"],"sourcesContent":["import type {\n ColumnDef,\n SortingState,\n RowData,\n Row as RowType,\n PaginationState,\n} from '@tanstack/react-table';\nimport type { CSSProperties } from 'react';\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n getSortedRowModel,\n createColumnHelper,\n getPaginationRowModel,\n} from '@tanstack/react-table';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Flex } from '@/atoms/flex';\nimport { Pagination } from '@/atoms/pagination';\nimport { Spinner } from '@/atoms/spinner';\nimport { Typo } from '@/atoms/typo';\nimport { TriangleArrowDownIcon } from '../../icons/down';\nimport { TriangleArrowUpIcon } from '../../icons/up';\nimport { Row, type ExpandComp, type OnRowClick } from './row';\n\nexport type { ExpandComp, OnRowClick, ColumnDef, RowType as Row };\nexport { createColumnHelper };\n\n\ntype Variant = 'card' | 'sprite' | 'sprite-border';\nconst sortButtonColorMapper: Record<Variant, { selected: string; unselected: string }> = {\n card: {\n selected: 'var(--iris-10)',\n unselected: 'var(--iris-6)',\n },\n sprite: {\n // selected: 'var(--gray-a12)',\n // unselected: 'var(--gray-a6)',\n selected: 'var(--iris-10)',\n unselected: 'var(--iris-6)',\n },\n 'sprite-border': {\n selected: 'var(--iris-10)',\n unselected: 'var(--iris-6)',\n },\n};\n\nexport interface ExpandTableProps<Datum extends RowData> {\n /** 렌더할 데이터 배열 */\n data?: Datum[];\n /** 테이블 컬럼의 메타 데이터 */\n columns: ColumnDef<Datum>[];\n /** Row의 open이 true인 경우 하단의 collapse에 렌더할 컴포넌트 */\n ExpandComp?: ExpandComp<Datum>;\n /** 데이테가 없을 시 화면에 표시할 컴포넌트 */\n placeholder?: React.ReactNode;\n /** 행 클릭 시 실행할 콜백 */\n onRowClick?: OnRowClick<Datum>;\n getRowStyle?: (data: Datum) => CSSProperties;\n getCellStyle?: (data: Datum) => CSSProperties;\n tableStyle?: CSSProperties;\n isLoading?: boolean;\n\n /** pagination - 표시 유무, 기본값 true */\n showPagination?: boolean;\n /** pagination - 현재 선택된 페이지, 0부터 시작 */\n pageIndex?: number;\n /** pagination - 한 페이지에 표시될 컬럼 개수, 기본값 10 */\n pageSize?: number;\n /** pagination - */\n siblingCount?: number;\n variant?: Variant;\n}\n\nexport function ExpandTable<Datum extends RowData>(\n props: ExpandTableProps<Datum>\n): React.ReactNode {\n const {\n data,\n columns,\n ExpandComp,\n placeholder,\n onRowClick,\n tableStyle,\n showPagination = true,\n isLoading,\n pageIndex = 0,\n pageSize = 10,\n siblingCount = 2,\n getRowStyle,\n getCellStyle,\n variant = 'card',\n } = props;\n const defaultAlign = 'left';\n const [pagination, setPagination] = useState<PaginationState>({\n pageIndex: pageIndex || 0,\n pageSize: pageSize || 9999,\n });\n\n const [sorting, setSorting] = useState<SortingState>([]);\n const { getRowModel, getHeaderGroups, setPageIndex } = useReactTable({\n data: data || [],\n columns,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n sorting,\n pagination,\n },\n onSortingChange: setSorting,\n getPaginationRowModel: getPaginationRowModel(),\n onPaginationChange: setPagination,\n });\n\n const gridTemplateColumns = useMemo<string>(() => {\n return columns\n .map((col) => {\n if (col.meta?.autoSize) return `minmax(${col.size || 50}px, 1fr)`;\n return `${col.size || 150}px`;\n })\n .join(' ');\n }, [columns]);\n\n const rowModels = getRowModel();\n\n const onChangePagination = useCallback(\n (page: number) => {\n setPageIndex(page - 1);\n },\n [setPageIndex]\n );\n\n const helpCompRender = useCallback(\n (rowLength: number) => {\n if (isLoading) {\n return (\n <Flex\n align=\"center\"\n height=\"100%\"\n justify=\"center\"\n p=\"5\"\n width=\"100%\"\n >\n <Spinner />\n </Flex>\n );\n }\n if (rowLength === 0) {\n return (\n <div className=\"tr\" key=\"expand_placeholder\">\n <Flex align=\"center\" justify=\"center\">\n {placeholder || (\n <Typo color=\"gray\" mb=\"6\" mt=\"6\" variant=\"body\">\n 데이터가 없습니다\n </Typo>\n )}\n </Flex>\n </div>\n );\n }\n return null;\n },\n [isLoading, placeholder]\n );\n\n const pageCount = useMemo(() => {\n if (!data) return 0;\n return Math.ceil(data.length / pageSize);\n }, [data, pageSize]);\n\n return (\n <div className={`expand-table-wrapper ${variant}`}>\n <div className=\"expand-table\" style={tableStyle}>\n <div className=\"thead\">\n {getHeaderGroups().map((headerGroup) => (\n <div\n className=\"tr\"\n key={headerGroup.id}\n style={{ gridTemplateColumns }}\n >\n {headerGroup.headers.map((header) => {\n const sortable = header.column.getCanSort();\n const sortedState = header.column.getIsSorted();\n const justifyContent =\n header.column.columnDef.meta?.align || defaultAlign;\n\n if (sortable) {\n return (\n <div className={`${justifyContent} th`} key={header.id}>\n <button\n onClick={header.column.getToggleSortingHandler()}\n style={{ cursor: 'pointer' }}\n type=\"button\"\n >\n <Typo as=\"div\" variant=\"body\">\n {flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </Typo>\n <Flex\n direction=\"column\"\n style={{ marginLeft: 'var(--space-2)' }}\n >\n {sortedState === false && (\n <TriangleArrowDownIcon\n color={sortButtonColorMapper[variant].unselected}\n />\n )}\n {sortedState === 'asc' && (\n <TriangleArrowUpIcon\n color={sortButtonColorMapper[variant].selected}\n />\n )}\n {sortedState === 'desc' && (\n <TriangleArrowDownIcon\n color={sortButtonColorMapper[variant].selected}\n />\n )}\n </Flex>\n </button>\n </div>\n );\n }\n\n return (\n <div className={`${justifyContent} th`} key={header.id}>\n <div style={{ cursor: 'default' }}>\n <Typo as=\"div\" variant=\"body\">\n {flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </Typo>\n </div>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n <div className=\"tbody\">\n {/* 조건에 따라 placeholder 또는 loading 렌더*/}\n {helpCompRender(rowModels.rows.length) ||\n rowModels.rows.map((row) => {\n return (\n <Row\n ExpandComp={ExpandComp}\n defaultAlign={defaultAlign}\n getCellStyle={getCellStyle}\n getRowStyle={getRowStyle}\n gridTemplateColumns={gridTemplateColumns}\n key={`row_${row.id}`}\n onRowClick={onRowClick}\n row={row}\n />\n );\n })}\n </div>\n </div>\n {showPagination ? (\n <Flex justify=\"end\" pt=\"4\" width=\"100%\">\n <Pagination\n count={pageCount}\n onChange={onChangePagination}\n page={pagination.pageIndex + 1}\n siblingCount={siblingCount}\n />\n </Flex>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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ACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA;AAAA,YACA;AAAA;AAAA,UAFK,OAAO,IAAI,EAAE;AAAA,QAGpB;AAAA,MAEJ,CAAC,GACL;AAAA,OACF;AAAA,IACC,iBACC,oBAAC,QAAK,SAAQ,OAAM,IAAG,KAAI,OAAM,QAC/B;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,UAAU;AAAA,QACV,MAAM,WAAW,YAAY;AAAA,QAC7B;AAAA;AAAA,IACF,GACF,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReviewQuestionContentHeader
|
|
3
|
+
} from "./chunk-7UUHYDMJ.js";
|
|
4
|
+
import {
|
|
5
|
+
TextArea
|
|
6
|
+
} from "./chunk-5XYPLDI5.js";
|
|
7
|
+
import {
|
|
8
|
+
Grid
|
|
9
|
+
} from "./chunk-EGEQY3KT.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Callout
|
|
18
|
+
} from "./chunk-B6XJN6EC.js";
|
|
19
|
+
import {
|
|
20
|
+
Card
|
|
21
|
+
} from "./chunk-RP2RGCAW.js";
|
|
22
|
+
import {
|
|
23
|
+
BellIcon
|
|
24
|
+
} from "./chunk-W5TPOFOO.js";
|
|
25
|
+
|
|
26
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.tsx
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
function ReviewQuestionText(props) {
|
|
29
|
+
const { question, answer, onChange } = props;
|
|
30
|
+
const minLengthNotMet = question.minLength && answer.length < question.minLength;
|
|
31
|
+
const remainingLength = question.minLength && answer.length < question.minLength ? question.minLength - answer.length : 0;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Card,
|
|
34
|
+
{
|
|
35
|
+
size: "2",
|
|
36
|
+
style: {
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "100%"
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "1fr auto", children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "auto 1fr", width: "100%", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
ReviewQuestionContentHeader,
|
|
44
|
+
{
|
|
45
|
+
icon: question.icon,
|
|
46
|
+
question: question.question,
|
|
47
|
+
title: question.title,
|
|
48
|
+
type: question.type
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
TextArea,
|
|
53
|
+
{
|
|
54
|
+
mt: "2",
|
|
55
|
+
onChange: (e) => {
|
|
56
|
+
onChange(e.target.value);
|
|
57
|
+
},
|
|
58
|
+
placeholder: question.placeholder,
|
|
59
|
+
value: answer
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] }),
|
|
63
|
+
minLengthNotMet ? /* @__PURE__ */ jsxs(Box, { mt: "2", children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Typo, { align: "right", as: "p", color: "red", variant: "caption", children: `${remainingLength}\uC790 \uB354 \uC791\uC131\uD574\uC8FC\uC138\uC694.` }),
|
|
65
|
+
question.minLengthInfoMessage ? /* @__PURE__ */ jsxs(
|
|
66
|
+
Callout.Root,
|
|
67
|
+
{
|
|
68
|
+
color: "iris",
|
|
69
|
+
mt: "2",
|
|
70
|
+
style: { alignItems: "center" },
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(BellIcon, {}) }),
|
|
73
|
+
/* @__PURE__ */ jsx(Callout.Text, { children: /* @__PURE__ */ jsx(Typo, { as: "p", variant: "caption", children: question.minLengthInfoMessage }) })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
77
|
+
] }) : null
|
|
78
|
+
] })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
var review_question_text_default = ReviewQuestionText;
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
review_question_text_default
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-QPTWBPAQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@/atoms/box';\nimport { Card } from '@/atoms/card';\nimport { Grid } from '@/atoms/grid';\nimport { TextArea } from '@/atoms/text-area';\nimport { Typo } from '@/atoms/typo';\nimport { BellIcon } from '@/icon';\nimport { type CurriculumReviewQuestionText } from '@/types/curriculumContents.type';\nimport { Callout } from '@/atoms/call-out';\nimport { ReviewQuestionContentHeader } from './review-comp';\n\ninterface ReviewQuestionTextProps {\n question: CurriculumReviewQuestionText;\n answer: string;\n error?: string;\n onChange: (value: string) => void;\n}\n\nfunction ReviewQuestionText(props: ReviewQuestionTextProps): React.ReactNode {\n const { question, answer, onChange } = props;\n\n const minLengthNotMet =\n question.minLength && answer.length < question.minLength;\n\n const remainingLength =\n question.minLength && answer.length < question.minLength\n ? question.minLength - answer.length\n : 0;\n\n return (\n <Card\n size=\"2\"\n style={{\n width: '100%',\n height: '100%',\n }}\n >\n <Grid height=\"100%\" rows=\"1fr auto\">\n <Grid height=\"100%\" rows=\"auto 1fr\" width=\"100%\">\n <ReviewQuestionContentHeader\n icon={question.icon}\n question={question.question}\n title={question.title}\n type={question.type}\n />\n\n <TextArea\n mt=\"2\"\n onChange={(e) => {\n onChange(e.target.value);\n }}\n placeholder={question.placeholder}\n value={answer}\n />\n </Grid>\n {minLengthNotMet ? (\n <Box mt=\"2\">\n <Typo align=\"right\" as=\"p\" color=\"red\" variant=\"caption\">\n {`${remainingLength}자 더 작성해주세요.`}\n </Typo>\n {question.minLengthInfoMessage ? (\n <Callout.Root\n color=\"iris\"\n mt=\"2\"\n style={{ alignItems: 'center' }}\n >\n <Callout.Icon>\n <BellIcon />\n </Callout.Icon>\n <Callout.Text>\n <Typo as=\"p\" variant=\"caption\">\n {question.minLengthInfoMessage}\n </Typo>\n </Callout.Text>\n </Callout.Root>\n ) : null}\n </Box>\n ) : null}\n </Grid>\n </Card>\n );\n}\n\nexport default ReviewQuestionText;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsCQ,SACE,KADF;AApBR,SAAS,mBAAmB,OAAiD;AAC3E,QAAM,EAAE,UAAU,QAAQ,SAAS,IAAI;AAEvC,QAAM,kBACJ,SAAS,aAAa,OAAO,SAAS,SAAS;AAEjD,QAAM,kBACJ,SAAS,aAAa,OAAO,SAAS,SAAS,YAC3C,SAAS,YAAY,OAAO,SAC5B;AAEN,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MAEA,+BAAC,QAAK,QAAO,QAAO,MAAK,YACvB;AAAA,6BAAC,QAAK,QAAO,QAAO,MAAK,YAAW,OAAM,QACxC;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,SAAS;AAAA,cACf,UAAU,SAAS;AAAA,cACnB,OAAO,SAAS;AAAA,cAChB,MAAM,SAAS;AAAA;AAAA,UACjB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC,IAAG;AAAA,cACH,UAAU,CAAC,MAAM;AACf,yBAAS,EAAE,OAAO,KAAK;AAAA,cACzB;AAAA,cACA,aAAa,SAAS;AAAA,cACtB,OAAO;AAAA;AAAA,UACT;AAAA,WACF;AAAA,QACC,kBACC,qBAAC,OAAI,IAAG,KACN;AAAA,8BAAC,QAAK,OAAM,SAAQ,IAAG,KAAI,OAAM,OAAM,SAAQ,WAC5C,aAAG,eAAe,uDACrB;AAAA,UACC,SAAS,uBACR;AAAA,YAAC,QAAQ;AAAA,YAAR;AAAA,cACC,OAAM;AAAA,cACN,IAAG;AAAA,cACH,OAAO,EAAE,YAAY,SAAS;AAAA,cAE9B;AAAA,oCAAC,QAAQ,MAAR,EACC,8BAAC,YAAS,GACZ;AAAA,gBACA,oBAAC,QAAQ,MAAR,EACC,8BAAC,QAAK,IAAG,KAAI,SAAQ,WAClB,mBAAS,sBACZ,GACF;AAAA;AAAA;AAAA,UACF,IACE;AAAA,WACN,IACE;AAAA,SACN;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,+BAAQ;","names":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sidebar_item_default
|
|
3
|
+
} from "./chunk-KTUCYAG7.js";
|
|
4
|
+
import {
|
|
5
|
+
useCurriculumContext
|
|
6
|
+
} from "./chunk-ZFWZAZPG.js";
|
|
7
|
+
import {
|
|
8
|
+
Tabs
|
|
9
|
+
} from "./chunk-5ZITU5L7.js";
|
|
10
|
+
import {
|
|
11
|
+
Grid
|
|
12
|
+
} from "./chunk-EGEQY3KT.js";
|
|
13
|
+
import {
|
|
14
|
+
Box
|
|
15
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/curriculumV2/CurriculumSidebar/index.tsx
|
|
18
|
+
import { useMemo } from "react";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var TAB_LIST = [
|
|
21
|
+
{
|
|
22
|
+
label: "\uAC15\uC758 \uBAA9\uCC28",
|
|
23
|
+
value: "curriculum"
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
var TABS_LIST_STYLE = {
|
|
27
|
+
padding: "0 var(--space-3)"
|
|
28
|
+
};
|
|
29
|
+
var TABS_CONTENT_STYLE = {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
height: "100%",
|
|
32
|
+
width: "100%"
|
|
33
|
+
};
|
|
34
|
+
function CurriculumSidebar() {
|
|
35
|
+
const {
|
|
36
|
+
curriculum,
|
|
37
|
+
selectedIndex,
|
|
38
|
+
setSelectedIndex,
|
|
39
|
+
scrollAreaRef,
|
|
40
|
+
curriculumCompleteMap,
|
|
41
|
+
customTabs
|
|
42
|
+
} = useCurriculumContext();
|
|
43
|
+
const list = curriculum.contents.list;
|
|
44
|
+
const tabList = useMemo(() => {
|
|
45
|
+
return [...TAB_LIST, ...customTabs != null ? customTabs : []];
|
|
46
|
+
}, [customTabs]);
|
|
47
|
+
return /* @__PURE__ */ jsx(Tabs.Root, { asChild: true, defaultValue: TAB_LIST[0].value, children: /* @__PURE__ */ jsxs(Grid, { height: "100%", overflowY: "auto", rows: "auto 1fr ", width: "100%", children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Tabs.List, { style: TABS_LIST_STYLE, children: tabList.map((tab) => /* @__PURE__ */ jsx(Tabs.Trigger, { value: tab.value, children: tab.label }, tab.value)) }),
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
50
|
+
Box,
|
|
51
|
+
{
|
|
52
|
+
height: "100%",
|
|
53
|
+
overflowY: "auto",
|
|
54
|
+
position: "relative",
|
|
55
|
+
ref: scrollAreaRef,
|
|
56
|
+
width: "100%",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(
|
|
59
|
+
Tabs.Content,
|
|
60
|
+
{
|
|
61
|
+
style: TABS_CONTENT_STYLE,
|
|
62
|
+
value: TAB_LIST[0].value,
|
|
63
|
+
children: [
|
|
64
|
+
list.map((item, index) => /* @__PURE__ */ jsx(
|
|
65
|
+
sidebar_item_default,
|
|
66
|
+
{
|
|
67
|
+
done: curriculumCompleteMap[item.uuid],
|
|
68
|
+
index,
|
|
69
|
+
item,
|
|
70
|
+
selectedIndex,
|
|
71
|
+
setSelectedIndex
|
|
72
|
+
},
|
|
73
|
+
item.uuid
|
|
74
|
+
)),
|
|
75
|
+
/* @__PURE__ */ jsx(Box, { height: "150px" })
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
TAB_LIST[0].value
|
|
79
|
+
),
|
|
80
|
+
customTabs == null ? void 0 : customTabs.map((tab) => /* @__PURE__ */ jsx(
|
|
81
|
+
Tabs.Content,
|
|
82
|
+
{
|
|
83
|
+
style: TABS_CONTENT_STYLE,
|
|
84
|
+
value: tab.value,
|
|
85
|
+
children: tab.content
|
|
86
|
+
},
|
|
87
|
+
tab.value
|
|
88
|
+
))
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] }) });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
CurriculumSidebar
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=chunk-R7NTFLYB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumSidebar/index.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Box } from '@/atoms/box';\nimport { Grid } from '@/atoms/grid';\nimport { Tabs } from '@/atoms/tabs';\nimport { useCurriculumContext } from '../curriculum-context';\nimport SidebarItem from './sidebar-item';\n\nconst TAB_LIST = [\n {\n label: '강의 목차',\n value: 'curriculum',\n },\n];\n\nconst TABS_LIST_STYLE: React.CSSProperties = {\n padding: '0 var(--space-3)',\n};\n\nconst TABS_CONTENT_STYLE: React.CSSProperties = {\n position: 'absolute',\n height: '100%',\n width: '100%',\n};\n\n\nexport function CurriculumSidebar(): React.ReactNode {\n const {\n curriculum,\n selectedIndex,\n setSelectedIndex,\n scrollAreaRef,\n curriculumCompleteMap,\n customTabs,\n } = useCurriculumContext();\n const list = curriculum.contents.list;\n\n const tabList = useMemo(() => {\n return [...TAB_LIST, ...(customTabs ?? [])];\n }, [customTabs]);\n\n return (\n <Tabs.Root asChild defaultValue={TAB_LIST[0].value}>\n <Grid height=\"100%\" overflowY=\"auto\" rows=\"auto 1fr \" width=\"100%\">\n <Tabs.List style={TABS_LIST_STYLE}>\n {tabList.map((tab) => (\n <Tabs.Trigger key={tab.value} value={tab.value}>\n {tab.label}\n </Tabs.Trigger>\n ))}\n </Tabs.List>\n <Box\n height=\"100%\"\n overflowY=\"auto\"\n position=\"relative\"\n ref={scrollAreaRef}\n width=\"100%\"\n >\n <Tabs.Content\n key={TAB_LIST[0].value}\n style={TABS_CONTENT_STYLE}\n value={TAB_LIST[0].value}\n >\n {list.map((item, index) => (\n <SidebarItem\n done={curriculumCompleteMap[item.uuid]}\n index={index}\n item={item}\n key={item.uuid}\n selectedIndex={selectedIndex}\n setSelectedIndex={setSelectedIndex}\n />\n ))}\n <Box height=\"150px\" />\n </Tabs.Content>\n {customTabs?.map((tab) => (\n <Tabs.Content\n key={tab.value}\n style={TABS_CONTENT_STYLE}\n value={tab.value}\n >\n {tab.content}\n </Tabs.Content>\n ))}\n </Box>\n </Grid>\n </Tabs.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAe;AA6CnB,cAYF,YAZE;AAtCZ,IAAM,WAAW;AAAA,EACf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAEA,IAAM,kBAAuC;AAAA,EAC3C,SAAS;AACX;AAEA,IAAM,qBAA0C;AAAA,EAC9C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AACT;AAGO,SAAS,oBAAqC;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,qBAAqB;AACzB,QAAM,OAAO,WAAW,SAAS;AAEjC,QAAM,UAAU,QAAQ,MAAM;AAC5B,WAAO,CAAC,GAAG,UAAU,GAAI,kCAAc,CAAC,CAAE;AAAA,EAC5C,GAAG,CAAC,UAAU,CAAC;AAEf,SACE,oB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Y5Q.js";
|
|
10
|
+
import {
|
|
11
|
+
ResetIcon
|
|
12
|
+
} from "./chunk-W5TPOFOO.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.tsx
|
|
18
|
+
import { useMemo } from "react";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
function CurriculumAiTraning({
|
|
21
|
+
item
|
|
22
|
+
}) {
|
|
23
|
+
const { title, description, buttonTitle } = item;
|
|
24
|
+
const { curriculumCompleteMap, onActionButtonClick } = useCurriculumContext();
|
|
25
|
+
const done = useMemo(() => {
|
|
26
|
+
return Boolean(curriculumCompleteMap[item.uuid]);
|
|
27
|
+
}, [curriculumCompleteMap, item.uuid]);
|
|
28
|
+
const bgColor = done ? "var(--color-panel-solid)" : void 0;
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
Flex,
|
|
31
|
+
{
|
|
32
|
+
align: "center",
|
|
33
|
+
direction: "column",
|
|
34
|
+
height: "100%",
|
|
35
|
+
justify: "center",
|
|
36
|
+
style: {
|
|
37
|
+
backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_ai_bg.png)`,
|
|
38
|
+
backgroundPosition: "center",
|
|
39
|
+
backgroundSize: "cover",
|
|
40
|
+
backgroundRepeat: "no-repeat"
|
|
41
|
+
},
|
|
42
|
+
width: "100%",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Typo, { color: "gray", weight: "bold", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", as: "p", color: "gray", children: description }),
|
|
46
|
+
/* @__PURE__ */ jsxs(
|
|
47
|
+
Button,
|
|
48
|
+
{
|
|
49
|
+
mt: "3",
|
|
50
|
+
onClick: () => {
|
|
51
|
+
onActionButtonClick(item);
|
|
52
|
+
},
|
|
53
|
+
style: { minWidth: 232, backgroundColor: bgColor },
|
|
54
|
+
variant: done ? "outline" : "solid",
|
|
55
|
+
children: [
|
|
56
|
+
done ? "\uB2E4\uC2DC \uC5F0\uC2B5\uD558\uAE30" : buttonTitle || "\uC2DC\uC791\uD558\uAE30",
|
|
57
|
+
done ? /* @__PURE__ */ jsx(ResetIcon, {}) : null
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
var curriculum_ai_traning_default = CurriculumAiTraning;
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
curriculum_ai_traning_default
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=chunk-RAK5LEBO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport type { CurriculumAiTrainingContents } from '@/types/curriculumContents.type';\nimport { Button } from '@/atoms/button';\nimport { Flex } from '@/atoms/flex';\nimport { Typo } from '@/atoms/typo';\nimport { ResetIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\n\ninterface CurriculumAiTraningProps {\n item: CurriculumAiTrainingContents;\n}\n\nfunction CurriculumAiTraning({\n item,\n}: CurriculumAiTraningProps): React.ReactNode {\n const { title, description, buttonTitle } = item;\n const { curriculumCompleteMap, onActionButtonClick } = useCurriculumContext();\n\n const done = useMemo(() => {\n return Boolean(curriculumCompleteMap[item.uuid]);\n }, [curriculumCompleteMap, item.uuid]);\n\n const bgColor= done ? 'var(--color-panel-solid)' : undefined;\n\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n height=\"100%\"\n justify=\"center\"\n style={{\n backgroundImage: `url(https://tipp-coaching-live.s3.ap-northeast-2.amazonaws.com/images/curriculum_ai_bg.png)`,\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n backgroundRepeat: 'no-repeat',\n }}\n width=\"100%\"\n >\n <Typo color=\"gray\" weight=\"bold\">\n {title}\n </Typo>\n <Typo align=\"center\" as=\"p\" color=\"gray\">\n {description}\n </Typo>\n\n <Button\n mt=\"3\"\n onClick={() => { onActionButtonClick(item); }}\n style={{ minWidth: 232, backgroundColor: bgColor }}\n variant={done ? 'outline' : 'solid'}\n >\n {done ? '다시 연습하기' : buttonTitle || '시작하기'}\n {done ? <ResetIcon/> : null}\n </Button>\n \n </Flex>\n );\n}\n\nexport default CurriculumAiTraning;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAe;AAsCzB,cAOA,YAPA;AA1BN,SAAS,oBAAoB;AAAA,EAC3B;AACF,GAA8C;AAC5C,QAAM,EAAE,OAAO,aAAa,YAAY,IAAI;AAC5C,QAAM,EAAE,uBAAuB,oBAAoB,IAAI,qBAAqB;AAE5E,QAAM,OAAO,QAAQ,MAAM;AACzB,WAAO,QAAQ,sBAAsB,KAAK,IAAI,CAAC;AAAA,EACjD,GAAG,CAAC,uBAAuB,KAAK,IAAI,CAAC;AAErC,QAAM,UAAU,OAAO,6BAA6B;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,WAAU;AAAA,MACV,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,oBAAoB;AAAA,QACpB,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACpB;AAAA,MACA,OAAM;AAAA,MAEN;AAAA,4BAAC,QAAK,OAAM,QAAO,QAAO,QACvB,iBACH;AAAA,QACA,oBAAC,QAAK,OAAM,UAAS,IAAG,KAAI,OAAM,QAC/B,uBACH;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,SAAS,MAAM;AAAE,kCAAoB,IAAI;AAAA,YAAG;AAAA,YAC5C,OAAO,EAAE,UAAU,KAAK,iBAAiB,QAAQ;AAAA,YACjD,SAAS,OAAO,YAAY;AAAA,YAE3B;AAAA,qBAAO,0CAAY,eAAe;AAAA,cAClC,OAAO,oBAAC,aAAS,IAAK;AAAA;AAAA;AAAA,QACzB;AAAA;AAAA;AAAA,EAEF;AAEJ;AAEA,IAAO,gCAAQ;","names":[]}
|