From 0e72719a5d0271d68fd0b5f16cfd12f5a85c47af Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 1 Oct 2026 14:02:45 +0900 Subject: [PATCH] =?UTF-8?q?feat(m01-sl):=20=EB=8B=A4=EB=A5=B8=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=83=81=EC=9E=90=20=EC=86=90=EC=9E=A1=EC=9D=B4=20?= =?UTF-8?q?=EC=9E=87=EA=B8=B0(renderLogicTools)=20=C2=B7=20=EB=84=98?= =?UTF-8?q?=EA=B8=B8=20=EA=B0=92=EC=9D=84=20=EC=8B=A4=EC=9D=80=20=EB=B0=94?= =?UTF-8?q?=EA=B9=A5=20=EA=B0=92=20=EB=AC=BC=EC=9D=8C=EC=9D=84=20=EC=A7=90?= =?UTF-8?q?=EC=9E=91=ED=95=9C=20=EB=AC=BC=EC=9D=8C=EB=B3=B4=EB=8B=A4=20?= =?UTF-8?q?=EB=A8=BC=EC=A0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt --- .../SheetLogic/M01_SL_Entry_Paper.ts | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/M01_MasterData/SheetLogic/M01_SL_Entry_Paper.ts b/M01_MasterData/SheetLogic/M01_SL_Entry_Paper.ts index ca3b354a0..2b4d7bdb2 100644 --- a/M01_MasterData/SheetLogic/M01_SL_Entry_Paper.ts +++ b/M01_MasterData/SheetLogic/M01_SL_Entry_Paper.ts @@ -33,7 +33,8 @@ export const loadMods = () => import("./M01_SL_Result"), import("./M01_SL_Import"), import("../../A00_Common/spreadsheet/spreadsheet_recalc"), - ]).then(([model, ev, api, diagram, panel, table, item, result, imp, recalc]) => ({ + import("./M01_SL_LogicTools"), + ]).then(([model, ev, api, diagram, panel, table, item, result, imp, recalc, logic]) => ({ model, ev, api, @@ -44,6 +45,7 @@ export const loadMods = () => result, imp, recalc, + logic, })); export type Mods = Awaited>; @@ -109,13 +111,19 @@ export function outsidePlaces(M: Mods, sl: SheetLogic): SlOutsideAt[] { if (!at.has(k)) at.set(k, p); }; M.item.itemOutsides(sl).forEach(put); - for (const c of M.ev.outsideCells(sl)) { - const node = sl.nodes.find((n) => n.id === c.node); - if (node && c.source) - put({ item: { id: c.id, ...c.source } as SlQuery, sheet: node.sheetId, cell: c.cell }); - } + // 상자에 출처가 적힌 알약 → 넘길 값을 실은 물음(outsideOf) → 출처를 짐작한 나머지(넘길 값 없음) 차례 + const cells = M.ev.outsideCells(sl); + const fromCell = (explicit: boolean): void => { + for (const c of cells) { + const node = sl.nodes.find((n) => n.id === c.node); + if (node && c.source && !!node.source === explicit) + put({ item: { id: c.id, ...c.source } as SlQuery, sheet: node.sheetId, cell: c.cell }); + } + }; + fromCell(true); // 넘길 입력값이 수식 칸이면 계산값이 있어야 함(없으면 null 로 넘어가 단가가 0) M.imp.outsideOf(sl, M.recalc.recalcWorkbook(sl.workbook)).forEach(put); + fromCell(false); return [...at.values()]; } @@ -294,10 +302,6 @@ export function showPaper( }); }; - /* ponytail: 「다른 로직」 상자 손잡이(sub5 renderLogicTools)가 올라오기 전엔 없음 — 올라오면 바로 M.item.renderLogicTools 로 부름 */ - const logicTools = (M.item as { renderLogicTools?: typeof M.item.renderItemTools }) - .renderLogicTools; - const drawPanel = (): void => { const node = sl.nodes.find((n) => n.id === selected); if (!node) { @@ -323,8 +327,8 @@ export function showPaper( loadPrices(node.id); }, }); - else if (node.kind === "logic" && logicTools) - logicTools(toolsHost, sl, node.id, { + else if (node.kind === "logic") + M.logic.renderLogicTools(toolsHost, sl, node.id, { change: (next) => { edit(next, true); loadPrices(node.id);