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