UNPKG

@aplus-frontend/ui

Version:

44 lines (43 loc) 1.31 kB
import { defineComponent as h, useTemplateRef as g, computed as p, ref as f, watch as d, onMounted as m, createElementBlock as H, openBlock as v, normalizeStyle as y, unref as w, renderSlot as S } from "vue"; import { SMALL_HEIGHT as l, LARGER_HEIGHT as _ } from "../constants.mjs"; import { useAgGridModalInject as L } from "../hooks/use-ag-grid-instance.mjs"; const k = /* @__PURE__ */ h({ __name: "index", props: { rowHeight: { default: 32 }, height: { default: void 0 } }, setup(c) { const u = c, t = g("wrapperContainer"), s = L(), r = p( () => s?.dataSourceLength?.value || 0 ), i = f(l), a = () => { const e = t.value?.clientHeight, o = t.value?.querySelector( ".ag-body.ag-layout-normal" )?.clientHeight; let n = 0; !e || !o ? n = 0 : n = e - o, r.value * u.rowHeight > 480 - n && (i.value = _); }; return d( () => r.value, () => { a(); } ), m(() => { a(); }), (e, o) => (v(), H("div", { ref_key: "wrapperContainer", ref: t, style: y({ minHeight: e.height ? "unset" : w(l), height: e.height ?? i.value, display: "flex", flexDirection: "column" }) }, [ S(e.$slots, "default") ], 4)); } }); export { k as default };