/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

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

var _typeof = require('@babel/runtime/helpers/typeof');
var vue = require('vue');
var iconsVueNext = require('@ldesign/icons-vue-next');
var input_index = require('../../input/index.js');
var hooks_useConfig = require('../../hooks/useConfig.js');
var hooks_useGlobalIcon = require('../../hooks/useGlobalIcon.js');
require('../../utils/withInstall.js');
require('../../input/input.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/defineProperty');
require('lodash/isUndefined');
require('../../form/hooks.js');
require('../../hooks/tnode.js');
require('lodash/isFunction');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/isString');
require('lodash/isObject');
require('../../input/props.js');
require('../../input/useInput.js');
require('@babel/runtime/helpers/slicedToArray');
require('../../form/const.js');
require('../../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('../../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('../../_chunks/dep-f4db2590.js');
require('dayjs');
require('../../hooks/useVModel.js');
require('../../input/useLengthLimit.js');
require('lodash/isNumber');
require('../../_common/js/log/log.js');
require('../../_common/js/utils/helper.js');
require('@babel/runtime/helpers/toConsumableArray');
require('lodash/isNull');
require('../../input/useInputEventHandler.js');
require('../../input/useInputWidth.js');
require('../../input/input-group.js');
require('../../input/input-group-props.js');

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

var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);

var Search = vue.defineComponent({
  name: "TTransferSearch",
  props: {
    value: {
      type: String,
      "default": ""
    },
    search: {
      type: [Boolean, Object],
      "default": false
    },
    placeholder: {
      type: String,
      "default": ""
    },
    onChange: Function
  },
  setup: function setup(props) {
    var classPrefix = hooks_useConfig.usePrefixClass();
    var _useGlobalIcon = hooks_useGlobalIcon.useGlobalIcon({
        SearchIcon: iconsVueNext.SearchIcon
      }),
      SearchIcon = _useGlobalIcon.SearchIcon;
    var handleChange = function handleChange(value, changeCtx) {
      var _props$onChange;
      (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
        value: value,
        e: changeCtx.e
      });
    };
    var inputProps = _typeof__default["default"](props.search) === "object" ? props.search : {
      clearable: true
    };
    return function () {
      return vue.createVNode("div", {
        "class": "".concat(classPrefix.value, "-transfer__search-wrapper")
      }, [vue.createVNode(input_index.Input, vue.mergeProps(inputProps, {
        "defaultValue": props.value,
        "onChange": handleChange,
        "placeholder": props.placeholder
      }), {
        "default": function _default() {
          return [vue.createVNode(SearchIcon, {
            "slot": "suffix-icon"
          }, null)];
        }
      })]);
    };
  }
});

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