[agent-pipeline] pipe-20260311182531-f443 round-6

This commit is contained in:
DDD1542 2026-03-12 03:56:15 +09:00
parent 43edc16486
commit 6974a38df2
1 changed files with 62 additions and 16 deletions

View File

@ -27,6 +27,7 @@ import type {
PivotAreaType, PivotAreaType,
AggregationType, AggregationType,
FieldDataType, FieldDataType,
ConditionalFormatRule,
} from "@/lib/registry/components/v2-pivot-grid/types"; } from "@/lib/registry/components/v2-pivot-grid/types";
interface TableInfo { interface TableInfo {
@ -179,6 +180,13 @@ const AreaDropZone: React.FC<AreaDropZoneProps> = ({
); );
}; };
const STYLE_DEFAULTS: { theme: "default"; headerStyle: "default"; cellPadding: "normal"; borderStyle: "light" } = {
theme: "default",
headerStyle: "default",
cellPadding: "normal",
borderStyle: "light",
};
/* ─── 메인 컴포넌트 ─── */ /* ─── 메인 컴포넌트 ─── */
export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
@ -239,7 +247,15 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
const updateConfig = useCallback( const updateConfig = useCallback(
(updates: Partial<PivotGridComponentConfig>) => { (updates: Partial<PivotGridComponentConfig>) => {
onChange({ ...config, ...updates }); const newConfig = { ...config, ...updates };
onChange(newConfig);
if (typeof window !== "undefined") {
window.dispatchEvent(
new CustomEvent("componentConfigChanged", {
detail: { config: newConfig },
})
);
}
}, },
[config, onChange] [config, onChange]
); );
@ -540,7 +556,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
<Switch <Switch
checked={config.style?.alternateRowColors !== false} checked={config.style?.alternateRowColors !== false}
onCheckedChange={(v) => onCheckedChange={(v) =>
updateConfig({ style: { ...config.style, alternateRowColors: v } }) updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, alternateRowColors: v } })
} }
/> />
</div> </div>
@ -552,7 +568,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
<Switch <Switch
checked={config.style?.mergeCells === true} checked={config.style?.mergeCells === true}
onCheckedChange={(v) => onCheckedChange={(v) =>
updateConfig({ style: { ...config.style, mergeCells: v } }) updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, mergeCells: v } })
} }
/> />
</div> </div>
@ -600,12 +616,42 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
</div> </div>
<div className="flex items-center justify-between py-1"> <div className="flex items-center justify-between py-1">
<div> <div>
<p className="text-sm"> </p> <p className="text-sm"> /</p>
<p className="text-[11px] text-muted-foreground"> </p> <p className="text-[11px] text-muted-foreground"> </p>
</div> </div>
<Switch <Switch
checked={config.saveState === true} checked={config.allowExpandAll !== false}
onCheckedChange={(v) => updateConfig({ saveState: v })} onCheckedChange={(v) => updateConfig({ allowExpandAll: v })}
/>
</div>
<div className="flex items-center justify-between py-1">
<div>
<p className="text-sm"></p>
<p className="text-[11px] text-muted-foreground"> </p>
</div>
<Switch
checked={config.allowFiltering !== false}
onCheckedChange={(v) => updateConfig({ allowFiltering: v })}
/>
</div>
<div className="flex items-center justify-between py-1">
<div>
<p className="text-sm"> </p>
<p className="text-[11px] text-muted-foreground"> </p>
</div>
<Switch
checked={config.allowSortingBySummary !== false}
onCheckedChange={(v) => updateConfig({ allowSortingBySummary: v })}
/>
</div>
<div className="flex items-center justify-between py-1">
<div>
<p className="text-sm"> </p>
<p className="text-[11px] text-muted-foreground"> </p>
</div>
<Switch
checked={config.wordWrapEnabled === true}
onCheckedChange={(v) => updateConfig({ wordWrapEnabled: v })}
/> />
</div> </div>
</div> </div>
@ -620,8 +666,8 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
value={rule.type} value={rule.type}
onValueChange={(v) => { onValueChange={(v) => {
const newFormats = [...(config.style?.conditionalFormats || [])]; const newFormats = [...(config.style?.conditionalFormats || [])];
newFormats[index] = { ...rule, type: v as any }; newFormats[index] = { ...rule, type: v as ConditionalFormatRule["type"] };
updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } });
}} }}
> >
<SelectTrigger className="h-7 w-24 text-xs"> <SelectTrigger className="h-7 w-24 text-xs">
@ -650,7 +696,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
maxColor: rule.colorScale?.maxColor || "#00ff00", 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" className="h-6 w-6 cursor-pointer rounded"
title="최소값 색상" title="최소값 색상"
@ -669,7 +715,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
maxColor: e.target.value, 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" className="h-6 w-6 cursor-pointer rounded"
title="최대값 색상" title="최대값 색상"
@ -684,7 +730,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
onChange={(e) => { onChange={(e) => {
const newFormats = [...(config.style?.conditionalFormats || [])]; const newFormats = [...(config.style?.conditionalFormats || [])];
newFormats[index] = { ...rule, dataBar: { color: e.target.value } }; 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" className="h-6 w-6 cursor-pointer rounded"
title="바 색상" title="바 색상"
@ -696,8 +742,8 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
value={rule.iconSet?.type || "traffic"} value={rule.iconSet?.type || "traffic"}
onValueChange={(v) => { onValueChange={(v) => {
const newFormats = [...(config.style?.conditionalFormats || [])]; const newFormats = [...(config.style?.conditionalFormats || [])];
newFormats[index] = { ...rule, iconSet: { type: v as any, thresholds: [33, 67] } }; newFormats[index] = { ...rule, iconSet: { type: v as "arrows" | "traffic" | "rating" | "flags", thresholds: [33, 67] } };
updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } });
}} }}
> >
<SelectTrigger className="h-7 w-20 text-xs"> <SelectTrigger className="h-7 w-20 text-xs">
@ -718,7 +764,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
className="ml-auto h-6 w-6" className="ml-auto h-6 w-6"
onClick={() => { onClick={() => {
const newFormats = (config.style?.conditionalFormats || []).filter((_, i) => i !== index); const newFormats = (config.style?.conditionalFormats || []).filter((_, i) => i !== index);
updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } });
}} }}
> >
<X className="h-3 w-3" /> <X className="h-3 w-3" />
@ -739,7 +785,7 @@ export const V2PivotGridConfigPanel: React.FC<V2PivotGridConfigPanelProps> = ({
colorScale: { minColor: "#ff0000", maxColor: "#00ff00" }, colorScale: { minColor: "#ff0000", maxColor: "#00ff00" },
}, },
]; ];
updateConfig({ style: { ...config.style, conditionalFormats: newFormats } }); updateConfig({ style: { ...STYLE_DEFAULTS, ...config.style, conditionalFormats: newFormats } });
}} }}
> >
<Plus className="mr-1 h-3 w-3" /> <Plus className="mr-1 h-3 w-3" />