UNPKG

@aplus-frontend/ui

Version:

2 lines (1 loc) 984 B
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../constants.js"),h=require("../hooks/use-ag-grid-instance.js"),d=e.defineComponent({__name:"index",props:{rowHeight:{default:32},height:{default:void 0}},setup(s){const c=s,n=e.useTemplateRef("wrapperContainer"),g=h.useAgGridModalInject(),a=e.computed(()=>g?.dataSourceLength?.value||0),l=e.ref(i.SMALL_HEIGHT),u=()=>{const t=n.value?.clientHeight,o=n.value?.querySelector(".ag-body.ag-layout-normal")?.clientHeight;let r=0;!t||!o?r=0:r=t-o,a.value*c.rowHeight>480-r&&(l.value=i.LARGER_HEIGHT)};return e.watch(()=>a.value,()=>{u()}),e.onMounted(()=>{u()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperContainer",ref:n,style:e.normalizeStyle({minHeight:t.height?"unset":e.unref(i.SMALL_HEIGHT),height:t.height??l.value,display:"flex",flexDirection:"column"})},[e.renderSlot(t.$slots,"default")],4))}});exports.default=d;