fix(M02-흐름도): 알약 판 숫자에 천 단위 쉼표 · 온 길 줄에 선 규칙 글(보낸 알약 → (규칙) → 받는 알약)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D2nUMUMTsqm93PbQtipo6c
This commit is contained in:
2026-10-01 20:33:13 +09:00
co-authored by Claude Sonnet 5.5
parent 3abbe74f58
commit 5ef189ca45
3 changed files with 34 additions and 15 deletions
@@ -19,6 +19,7 @@ import {
} from "./M02_DF_Model";
import {
GATE_OPS,
commas,
SCALE_OPS,
evalSafe,
labelOf,
@@ -127,6 +128,7 @@ function select(
return s;
}
/** 숫자 칸 — 보일 때만 천 단위 쉼표 · 고치는 동안은 쉼표 없이 */
function numberBox(
ctx: Ctx,
value: number | string,
@@ -135,10 +137,13 @@ function numberBox(
): HTMLElement {
const i = el("input", {
className: "ui-input ui-input--sm m02-dflink-num",
attrs: { type: "text", "aria-label": aria },
attrs: { type: "text", inputmode: "decimal", "aria-label": aria },
});
i.value = String(value);
const shown = (): string => (typeof value === "number" ? commas(value) : String(value));
i.value = shown();
i.readOnly = ctx.readOnly;
i.addEventListener("focus", () => (i.value = String(value)));
i.addEventListener("blur", () => (i.value = shown()));
i.addEventListener("change", () => {
const t = i.value.trim().replace(/,/g, "");
onCommit(t !== "" && Number.isFinite(Number(t)) ? Number(t) : t);