UNPKG

1.16 kBJavaScriptView Raw
1// ag-grid-react v26.2.0
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4/*
5const JsEditorComp = (props: {setCellEditorRef: (cellEditor: ICellEditor | undefined)=>void,
6 compDetails: UserCompDetails, eParentElement: HTMLElement}) => {
7
8 const {context} = useContext(BeansContext);
9
10 useEffect(() => {
11
12 const {compDetails, eParentElement, setCellEditorRef} = props;
13
14 const cellEditor = createJsComp(context, factory => factory.createCellEditor(compDetails) ) as ICellEditorComp;
15 if (!cellEditor) { return; }
16
17 const compGui = cellEditor.getGui();
18
19 if (compGui) {
20 eParentElement.appendChild(cellEditor.getGui());
21 }
22
23 setCellEditorRef(cellEditor);
24
25 cellEditor.afterGuiAttached && cellEditor.afterGuiAttached();
26
27 return () => {
28 context.destroyBean(cellEditor);
29 setCellEditorRef(undefined);
30 if (compGui && compGui.parentElement) {
31 compGui.parentElement.removeChild(compGui);
32 }
33 };
34 }, []);
35
36 return (
37 <></>
38 );
39};
40
41export default memo(JsEditorComp);
42*/