'use strict';

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

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
var index = require('../../input/index.cjs');
var props = require('./props.cjs');
var initDefaultProps = require('../../../utils/vue/initDefaultProps.cjs');

var Search = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "Search",
  inheritAttrs: false,
  props: initDefaultProps.initDefaultProps(props.transferSearchProps(), {
    placeholder: ""
  }),
  emits: ["change"],
  setup(props, {
    emit
  }) {
    const handleChange = (e) => {
      var _a;
      emit("change", e);
      if (e.target.value === "")
        (_a = props.handleClear) == null ? void 0 : _a.call(props);
    };
    return () => {
      const {
        placeholder,
        value,
        prefixCls,
        disabled
      } = props;
      return vue.createVNode(index.Input, {
        "placeholder": placeholder,
        "class": prefixCls,
        "value": value,
        "onChange": handleChange,
        "disabled": disabled,
        "allowClear": true
      }, {
        prefix: () => vue.createVNode(iconsVue.SearchOutlined, null, null)
      });
    };
  }
});

exports.default = Search;
//# sourceMappingURL=search.cjs.map
