feat(m02): 입력 · 수량산출 · 참조 창 아래 단추 지움 · [확인] 머리 [닫기] 왼쪽(147-3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QND7Co43B24zK2P937rdxt
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -19,23 +19,6 @@ const fill = (text: string, value: string): string => text.replace("{value}", va
|
||||
/** 면적산출 상세로 감 — 옮겨 갔으면 참(물음에서 취소 = 거짓) */
|
||||
export type GoArea = () => Promise<boolean>;
|
||||
|
||||
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 }),
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 }));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export async function openRefEdit(opt: RefEditOptions): Promise<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
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);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user