feat(m01-sl): 표 상자 Table 완성 — 내 표 붙여넣기 · 범위 조건 · 빈칸 무관 · 선 수식 보존 · 시험
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ACSGaHdLgnkEkoA4LDtMU
This commit is contained in:
@@ -159,7 +159,7 @@ export function planLookup(info: TblInfo, roles: TblRoles): TblPlan {
|
||||
const bl = blankable.slice(0, 2);
|
||||
const subsets =
|
||||
bl.length === 2 ? [[bl[0]], [bl[1]], [bl[0], bl[1]]] : bl.length === 1 ? [[bl[0]]] : [];
|
||||
variants.push(...subsets);
|
||||
variants.push(...subsets.filter((sub) => sub.length < exact.length)); // 모든 조건 칸이 빈칸인 변형은 열쇠가 없음
|
||||
}
|
||||
const keyCols = exact.length ? variants : [];
|
||||
const kStart = W + 1;
|
||||
@@ -310,6 +310,8 @@ export function applyTable(
|
||||
if (si < 0) throw new Error("상자의 시트가 없음");
|
||||
const plan = planLookup(info, roles);
|
||||
const sheet: Sheet = next.workbook.시트[si];
|
||||
// 이미 있던 입력 칸 내용(예시값 · 선을 그은 참조 수식)은 같은 이름이면 그대로 가져감
|
||||
const oldIn = Object.fromEntries(node.pillsIn.map((p) => [p.name, sheet.칸[p.cell]]));
|
||||
const keep = Object.entries(sheet.칸).filter(
|
||||
([a]) => colIndex(a.replace(/\d+/g, "")) < plan.helperFrom,
|
||||
);
|
||||
@@ -319,6 +321,8 @@ export function applyTable(
|
||||
Object.assign(sheet.칸, blockCells(info));
|
||||
}
|
||||
Object.assign(sheet.칸, plan.cells);
|
||||
for (const [name, cell] of Object.entries(plan.inCells))
|
||||
if (oldIn[name]) sheet.칸[cell] = oldIn[name];
|
||||
const pills = pillsOf(info, plan, opts.outside);
|
||||
const gone = (dir: "in" | "out", name: string): boolean =>
|
||||
!(dir === "in" ? pills.pillsIn : pills.pillsOut).some((p) => p.name === name);
|
||||
|
||||
Reference in New Issue
Block a user