From baa1d40bc45fefaeccf3e7f8883a23d5a7904ccc Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Thu, 12 Mar 2026 00:37:17 +0900 Subject: [PATCH] [agent-pipeline] pipe-20260311151253-nyk7 round-7 --- .../V2TableSearchWidgetConfigPanel.tsx | 68 +++++++++++++++++++ .../v2-table-search-widget/index.tsx | 4 +- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 frontend/components/v2/config-panels/V2TableSearchWidgetConfigPanel.tsx diff --git a/frontend/components/v2/config-panels/V2TableSearchWidgetConfigPanel.tsx b/frontend/components/v2/config-panels/V2TableSearchWidgetConfigPanel.tsx new file mode 100644 index 00000000..588d2d8e --- /dev/null +++ b/frontend/components/v2/config-panels/V2TableSearchWidgetConfigPanel.tsx @@ -0,0 +1,68 @@ +"use client"; + +/** + * V2TableSearchWidget 설정 패널 + * 기존 TableSearchWidgetConfigPanel의 모든 로직(필터 모드, 대상 패널, 고정 필터 등)을 유지하면서 + * componentConfigChanged 이벤트를 추가하여 실시간 업데이트 지원 + */ + +import React from "react"; +import { TableSearchWidgetConfigPanel } from "@/lib/registry/components/v2-table-search-widget/TableSearchWidgetConfigPanel"; + +interface V2TableSearchWidgetConfigPanelProps { + component?: any; + config?: any; + onUpdateProperty?: (property: string, value: any) => void; + onChange?: (newConfig: any) => void; + tables?: any[]; +} + +export function V2TableSearchWidgetConfigPanel({ + component, + config, + onUpdateProperty, + onChange, + tables, +}: V2TableSearchWidgetConfigPanelProps) { + const handleChange = (newConfig: any) => { + if (onChange) { + onChange(newConfig); + } + + if (typeof window !== "undefined") { + window.dispatchEvent( + new CustomEvent("componentConfigChanged", { + detail: { config: newConfig }, + }) + ); + } + }; + + const handleUpdateProperty = (property: string, value: any) => { + if (onUpdateProperty) { + onUpdateProperty(property, value); + } + + if (typeof window !== "undefined") { + window.dispatchEvent( + new CustomEvent("componentConfigChanged", { + detail: { property, value }, + }) + ); + } + }; + + return ( + + ); +} + +V2TableSearchWidgetConfigPanel.displayName = "V2TableSearchWidgetConfigPanel"; + +export default V2TableSearchWidgetConfigPanel; diff --git a/frontend/lib/registry/components/v2-table-search-widget/index.tsx b/frontend/lib/registry/components/v2-table-search-widget/index.tsx index ff7f4f54..1a913f63 100644 --- a/frontend/lib/registry/components/v2-table-search-widget/index.tsx +++ b/frontend/lib/registry/components/v2-table-search-widget/index.tsx @@ -3,7 +3,7 @@ import { ComponentRegistry } from "../../ComponentRegistry"; import { TableSearchWidget } from "./TableSearchWidget"; import { TableSearchWidgetRenderer } from "./TableSearchWidgetRenderer"; -import { TableSearchWidgetConfigPanel } from "./TableSearchWidgetConfigPanel"; +import { V2TableSearchWidgetConfigPanel } from "@/components/v2/config-panels/V2TableSearchWidgetConfigPanel"; // 검색 필터 위젯 등록 (v2) ComponentRegistry.registerComponent({ @@ -30,7 +30,7 @@ ComponentRegistry.registerComponent({ }, }, renderer: TableSearchWidgetRenderer.render, - configPanel: TableSearchWidgetConfigPanel, + configPanel: V2TableSearchWidgetConfigPanel, version: "1.0.0", author: "WACE", });