feat(m01-sl): 다른 로직 상자 손잡이 잇기(renderLogicTools) · 넘길 값을 실은 바깥 값 물음을 짐작한 물음보다 먼저

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-01 14:02:45 +09:00
co-authored by Claude Opus 5.5
parent 52b86b4620
commit 0e72719a5d
+16 -12
View File
@@ -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<ReturnType<typeof loadMods>>;
@@ -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);