/* ============================================================================= * M02_MasterTemplete_Sangeun_Tabs.ts * M02 단가산출(SK) 상세 보기 고르기(PLAN 799-2 · 요구 655-8) — 수식(첫 탭 · 796-2b `_Sangeun_Equation`) · 단가산출 상세 둘. * 시트 · 인력·재료·경비 · 시험 계산 · 텍스트 수식 보기는 걷음(옛 `_Sangeun_Sheet*` · 790-1) — 서버 문서 꼴(변수줄 · 글줄 · 덮개)은 그대로 * 수식 = 이 파일이 쥔 그릇 · 단가산출 상세 = 상세가 쥔 `editor`(수식일 때 숨김) * ========================================================================== */ import { createSegment } from "@ui/ui_template_segment"; import { tl } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Text"; import { createSangeunEquation, type SkEquationDraw, type SkEquationOptions, } from "./M02_MasterTemplete_Sangeun_Equation"; type View = "equation" | "ho"; /** 보기 고르기 · 수식 그릇 — `editor` = 단가산출 상세 그릇(수식일 때 숨김) */ export function createSangeunTabs( editor: HTMLElement, opt: SkEquationOptions, ): { picker: HTMLElement; host: HTMLElement; draw: (d: SkEquationDraw) => void; saved: () => void; } { const eqView = createSangeunEquation(opt); const show = (v: View): void => { eqView.root.hidden = v !== "equation"; editor.hidden = v === "equation"; if (!editor.hidden) editor.dataset.view = v; }; const picker = createSegment({ options: [ { value: "equation", label: tl("View_Equation") }, { value: "ho", label: tl("Ho_Title") }, ], value: "equation", size: 32, ariaLabel: tl("View_Label"), onChange: (v) => show(v as View), }); picker.root.dataset.skViews = ""; show("equation"); return { picker: picker.root, host: eqView.root, draw: eqView.draw, saved: eqView.saved, // 796-2b 사본 할일 뗌 }; }