import { ElButton as x } from "element-plus/es";
import { defineComponent as H, useSlots as h, ref as s, onMounted as q, createElementBlock as p, openBlock as i, createElementVNode as r, normalizeStyle as w, normalizeClass as B, renderSlot as f, createCommentVNode as y, createVNode as C, withCtx as a, createTextVNode as d, Fragment as E, createBlock as c, nextTick as N } from "vue";
const V = { class: "CiCommonListQuery" }, S = { class: "query-actions" }, z = {
  name: "CiCommonListQuery",
  inheritAttrs: !1
  // 禁止继承外部传递给组件的属性（例如 class、style 等）
}, T = /* @__PURE__ */ H({
  ...z,
  setup(L) {
    const k = h(), t = s(!1), o = s(null), u = s(0), m = s(0), _ = !!k.hiddenConditions;
    q(() => {
      g();
    });
    const g = async () => {
      o.value && (u.value = o.value.scrollHeight);
    }, v = async () => {
      t.value = !t.value, await N(), o.value && (m.value = o.value.scrollHeight);
    };
    return (n, e) => {
      const l = x;
      return i(), p("div", V, [
        r("div", {
          class: B(["query-conditions", { "is-expanded": t.value }]),
          ref_key: "queryConditions",
          ref: o,
          style: w({ height: t.value ? `${m.value}px` : `${u.value}px` })
        }, [
          f(n.$slots, "showConditions", {}, void 0, !0),
          t.value ? f(n.$slots, "hiddenConditions", { key: 0 }, void 0, !0) : y("", !0),
          r("div", S, [
            C(l, {
              type: "primary",
              onClick: e[0] || (e[0] = ($) => n.$emit("search"))
            }, {
              default: a(() => e[2] || (e[2] = [
                d("查询")
              ])),
              _: 1,
              __: [2]
            }),
            C(l, {
              onClick: e[1] || (e[1] = ($) => n.$emit("reset"))
            }, {
              default: a(() => e[3] || (e[3] = [
                d("重置")
              ])),
              _: 1,
              __: [3]
            }),
            _ ? (i(), p(E, { key: 0 }, [
              t.value ? (i(), c(l, {
                key: 1,
                onClick: v
              }, {
                default: a(() => e[5] || (e[5] = [
                  d("收起")
                ])),
                _: 1,
                __: [5]
              })) : (i(), c(l, {
                key: 0,
                type: "primary",
                link: "",
                onClick: v
              }, {
                default: a(() => e[4] || (e[4] = [
                  r("span", null, "更多筛选", -1),
                  r("div", { class: "down-triangle" }, null, -1)
                ])),
                _: 1,
                __: [4]
              }))
            ], 64)) : y("", !0)
          ])
        ], 6)
      ]);
    };
  }
});
export {
  T as default
};
