From 6974a38df29544c2ad8dd609802927daebbdcf41 Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Thu, 12 Mar 2026 03:56:15 +0900 Subject: [PATCH] [agent-pipeline] pipe-20260311182531-f443 round-6 --- .../config-panels/V2PivotGridConfigPanel.tsx | 78 +++++++++++++++---- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/frontend/components/v2/config-panels/V2PivotGridConfigPanel.tsx b/frontend/components/v2/config-panels/V2PivotGridConfigPanel.tsx index 1fac6844..27d39616 100644 --- a/frontend/components/v2/config-panels/V2PivotGridConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2PivotGridConfigPanel.tsx @@ -27,6 +27,7 @@ import type { PivotAreaType, AggregationType, FieldDataType, + ConditionalFormatRule, } from "@/lib/registry/components/v2-pivot-grid/types"; interface TableInfo { @@ -179,6 +180,13 @@ const AreaDropZone: React.FC = ({ ); }; +const STYLE_DEFAULTS: { theme: "default"; headerStyle: "default"; cellPadding: "normal"; borderStyle: "light" } = { + theme: "default", + headerStyle: "default", + cellPadding: "normal", + borderStyle: "light", +}; + /* ─── 메인 컴포넌트 ─── */ export const V2PivotGridConfigPanel: React.FC = ({ @@ -239,7 +247,15 @@ export const V2PivotGridConfigPanel: React.FC = ({ const updateConfig = useCallback( (updates: Partial) => { - onChange({ ...config, ...updates }); + const newConfig = { ...config, ...updates }; + onChange(newConfig); + if (typeof window !== "undefined") { + window.dispatchEvent( + new CustomEvent("componentConfigChanged", { + detail: { config: newConfig }, + }) + ); + } }, [config, onChange] ); @@ -540,7 +556,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ - updateConfig({ style: { ...config.style, alternateRowColors: v } }) + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, alternateRowColors: v } }) } /> @@ -552,7 +568,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ - updateConfig({ style: { ...config.style, mergeCells: v } }) + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, mergeCells: v } }) } /> @@ -600,12 +616,42 @@ export const V2PivotGridConfigPanel: React.FC = ({
-

상태 저장

-

사용자가 설정한 피벗 상태를 기억해요

+

전체 확장/축소

+

모든 그룹을 한번에 열거나 닫을 수 있어요

updateConfig({ saveState: v })} + checked={config.allowExpandAll !== false} + onCheckedChange={(v) => updateConfig({ allowExpandAll: v })} + /> +
+
+
+

필터링

+

필드별 필터를 사용할 수 있어요

+
+ updateConfig({ allowFiltering: v })} + /> +
+
+
+

요약값 기준 정렬

+

집계 결과를 클릭해서 정렬할 수 있어요

+
+ updateConfig({ allowSortingBySummary: v })} + /> +
+
+
+

텍스트 줄바꿈

+

긴 텍스트를 셀 안에서 줄바꿈해요

+
+ updateConfig({ wordWrapEnabled: v })} />
@@ -620,8 +666,8 @@ export const V2PivotGridConfigPanel: React.FC = ({ value={rule.type} onValueChange={(v) => { const newFormats = [...(config.style?.conditionalFormats || [])]; - newFormats[index] = { ...rule, type: v as any }; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + newFormats[index] = { ...rule, type: v as ConditionalFormatRule["type"] }; + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} > @@ -650,7 +696,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ maxColor: rule.colorScale?.maxColor || "#00ff00", }, }; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} className="h-6 w-6 cursor-pointer rounded" title="최소값 색상" @@ -669,7 +715,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ maxColor: e.target.value, }, }; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} className="h-6 w-6 cursor-pointer rounded" title="최대값 색상" @@ -684,7 +730,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ onChange={(e) => { const newFormats = [...(config.style?.conditionalFormats || [])]; newFormats[index] = { ...rule, dataBar: { color: e.target.value } }; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} className="h-6 w-6 cursor-pointer rounded" title="바 색상" @@ -696,8 +742,8 @@ export const V2PivotGridConfigPanel: React.FC = ({ value={rule.iconSet?.type || "traffic"} onValueChange={(v) => { const newFormats = [...(config.style?.conditionalFormats || [])]; - newFormats[index] = { ...rule, iconSet: { type: v as any, thresholds: [33, 67] } }; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + newFormats[index] = { ...rule, iconSet: { type: v as "arrows" | "traffic" | "rating" | "flags", thresholds: [33, 67] } }; + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} > @@ -718,7 +764,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ className="ml-auto h-6 w-6" onClick={() => { const newFormats = (config.style?.conditionalFormats || []).filter((_, i) => i !== index); - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} > @@ -739,7 +785,7 @@ export const V2PivotGridConfigPanel: React.FC = ({ colorScale: { minColor: "#ff0000", maxColor: "#00ff00" }, }, ]; - updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); + updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } }); }} >