Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.124/FieldSet/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[i,c]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{i&&(setCollapseHeight(r),e&&removeCollapseHeight(r))}),[r,i,e]),[i,n=>{n.target===r.current&&i&&!e?(t(!0),c(!1),removeCollapseHeight(r)):n.target===r.current&&(t(!1),c(!1))},t=>{t.preventDefault(),e&&!i&&setCollapseHeight(r),i||c(!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