'use strict';

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

var vue = require('vue');
var CloseOutlined = require('@ant-design/icons-vue');
require('../input/index.js');
var initDefaultProps = require('../_util/props-util/initDefaultProps.js');
var Input = require('../input/Input.js');

const transferSearchProps = {
  prefixCls: String,
  placeholder: String,
  value: String,
  handleClear: Function,
  disabled: {
    type: Boolean,
    default: void 0
  },
  onChange: Function
};
var Search = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "Search",
  inheritAttrs: false,
  props: initDefaultProps.default(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(Input.default, {
        "placeholder": placeholder,
        "class": prefixCls,
        "value": value,
        "onChange": handleChange,
        "disabled": disabled,
        "allowClear": true
      }, {
        prefix: () => vue.createVNode(CloseOutlined.SearchOutlined, null, null)
      });
    };
  }
});

exports.default = Search;
exports.transferSearchProps = transferSearchProps;
//# sourceMappingURL=search.js.map
