[agent-pipeline] pipe-20260311151253-nyk7 round-7
This commit is contained in:
parent
b4aec05512
commit
baa1d40bc4
|
|
@ -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 (
|
||||||
|
<TableSearchWidgetConfigPanel
|
||||||
|
component={component}
|
||||||
|
config={config}
|
||||||
|
onUpdateProperty={onChange ? undefined : handleUpdateProperty}
|
||||||
|
onChange={onChange ? handleChange : undefined}
|
||||||
|
tables={tables}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
V2TableSearchWidgetConfigPanel.displayName = "V2TableSearchWidgetConfigPanel";
|
||||||
|
|
||||||
|
export default V2TableSearchWidgetConfigPanel;
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import { ComponentRegistry } from "../../ComponentRegistry";
|
import { ComponentRegistry } from "../../ComponentRegistry";
|
||||||
import { TableSearchWidget } from "./TableSearchWidget";
|
import { TableSearchWidget } from "./TableSearchWidget";
|
||||||
import { TableSearchWidgetRenderer } from "./TableSearchWidgetRenderer";
|
import { TableSearchWidgetRenderer } from "./TableSearchWidgetRenderer";
|
||||||
import { TableSearchWidgetConfigPanel } from "./TableSearchWidgetConfigPanel";
|
import { V2TableSearchWidgetConfigPanel } from "@/components/v2/config-panels/V2TableSearchWidgetConfigPanel";
|
||||||
|
|
||||||
// 검색 필터 위젯 등록 (v2)
|
// 검색 필터 위젯 등록 (v2)
|
||||||
ComponentRegistry.registerComponent({
|
ComponentRegistry.registerComponent({
|
||||||
|
|
@ -30,7 +30,7 @@ ComponentRegistry.registerComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
renderer: TableSearchWidgetRenderer.render,
|
renderer: TableSearchWidgetRenderer.render,
|
||||||
configPanel: TableSearchWidgetConfigPanel,
|
configPanel: V2TableSearchWidgetConfigPanel,
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
author: "WACE",
|
author: "WACE",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue