[agent-pipeline] pipe-20260311151253-nyk7 round-10
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* V2AggregationWidget 설정 패널
|
||||
* 기존 AggregationWidgetConfigPanel의 모든 로직(테이블/컬럼 Combobox, 집계 항목 관리,
|
||||
* 필터 조건, 데이터 소스 선택, 스타일 설정 등)을 유지하면서
|
||||
* componentConfigChanged 이벤트를 추가하여 실시간 업데이트 지원
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { AggregationWidgetConfigPanel } from "@/lib/registry/components/v2-aggregation-widget/AggregationWidgetConfigPanel";
|
||||
import type { AggregationWidgetConfig } from "@/lib/registry/components/v2-aggregation-widget/types";
|
||||
|
||||
interface V2AggregationWidgetConfigPanelProps {
|
||||
config: AggregationWidgetConfig;
|
||||
onChange: (config: Partial<AggregationWidgetConfig>) => void;
|
||||
screenTableName?: string;
|
||||
screenComponents?: Array<{
|
||||
id: string;
|
||||
componentType: string;
|
||||
label?: string;
|
||||
tableName?: string;
|
||||
columnName?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export const V2AggregationWidgetConfigPanel: React.FC<V2AggregationWidgetConfigPanelProps> = ({
|
||||
config,
|
||||
onChange,
|
||||
screenTableName,
|
||||
screenComponents,
|
||||
}) => {
|
||||
const handleChange = (newConfig: Partial<AggregationWidgetConfig>) => {
|
||||
onChange(newConfig);
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("componentConfigChanged", {
|
||||
detail: { config: { ...config, ...newConfig } },
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<AggregationWidgetConfigPanel
|
||||
config={config}
|
||||
onChange={handleChange}
|
||||
screenTableName={screenTableName}
|
||||
screenComponents={screenComponents}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
V2AggregationWidgetConfigPanel.displayName = "V2AggregationWidgetConfigPanel";
|
||||
|
||||
export default V2AggregationWidgetConfigPanel;
|
||||
Reference in New Issue
Block a user