'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var _ = require('lodash');
require('../../../../utils/index.js');
require('../config/index.js');
var createNamespace = require('../../../../utils/create-namespace.js');
var headerSearch = require('../config/header-search.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlTreeSelectHeaderSearch" },
  __name: "header-search",
  props: headerSearch.treeSelectHeaderSearchProps,
  emits: headerSearch.treeSelectHeaderSearchEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const bem = createNamespace.createNamespace("tree-search");
    const handleInputChange = (e) => {
      props.onSearchInputChange && props.onSearchInputChange(e.target.value);
    };
    const handleClick = (e) => emits("click", e);
    const throttleInputChange = _.throttle(handleInputChange, props.throttleTime);
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_ll_input = vue.resolveComponent("ll-input");
      const _component_ll_button = vue.resolveComponent("ll-button");
      return vue.openBlock(), vue.createElementBlock(
        "div",
        {
          class: vue.normalizeClass(vue.unref(bem).e("header"))
        },
        [
          vue.createCommentVNode(" input "),
          vue.createVNode(_component_ll_input, {
            value: props.searchValue,
            placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57",
            onChange: vue.unref(throttleInputChange)
          }, {
            prefix: vue.withCtx(() => [
              vue.createVNode(_component_ll_icon, {
                "icon-name": "icon-search",
                class: vue.normalizeClass(vue.unref(bem).e("header-icon"))
              }, null, 8, ["class"])
            ]),
            _: 1
            /* STABLE */
          }, 8, ["value", "onChange"]),
          vue.createCommentVNode(" add "),
          _ctx.isShowAddBtn ? (vue.openBlock(), vue.createBlock(_component_ll_button, {
            key: 0,
            class: vue.normalizeClass(`${vue.unref(bem).e("header-button")}`),
            onClick: handleClick
          }, {
            default: vue.withCtx(() => [
              vue.createVNode(_component_ll_icon, { "icon-name": "icon-add" })
            ]),
            _: 1
            /* STABLE */
          }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
        ],
        2
        /* CLASS */
      );
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=header-search.vue2.js.map
