Liferay.Loader.define("data-engine-taglib@3.3.53/data_layout_builder/js/hooks/useHeightTransition.es",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function useHeightTransition(e,t,r){const[a,i]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{a&&(setCollapseHeight(r),e&&removeCollapseHeight(r))}),[r,a,e]),[a,n=>{n.target===r.current&&a&&!e?(t(!0),i(!1),removeCollapseHeight(r)):n.target===r.current&&(t(!1),i(!1))},t=>{t.preventDefault(),e&&!a&&setCollapseHeight(r),a||i(!0)}]};var n=r("liferay!frontend-js-react-web$react");const removeCollapseHeight=e=>{e&&e.current&&e.current.style.removeProperty("height")},setCollapseHeight=e=>{if(e&&e.current){const t=Array.prototype.slice.call(e.current.children).reduce(((e,t)=>e+t.clientHeight),0);e.current.setAttribute("style","height: ".concat(t,"px"))}}}}));
//# sourceMappingURL=useHeightTransition.es.js.map