/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

import { h as helper } from '../../../chunks/helper.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _typeof from '@babel/runtime/helpers/typeof';
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 '../../input/input.js';
import '@babel/runtime/helpers/toConsumableArray';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../../chunks/helper2.js';
import '@babel/runtime/helpers/slicedToArray';
import '../../../chunks/defineProperty-28395935.js';
import '../../../utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '../../../utils/event.js';
import '../../input/props.js';
import '../../../utils/render-node.js';
import 'vue';
import 'lodash/mergeWith';
import 'lodash';
import '../../config-provider/context.js';
import '../../../chunks/zh_CN.js';
import '../../config-provider/type.js';
import '../../input/group.js';
import '../../../utils/map-props.js';
import '../../../utils/with-install.js';
import '../../../config.js';
import '../../input/style';
import '../../input/type.js';

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(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 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: function render() {
    var _this = this;

    var h = arguments[0];

    var _this$useGlobalIcon = this.useGlobalIcon({
      SearchIcon: SearchIcon
    }),
        SearchIcon$1 = _this$useGlobalIcon.SearchIcon;

    4;
    var searchValue = this.searchValue,
        search = this.search,
        placeholder = this.placeholder,
        classPrefix = this.classPrefix;
    var inputProps = _typeof(search) === "object" ? search : {
      clearable: true
    };

    var handleChange = function handleChange(value, changeCtx) {
      _this.$emit("change", value);

      _this.$emit("search", {
        value: value,
        trigger: "input",
        e: changeCtx.e
      });
    };

    var handleEnter = function handleEnter(value, changeCtx) {
      _this.$emit("search", {
        value: value,
        trigger: "input",
        e: changeCtx.e
      });
    };

    return h("div", {
      "class": "".concat(classPrefix, "-transfer__search-wrapper")
    }, [h("l-input", helper([{}, {
      "props": _objectSpread({}, 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
