import { defineComponent as P, useSlots as v, ref as A, computed as a, openBlock as t, createBlock as B, withCtx as u, renderSlot as d, createElementBlock as s, normalizeClass as I, createElementVNode as p, Fragment as w, toDisplayString as S, withModifiers as T } from "vue";
import { _ as E } from "./Base.vue_vue_type_script_setup_true_lang-Duh9tbur.js";
import { C as i } from "./base-PQGakkrl.js";
const F = {
  key: 0,
  class: "dropdownLayer-text-arrow"
}, U = ["title"], $ = {
  key: 0,
  class: "dropdownLayer-placeholder"
}, H = ["innerHTML"], M = {
  key: 4,
  class: "dropdownLayer-text-arrow"
}, K = /* @__PURE__ */ P({
  name: "ClDropdownlayerList",
  __name: "List",
  props: {
    classParent: String,
    classText: String,
    classDropDown: String,
    placeholder: String,
    isDisabled: {
      type: Boolean,
      default: !1
    },
    isClear: {
      type: Boolean,
      default: !1
    },
    textLabel: {
      type: String,
      default: ""
    },
    textArrowDirection: {
      type: String,
      default: "right"
      // left|right
    },
    dropdownArrowPos: {
      type: String,
      default: "left"
      // left|right
    },
    isUseDropdownArrow: {
      type: Boolean,
      default: !1
    },
    isCloseDestroy: {
      type: Boolean,
      default: !0
    },
    onOpenBeforeCallback: Function
  },
  emits: ["onChangeOpen", "onClear", "onChangePosition", "onOpenComplete"],
  setup(o, { expose: C, emit: m }) {
    const y = v(), n = o, c = m, r = A(), D = a(() => !i.isUndefined(y.labelCustom)), f = a(() => {
      let e;
      const { textLabel: l } = n;
      return i.isHtml(l) ? e = i.removeHTMLTags(l) : e = l, e;
    }), x = a(() => {
      let e = " dropdownLayer-theme-list ";
      return n.classParent && !i.isEmpty(n.classParent) && (e += n.classParent), e;
    }), g = a(() => {
      let e = " dropdownLayer-dropdown-theme-list ";
      return n.classDropDown && !i.isEmpty(n.classDropDown) && (e += n.classDropDown), e;
    }), h = a(() => ({
      "dropdownLayer-text-container": !0,
      "arrow-pos-left": n.textArrowDirection === "left"
    })), O = (e) => {
      c("onChangeOpen", e);
    }, L = (e) => {
      c("onChangePosition", e);
    }, k = () => {
      n.isDisabled || c("onClear");
    }, b = () => {
      c("onOpenComplete");
    };
    return C({
      setOpen: (e) => {
        r.value.setOpen(e);
      },
      calculationPosition: () => r.value.calculationPosition(),
      initCompleteOpen: () => {
        r.value.initCompleteOpen();
      },
      checkCurrentIsOpen: () => r.value.getIsShowOpen()
    }), (e, l) => (t(), B(E, {
      ref_key: "refElDropdownLayer",
      ref: r,
      classParent: x.value,
      classText: o.classText,
      classDropDown: g.value,
      isDisabled: o.isDisabled,
      dropdownArrowPos: o.dropdownArrowPos,
      isUseDropdownArrow: o.isUseDropdownArrow,
      isCloseDestroy: o.isCloseDestroy,
      isInitDelayComplete: !0,
      onOpenBeforeCallback: o.onOpenBeforeCallback,
      onOnChangeOpen: O,
      onOnChangePosition: L,
      onOnOpenComplete: b
    }, {
      labelText: u(() => [
        D.value ? d(e.$slots, "labelCustom", { key: 0 }) : (t(), s("div", {
          key: 1,
          class: I(h.value)
        }, [
          o.textArrowDirection === "left" ? (t(), s("div", F, [...l[0] || (l[0] = [
            p("i", { class: "clIconFont clIcon-angle-down" }, null, -1)
          ])])) : (t(), s(w, { key: 1 }, [], 64)),
          p("div", {
            class: "dropdownLayer-text-render",
            title: f.value
          }, [
            o.textLabel.length === 0 ? (t(), s("span", $, S(o.placeholder), 1)) : (t(), s("span", {
              key: 1,
              innerHTML: o.textLabel
            }, null, 8, H))
          ], 8, U),
          !o.isDisabled && o.isClear && o.textLabel.length > 0 ? (t(), s("i", {
            key: 2,
            class: "dropdownLayer-text-clear clIconFont clIcon-close-circle-fill",
            onClick: T(k, ["stop"])
          })) : (t(), s(w, { key: 3 }, [], 64)),
          d(e.$slots, "textExtend"),
          o.textArrowDirection === "right" ? (t(), s("div", M, [...l[1] || (l[1] = [
            p("i", { class: "clIconFont clIcon-angle-down" }, null, -1)
          ])])) : (t(), s(w, { key: 5 }, [], 64))
        ], 2))
      ]),
      dropdown: u(() => [
        d(e.$slots, "dropdown"),
        d(e.$slots, "dropdownExtend")
      ]),
      _: 3
    }, 8, ["classParent", "classText", "classDropDown", "isDisabled", "dropdownArrowPos", "isUseDropdownArrow", "isCloseDestroy", "onOpenBeforeCallback"]));
  }
});
export {
  K as _
};
//# sourceMappingURL=List.vue_vue_type_script_setup_true_lang-DzmylhZ6.js.map
