Merge remote-tracking branch 'origin/sub_laptop_1' into main_laptop_1

This commit is contained in:
2026-09-14 09:17:35 +09:00
3 changed files with 17 additions and 17 deletions
@@ -284,7 +284,7 @@ export function createFacilityOptionsForm(
// 나눈다(2026-08-30 사용자). 설치 측이 한쪽이면 그 칸만 뜬다. // 나눈다(2026-08-30 사용자). 설치 측이 한쪽이면 그 칸만 뜬다.
// 좌·우가 저장 채널(유입/유출) 중 어느 쪽인지는 측점 지형이 정하므로 이름표만 // 좌·우가 저장 채널(유입/유출) 중 어느 쪽인지는 측점 지형이 정하므로 이름표만
// 바꿔 단다(`setRevetSideLabels`) — 값은 언제나 그 채널 키로 오간다. // 바꿔 단다(`setRevetSideLabels`) — 값은 언제나 그 채널 키로 오간다.
const revetSide = optionalSelect("양쪽", ["양쪽", "좌", "우"]); const revetSide = optionalSelect("— 안 정함 —", ["양쪽", "좌", "우"]);
revetSide.value = "양쪽"; revetSide.value = "양쪽";
const revetTopRow = grid(labeled("설치 측", revetSide)); const revetTopRow = grid(labeled("설치 측", revetSide));
const revetInlet = createRevetSideGroup(INLET_REVET_KEYS, "돌쌓기(메)"); const revetInlet = createRevetSideGroup(INLET_REVET_KEYS, "돌쌓기(메)");
@@ -153,14 +153,18 @@ export function putNumber(target: Record<string, string | number>, key: string,
if (Number.isFinite(value) && value > 0) target[key] = Number(value.toFixed(1)); if (Number.isFinite(value) && value > 0) target[key] = Number(value.toFixed(1));
} }
/** 선택지 셀렉트 — 빈("미지정") 항목을 두지 않는다. 첫 항목이 곧 기본값이고, /** 선택지 셀렉트 — **맨 앞에 빈 보기(「안 정함」)** 를 둠. 첫 보기를 미리 고르지 않음
* 기본값은 구조물별로 따로 지정한다(2026-08-17 사용자 지시 1). */ * (2026-09-14 브레인 판정 · 옛 2026-08-17 「빈 항목 두지 않음」 걷음) — 고른 적 없는 첫 값이 저장돼
* 확정으로 굳지 않게. 기본값이 있는 칸은 부르는 쪽이 값을 넣음(그것은 따로 차례). */
export function optionalSelect( export function optionalSelect(
_blankLabel: string, blankLabel: string,
choices: ReadonlyArray<string>, choices: ReadonlyArray<string>,
): HTMLSelectElement { ): HTMLSelectElement {
const element = document.createElement("select"); const element = document.createElement("select");
element.replaceChildren(...choices.map((choice) => new Option(choice, choice))); element.replaceChildren(
new Option(blankLabel, ""),
...choices.map((choice) => new Option(choice, choice)),
);
return element; return element;
} }
+8 -12
View File
@@ -320,20 +320,16 @@ export function createStructuresSection(
const preset = values[option.key] ?? option.default ?? ""; const preset = values[option.key] ?? option.default ?? "";
let input: HTMLInputElement | HTMLSelectElement; let input: HTMLInputElement | HTMLSelectElement;
if (option.input === "select") { if (option.input === "select") {
// 빈("선택하세요") 항목은 두지 않는다 — 첫 항목이 곧 기본값이고, 기본값은
// 구조물별로 레지스트리에서 지정한다(2026-08-17 사용자 지시 1).
const choices = option.choices.map((choice) => [choice, choice] as [string, string]); const choices = option.choices.map((choice) => [choice, choice] as [string, string]);
// 기본값 없는 필수 항목은 **빈 칸으로** — 첫 항목을 슬쩍 고르면 근거 없는 값이 나간다. // 기본값 없는 고르기 칸은 **「안 정함」이 실제 상태** — 첫 보기를 미리 고르지 않음
const mustPick = option.required === true && (option.default ?? "") === ""; // (2026-09-14 브레인 판정, 옛 2026-08-17 「빈 보기 두지 않음」을 걷음). 사용자가 고른 적
// **비워 두는 것이 뜻인 칸**(`empty_means`)도 같다 — 비면 계산 쪽이 기준값으로 도는데 // 없는 첫 값이 저장돼 확정으로 굳는 뿌리였음(2026-09-13 `fill_concrete_mpa` 180 박힘도
// 첫 보기가 골라져 저장되면 기준과 다른 값이 조용히 나간다(2026-09-13: // 같은 병). 저장에는 빈 값이 가고 표가 사유를 보임.
// `fill_concrete_mpa` 가 180 으로 박혀 엔진 기준 210 과 갈렸다). 기본값이 **있는** 칸은 if ((option.default ?? "") === "") {
// 그대로 첫 보기를 쓴다 — 2026-08-17 「빈 보기 두지 않음」 지시가 그 자리다. choices.unshift(["", option.required === true ? "— 선택 —" : "— 안 정함 —"]);
const meansEmpty = (option.empty_means ?? "") !== "" && (option.default ?? "") === ""; }
const keepEmpty = mustPick || meansEmpty;
if (keepEmpty) choices.unshift(["", mustPick ? "— 선택 —" : "— 안 정함 —"]);
input = select(choices); input = select(choices);
input.value = String(preset || (keepEmpty ? "" : (option.choices[0] ?? ""))); input.value = String(preset);
} else if (option.input === "number") { } else if (option.input === "number") {
input = numberInput("0.1", "0"); input = numberInput("0.1", "0");
input.value = String(preset ?? ""); input.value = String(preset ?? "");