feat(M02): 좌측 같은 이름 단추 · 나무 뿌리 줄 없앰 · 「+」 더하기 · 찾기 하나(AND) (PLAN 29-6)

- 「일위대가 조합」 · 「구조물 조합」 컨테이너 안 같은 이름 줄 단추 없앰 — 제목을 펼치면 그 화면을 엶
- 나무 맨 위 뿌리 줄 없앰 — 폴더 · 항목부터 · 맨 위 더하기는 빈 자리 오른쪽 클릭 · 층 단추 옆 「+」(읽기만 층 = 숨김) · 빈 나무 안내글 맞춤
- 찾기 칸 하나 — 띄어쓰기 낱말 모두(AND · 대소문자 무시) · 이름 · 키 · 경로(구분 · 상세구분) · 단위 · 공용 matchText 를 나무 · 일위대가 조합 목록이 함께 씀(목록의 따로 찾기 칸 없앰)
- 시험 — 찾기 AND · 새 배치 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 18:15:43 +09:00
co-authored by Claude Opus 5.5
parent 95849aefbd
commit c1ad11e869
14 changed files with 127 additions and 51 deletions
@@ -26,6 +26,7 @@ import {
import { openLogicPicker } from "./M02_MasterTemplete_Labor_Pick";
import { buildPreview } from "./M02_MasterTemplete_Labor_Preview";
import { tc } from "./M02_MasterTemplete_Labor_Text";
import { matchText } from "./M02_MasterTemplete_TreePanel_Model";
import "../M01_MasterData/M01_MasterData_UI_Logic_Style.css";
import "../M01_MasterData/M01_MasterData_UI_LogicLab_Style.css";
import "./M02_MasterTemplete_Labor.css";
@@ -77,6 +78,8 @@ export interface LaborEditor {
isDirty: () => boolean;
/** 열린 조합 키 — 목록이면 null · 새 조합이면 빈 글 */
current: () => string | null;
/** 라이브러리 찾기 칸 글 — 목록을 같은 규칙(`matchText`)으로 거름 */
setQuery: (text: string) => void;
}
export function createLaborEditor(opt: LaborEditOptions): LaborEditor {
@@ -89,11 +92,11 @@ export function createLaborEditor(opt: LaborEditOptions): LaborEditor {
let current: { combo: Combo; version: string; saved: string } | null = null;
let q = "";
const view = el("div", { className: "m01-logic__editor m01-combo m02-labor__edit" });
const find = createInputField({ type: "search", placeholder: tc("Search") });
find.input.addEventListener("input", () => {
q = find.input.value.trim().toLowerCase();
// 찾기 칸은 라이브러리 하나(상세 위 · 나무와 같은 글 · PLAN 29-6) — `setQuery` 로 받음
const setQuery = (text: string): void => {
q = text;
if (!current) drawList();
});
};
const logicsReady = fetchLibLogics()
.then((all) => {
@@ -111,7 +114,7 @@ export function createLaborEditor(opt: LaborEditOptions): LaborEditor {
nav++;
current = null;
opt.onDirty(false);
const shown = items.filter((x) => !q || `${x.키} ${x.이름}`.toLowerCase().includes(q));
const shown = items.filter((x) => matchText([x.키, x.이름, x.구분, x.상세구분, x.단위], q));
const heads = [
tc("Head_Key"),
tc("Head_Name"),
@@ -142,7 +145,6 @@ export function createLaborEditor(opt: LaborEditOptions): LaborEditor {
el("div", {
className: "m01-logic__section-head",
children: [
find.root,
...(edit
? [createButton({ label: tc("New"), variant: "filled", onClick: () => startNew([]) })]
: [el("span", { className: "m01-logic__muted", text: tc("ReadOnly") })]),
@@ -387,5 +389,6 @@ export function createLaborEditor(opt: LaborEditOptions): LaborEditor {
showList: drawList,
isDirty: dirty,
current: () => current?.combo.키 ?? null,
setQuery,
};
}