diff --git a/A00_Common/design/design_page.ts b/A00_Common/design/design_page.ts index a758d2288..b4ef131c6 100644 --- a/A00_Common/design/design_page.ts +++ b/A00_Common/design/design_page.ts @@ -49,9 +49,10 @@ import { peekSectionDetail, } from "../../B06_Section/B06_Section_Section_Store"; import "./design_page.css"; -// 클래스로 붙이는 부품(체크 · 빈 상태 · 보조 글)의 CSS — B05 · B06 화면 파일이 시험 때문에 import 없이 클래스만 씀(553-2) +// 클래스로 붙이는 부품(체크 · 빈 상태 · 보조 글 · 표)의 CSS — B05 · B06 화면 파일이 시험 때문에 import 없이 클래스만 씀(553-2) import "@ui/ui_template_checkbox"; import "@ui/ui_template_empty"; +import "@ui/ui_template_table"; import "@ui/ui_template_text"; export type { DesignPageShared } from "./design_shared"; diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts index 8033af8c6..4d731ebe8 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts @@ -229,7 +229,7 @@ export function openRecommendModal(params: RecommendParams): void { @@ -287,7 +287,7 @@ export function openRecommendModal(params: RecommendParams): void { for (const key of WEIGHT_KEYS) { const bar = document.createElement("div"); bar.className = "b05-routerec__bar"; - const numField = createInputField({ type: "number", min: 0, max: 100, compact: true }); + const numField = createInputField({ type: "number", min: 0, max: 100, size: 32 }); // 부품 입력 단 32(553-2) numField.input.step = "1"; numField.input.inputMode = "numeric"; numField.input.classList.add("b05-routerec__num"); @@ -321,7 +321,7 @@ export function openRecommendModal(params: RecommendParams): void { row.title = field.title; const name = document.createElement("span"); name.textContent = field.label; - const input = createInputField({ type: "number", min: 0, compact: true }); + const input = createInputField({ type: "number", min: 0, size: 32 }); // 부품 입력 단 32(553-2) input.input.inputMode = "decimal"; input.input.step = "0.1"; input.input.dataset.criteria = key; @@ -332,7 +332,7 @@ export function openRecommendModal(params: RecommendParams): void { criteriaBox.append(row); } - const targetField = createInputField({ type: "number", min: 0, max: 100, compact: true }); + const targetField = createInputField({ type: "number", min: 0, max: 100, size: 32 }); // 부품 입력 단 32(553-2) targetField.input.inputMode = "decimal"; targetField.input.step = "0.1"; targetField.input.dataset.criteria = TARGET_GRADE_KEY; diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts index b96c4cf5e..17ca26898 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts @@ -10,8 +10,6 @@ * (`initial_profile` · 438 직선화 · 종단곡선 포함)을 펴서 같은 그림에 선 하나 · 한 줄로 더한다. * ========================================================================== */ -import { renderDataTableHtml, type DataColumn } from "@ui/ui_template_data_table"; - /** 후보 하나의 균형 종단 — 서버 `metrics.profile`. */ export interface BalanceProfile { stationsM: number[]; @@ -193,25 +191,26 @@ export function profileLegend(hasPlan: boolean, hasInitial: boolean): string { ].join("")}`; } -const CANDIDATE_COLUMNS: DataColumn[] = [ - { key: "name", label: "후보" }, - { key: "cut", label: "절토" }, - { key: "fill", label: "성토" }, - { key: "mass", label: "누가토량" }, - { key: "grade", label: "최대 종단경사" }, -]; +const CANDIDATE_COLUMNS = ["후보", "절토", "성토", "누가토량", "최대 종단경사"]; -/** 이 모달에서 셈한 후보들 — 갈래 이름 · 절 · 성 · 누가토량(±) · 최대 종단경사 표. 비면 빈 글. */ +const escapeHtml = (text: string): string => + text.replace(/&/g, "&").replace(//g, ">"); + +/** 이 모달에서 셈한 후보들 — 갈래 이름 · 절 · 성 · 누가토량(±) · 최대 종단경사 표. 비면 빈 글. + * 꼴 = 부품 「표」 데이터표(`ui-table--data` · 553-2) — 이름 칸 왼쪽 · 수 칸 오른쪽. */ export function candidatesTable(rows: Array<[string, BalanceProfile]>): string { if (!rows.length) return ""; - return renderDataTableHtml({ - columns: CANDIDATE_COLUMNS, - rows: rows.map(([name, b]) => ({ - name, - cut: m3(b.cutM3), - fill: m3(b.fillM3), - mass: signedM3(b.massEndM3), - grade: pct(b.maxGradePct), - })), + const end = (i: number): string => (i ? ' class="is-end"' : ""); + const head = CANDIDATE_COLUMNS.map((label, i) => `