Files
Aislo/B05_Profile/B05_Profile_UI_Drainage_Revet_Choice.ts
T
eomsangdonandClaude Opus 5.5 f93cc56284 fix(B05·B06): 54-30 추가 흙막이 강조 유지 · 관 보호공 [연동] [경사] · 칸 고침 강조 · 흙막이 칸 일원화
- 폼이 상자를 새로 세울 때마다(단 수 · 유입 형식 · 벽 조작 · 저장 · 넘김) 고른 상자 강조 다시(specpaint 한 곳) · 54-29 의 두 군데 호출 대체
- 관 보호공(유입 · 유출) 상자 안 [연동] [경사] 반 폭 두 단추 — 옛 연동 제어 값(revet_link_detached · revet_follow_grade) 그대로 · 쓸 수 있을 때만 활성 · 경사 끄면 연동 잠김 · 누르면 횡단 그림 바로
- 상자 칸을 고치거나 고르면 그 벽을 고름(횡단에서 누른 것과 같은 길 · 카드 다시 그림) · 단 수 칸은 고른 단을 지킴
- 추가 흙막이 상자 = 사면안정 흙막이와 같은 칸(형태 · 길이 · 높이 · 전 · 후) · 구조 고르기 칸과 정의 이름 두 줄 뺌 · 저장 키 그대로
- 시험 54-29 · 54-27 · 52 명세 · 54-14 말풍선 기대값 맞춤

화면 확인(sub5_검증 12+18): 흙막이 1 강조 = 단 2→1 · 넘김 · 저장 뒤 유지 · 형태 고침 → 상자 · 벽 강조 · 경사 끔 → 13+0 벽 이동 · 두 줄 함께 · 목록 대 횡단 같은 글(칸 54) · 단 0 저장으로 되돌림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
2026-10-06 13:47:56 +09:00

56 lines
2.6 KiB
TypeScript

/* =============================================================================
* B05_Profile_UI_Drainage_Revet_Choice.ts
* 관 보호공 상자 안 [연동] · [경사] 한 줄(54-30) — 반 폭 단추 둘 · 쓸 수 있는 쪽만 누를 수 있음.
* 값 = 횡단 연동 제어 옛 자리(`revet_link_detached` · `revet_follow_grade` · `design_structure_pipe_calc`) ·
* 고르면 횡단 그림이 바로 따라감. 경사를 끄면(수평) 연동은 풀 수 없음(옛 규칙 그대로).
* ========================================================================== */
import { toggleButton } from "./B05_Profile_UI_Panel_Fields";
import {
pipeRevetChoice,
setPipeRevetChoice,
} from "../A00_Common/design/design_structure_pipe_calc";
const LINK_TITLE = "옆 측점 흙막이와 횡단 자리를 함께 씀 — 끄면 측점마다 따로 잡음";
const LINK_LOCKED = "경사를 끈(수평) 동안은 연동을 풀 수 없음";
const GRADE_TITLE = "종단경사 반영 — 끄면 연장 구간 내내 같은 높이(수평)";
/** 한 줄 — `paint` 가 지금 값 · 쓸 수 있는지를 다시 칠하고 줄을 돌려줌(폼 다시 그림마다). */
export function revetChoiceRow(
chainageOf: () => number | null,
/** 쓴 뒤 — 폼을 다시 그려 유입 · 유출 두 줄을 함께 칠함. */
written: () => void,
): {
paint: (hidden: boolean) => HTMLElement;
} {
const row = document.createElement("div"); // label 이 아님 — 이름표를 눌러 첫 단추가 눌리지 않게
row.className = "b05-route__field";
const caption = document.createElement("span");
caption.textContent = "옵션";
const pair = document.createElement("div");
pair.className = "b05-structure__half-pair";
const write = (kind: "link" | "grade", on: boolean): void =>
void setPipeRevetChoice(chainageOf(), kind, on).then(written);
const link = toggleButton("연동", true, (on) => write("link", on));
const grade = toggleButton("경사", true, (on) => write("grade", on));
grade.title = GRADE_TITLE;
pair.append(link, grade);
row.append(caption, pair);
const set = (button: HTMLButtonElement, value: boolean | null, locked: boolean): void => {
button.disabled = value === null || locked;
button.classList.toggle("is-active", value === true);
button.setAttribute("aria-pressed", String(value === true));
};
function paint(hidden: boolean): HTMLElement {
const now = pipeRevetChoice(chainageOf());
const locked = now?.grade === false;
set(link, now?.linked ?? null, locked);
link.title = locked ? LINK_LOCKED : LINK_TITLE;
set(grade, now?.grade ?? null, false);
row.hidden = hidden;
return row;
}
return { paint };
}