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

'use strict';

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

var helper = require('../../../chunks/helper.js');
var iconsVue = require('@ldesign/icons-vue');
var components_input_index = require('../../input/index.js');
var utils_mixins = require('../../../utils/mixins.js');
var components_configProvider_configReceiver = require('../../config-provider/config-receiver.js');
require('../../../utils/map-props.js');
require('vue');
require('../../../utils/with-install.js');
require('lodash');
require('../../../config.js');
require('../../input/input.js');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../../chunks/helper2.js');
require('../../../chunks/log.js');
require('../../../chunks/_commonjsHelpers-2e6815bd.js');
require('../../../utils/helper.js');
require('../../../utils/event.js');
require('../../../utils/render-node.js');
require('../../input/props.js');
require('lodash/mergeWith');
require('../../config-provider/context.js');
require('../../../chunks/zh_CN.js');
require('../../input/group.js');

var LSearch = utils_mixins["default"](components_configProvider_configReceiver.getGlobalIconMixins()).extend({
  name: "LTransferSearch",
  model: {
    prop: "searchValue",
    event: "change"
  },
  components: {
    LInput: components_input_index.Input
  },
  props: {
    searchValue: {
      type: String,
      default: ""
    },
    search: {
      type: [Boolean, Object]
    },
    placeholder: String,
    classPrefix: String
  },
  render() {
    const h = arguments[0];
    const {
      SearchIcon
    } = this.useGlobalIcon({
      SearchIcon: iconsVue.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.helper([{}, {
      "props": {
        ...inputProps
      }
    }, {
      "attrs": {
        "value": searchValue,
        "placeholder": placeholder
      },
      "on": {
        "change": handleChange,
        "enter": handleEnter
      }
    }]), [h(SearchIcon, {
      "slot": "suffix-icon"
    })])]);
  }
});

exports["default"] = LSearch;
//# sourceMappingURL=transfer-search.js.map
