export*from"@vaadin/grid-pro/vaadin-grid-pro-edit-column.js";import{useLayoutEffect as l,useRef as O,useState as g}from"react";import{forwardRef as A}from"react";import{flushSync as C}from"react-dom";import{GridProEditColumn as L}from"@vaadin/grid-pro/vaadin-grid-pro-edit-column.js";import*as N from"react";import{createComponent as v}from"./utils/createComponent.js";var b={onEditorTypeChanged:"editor-type-changed"},s=v({elementClass:L,events:b,react:N,tagName:"vaadin-grid-pro-edit-column"});import{useModelRenderer as E}from"@vaadin/react-components/renderers/useModelRenderer.js";import{useSimpleOrChildrenRenderer as p}from"@vaadin/react-components/renderers/useSimpleOrChildrenRenderer.js";import H from"@vaadin/react-components/utils/useMergedRefs.js";import{jsxs as x}from"react/jsx-runtime";var n=Symbol();function S({children:c,footer:f,header:P,...o},R){let[a,u]=g(null),[G,i]=E(o.editModeRenderer,{renderMode:"sync",shouldRenderPortal:(e,r,t)=>a===t.item}),[T,I]=p(o.headerRenderer,P,{renderMode:"microtask"}),[y,_]=p(o.footerRenderer,f,{renderMode:"microtask"}),[h,m]=E(o.renderer??c,{renderMode:"microtask",shouldRenderPortal:(e,r,t)=>a!==t.item}),d=O(null),M=H(d,R);return l(()=>{d.current._clearCellContent=function(e){e[n]||Object.getPrototypeOf(this)._clearCellContent.call(this,e)}},[]),l(()=>{d.current._renderEditor=function(e,r){m||this._clearCellContent(e),C(()=>{u(r.item)}),e[n]=!0,Object.getPrototypeOf(this)._renderEditor.call(this,e,r),e[n]=!1}},[m]),l(()=>{d.current._removeEditor=function(e,r){i||this._clearCellContent(e),C(()=>{u(t=>t===r.item?null:t)}),e[n]=!0,Object.getPrototypeOf(this)._removeEditor.call(this,e,r),e[n]=!1}},[i]),x(s,{...o,editModeRenderer:i,footerRenderer:_,headerRenderer:I,ref:M,renderer:m,children:[G,T,y,h]})}var Q=A(S);export{Q as GridProEditColumn,L as GridProEditColumnElement};
/**
 * @license
 * Copyright (c) 2000 - 2024 Vaadin Ltd.
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 *
 * See https://vaadin.com/commercial-license-and-service-terms for the full
 * license.
 */
//# sourceMappingURL=GridProEditColumn.js.map
