feat(structure): 54-43 빈 칸 = 그냥 빈 칸 · 필수 칸 빈 보기 없음 · 빈 옛 값 = 기본값

- 공용 명세 폼: 필수 상자 고르기 칸 빈 보기 없음 · 빈 옛 값 = 정의 기본값(없으면 첫 보기)을 실제 값으로(저장도 그 값) · 선택 상자 빈 보기 = 빈 글 · 숫자 칸 자리표시 글 걷음
- 시설 폼: 배관 · BOX · 세월교 · 물넘이 포장에 정의 기본값 전달 · 독립 기슭막이 설치 측 · 형태 빈 보기 없음 · 높이 · 추가 흙막이(단) · 월류 높이 자리표시 글 걷음
- 일반 구조물 칸: 필수 · 기본값 있는 고르기 칸 빈 보기 없음 · 그 밖 빈 보기 = 빈 글 · 「필수 입력」 자리표시 걷음 · 규칙 선택지 좁힘이 빈 보기 없는 칸도 다룸
- 기준 측점 이름표 「(비우면 시작)」 걷음
- 시험: 기슭막이 높이 칸 = 자리표시 없음 · 화면 점검 ui_checks/54-43

화면 확인(sub5_검증 · B05 구조물 20개): 「선택 안 함」 · 「안 정함」 · 「비우면」 · 「기본」 0 · 필수 칸 빈 보기 0 · 필수 칸 빈 값 0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
This commit is contained in:
2026-10-06 14:51:42 +09:00
co-authored by Claude Opus 5.5
parent 5f809b6761
commit d02f7033e1
9 changed files with 128 additions and 70 deletions
@@ -250,14 +250,16 @@ function syncChoices(
choices: string[],
label: (choice: string) => string,
): void {
const now = [...element.children].slice(1).map((o) => (o as HTMLOptionElement).value);
// 빈 보기는 선택 칸에만(54-43 · 필수 칸은 없음)
const blank = [...element.options].filter((o) => o.value === "").slice(0, 1);
const now = [...element.options].filter((o) => o.value !== "").map((o) => o.value);
const keep = element.value && !choices.includes(element.value) ? [element.value] : [];
const want = [...choices, ...keep];
if (now.length === want.length && now.every((v, i) => v === want[i])) return;
const value = element.value;
const blank = element.children[0];
element.replaceChildren(blank, ...want.map((c) => new Option(label(c), c)));
element.replaceChildren(...blank, ...want.map((c) => new Option(label(c), c)));
element.value = value;
if (element.selectedIndex < 0) element.selectedIndex = 0;
}
/** 「지난 정의 값」 상자(48-3) — 지금 정의에 없는 키의 값을 읽기만 칸으로 보임(오류 없음 · 저장은