@tipp/ui 2.3.13 → 2.3.15
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 +183 -160
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +80 -78
- package/dist/app/platform/coach-question-list.js +26 -26
- package/dist/app/platform/contents-card.js +26 -26
- package/dist/app/platform/curriculum-card.js +2 -2
- package/dist/app/platform/edit-coaching-time.cjs +40 -17
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +62 -60
- package/dist/app/platform/edit-service-type.cjs +42 -17
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +62 -60
- package/dist/app/platform/goal-manage-card-edit.cjs +48 -23
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +63 -61
- package/dist/app/platform/goal-manage-card-read.js +26 -26
- package/dist/app/platform/on-offline-radio-card.cjs +46 -23
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +62 -60
- package/dist/app/platform/report-card.js +26 -26
- package/dist/app/platform/reservation-card.cjs +59 -34
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +63 -61
- package/dist/app/platform/session-card.cjs +79 -56
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +63 -61
- package/dist/app/platform/session-review-simple-read.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +28 -28
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +25 -25
- package/dist/app/platform/userInfos/session-user-info-detail.js +25 -25
- package/dist/app/platform/userInfos/utils.js +25 -25
- package/dist/atoms/index.js +60 -60
- package/dist/chunk-2GWB6C4M.js +63 -0
- package/dist/chunk-2GWB6C4M.js.map +1 -0
- package/dist/chunk-3INEXJIV.js +37 -0
- package/dist/chunk-3INEXJIV.js.map +1 -0
- package/dist/chunk-3RTIQ36S.js +222 -0
- package/dist/chunk-3RTIQ36S.js.map +1 -0
- package/dist/chunk-3UOA73MU.js +196 -0
- package/dist/chunk-3UOA73MU.js.map +1 -0
- package/dist/chunk-4CAKGS6P.js +196 -0
- package/dist/chunk-4CAKGS6P.js.map +1 -0
- package/dist/chunk-4F2XOUIR.js +51 -0
- package/dist/chunk-4F2XOUIR.js.map +1 -0
- package/dist/chunk-6DAL2GRI.js +196 -0
- package/dist/chunk-6DAL2GRI.js.map +1 -0
- package/dist/chunk-6IMCKSQD.js +69 -0
- package/dist/chunk-6IMCKSQD.js.map +1 -0
- package/dist/chunk-7XUN3OQT.js +1 -0
- package/dist/chunk-7XUN3OQT.js.map +1 -0
- package/dist/chunk-A2DBM6WR.js +51 -0
- package/dist/chunk-A2DBM6WR.js.map +1 -0
- package/dist/chunk-AULDM6SL.js +89 -0
- package/dist/chunk-AULDM6SL.js.map +1 -0
- package/dist/chunk-BN24NIPU.js +64 -0
- package/dist/chunk-BN24NIPU.js.map +1 -0
- package/dist/chunk-CMFHPI3J.js +51 -0
- package/dist/chunk-CMFHPI3J.js.map +1 -0
- package/dist/chunk-EEJ2JXHV.js +139 -0
- package/dist/chunk-EEJ2JXHV.js.map +1 -0
- package/dist/chunk-FFAGYBAB.js +64 -0
- package/dist/chunk-FFAGYBAB.js.map +1 -0
- package/dist/chunk-G6ZTIOUH.js +54 -0
- package/dist/chunk-G6ZTIOUH.js.map +1 -0
- package/dist/chunk-GAXILFF4.js +63 -0
- package/dist/chunk-GAXILFF4.js.map +1 -0
- package/dist/chunk-GWJU4LIN.js +222 -0
- package/dist/chunk-GWJU4LIN.js.map +1 -0
- package/dist/chunk-GZTKJMEK.js +218 -0
- package/dist/chunk-GZTKJMEK.js.map +1 -0
- package/dist/chunk-JMYWVT4X.js +98 -0
- package/dist/chunk-JMYWVT4X.js.map +1 -0
- package/dist/chunk-K7NSOSIE.js +1 -0
- package/dist/chunk-K7NSOSIE.js.map +1 -0
- package/dist/chunk-MFAW7E6L.js +69 -0
- package/dist/chunk-MFAW7E6L.js.map +1 -0
- package/dist/chunk-N7WM36NN.js +64 -0
- package/dist/chunk-N7WM36NN.js.map +1 -0
- package/dist/chunk-NCSMSA3X.js +50 -0
- package/dist/chunk-NCSMSA3X.js.map +1 -0
- package/dist/chunk-NJMRRUNJ.js +218 -0
- package/dist/chunk-NJMRRUNJ.js.map +1 -0
- package/dist/chunk-PZXLZLQH.js +64 -0
- package/dist/chunk-PZXLZLQH.js.map +1 -0
- package/dist/chunk-QOA6EEKP.js +89 -0
- package/dist/chunk-QOA6EEKP.js.map +1 -0
- package/dist/chunk-SLV7LKTR.js +51 -0
- package/dist/chunk-SLV7LKTR.js.map +1 -0
- package/dist/chunk-T4XIMI4Y.js +64 -0
- package/dist/chunk-T4XIMI4Y.js.map +1 -0
- package/dist/chunk-TTVJOFG5.js +30 -0
- package/dist/chunk-TTVJOFG5.js.map +1 -0
- package/dist/chunk-TXMVRPAL.js +139 -0
- package/dist/chunk-TXMVRPAL.js.map +1 -0
- package/dist/chunk-USNFN36O.js +89 -0
- package/dist/chunk-USNFN36O.js.map +1 -0
- package/dist/chunk-WU6EJCDT.js +196 -0
- package/dist/chunk-WU6EJCDT.js.map +1 -0
- package/dist/chunk-YIDE5VOF.js +196 -0
- package/dist/chunk-YIDE5VOF.js.map +1 -0
- package/dist/chunk-ZP5VSS77.js +89 -0
- package/dist/chunk-ZP5VSS77.js.map +1 -0
- package/dist/context/dynamic-form-context.cjs +3 -2
- package/dist/context/dynamic-form-context.cjs.map +1 -1
- package/dist/context/dynamic-form-context.d.cts +2 -1
- package/dist/context/dynamic-form-context.d.ts +2 -1
- package/dist/context/dynamic-form-context.js +1 -1
- package/dist/context/index.cjs +3 -2
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.js +2 -2
- package/dist/index.cjs +308 -244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +152 -142
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +9 -9
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +6 -6
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +1 -1
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +3 -3
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +12 -12
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +2 -2
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +13 -13
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +16 -16
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +4 -4
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +2 -2
- package/dist/molecules/curriculumV2/index.js +28 -28
- package/dist/molecules/description-json-render.cjs +722 -0
- package/dist/molecules/description-json-render.cjs.map +1 -0
- package/dist/molecules/description-json-render.d.cts +27 -0
- package/dist/molecules/description-json-render.d.ts +27 -0
- package/dist/molecules/description-json-render.js +30 -0
- package/dist/molecules/description-json-render.js.map +1 -0
- package/dist/molecules/dynamic-field.cjs.map +1 -1
- package/dist/molecules/dynamic-field.js +3 -3
- package/dist/molecules/dynamic-form.cjs +6 -4
- package/dist/molecules/dynamic-form.cjs.map +1 -1
- package/dist/molecules/dynamic-form.d.cts +2 -1
- package/dist/molecules/dynamic-form.d.ts +2 -1
- package/dist/molecules/dynamic-form.js +4 -4
- package/dist/molecules/expand-table/index.cjs +1 -1
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +2 -2
- package/dist/molecules/index.cjs +65 -5
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.d.cts +1 -0
- package/dist/molecules/index.d.ts +1 -0
- package/dist/molecules/index.js +71 -66
- package/dist/molecules/learning-post.js +2 -2
- package/dist/molecules/stepper.js +2 -2
- package/dist/molecules/tag-selector.js +3 -3
- package/dist/molecules/time-select.cjs +519 -5
- package/dist/molecules/time-select.cjs.map +1 -1
- package/dist/molecules/time-select.js +18 -2
- package/dist/utils/getCalloutIconComponent.cjs +580 -0
- package/dist/utils/getCalloutIconComponent.cjs.map +1 -0
- package/dist/utils/getCalloutIconComponent.d.cts +11 -0
- package/dist/utils/getCalloutIconComponent.d.ts +11 -0
- package/dist/utils/getCalloutIconComponent.js +25 -0
- package/dist/utils/getCalloutIconComponent.js.map +1 -0
- package/dist/utils/index.cjs +535 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +24 -3
- package/package.json +1 -1
- package/src/context/dynamic-form-context.tsx +3 -1
- package/src/molecules/description-json-render.tsx +85 -0
- package/src/molecules/dynamic-form.tsx +3 -1
- package/src/molecules/expand-table/index.tsx +1 -1
- package/src/molecules/index.ts +2 -1
- package/src/utils/getCalloutIconComponent.ts +39 -0
- package/src/utils/index.ts +1 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DynamicFormField
|
|
3
|
+
} from "./chunk-EEJ2JXHV.js";
|
|
4
|
+
import {
|
|
5
|
+
DynamicFormProvider,
|
|
6
|
+
useDynamicForm
|
|
7
|
+
} from "./chunk-NCSMSA3X.js";
|
|
8
|
+
import {
|
|
9
|
+
Form
|
|
10
|
+
} from "./chunk-2OMSNCRH.js";
|
|
11
|
+
import {
|
|
12
|
+
Typo
|
|
13
|
+
} from "./chunk-PMJIFLDT.js";
|
|
14
|
+
import {
|
|
15
|
+
__async
|
|
16
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
17
|
+
|
|
18
|
+
// src/molecules/dynamic-form.tsx
|
|
19
|
+
import { useMemo, useCallback, useEffect } from "react";
|
|
20
|
+
import { useFormik } from "formik";
|
|
21
|
+
import * as Yup from "yup";
|
|
22
|
+
import { Box } from "@radix-ui/themes";
|
|
23
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
function scrollToFirstError(errors, _fields) {
|
|
25
|
+
const firstErrorFieldName = Object.keys(errors)[0];
|
|
26
|
+
if (!firstErrorFieldName) return;
|
|
27
|
+
let fieldElement = document.querySelector(`[name="${firstErrorFieldName}"]`);
|
|
28
|
+
if (!fieldElement) {
|
|
29
|
+
fieldElement = document.querySelector(`[data-field-name="${firstErrorFieldName}"]`);
|
|
30
|
+
}
|
|
31
|
+
if (!fieldElement) {
|
|
32
|
+
fieldElement = document.querySelector(`[data-error-field="${firstErrorFieldName}"]`);
|
|
33
|
+
}
|
|
34
|
+
if (fieldElement) {
|
|
35
|
+
fieldElement.scrollIntoView({
|
|
36
|
+
behavior: "smooth",
|
|
37
|
+
block: "nearest"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function DynamicFormRoot({
|
|
42
|
+
fields,
|
|
43
|
+
initialValues = {},
|
|
44
|
+
onSubmit,
|
|
45
|
+
children,
|
|
46
|
+
readonly = false,
|
|
47
|
+
formStyle
|
|
48
|
+
}) {
|
|
49
|
+
const validationSchema = useMemo(() => {
|
|
50
|
+
const schema = {};
|
|
51
|
+
fields.forEach((field) => {
|
|
52
|
+
if (field.validation) {
|
|
53
|
+
const validation = createYupValidation(field, field.validation);
|
|
54
|
+
if (validation) {
|
|
55
|
+
schema[field.name] = validation;
|
|
56
|
+
}
|
|
57
|
+
} else if (field.required) {
|
|
58
|
+
if (field.type === "choices") {
|
|
59
|
+
schema[field.name] = Yup.array().min(1, `${field.label}\uC744(\uB97C) \uD558\uB098 \uC774\uC0C1 \uC120\uD0DD\uD574\uC8FC\uC138\uC694`).required(`${field.label}\uC740(\uB294) \uD544\uC218\uC785\uB2C8\uB2E4`);
|
|
60
|
+
} else if (field.type === "yes_no") {
|
|
61
|
+
schema[field.name] = Yup.boolean().oneOf([true], `${field.label}\uC5D0 \uB3D9\uC758\uD574\uC8FC\uC138\uC694`);
|
|
62
|
+
} else {
|
|
63
|
+
schema[field.name] = Yup.string().required(
|
|
64
|
+
`${field.label}\uC740(\uB294) \uD544\uC218\uC785\uB2C8\uB2E4`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return Object.keys(schema).length > 0 ? Yup.object(schema) : void 0;
|
|
70
|
+
}, [fields]);
|
|
71
|
+
const handleSubmit = useCallback((values) => __async(null, null, function* () {
|
|
72
|
+
yield onSubmit(values);
|
|
73
|
+
}), [onSubmit]);
|
|
74
|
+
const formik = useFormik({
|
|
75
|
+
initialValues: fields.reduce((acc, field) => {
|
|
76
|
+
if (field.type === "choices") {
|
|
77
|
+
acc[field.name] = initialValues[field.name] || [];
|
|
78
|
+
} else if (field.type === "yes_no") {
|
|
79
|
+
acc[field.name] = initialValues[field.name] || false;
|
|
80
|
+
} else {
|
|
81
|
+
acc[field.name] = initialValues[field.name] || "";
|
|
82
|
+
}
|
|
83
|
+
return acc;
|
|
84
|
+
}, {}),
|
|
85
|
+
validationSchema,
|
|
86
|
+
validateOnBlur: true,
|
|
87
|
+
validateOnChange: true,
|
|
88
|
+
onSubmit: handleSubmit
|
|
89
|
+
});
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (formik.submitCount > 0 && Object.keys(formik.errors).length > 0) {
|
|
92
|
+
const timeoutId = setTimeout(() => {
|
|
93
|
+
scrollToFirstError(formik.errors, fields);
|
|
94
|
+
}, 100);
|
|
95
|
+
return () => {
|
|
96
|
+
clearTimeout(timeoutId);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}, [formik.submitCount, formik.errors, fields]);
|
|
100
|
+
return /* @__PURE__ */ jsx(DynamicFormProvider, { fields, formStyle, formik, readonly, children });
|
|
101
|
+
}
|
|
102
|
+
function DynamicFormFieldList({
|
|
103
|
+
fields: fieldsProp,
|
|
104
|
+
labelVariant
|
|
105
|
+
}) {
|
|
106
|
+
const { formik, fields: fieldsFromContext, readonly } = useDynamicForm();
|
|
107
|
+
const fields = fieldsProp || fieldsFromContext;
|
|
108
|
+
return /* @__PURE__ */ jsx(Fragment, { children: fields.map((field) => {
|
|
109
|
+
const errorMessage = !readonly && formik.touched[field.name] && formik.errors[field.name] ? String(formik.errors[field.name]) : void 0;
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
Box,
|
|
112
|
+
{
|
|
113
|
+
"data-error-field": errorMessage ? field.name : void 0,
|
|
114
|
+
"data-field-name": field.name,
|
|
115
|
+
mb: "2",
|
|
116
|
+
children: /* @__PURE__ */ jsxs(
|
|
117
|
+
Form.FormItem,
|
|
118
|
+
{
|
|
119
|
+
errorMessage,
|
|
120
|
+
label: field.label,
|
|
121
|
+
labelVariant,
|
|
122
|
+
name: field.name,
|
|
123
|
+
required: field.required,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(DynamicFormField, { field }),
|
|
126
|
+
field.description ? /* @__PURE__ */ jsx(Typo, { children: field.description }) : null
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
},
|
|
131
|
+
field.name
|
|
132
|
+
);
|
|
133
|
+
}) });
|
|
134
|
+
}
|
|
135
|
+
var DynamicForm = {
|
|
136
|
+
Root: DynamicFormRoot,
|
|
137
|
+
FieldList: DynamicFormFieldList
|
|
138
|
+
};
|
|
139
|
+
function createYupValidation(field, validation) {
|
|
140
|
+
if (!validation) return void 0;
|
|
141
|
+
let schema;
|
|
142
|
+
if (field.type === "number") {
|
|
143
|
+
schema = Yup.number();
|
|
144
|
+
} else if (field.type === "email") {
|
|
145
|
+
schema = Yup.string().email(
|
|
146
|
+
validation.message || "\uC62C\uBC14\uB978 \uC774\uBA54\uC77C \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4"
|
|
147
|
+
);
|
|
148
|
+
} else if (field.type === "choices") {
|
|
149
|
+
schema = Yup.array();
|
|
150
|
+
} else if (field.type === "yes_no") {
|
|
151
|
+
schema = Yup.boolean();
|
|
152
|
+
} else {
|
|
153
|
+
schema = Yup.string();
|
|
154
|
+
}
|
|
155
|
+
if (validation.min !== void 0) {
|
|
156
|
+
if (field.type === "number") {
|
|
157
|
+
schema = schema.min(
|
|
158
|
+
validation.min,
|
|
159
|
+
validation.message || `\uCD5C\uC18C ${validation.min}\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`
|
|
160
|
+
);
|
|
161
|
+
} else if (field.type === "choices") {
|
|
162
|
+
schema = schema.min(
|
|
163
|
+
validation.min,
|
|
164
|
+
validation.message || `\uCD5C\uC18C ${validation.min}\uAC1C \uC774\uC0C1 \uC120\uD0DD\uD574\uC8FC\uC138\uC694`
|
|
165
|
+
);
|
|
166
|
+
} else if (field.type === "yes_no") {
|
|
167
|
+
} else {
|
|
168
|
+
schema = schema.min(
|
|
169
|
+
validation.min,
|
|
170
|
+
validation.message || `\uCD5C\uC18C ${validation.min}\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (validation.max !== void 0) {
|
|
175
|
+
if (field.type === "number") {
|
|
176
|
+
schema = schema.max(
|
|
177
|
+
validation.max,
|
|
178
|
+
validation.message || `\uCD5C\uB300 ${validation.max}\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`
|
|
179
|
+
);
|
|
180
|
+
} else if (field.type === "choices") {
|
|
181
|
+
schema = schema.max(
|
|
182
|
+
validation.max,
|
|
183
|
+
validation.message || `\uCD5C\uB300 ${validation.max}\uAC1C\uAE4C\uC9C0 \uC120\uD0DD \uAC00\uB2A5\uD569\uB2C8\uB2E4`
|
|
184
|
+
);
|
|
185
|
+
} else if (field.type === "yes_no") {
|
|
186
|
+
} else {
|
|
187
|
+
schema = schema.max(
|
|
188
|
+
validation.max,
|
|
189
|
+
validation.message || `\uCD5C\uB300 ${validation.max}\uC790 \uC774\uD558\uC5EC\uC57C \uD569\uB2C8\uB2E4`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (validation.pattern) {
|
|
194
|
+
if (field.type === "yes_no") {
|
|
195
|
+
} else {
|
|
196
|
+
schema = schema.matches(
|
|
197
|
+
new RegExp(validation.pattern),
|
|
198
|
+
validation.message || "\uC62C\uBC14\uB978 \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4"
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (field.required) {
|
|
203
|
+
if (field.type === "yes_no") {
|
|
204
|
+
schema = schema.oneOf([true], validation.message || `${field.label}\uC5D0 \uB3D9\uC758\uD574\uC8FC\uC138\uC694`);
|
|
205
|
+
} else if (field.type === "choices") {
|
|
206
|
+
schema = schema.min(1, validation.message || `${field.label}\uC744(\uB97C) \uD558\uB098 \uC774\uC0C1 \uC120\uD0DD\uD574\uC8FC\uC138\uC694`);
|
|
207
|
+
} else {
|
|
208
|
+
schema = schema.required(validation.message || `${field.label}\uC740(\uB294) \uD544\uC218\uC785\uB2C8\uB2E4`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return schema;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export {
|
|
215
|
+
DynamicForm,
|
|
216
|
+
createYupValidation
|
|
217
|
+
};
|
|
218
|
+
//# sourceMappingURL=chunk-NJMRRUNJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dynamic-form.tsx"],"sourcesContent":["import React, { useMemo, useCallback, useEffect } from 'react';\nimport { useFormik, type FormikProps } from 'formik';\nimport * as Yup from 'yup';\nimport { Box } from '@radix-ui/themes';\nimport { Typo } from '@/atoms/typo';\nimport {\n DynamicFormProvider,\n useDynamicForm,\n} from '@/context/dynamic-form-context';\nimport type {\n DynamicFormFieldSchema,\n ValidationRule,\n} from '@/types/dynamic-form-schema-generated';\nimport { Form } from './form/form';\nimport { DynamicFormField } from './dynamic-field';\n\nexport interface DynamicFormProps {\n fields: DynamicFormFieldSchema[];\n initialValues?: Record<string, unknown>;\n onSubmit: (values: Record<string, unknown>) => void | Promise<void>;\n children: React.ReactNode;\n readonly?: boolean;\n formStyle?: React.CSSProperties;\n}\n\n/**\n * 첫 번째 에러 필드로 스크롤하는 함수\n */\nfunction scrollToFirstError(errors: Record<string, unknown>, _fields: DynamicFormFieldSchema[]): void {\n const firstErrorFieldName = Object.keys(errors)[0];\n if (!firstErrorFieldName) return;\n\n // 해당 필드의 DOM 요소를 찾기 (여러 선택자 시도)\n let fieldElement = document.querySelector(`[name=\"${firstErrorFieldName}\"]`);\n \n // input 요소를 찾지 못한 경우, 해당 필드의 컨테이너를 찾기\n if (!fieldElement) {\n fieldElement = document.querySelector(`[data-field-name=\"${firstErrorFieldName}\"]`);\n }\n \n // 여전히 찾지 못한 경우, FormItem의 에러 메시지 영역을 찾기\n if (!fieldElement) {\n fieldElement = document.querySelector(`[data-error-field=\"${firstErrorFieldName}\"]`);\n }\n\n if (fieldElement) {\n fieldElement.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n });\n }\n}\n\nfunction DynamicFormRoot({\n fields,\n initialValues = {},\n onSubmit,\n children,\n readonly = false,\n formStyle,\n}: DynamicFormProps): React.ReactElement {\n const validationSchema = useMemo(() => {\n const schema: Record<string, Yup.Schema<unknown>> = {};\n fields.forEach((field) => {\n if (field.validation) {\n const validation = createYupValidation(field, field.validation);\n if (validation) {\n schema[field.name] = validation;\n }\n } else if (field.required) {\n // choices 타입은 배열 스키마로 처리\n if (field.type === 'choices') {\n schema[field.name] = Yup.array()\n .min(1, `${field.label}을(를) 하나 이상 선택해주세요`)\n .required(`${field.label}은(는) 필수입니다`);\n } else if (field.type === 'yes_no') {\n // yes_no 타입은 boolean 스키마로 처리\n schema[field.name] = Yup.boolean().oneOf([true], `${field.label}에 동의해주세요`);\n } else {\n // choice, dropdown, short_text, long_text, number, email 타입은 문자열 스키마로 처리\n schema[field.name] = Yup.string().required(\n `${field.label}은(는) 필수입니다`\n );\n }\n }\n });\n return Object.keys(schema).length > 0 ? Yup.object(schema) : undefined;\n }, [fields]);\n\n const handleSubmit = useCallback(async (values: Record<string, unknown>) => {\n await onSubmit(values);\n }, [onSubmit]);\n\n const formik: FormikProps<Record<string, unknown>> = useFormik({\n initialValues: fields.reduce<Record<string, unknown>>((acc, field) => {\n if (field.type === 'choices') {\n acc[field.name] = initialValues[field.name] || [];\n } else if (field.type === 'yes_no') {\n acc[field.name] = initialValues[field.name] || false;\n } else {\n acc[field.name] = initialValues[field.name] || '';\n }\n return acc;\n }, {}),\n validationSchema,\n validateOnBlur: true,\n validateOnChange: true,\n onSubmit: handleSubmit,\n });\n\n // submit 시 validation 에러가 있으면 첫 번째 에러 필드로 스크롤\n useEffect(() => {\n if (formik.submitCount > 0 && Object.keys(formik.errors).length > 0) {\n // 약간의 지연을 두어 DOM 업데이트 후 스크롤 실행\n const timeoutId = setTimeout(() => {\n scrollToFirstError(formik.errors, fields);\n }, 100);\n \n return () => {\n clearTimeout(timeoutId);\n };\n }\n }, [formik.submitCount, formik.errors, fields]);\n\n return (\n <DynamicFormProvider fields={fields} formStyle={formStyle} formik={formik} readonly={readonly}>\n {children}\n </DynamicFormProvider>\n );\n}\n\ninterface DynamicFormFieldListProps {\n fields?: DynamicFormFieldSchema[];\n labelVariant?: 'title' | 'body' | 'caption';\n}\nfunction DynamicFormFieldList({\n fields: fieldsProp,\n labelVariant,\n}: DynamicFormFieldListProps): React.ReactElement {\n const { formik, fields: fieldsFromContext, readonly } = useDynamicForm();\n const fields = fieldsProp || fieldsFromContext;\n\n return (\n <>\n {fields.map((field) => {\n const errorMessage =\n !readonly && formik.touched[field.name] && formik.errors[field.name]\n ? String(formik.errors[field.name])\n : undefined;\n\n return (\n <Box\n data-error-field={errorMessage ? field.name : undefined}\n data-field-name={field.name}\n key={field.name}\n mb=\"2\"\n >\n <Form.FormItem\n errorMessage={errorMessage}\n label={field.label}\n labelVariant={labelVariant}\n name={field.name}\n required={field.required}\n >\n <DynamicFormField field={field} />\n {field.description ? <Typo>{field.description}</Typo> : null}\n </Form.FormItem>\n </Box>\n );\n })}\n </>\n );\n}\n\nexport const DynamicForm = {\n Root: DynamicFormRoot,\n FieldList: DynamicFormFieldList,\n};\n\nexport function createYupValidation(\n field: DynamicFormFieldSchema,\n validation?: ValidationRule\n): Yup.Schema<unknown> | undefined {\n if (!validation) return undefined;\n\n let schema: Yup.Schema<unknown>;\n\n // field.type을 기준으로 기본 스키마 생성\n if (field.type === 'number') {\n schema = Yup.number();\n } else if (field.type === 'email') {\n schema = Yup.string().email(\n validation.message || '올바른 이메일 형식이 아닙니다'\n );\n } else if (field.type === 'choices') {\n schema = Yup.array();\n } else if (field.type === 'yes_no') {\n schema = Yup.boolean();\n } else {\n // choice, dropdown, short_text, long_text 타입은 문자열 스키마로 처리\n schema = Yup.string();\n }\n\n if (validation.min !== undefined) {\n if (field.type === 'number') {\n schema = (schema as Yup.NumberSchema).min(\n validation.min,\n validation.message || `최소 ${validation.min}이어야 합니다`\n );\n } else if (field.type === 'choices') {\n schema = (schema as ReturnType<typeof Yup.array>).min(\n validation.min,\n validation.message || `최소 ${validation.min}개 이상 선택해주세요`\n );\n } else if (field.type === 'yes_no') {\n // yes_no 타입은 boolean이므로 min/max 검증 불가\n // 대신 required 검증만 적용\n } else {\n schema = (schema as Yup.StringSchema).min(\n validation.min,\n validation.message || `최소 ${validation.min}자 이상이어야 합니다`\n );\n }\n }\n\n if (validation.max !== undefined) {\n if (field.type === 'number') {\n schema = (schema as Yup.NumberSchema).max(\n validation.max,\n validation.message || `최대 ${validation.max}이어야 합니다`\n );\n } else if (field.type === 'choices') {\n schema = (schema as ReturnType<typeof Yup.array>).max(\n validation.max,\n validation.message || `최대 ${validation.max}개까지 선택 가능합니다`\n );\n } else if (field.type === 'yes_no') {\n // yes_no 타입은 boolean이므로 min/max 검증 불가\n // 대신 required 검증만 적용\n } else {\n schema = (schema as Yup.StringSchema).max(\n validation.max,\n validation.message || `최대 ${validation.max}자 이하여야 합니다`\n );\n }\n }\n\n if (validation.pattern) {\n if (field.type === 'yes_no') {\n // yes_no 타입은 boolean이므로 pattern 검증 불가\n // 대신 required 검증만 적용\n } else {\n schema = (schema as Yup.StringSchema).matches(\n new RegExp(validation.pattern),\n validation.message || '올바른 형식이 아닙니다'\n );\n }\n }\n\n // field.required가 true인 경우 required 검증 추가\n if (field.required) {\n if (field.type === 'yes_no') {\n schema = (schema as Yup.BooleanSchema).oneOf([true], validation.message || `${field.label}에 동의해주세요`);\n } else if (field.type === 'choices') {\n schema = (schema as ReturnType<typeof Yup.array>).min(1, validation.message || `${field.label}을(를) 하나 이상 선택해주세요`);\n } else {\n schema = (schema as Yup.StringSchema).required(validation.message || `${field.label}은(는) 필수입니다`);\n }\n }\n\n return schema;\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
curriculum_ai_traning_default
|
|
3
|
+
} from "./chunk-3PE6OFB3.js";
|
|
4
|
+
import {
|
|
5
|
+
curriculum_review_default
|
|
6
|
+
} from "./chunk-6DAL2GRI.js";
|
|
7
|
+
import {
|
|
8
|
+
curriculum_video_default
|
|
9
|
+
} from "./chunk-QGKQ3IX7.js";
|
|
10
|
+
import {
|
|
11
|
+
useCurriculumContext
|
|
12
|
+
} from "./chunk-ZFWZAZPG.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
InfoCircledIcon
|
|
21
|
+
} from "./chunk-W5TPOFOO.js";
|
|
22
|
+
|
|
23
|
+
// src/molecules/curriculumV2/CurriculumContents/index.tsx
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
function CurriculumBody() {
|
|
26
|
+
const { selectedItem, selectedSectionTitle } = useCurriculumContext();
|
|
27
|
+
switch (selectedItem.type) {
|
|
28
|
+
case "video":
|
|
29
|
+
return /* @__PURE__ */ jsx(curriculum_video_default, { item: selectedItem });
|
|
30
|
+
case "review":
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
curriculum_review_default,
|
|
33
|
+
{
|
|
34
|
+
item: selectedItem,
|
|
35
|
+
sectionTitle: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
case "aiTraining":
|
|
39
|
+
return /* @__PURE__ */ jsx(curriculum_ai_traning_default, { item: selectedItem });
|
|
40
|
+
default:
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
Flex,
|
|
43
|
+
{
|
|
44
|
+
align: "center",
|
|
45
|
+
direction: "column",
|
|
46
|
+
gap: "2",
|
|
47
|
+
height: "100%",
|
|
48
|
+
justify: "center",
|
|
49
|
+
width: "100%",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(InfoCircledIcon, { height: 24, width: 24 }),
|
|
52
|
+
/* @__PURE__ */ jsx(Typo, { children: "\uCEE8\uD150\uCE20\uB97C \uB85C\uB529 \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
53
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", color: "gray", variant: "caption", children: `[debug info]
|
|
54
|
+
${JSON.stringify(selectedItem)}` })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
CurriculumBody
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=chunk-PZXLZLQH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from '@/atoms/flex';\nimport { Typo } from '@/atoms/typo';\nimport { InfoCircledIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\nimport CurriculumVideo from './curriculum-video';\nimport CurriculumReview from './curriculum-review';\nimport CurriculumAiTraning from './curriculum-ai-traning';\n\nexport function CurriculumBody(): React.ReactNode {\n const { selectedItem, selectedSectionTitle } = useCurriculumContext();\n\n switch (selectedItem.type) {\n case 'video':\n return <CurriculumVideo item={selectedItem} />;\n case 'review':\n return (\n <CurriculumReview\n item={selectedItem}\n sectionTitle={selectedSectionTitle?.title}\n />\n );\n case 'aiTraining':\n return <CurriculumAiTraning item={selectedItem}/>\n default:\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n gap=\"2\"\n height=\"100%\"\n justify=\"center\"\n width=\"100%\"\n >\n <InfoCircledIcon height={24} width={24} />\n <Typo>컨텐츠를 로딩 할 수 없습니다</Typo>\n <Typo align=\"center\" color=\"gray\" variant=\"caption\">\n {`[debug info]\n ${JSON.stringify(selectedItem)}`}\n </Typo>\n </Flex>\n );\n }\n} "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAca,cAYL,YAZK;AALN,SAAS,iBAAkC;AAChD,QAAM,EAAE,cAAc,qBAAqB,IAAI,qBAAqB;AAEpE,UAAQ,aAAa,MAAM;AAAA,IACzB,KAAK;AACH,aAAO,oBAAC,4BAAgB,MAAM,cAAc;AAAA,IAC9C,KAAK;AACH,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,cAAc,6DAAsB;AAAA;AAAA,MACtC;AAAA,IAEF,KAAK;AACH,aAAO,oBAAC,iCAAoB,MAAM,cAAa;AAAA,IACnD;AACE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAU;AAAA,UACV,KAAI;AAAA,UACJ,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,mBAAgB,QAAQ,IAAI,OAAO,IAAI;AAAA,YACxC,oBAAC,QAAK,0FAAgB;AAAA,YACtB,oBAAC,QAAK,OAAM,UAAS,OAAM,QAAO,SAAQ,WACvC;AAAA,cACC,KAAK,UAAU,YAAY,CAAC,IAChC;AAAA;AAAA;AAAA,MACF;AAAA,EAEN;AACF;","names":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReviewQuestion_default
|
|
3
|
+
} from "./chunk-2GWB6C4M.js";
|
|
4
|
+
import {
|
|
5
|
+
complete_review_default
|
|
6
|
+
} from "./chunk-W747CDDK.js";
|
|
7
|
+
import {
|
|
8
|
+
start_review_default
|
|
9
|
+
} from "./chunk-KXCFAFL3.js";
|
|
10
|
+
import {
|
|
11
|
+
CurriculumReviewProvider,
|
|
12
|
+
useCurriculumReviewContext
|
|
13
|
+
} from "./chunk-GMKRNFH5.js";
|
|
14
|
+
|
|
15
|
+
// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function CurriculumReviewStepsInner() {
|
|
18
|
+
const {
|
|
19
|
+
formik,
|
|
20
|
+
step,
|
|
21
|
+
handleStart,
|
|
22
|
+
handleNext,
|
|
23
|
+
handlePrev,
|
|
24
|
+
onClickReviewMyAnswer,
|
|
25
|
+
handleSubmit,
|
|
26
|
+
currentQuestion,
|
|
27
|
+
currentAnswer,
|
|
28
|
+
currentError,
|
|
29
|
+
reviewContents,
|
|
30
|
+
handleAnswerChange
|
|
31
|
+
} = useCurriculumReviewContext();
|
|
32
|
+
const { questions } = reviewContents;
|
|
33
|
+
if (step === 0) {
|
|
34
|
+
return /* @__PURE__ */ jsx(start_review_default, { onStart: handleStart });
|
|
35
|
+
}
|
|
36
|
+
if (step > 0 && step <= questions.length && currentQuestion) {
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
ReviewQuestion_default,
|
|
39
|
+
{
|
|
40
|
+
answer: currentAnswer,
|
|
41
|
+
error: currentError,
|
|
42
|
+
index: step - 1,
|
|
43
|
+
isLast: step === questions.length,
|
|
44
|
+
isLoading: formik.isSubmitting,
|
|
45
|
+
isNextDisabled: currentError !== void 0,
|
|
46
|
+
onChange: handleAnswerChange,
|
|
47
|
+
onNext: handleNext,
|
|
48
|
+
onPrev: handlePrev,
|
|
49
|
+
onSubmit: handleSubmit,
|
|
50
|
+
question: currentQuestion,
|
|
51
|
+
total: questions.length
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsx(complete_review_default, { onClickReviewMyAnswer });
|
|
56
|
+
}
|
|
57
|
+
function CurriculumReviewSteps({
|
|
58
|
+
contents,
|
|
59
|
+
title,
|
|
60
|
+
onClickEndReview,
|
|
61
|
+
onSubmit,
|
|
62
|
+
defaultValues,
|
|
63
|
+
curriculum,
|
|
64
|
+
onReviewValueChange,
|
|
65
|
+
mode,
|
|
66
|
+
done
|
|
67
|
+
}) {
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
CurriculumReviewProvider,
|
|
70
|
+
{
|
|
71
|
+
curriculum,
|
|
72
|
+
defaultValues,
|
|
73
|
+
done,
|
|
74
|
+
mode,
|
|
75
|
+
onClickEndReview,
|
|
76
|
+
onReviewValueChange,
|
|
77
|
+
onSubmit,
|
|
78
|
+
reviewContents: contents,
|
|
79
|
+
sectionTitle: title,
|
|
80
|
+
children: /* @__PURE__ */ jsx(CurriculumReviewStepsInner, {})
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
var CurriculumReviewSteps_default = CurriculumReviewSteps;
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
CurriculumReviewSteps_default
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=chunk-QOA6EEKP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.tsx"],"sourcesContent":["import React from 'react';\nimport { type CurriculumReviewContents } from '@/types/curriculumContents.type';\nimport type { Curriculum } from '@/types'; \nimport {\n CurriculumReviewProvider,\n useCurriculumReviewContext,\n} from './curriculum-review-context';\nimport StartReview from './start-review';\nimport CompleteReview from './complete-review';\nimport ReviewQuestion from './ReviewQuestion';\n \nfunction CurriculumReviewStepsInner(): React.ReactNode {\n const {\n formik,\n step,\n handleStart,\n handleNext,\n handlePrev,\n onClickReviewMyAnswer,\n handleSubmit,\n currentQuestion,\n currentAnswer,\n currentError,\n reviewContents,\n handleAnswerChange,\n } = useCurriculumReviewContext();\n const { questions } = reviewContents;\n\n if (step === 0) {\n return <StartReview onStart={handleStart} />;\n }\n if (step > 0 && step <= questions.length && currentQuestion) {\n return (\n <ReviewQuestion\n answer={currentAnswer}\n error={currentError}\n index={step - 1}\n isLast={step === questions.length}\n isLoading={formik.isSubmitting}\n isNextDisabled={currentError !== undefined}\n onChange={handleAnswerChange}\n onNext={handleNext}\n onPrev={handlePrev}\n onSubmit={handleSubmit}\n question={currentQuestion}\n total={questions.length}\n />\n );\n }\n return <CompleteReview onClickReviewMyAnswer={onClickReviewMyAnswer} />;\n}\n\ninterface CurriculumReviewStepsProps {\n contents: CurriculumReviewContents;\n title: string | undefined;\n onClickEndReview: () => void;\n onSubmit: (values: Record<string, string>) => Promise<boolean>;\n defaultValues?: Record<string, string>;\n curriculum: Curriculum;\n onReviewValueChange: ({\n reviewId,\n answer,\n }: {\n reviewId: string;\n answer: Record<string, string>;\n }) => void;\n mode: 'edit' | 'create';\n done: boolean; \n}\n\nfunction CurriculumReviewSteps({\n contents,\n title,\n onClickEndReview,\n onSubmit,\n defaultValues,\n curriculum,\n onReviewValueChange,\n mode,\n done,\n}: CurriculumReviewStepsProps): React.ReactNode { \n\n return (\n <CurriculumReviewProvider\n curriculum={curriculum}\n defaultValues={defaultValues}\n done={done}\n mode={mode}\n onClickEndReview={onClickEndReview}\n onReviewValueChange={onReviewValueChange}\n onSubmit={onSubmit}\n reviewContents={contents}\n sectionTitle={title}\n >\n <CurriculumReviewStepsInner />\n </CurriculumReviewProvider>\n );\n}\n\nexport default CurriculumReviewSteps;\n"],"mappings":";;;;;;;;;;;;;;;AA6BW;AAlBX,SAAS,6BAA8C;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,2BAA2B;AAC/B,QAAM,EAAE,UAAU,IAAI;AAEtB,MAAI,SAAS,GAAG;AACd,WAAO,oBAAC,wBAAY,SAAS,aAAa;AAAA,EAC5C;AACA,MAAI,OAAO,KAAK,QAAQ,UAAU,UAAU,iBAAiB;AAC3D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,OAAO,OAAO;AAAA,QACd,QAAQ,SAAS,UAAU;AAAA,QAC3B,WAAW,OAAO;AAAA,QAClB,gBAAgB,iBAAiB;AAAA,QACjC,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,UAAU;AAAA,QACV,OAAO,UAAU;AAAA;AAAA,IACnB;AAAA,EAEJ;AACA,SAAO,oBAAC,2BAAe,uBAA8C;AACvE;AAoBA,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,cAAc;AAAA,MAEd,8BAAC,8BAA2B;AAAA;AAAA,EAC9B;AAEJ;AAEA,IAAO,gCAAQ;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCalloutIconComponent
|
|
3
|
+
} from "./chunk-3INEXJIV.js";
|
|
4
|
+
import {
|
|
5
|
+
List
|
|
6
|
+
} from "./chunk-JIJLOKVN.js";
|
|
7
|
+
import {
|
|
8
|
+
Box
|
|
9
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
10
|
+
import {
|
|
11
|
+
Typo
|
|
12
|
+
} from "./chunk-PMJIFLDT.js";
|
|
13
|
+
import {
|
|
14
|
+
Callout
|
|
15
|
+
} from "./chunk-B6XJN6EC.js";
|
|
16
|
+
|
|
17
|
+
// src/molecules/description-json-render.tsx
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function DescriptionJsonRender(props) {
|
|
20
|
+
const { value } = props;
|
|
21
|
+
return value.values.map((block, index) => {
|
|
22
|
+
if (block.type === "bullet-list") {
|
|
23
|
+
return (
|
|
24
|
+
// eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
|
|
25
|
+
/* @__PURE__ */ jsx(Box, { mb: "2", pl: "4", children: /* @__PURE__ */ jsx(List.Root, { preSpace: "small", children: block.value.map((v, i) => (
|
|
26
|
+
// eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
|
|
27
|
+
/* @__PURE__ */ jsx(List.Item, { children: v }, `${index}-${i}`)
|
|
28
|
+
)) }) }, `${block.type}-${index}`)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
if (block.type === "callout") {
|
|
32
|
+
const Icon = getCalloutIconComponent(block.icon);
|
|
33
|
+
return (
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
|
|
35
|
+
/* @__PURE__ */ jsx(Box, { mb: "2", children: /* @__PURE__ */ jsxs(Callout.Root, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
37
|
+
/* @__PURE__ */ jsx(Callout.Text, { children: block.value })
|
|
38
|
+
] }) }, `${block.type}-${index}`)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
// eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용
|
|
43
|
+
/* @__PURE__ */ jsx(Typo, { mb: "2", weight: "regular", children: block.value }, `${block.type}-${index}`)
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
DescriptionJsonRender
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-SLV7LKTR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/description-json-render.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '@/atoms/box';\nimport { Callout } from '@/atoms/call-out';\nimport { List } from '@/atoms/list';\nimport { Typo } from '@/atoms/typo';\nimport { getCalloutIconComponent } from '@/utils/getCalloutIconComponent';\n\nexport type DescriptionBlockType = 'callout' | 'typo' | 'bullet-list';\n\nexport interface DescriptionCalloutBlock {\n type: 'callout';\n icon: string;\n value: string;\n}\n\nexport interface DescriptionTypoBlock {\n type: 'typo';\n value: string;\n}\n\nexport interface DescriptionBulletListBlock {\n type: 'bullet-list';\n value: string[];\n}\n\nexport type DescriptionBlock =\n | DescriptionCalloutBlock\n | DescriptionTypoBlock\n | DescriptionBulletListBlock;\n\nexport interface Description {\n version: number;\n values: DescriptionBlock[];\n}\n\nexport interface DescriptionJsonRenderProps {\n value: Description;\n}\n\nexport function DescriptionJsonRender(\n props: DescriptionJsonRenderProps\n): React.ReactElement {\n const { value } = props;\n return value.values.map((block, index) => {\n if (block.type === 'bullet-list') {\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\" pl=\"4\">\n <List.Root preSpace=\"small\">\n {block.value.map((v, i) => (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <List.Item key={`${index}-${i}`}>{v}</List.Item>\n ))}\n </List.Root>\n </Box>\n );\n }\n\n if (block.type === 'callout') {\n const Icon = getCalloutIconComponent(block.icon);\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Box key={`${block.type}-${index}`} mb=\"2\">\n <Callout.Root>\n <Callout.Icon>\n <Icon />\n </Callout.Icon>\n <Callout.Text>{block.value}</Callout.Text>\n </Callout.Root>\n </Box>\n );\n }\n\n return (\n // eslint-disable-next-line react/no-array-index-key -- 블록 타입과 인덱스를 키로 사용\n <Typo key={`${block.type}-${index}`} mb=\"2\" weight=\"regular\">\n {block.value}\n </Typo>\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmDc,cAYJ,YAZI;AAZP,SAAS,sBACd,OACoB;AACpB,QAAM,EAAE,MAAM,IAAI;AAClB,SAAS,MAAM,OAAO,IAAI,CAAC,OAAO,UAAU;AAC1C,QAAI,MAAM,SAAS,eAAe;AAChC;AAAA;AAAA,QAEE,oBAAC,OAAmC,IAAG,KAAI,IAAG,KAC5C,8BAAC,KAAK,MAAL,EAAU,UAAS,SACjB,gBAAM,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA,UAEnB,oBAAC,KAAK,MAAL,EAAiC,eAAlB,GAAG,KAAK,IAAI,CAAC,EAAO;AAAA,SACrC,GACH,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,IAEJ;AAEA,QAAI,MAAM,SAAS,WAAW;AAC5B,YAAM,OAAO,wBAAwB,MAAM,IAAI;AAC/C;AAAA;AAAA,QAEE,oBAAC,OAAmC,IAAG,KACrC,+BAAC,QAAQ,MAAR,EACC;AAAA,8BAAC,QAAQ,MAAR,EACC,8BAAC,QAAK,GACR;AAAA,UACA,oBAAC,QAAQ,MAAR,EAAc,gBAAM,OAAM;AAAA,WAC7B,KANQ,GAAG,MAAM,IAAI,IAAI,KAAK,EAOhC;AAAA;AAAA,IAEJ;AAEA;AAAA;AAAA,MAEE,oBAAC,QAAoC,IAAG,KAAI,QAAO,WAChD,gBAAM,SADE,GAAG,MAAM,IAAI,IAAI,KAAK,EAEjC;AAAA;AAAA,EAEJ,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
curriculum_review_default
|
|
3
|
+
} from "./chunk-4CAKGS6P.js";
|
|
4
|
+
import {
|
|
5
|
+
curriculum_video_default
|
|
6
|
+
} from "./chunk-QGKQ3IX7.js";
|
|
7
|
+
import {
|
|
8
|
+
curriculum_ai_traning_default
|
|
9
|
+
} from "./chunk-3PE6OFB3.js";
|
|
10
|
+
import {
|
|
11
|
+
useCurriculumContext
|
|
12
|
+
} from "./chunk-ZFWZAZPG.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PMJIFLDT.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
InfoCircledIcon
|
|
21
|
+
} from "./chunk-W5TPOFOO.js";
|
|
22
|
+
|
|
23
|
+
// src/molecules/curriculumV2/CurriculumContents/index.tsx
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
function CurriculumBody() {
|
|
26
|
+
const { selectedItem, selectedSectionTitle } = useCurriculumContext();
|
|
27
|
+
switch (selectedItem.type) {
|
|
28
|
+
case "video":
|
|
29
|
+
return /* @__PURE__ */ jsx(curriculum_video_default, { item: selectedItem });
|
|
30
|
+
case "review":
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
curriculum_review_default,
|
|
33
|
+
{
|
|
34
|
+
item: selectedItem,
|
|
35
|
+
sectionTitle: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
case "aiTraining":
|
|
39
|
+
return /* @__PURE__ */ jsx(curriculum_ai_traning_default, { item: selectedItem });
|
|
40
|
+
default:
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
Flex,
|
|
43
|
+
{
|
|
44
|
+
align: "center",
|
|
45
|
+
direction: "column",
|
|
46
|
+
gap: "2",
|
|
47
|
+
height: "100%",
|
|
48
|
+
justify: "center",
|
|
49
|
+
width: "100%",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(InfoCircledIcon, { height: 24, width: 24 }),
|
|
52
|
+
/* @__PURE__ */ jsx(Typo, { children: "\uCEE8\uD150\uCE20\uB97C \uB85C\uB529 \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
53
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", color: "gray", variant: "caption", children: `[debug info]
|
|
54
|
+
${JSON.stringify(selectedItem)}` })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
CurriculumBody
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=chunk-T4XIMI4Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from '@/atoms/flex';\nimport { Typo } from '@/atoms/typo';\nimport { InfoCircledIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\nimport CurriculumVideo from './curriculum-video';\nimport CurriculumReview from './curriculum-review';\nimport CurriculumAiTraning from './curriculum-ai-traning';\n\nexport function CurriculumBody(): React.ReactNode {\n const { selectedItem, selectedSectionTitle } = useCurriculumContext();\n\n switch (selectedItem.type) {\n case 'video':\n return <CurriculumVideo item={selectedItem} />;\n case 'review':\n return (\n <CurriculumReview\n item={selectedItem}\n sectionTitle={selectedSectionTitle?.title}\n />\n );\n case 'aiTraining':\n return <CurriculumAiTraning item={selectedItem}/>\n default:\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n gap=\"2\"\n height=\"100%\"\n justify=\"center\"\n width=\"100%\"\n >\n <InfoCircledIcon height={24} width={24} />\n <Typo>컨텐츠를 로딩 할 수 없습니다</Typo>\n <Typo align=\"center\" color=\"gray\" variant=\"caption\">\n {`[debug info]\n ${JSON.stringify(selectedItem)}`}\n </Typo>\n </Flex>\n );\n }\n} "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAca,cAYL,YAZK;AALN,SAAS,iBAAkC;AAChD,QAAM,EAAE,cAAc,qBAAqB,IAAI,qBAAqB;AAEpE,UAAQ,aAAa,MAAM;AAAA,IACzB,KAAK;AACH,aAAO,oBAAC,4BAAgB,MAAM,cAAc;AAAA,IAC9C,KAAK;AACH,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,cAAc,6DAAsB;AAAA;AAAA,MACtC;AAAA,IAEF,KAAK;AACH,aAAO,oBAAC,iCAAoB,MAAM,cAAa;AAAA,IACnD;AACE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAU;AAAA,UACV,KAAI;AAAA,UACJ,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,mBAAgB,QAAQ,IAAI,OAAO,IAAI;AAAA,YACxC,oBAAC,QAAK,0FAAgB;AAAA,YACtB,oBAAC,QAAK,OAAM,UAAS,OAAM,QAAO,SAAQ,WACvC;AAAA,cACC,KAAK,UAAU,YAAY,CAAC,IAChC;AAAA;AAAA;AAAA,MACF;AAAA,EAEN;AACF;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CoachingCustomerInfoLarge
|
|
3
|
+
} from "./chunk-RFXVHZAN.js";
|
|
4
|
+
import {
|
|
5
|
+
CoachingCustomerInfoMedium
|
|
6
|
+
} from "./chunk-KD6EXWP7.js";
|
|
7
|
+
import {
|
|
8
|
+
CoachingCustomerInfoSmall
|
|
9
|
+
} from "./chunk-YADSNPMG.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
__spreadValues
|
|
15
|
+
} from "./chunk-CRTRMMJ7.js";
|
|
16
|
+
|
|
17
|
+
// src/app/platform/userInfos/coaching-customer-info/index.tsx
|
|
18
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function CoachingCustomerInfo(props) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "block", sm: "none", md: "none" }, children: /* @__PURE__ */ jsx(CoachingCustomerInfoSmall, __spreadValues({}, props)) }),
|
|
22
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "none", sm: "block", md: "none" }, children: /* @__PURE__ */ jsx(CoachingCustomerInfoMedium, __spreadValues({}, props)) }),
|
|
23
|
+
/* @__PURE__ */ jsx(Box, { display: { initial: "none", sm: "none", md: "block" }, children: /* @__PURE__ */ jsx(CoachingCustomerInfoLarge, __spreadValues({}, props)) })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
CoachingCustomerInfo
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-TTVJOFG5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/userInfos/coaching-customer-info/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Box } from '../../../../atoms';\nimport type { CoachingCustomerInfoProps } from '../utils';\nimport { CoachingCustomerInfoSmall } from './small';\nimport { CoachingCustomerInfoMedium } from './medium';\nimport { CoachingCustomerInfoLarge } from './large';\n\nexport {\n CoachingCustomerInfoLarge,\n CoachingCustomerInfoMedium,\n CoachingCustomerInfoSmall,\n};\n\nexport { type CoachingCustomerInfoProps };\n\nexport function CoachingCustomerInfo(\n props: CoachingCustomerInfoProps\n): React.ReactNode {\n return (\n <>\n <Box display={{ initial: 'block', sm: 'none', md: 'none' }}>\n <CoachingCustomerInfoSmall {...props} />\n </Box>\n <Box display={{ initial: 'none', sm: 'block', md: 'none' }}>\n <CoachingCustomerInfoMedium {...props} />\n </Box>\n <Box display={{ initial: 'none', sm: 'none', md: 'block' }}>\n <CoachingCustomerInfoLarge {...props} />\n </Box>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBI,mBAEI,KAFJ;AAJG,SAAS,qBACd,OACiB;AACjB,SACE,iCACE;AAAA,wBAAC,OAAI,SAAS,EAAE,SAAS,SAAS,IAAI,QAAQ,IAAI,OAAO,GACvD,8BAAC,8CAA8B,MAAO,GACxC;AAAA,IACA,oBAAC,OAAI,SAAS,EAAE,SAAS,QAAQ,IAAI,SAAS,IAAI,OAAO,GACvD,8BAAC,+CAA+B,MAAO,GACzC;AAAA,IACA,oBAAC,OAAI,SAAS,EAAE,SAAS,QAAQ,IAAI,QAAQ,IAAI,QAAQ,GACvD,8BAAC,8CAA8B,MAAO,GACxC;AAAA,KACF;AAEJ;","names":[]}
|