feat(M01): 새로 만들기 모달에 새 길 잇기 — 절 목록으로 원문 절 고르기 · 절로 표 거르기 · 표 조건 값 목록 · 초안 시험 계산 · 자체 로직 저장(GX) · 본떠 만들기
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WRFJmmhPi4exAzHgPZHMT
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/* =============================================================================
|
||||
* M01_MasterData_UI_Logic_Wizard_Ui.ts
|
||||
* 「새로 만들기」 걸음 화면이 같이 쓰는 작은 부품 — 걸음 모양 · 쪽 · 안내 글 · 오류 알림
|
||||
* ========================================================================== */
|
||||
|
||||
import { el, showToast } from "@ui/ui_template_elements";
|
||||
import type { Draft } from "./M01_MasterData_UI_Logic_Wizard_Model";
|
||||
import { tw, type WizardTextKey } from "./M01_MasterData_UI_Logic_Wizard_Text";
|
||||
|
||||
export interface Ctx {
|
||||
d: Draft;
|
||||
/** 값이 바뀜 — 미리보기·다음 단추 다시 셈 */
|
||||
changed: () => void;
|
||||
/** 본떠 만들기가 끝남 — 모달이 닫고 새 키를 넘김 */
|
||||
onCopied: (key: string) => void;
|
||||
}
|
||||
export interface Step {
|
||||
key: WizardTextKey;
|
||||
question: WizardTextKey;
|
||||
render: (ctx: Ctx) => HTMLElement;
|
||||
ready: (d: Draft) => boolean;
|
||||
}
|
||||
|
||||
export const page = (question: WizardTextKey, ...body: (HTMLElement | string)[]): HTMLElement =>
|
||||
el("div", {
|
||||
className: "m01w__page",
|
||||
children: [el("h3", { text: tw(question) }), ...body],
|
||||
});
|
||||
export const note = (text: string): HTMLElement => el("p", { className: "m01w__muted", text });
|
||||
export const fail = (e: unknown): void =>
|
||||
showToast(e instanceof Error ? e.message : tw("Failed"), "error");
|
||||
Reference in New Issue
Block a user