fix(M02): 일위대가 목록 합계 · 단위 · 새 항목 두 단추 — 수량 없으면 기준 합(작은 글 「기준」) · 담은 로직 0 「—」 · 단위 = 일위대가 문서 단위 · 누른 단추가 진하게

39-8 B2 · B3 · B4 — 서버 목록 칸 labor 에 기준 · 단위 · laborSum · Col note · buildTwoWay choose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-04 22:05:58 +09:00
co-authored by Claude Opus 5.5
parent 26a24889e6
commit d4458ec894
5 changed files with 96 additions and 18 deletions
@@ -185,10 +185,21 @@ export function buildTwoWay(opt: TwoWayOptions): HTMLElement {
const copy = createButton({ label: TEXT.makeCopy, variant: "ghost" });
const below = el("div", { className: "m02-itempick__below" });
let busy = false;
fresh.addEventListener("click", opt.onNew);
/** 누른 단추 = 지금 화면 — 진한 단추가 고른 쪽 · 복사 생성 목록은 그쪽일 때만 보임 */
const choose = (which: HTMLElement): void => {
for (const b of [fresh, copy]) {
b.classList.toggle("ui-btn--filled", b === which);
b.classList.toggle("ui-btn--ghost", b !== which);
}
below.hidden = which !== copy;
};
fresh.addEventListener("click", () => {
choose(fresh);
opt.onNew();
});
copy.addEventListener("click", () => {
choose(copy);
if (below.firstChild) return;
copy.classList.add("is-active");
const picker = buildPicker({
...opt.picker,
onPick: (picked) =>