diff --git a/frontend/lib/registry/components/table/InvTableConfigPanel.tsx b/frontend/lib/registry/components/table/InvTableConfigPanel.tsx index 114f7d81..4717ff3c 100644 --- a/frontend/lib/registry/components/table/InvTableConfigPanel.tsx +++ b/frontend/lib/registry/components/table/InvTableConfigPanel.tsx @@ -281,73 +281,122 @@ export const InvTableConfigPanel: React.FC = ({ )} {displayMode === "pivot" && ( - - {columns.length === 0 ? ( - 컬럼을 먼저 자동 로드 또는 추가하세요. - ) : ( - <> - - 각 컬럼의 영역을 지정하면 피벗 필드가 생성됩니다. data 영역만 집계 함수가 필요합니다. - - {columns.map((col, idx) => { - const fields = current.pivotFields ?? []; - const fieldIdx = fields.findIndex((f) => f.field === col.key); - const field = fieldIdx >= 0 ? fields[fieldIdx] : undefined; - const area = field?.area ?? "none"; - const summaryType = field?.summaryType ?? "sum"; - const updateField = (next: Partial[number]> | "remove") => { - const list = [...fields]; - if (next === "remove") { - if (fieldIdx >= 0) list.splice(fieldIdx, 1); - } else if (fieldIdx >= 0) { - list[fieldIdx] = { ...list[fieldIdx], ...next }; - } else { - list.push({ - field: col.key, - caption: col.label || col.key, - area: "row", - ...next, - }); - } - patch({ pivotFields: list }); - }; - return ( - -
- { - if (v === "none") updateField("remove"); - else updateField({ area: v as any }); - }} - searchable={false} - > - - - - - - - {area === "data" && ( - updateField({ summaryType: v as any })} - searchable={false} - > - - - - - - - - )} -
-
- ); - })} - - )} + + {/* 피벗 필드 배치는 PivotView 본체의 FieldPanel/FieldChooser가 담당한다. ConfigPanel은 메타 옵션만 관리한다. */} + + + patch({ + pivotChart: { + type: current.pivotChart?.type ?? "bar", + position: current.pivotChart?.position ?? "bottom", + ...current.pivotChart, + enabled: v, + }, + }) + } + /> + + + + patch({ + pivotFieldChooser: { + ...current.pivotFieldChooser, + enabled: v, + }, + }) + } + /> + + + + patch({ + pivotTotals: { + ...current.pivotTotals, + showRowGrandTotals: v, + }, + }) + } + /> + + + + patch({ + pivotTotals: { + ...current.pivotTotals, + showColumnGrandTotals: v, + }, + }) + } + /> + + + + patch({ + pivotStyle: { + theme: current.pivotStyle?.theme ?? "default", + headerStyle: current.pivotStyle?.headerStyle ?? "default", + cellPadding: current.pivotStyle?.cellPadding ?? "normal", + borderStyle: current.pivotStyle?.borderStyle ?? "light", + ...current.pivotStyle, + mergeCells: v, + }, + }) + } + /> + + + + patch({ + pivotStyle: { + theme: current.pivotStyle?.theme ?? "default", + headerStyle: current.pivotStyle?.headerStyle ?? "default", + cellPadding: current.pivotStyle?.cellPadding ?? "normal", + borderStyle: current.pivotStyle?.borderStyle ?? "light", + ...current.pivotStyle, + alternateRowColors: v, + }, + }) + } + /> + + + + patch({ + pivotExportConfig: { + ...current.pivotExportConfig, + excel: v, + }, + }) + } + /> + + + + patch({ + pivotExportConfig: { + ...current.pivotExportConfig, + pdf: v, + }, + }) + } + /> + )}