"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-unified"),x=require("../../config-provider/index.js"),y=require("../../config-provider/hooks/use-global-config.js"),h=require("../../config-provider/config-provider.js"),b=e.defineComponent({__name:"index",props:{minHeight:{default:150},maxHeight:{default:"unset"}},emits:["heightChange"],setup(r,{emit:f}){const m=y.useGlobalConfig(),p=h.globalConfigCached.value.agGrid,l=r,H=f,a=e.useTemplateRef("wrapperContainer"),s=e.ref(u(l.minHeight)),g=t=>{const i=a.value?.clientHeight,o=a.value?.querySelector(".ag-body.ag-layout-normal")?.clientHeight;let n=0;!i||!o?n=0:n=i-o;const w=t+n,c=Math.max(w,l.minHeight);s.value=`${c}px`,H("heightChange",c)},C=t=>{if(!t)return;const i=t.getDisplayedRowCount();if(i>0){const o=t.getDisplayedRowAtIndex(i-1);if(o&&!d.isNil(o.rowTop)&&!d.isNil(o.rowHeight)){const n=o.rowTop+o.rowHeight;g(n)}}else g(150)},v=e.shallowRef({agGrid:{...m.value?.agGrid,onModelUpdated:C}});e.onMounted(()=>{h.globalConfigCached.value.agGrid=p});function u(t){return typeof t=="number"&&t?`${t}px`:t.toString()}return(t,i)=>(e.openBlock(),e.createBlock(e.unref(x.APConfigProvider),e.normalizeProps(e.guardReactiveProps(v.value)),{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"wrapperContainer",ref:a,style:e.normalizeStyle({height:s.value,maxHeight:r.maxHeight&&u(r.maxHeight)})},[e.renderSlot(t.$slots,"default")],4)]),_:3},16))}});exports.default=b;
