"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
;/* empty css                  */
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
const _hoisted_1 = {
  key: 0,
  class: "app-content"
};
const _sfc_main = {
  __name: "ApproveIdea",
  props: {
    approveDesc: {
      type: String,
      default: ""
    },
    uniqueKey: {
      type: String,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const ideaRef = Vue.ref(null);
    const isExpanded = Vue.ref(false);
    const isOverflow = Vue.ref(true);
    const checkOverflow = () => {
      if (!ideaRef.value) return;
      Vue.nextTick(() => {
        isOverflow.value = ideaRef.value.scrollHeight > ideaRef.value.offsetHeight;
      });
    };
    const toggle = () => {
      isExpanded.value = !isExpanded.value;
    };
    Vue.onMounted(() => {
      checkOverflow();
    });
    Vue.watch(
      () => props.approveDesc,
      () => {
        isExpanded.value = false;
        checkOverflow();
      }
    );
    return (_ctx, _cache) => {
      return __props.approveDesc ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createElementVNode("div", {
          class: Vue.normalizeClass(["approveIdea", { "is-expanded": isExpanded.value || !isOverflow.value }]),
          ref: (el) => {
            if (el) ideaRef.value = el;
          }
        }, Vue.toDisplayString(__props.approveDesc), 3),
        isOverflow.value ? (Vue.openBlock(), Vue.createElementBlock("div", {
          key: 0,
          class: "approve-toggle",
          onClick: toggle
        }, Vue.toDisplayString(isExpanded.value ? "收起" : "展开"), 1)) : Vue.createCommentVNode("", true)
      ])) : Vue.createCommentVNode("", true);
    };
  }
};
const ApproveIdea = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-95cdb22f"]]);
exports.default = ApproveIdea;
