feat(M02): 49-7 상세 셋(도면 · 일위대가 · 면적산출) 머리 제목 옆 [?] 도움말 — 카드와 같은 글 한 벌 · 상세 전용 줄(파일 불러오기 · 도면으로 보내기 · 돌아가기) 더함
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
@@ -159,8 +159,11 @@ const pairs = (rows: [string, string][]): HTMLElement =>
|
||||
children: rows.flatMap(([key, what]) => [el("dt", { text: key }), el("dd", { text: what })]),
|
||||
});
|
||||
|
||||
/** ? — 카드 제목 바로 옆 · 누르면 도움말 상자(카드 오른쪽 위 · 보이고 숨김) · 상자는 본문 앞에 끼움 */
|
||||
export function helpButton(shell: CardShell, title: string, help: CardHelp): HTMLElement {
|
||||
/** ? 단추 + 도움말 상자 한 쌍(카드 · 상세 머리 공용 · 49-7) — 놓는 자리는 부른 쪽이 정함 */
|
||||
export function helpParts(
|
||||
title: string,
|
||||
help: CardHelp,
|
||||
): { button: HTMLElement; box: HTMLElement } {
|
||||
const button = createButton({ label: CARD_TEXT.help, variant: "ghost", size: "sm" });
|
||||
button.title = button.ariaLabel = CARD_TEXT.helpTip.replace("{value}", title);
|
||||
button.classList.add("m02-struct__help");
|
||||
@@ -188,6 +191,12 @@ export function helpButton(shell: CardShell, title: string, help: CardHelp): HTM
|
||||
event.stopPropagation(); // 누름 ≠ 접기
|
||||
box.hidden = !box.hidden;
|
||||
});
|
||||
return { button, box };
|
||||
}
|
||||
|
||||
/** ? — 카드 제목 바로 옆 · 누르면 도움말 상자(카드 오른쪽 위 · 보이고 숨김) · 상자는 본문 앞에 끼움 */
|
||||
export function helpButton(shell: CardShell, title: string, help: CardHelp): HTMLElement {
|
||||
const { button, box } = helpParts(title, help);
|
||||
shell.title.after(button);
|
||||
shell.root.insertBefore(box, shell.body);
|
||||
return button;
|
||||
|
||||
Reference in New Issue
Block a user