/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { h as helper } from '../../../chunks/helper.js';
import { SearchIcon } from '@ldesign/icons-vue';
import { Input } from '../../input/index.js';
import mixins from '../../../utils/mixins.js';
import { getGlobalIconMixins } from '../../config-provider/config-receiver.js';
import '../../../chunks/_commonjsHelpers.js';
import '../../../utils/map-props.js';
import 'vue';
import '../../../utils/with-install.js';
import 'lodash';
import '../../../config.js';
import '../../input/input.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../../chunks/helper2.js';
import '../../../chunks/defineProperty-838e4192.js';
import '../../../chunks/index.js';
import '../../../chunks/log.js';
import '../../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../../utils/helper.js';
import '../../../utils/event.js';
import '../../../utils/render-node.js';
import '../../input/props.js';
import 'lodash/mergeWith';
import '../../config-provider/context.js';
import '../../../chunks/zh_CN.js';
import '../../config-provider/type.js';
import '../../input/group.js';
import '../../input/style';
import '../../input/type.js';

var LSearch = mixins(getGlobalIconMixins()).extend({
  name: "LTransferSearch",
  model: {
    prop: "searchValue",
    event: "change"
  },
  components: {
    LInput: Input
  },
  props: {
    searchValue: {
      type: String,
      default: ""
    },
    search: {
      type: [Boolean, Object]
    },
    placeholder: String,
    classPrefix: String
  },
  render() {
    const h = arguments[0];
    const {
      SearchIcon: SearchIcon$1
    } = this.useGlobalIcon({
      SearchIcon: SearchIcon
    });
    const {
      searchValue,
      search,
      placeholder,
      classPrefix
    } = this;
    const inputProps = typeof search === "object" ? search : {
      clearable: true
    };
    const handleChange = (value, changeCtx) => {
      this.$emit("change", value);
      this.$emit("search", {
        value,
        trigger: "input",
        e: changeCtx.e
      });
    };
    const handleEnter = (value, changeCtx) => {
      this.$emit("search", {
        value,
        trigger: "input",
        e: changeCtx.e
      });
    };
    return h("div", {
      "class": `${classPrefix}-transfer__search-wrapper`
    }, [h("l-input", helper([{}, {
      "props": {
        ...inputProps
      }
    }, {
      "attrs": {
        "value": searchValue,
        "placeholder": placeholder
      },
      "on": {
        "change": handleChange,
        "enter": handleEnter
      }
    }]), [h(SearchIcon$1, {
      "slot": "suffix-icon"
    })])]);
  }
});

export { LSearch as default };
//# sourceMappingURL=transfer-search.js.map
