From 9756b12347a89a0fa93d182f97e66ddc78ba0098 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 9 Oct 2026 19:03:45 +0900 Subject: [PATCH] =?UTF-8?q?feat(m02):=20=EC=9E=85=EB=A0=A5=20=C2=B7=20?= =?UTF-8?q?=EC=88=98=EB=9F=89=EC=82=B0=EC=B6=9C=20=C2=B7=20=EC=B0=B8?= =?UTF-8?q?=EC=A1=B0=20=EC=B0=BD=20=EC=95=84=EB=9E=98=20=EB=8B=A8=EC=B6=94?= =?UTF-8?q?=20=EC=A7=80=EC=9B=80=20=C2=B7=20[=ED=99=95=EC=9D=B8]=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20[=EB=8B=AB=EA=B8=B0]=20=EC=99=BC=EC=AA=BD(?= =?UTF-8?q?147-3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QND7Co43B24zK2P937rdxt --- .../M02_MasterTemplete_Labor.css | 7 ------ .../M02_MasterTemplete_Labor_Input.ts | 25 +++++-------------- .../M02_MasterTemplete_Labor_QtyModal.ts | 16 ++++-------- .../M02_MasterTemplete_Labor_RefEdit.ts | 17 +++---------- .../M02_MasterTemplete_Labor_Text.ts | 1 - resources/tester/test_modal_head_actions.py | 13 ++++++++++ 6 files changed, 27 insertions(+), 52 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor.css b/M02_MasterTemplete/M02_MasterTemplete_Labor.css index 550e2ec7b..76497fda7 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor.css +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor.css @@ -294,13 +294,6 @@ font-size: var(--text-caption); } -.m02-labin__foot { - display: flex; - justify-content: flex-end; - gap: var(--spacing-8); - margin-top: var(--spacing-12); -} - /* 보기 갈래(면적산출 오른쪽 패널 · 일위대가 카드) */ .m02-labview { display: flex; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Input.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Input.ts index bdeabdc1a..cc2d42196 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Input.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Input.ts @@ -19,23 +19,6 @@ const fill = (text: string, value: string): string => text.replace("{value}", va /** 면적산출 상세로 감 — 옮겨 갔으면 참(물음에서 취소 = 거짓) */ export type GoArea = () => Promise; -function footer( - readOnly: boolean, - ok: () => void, - close: () => void, - okLabel = tc("In_Ok"), -): HTMLElement { - return el("div", { - className: "m02-labin__foot", - children: readOnly - ? [createButton({ label: tc("In_Close"), variant: "ghost", onClick: close })] - : [ - createButton({ label: tc("In_Cancel"), variant: "ghost", onClick: close }), - createButton({ label: okLabel, variant: "filled", onClick: ok }), - ], - }); -} - export interface LaborInputResult { 입력값: LaborValues; 메모: string | null; @@ -79,7 +62,7 @@ export function openLaborInput(opt: LaborInputOptions): void { title: fill(tc("In_Title"), opt.title), closeLabel: tc("In_Close"), dialogClass: "m02-modal m02-labin", - mount: (body, close) => { + mount: (body, close, head) => { const rows = inputs.map((input) => { const field = createValueControl(input, draft[input.이름] ?? null, (value, isBad) => { if (isBad) bad.add(input.이름); @@ -184,8 +167,12 @@ export function openLaborInput(opt: LaborInputOptions): void { }), ], }), - footer(opt.readOnly, ok, close, opt.okLabel), ); + // [확인] = 머리 [닫기] 왼쪽 · 아래 단추 없음(머리 [닫기] = 취소 · 147-3) · 읽기만 = [닫기]만 + if (!opt.readOnly) + head.append( + createButton({ label: opt.okLabel ?? tc("In_Ok"), variant: "filled", onClick: ok }), + ); }, }); } diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_QtyModal.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_QtyModal.ts index 8bd58dc80..b54f34abc 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_QtyModal.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_QtyModal.ts @@ -4,7 +4,7 @@ * · 위 = 지금 수량(손 · 칸 · —) · 손 입력 칸 · [연결 풀기] * · 아래 = 그 열 면적산출 시트를 모달 안에 바로(읽기만 · 실제 값 · 이은 칸 색 · `mountAreaSheet`) · * 칸 누름 = 그 칸을 고름(함께 잇기 · 바꾸기 물음 그대로) - * · [확인] = 손 값이 있으면 손 · 아니면 고른 칸으로 잇기 · 풀기 · [닫기] = 그대로 + * · 머리 [확인] = 손 값이 있으면 손 · 아니면 고른 칸으로 잇기 · 풀기 · 머리 [닫기] = 그대로 * 잇기 · 풀기는 화면 문서만(저장은 일위대가 [저장] 때 면적 문서와 함께 · `Labor_Detail`). * ========================================================================== */ @@ -55,7 +55,7 @@ export function openQtyModal(opt: QtyModalOptions): void { closeLabel: tc("In_Close"), dialogClass: "m02-modal m02-labin m02-labqty", beforeClose: () => (sheet?.destroy(), true), - mount: (body, closeNow) => { + mount: (body, closeNow, head) => { const finish = (): void => { sheet?.destroy(); closeNow(); @@ -160,16 +160,10 @@ export function openQtyModal(opt: QtyModalOptions): void { ...(opt.handOnly ? [] : [el("p", { className: "m02-cellpick__hint", text: tc("Labor_SheetHint") }), host]), - el("div", { - className: "m02-labin__foot", - children: opt.readOnly - ? [createButton({ label: tc("In_Close"), variant: "ghost", onClick: finish })] - : [ - createButton({ label: tc("In_Close"), variant: "ghost", onClick: finish }), - createButton({ label: tc("In_Ok"), variant: "filled", onClick: ok }), - ], - }), ); + // [확인] = 머리 [닫기] 왼쪽 · 아래 [닫기] 없음(147-3) · 읽기만 = 머리 [닫기]만 + if (!opt.readOnly) + head.append(createButton({ label: tc("In_Ok"), variant: "filled", onClick: ok })); }, }); } diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_RefEdit.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_RefEdit.ts index d8edd56ab..ae980c9ae 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_RefEdit.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_RefEdit.ts @@ -59,7 +59,7 @@ export async function openRefEdit(opt: RefEditOptions): Promise { finish(); return true; }, - mount: (body, close) => { + mount: (body, close, head) => { const host = el("div", { attrs: { "data-labor-ref": opt.ref.키 } }); handle = mountLaborDetail(host, doc, { layer, @@ -70,15 +70,6 @@ export async function openRefEdit(opt: RefEditOptions): Promise { mode: "precombo", owner: opt.ref.주인, }); - const cancel = createButton({ - label: tc(opt.readOnly ? "In_Close" : "In_Cancel"), - variant: "ghost", - onClick: async () => { - if (dirty && !(await showConfirmDialog(tc("Ref_Discard")))) return; - close(); - finish(); - }, - }); const ok = createButton({ label: tc("Save"), variant: "filled", @@ -98,11 +89,9 @@ export async function openRefEdit(opt: RefEditOptions): Promise { attrs: { "data-labor-notice": "" }, }), host, - el("div", { - className: "m02-labin__foot", - children: opt.readOnly ? [cancel] : [cancel, ok], - }), ); + // [저장] = 머리 [닫기] 왼쪽 · 아래 단추 없음(머리 [닫기] = 취소 · 고친 것 있으면 물음 · 147-3) + if (!opt.readOnly) head.append(ok); }, }); } diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Text.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Text.ts index 8088e75fb..90b450800 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Text.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Text.ts @@ -136,7 +136,6 @@ const TEXT = { In_QtyNeed: ["손 입력 수량을 수로 적음", "Enter a number"], In_Bad: ["범위 밖 값이 있음 — 고친 뒤 확인", "Out-of-range values — fix first"], In_Ok: ["확인", "OK"], - In_Cancel: ["취소", "Cancel"], In_Close: ["닫기", "Close"], Lib_Name: ["이름", "Name"], // 서고 목록표(51-4) diff --git a/resources/tester/test_modal_head_actions.py b/resources/tester/test_modal_head_actions.py index 4346e5445..8c42f863b 100644 --- a/resources/tester/test_modal_head_actions.py +++ b/resources/tester/test_modal_head_actions.py @@ -2,6 +2,7 @@ · 147-1 곁값 `actions`(머리 [닫기] 바로 왼쪽 · 넘긴 창만) · `wide`(96vw × 94vh · 몸만 스크롤) · 147-2 연결창 단추 넷 → 머리 · 큰 창 · 글 묻는 창 [확인] 머리 · [취소] 없음 +· 147-3 M02 입력 · 수량산출 · 참조 창 — 아래 단추 줄 없음 · [확인] 머리 · 읽기만이면 없음 """ from __future__ import annotations @@ -67,3 +68,15 @@ def test_147_2_글_묻는_창_확인만_머리(): "ui_template/ui_template_item_picker_detail.ts", ): assert "cancelLabel" not in _text(rel), rel + + +def test_147_3_m02_창_셋_머리_확인(): + m02 = "M02_MasterTemplete/M02_MasterTemplete_" + for name in ("Labor_Input", "Labor_QtyModal", "Labor_RefEdit"): + ts = _text(f"{m02}{name}.ts") + assert "m02-labin__foot" not in ts, name + assert "mount: (body, " in ts and ", head) => {" in ts, name + # 읽기만 = 머리 [닫기]만 + assert "if (!opt.readOnly)" in ts and "head.append(" in ts, name + assert "In_Cancel" not in _text(f"{m02}Labor_Text.ts") + assert ".m02-labin__foot" not in _text(f"{m02}Labor.css")