/**
 * tdesign v0.32.0
 * (c) 2021 tdesign
 * @license MIT
 */

'use strict';

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

var helper = require('../../_chunks/dep-44e6bdf6.js');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _typeof = require('@babel/runtime/helpers/typeof');
var Vue = require('vue');
var tdesignIconsVue = require('tdesign-icons-vue');
var config = require('../../config.js');
var input_index = require('../../input/index.js');
require('../../input/addon.js');
require('../../input/input.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/slicedToArray');
require('lodash/camelCase');
require('../../config-provider/config-receiver.js');
require('../../config-provider/zh_CN_config.js');
require('../../utils/mixins.js');
require('../../utils/classnames.js');
require('../../utils/event.js');
require('../../input/props.js');
require('../../input/input-group.js');
require('../../utils/render-tnode.js');
require('../../utils/map-props.js');
require('../../utils/withInstall.js');
require('lodash/capitalize');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var Search = Vue__default["default"].extend({
  name: "TTransferSearch",
  functional: true,
  model: {
    prop: "searchValue",
    event: "change"
  },
  props: {
    searchValue: {
      type: String,
      "default": ""
    },
    search: {
      type: [Boolean, Object]
    },
    placeholder: String
  },
  render: function render(_, context) {
    var h = arguments[0];
    var _context$props = context.props,
        searchValue = _context$props.searchValue,
        search = _context$props.search,
        placeholder = _context$props.placeholder;
    var inputProps = _typeof__default["default"](search) === "object" ? search : {
      clearable: true
    };

    var handleChange = function handleChange(value, changeCtx) {
      context.listeners.change && context.listeners.change(value);
      context.listeners.search && context.listeners.search({
        value: value,
        trigger: "input",
        e: changeCtx.e
      });
    };

    var handleEnter = function handleEnter(value, changeCtx) {
      context.listeners.search && context.listeners.search({
        value: value,
        trigger: "input",
        e: changeCtx.e
      });
    };

    return h("div", {
      "class": "".concat(config.prefix, "-transfer__search-wrapper")
    }, [h(input_index.Input, helper.helper([{}, {
      "props": _objectSpread({}, inputProps)
    }, {
      "attrs": {
        "value": searchValue,
        "placeholder": placeholder
      },
      "on": {
        "change": handleChange,
        "enter": handleEnter
      }
    }]), [h(tdesignIconsVue.SearchIcon, {
      "slot": "suffix-icon"
    })])]);
  }
});

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