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

import _typeof from '@babel/runtime/helpers/typeof';
import { defineComponent, createVNode, mergeProps } from 'vue';
import { SearchIcon } from '@ldesign/icons-vue-next';
import { Input } from '../../input/index.js';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { useGlobalIcon } from '../../hooks/useGlobalIcon.js';
import '../../utils/withInstall.js';
import '../../input/input.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/isUndefined';
import '../../form/hooks.js';
import '../../hooks/tnode.js';
import 'lodash/isFunction';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isString';
import 'lodash/isObject';
import '../../input/props.js';
import '../../input/useInput.js';
import '@babel/runtime/helpers/slicedToArray';
import '../../form/const.js';
import '../../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import '../../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../_chunks/dep-e041f5b0.js';
import 'dayjs';
import '../../hooks/useVModel.js';
import '../../input/useLengthLimit.js';
import 'lodash/isNumber';
import '../../_common/js/log/log.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/toConsumableArray';
import 'lodash/isNull';
import '../../input/useInputEventHandler.js';
import '../../input/useInputWidth.js';
import '../../input/input-group.js';
import '../../input/input-group-props.js';

var Search = 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 = usePrefixClass();
    var _useGlobalIcon = useGlobalIcon({
        SearchIcon: SearchIcon
      }),
      SearchIcon$1 = _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(props.search) === "object" ? props.search : {
      clearable: true
    };
    return function () {
      return createVNode("div", {
        "class": "".concat(classPrefix.value, "-transfer__search-wrapper")
      }, [createVNode(Input, mergeProps(inputProps, {
        "defaultValue": props.value,
        "onChange": handleChange,
        "placeholder": props.placeholder
      }), {
        "default": function _default() {
          return [createVNode(SearchIcon$1, {
            "slot": "suffix-icon"
          }, null)];
        }
      })]);
    };
  }
});

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