ERP-node/frontend/components/v2/config-panels/V2TableListConfigPanel.tsx

54 lines
1.5 KiB
TypeScript
Raw Normal View History

"use client";
/**
* V2TableList
* TableListConfigPanel의 ( , DnD, ,
* , , , , , )
* componentConfigChanged
*/
import React from "react";
import { TableListConfigPanel } from "@/lib/registry/components/v2-table-list/TableListConfigPanel";
import type { TableListConfig } from "@/lib/registry/components/v2-table-list/types";
interface V2TableListConfigPanelProps {
config: TableListConfig;
onChange: (config: Partial<TableListConfig>) => void;
screenTableName?: string;
tableColumns?: any[];
menuObjid?: number;
}
export const V2TableListConfigPanel: React.FC<V2TableListConfigPanelProps> = ({
config,
onChange,
screenTableName,
tableColumns,
menuObjid,
}) => {
const handleChange = (newConfig: Partial<TableListConfig>) => {
onChange(newConfig);
if (typeof window !== "undefined") {
window.dispatchEvent(
new CustomEvent("componentConfigChanged", {
detail: { config: { ...config, ...newConfig } },
})
);
}
};
return (
<TableListConfigPanel
config={config}
onChange={handleChange}
screenTableName={screenTableName}
tableColumns={tableColumns}
/>
);
};
V2TableListConfigPanel.displayName = "V2TableListConfigPanel";
export default V2TableListConfigPanel;