260710_0
This commit is contained in:
@@ -16,6 +16,7 @@ import { currentLanguageIndex, ui_locales } from "@ui/ui_template_locale";
|
||||
import {
|
||||
createButton,
|
||||
createInputField,
|
||||
createSelectField,
|
||||
createWorkflowShell,
|
||||
hideLoadingOverlay,
|
||||
showLoadingOverlay,
|
||||
@@ -41,28 +42,6 @@ const GRADE_CLASSES = ["trunk", "branch", "work"] as const;
|
||||
/** 경로 알고리즘 (Schema.algorithm 허용값) */
|
||||
const ALGORITHMS = ["dijkstra", "ridge_valley"] as const;
|
||||
|
||||
/** 라벨 + select 요소 하나 생성. */
|
||||
function buildSelect(
|
||||
label: string,
|
||||
values: readonly string[],
|
||||
): { root: HTMLElement; select: HTMLSelectElement } {
|
||||
const root = document.createElement("div");
|
||||
root.className = "ui-field";
|
||||
const labelEl = document.createElement("label");
|
||||
labelEl.className = "ui-field__label";
|
||||
labelEl.textContent = label;
|
||||
const select = document.createElement("select");
|
||||
select.className = "ui-input b05-route__select";
|
||||
for (const value of values) {
|
||||
const option = document.createElement("option");
|
||||
option.value = value;
|
||||
option.textContent = value;
|
||||
select.append(option);
|
||||
}
|
||||
root.append(labelEl, select);
|
||||
return { root, select };
|
||||
}
|
||||
|
||||
/** X/Y 좌표 한 쌍 입력 행 생성. */
|
||||
function buildPointRow(label: string): {
|
||||
root: HTMLElement;
|
||||
@@ -158,8 +137,14 @@ export function renderB05Route(root: HTMLElement): void {
|
||||
const constraintLegend = document.createElement("legend");
|
||||
constraintLegend.className = "b05-route__group-legend";
|
||||
constraintLegend.textContent = L("B05_Route_Group_Constraints");
|
||||
const gradeSelect = buildSelect(L("B05_Route_Field_GradeClass"), GRADE_CLASSES);
|
||||
const algorithmSelect = buildSelect(L("B05_Route_Field_Algorithm"), ALGORITHMS);
|
||||
const gradeSelect = createSelectField({
|
||||
label: L("B05_Route_Field_GradeClass"),
|
||||
options: GRADE_CLASSES.map((v) => ({ value: v, text: v })),
|
||||
});
|
||||
const algorithmSelect = createSelectField({
|
||||
label: L("B05_Route_Field_Algorithm"),
|
||||
options: ALGORITHMS.map((v) => ({ value: v, text: v })),
|
||||
});
|
||||
const maxUphillField = createInputField({
|
||||
label: L("B05_Route_Field_MaxUphill"),
|
||||
type: "number",
|
||||
|
||||
Reference in New Issue
Block a user