import { defineComponent, createVNode } from 'vue';
import { SearchOutlined } from '@ant-design/icons-vue';
import '../../../utils/index.mjs';
import { Input } from '../../input/index.mjs';
import { transferSearchProps } from './props.mjs';
import { initDefaultProps } from '../../../utils/vue/initDefaultProps.mjs';

var Search = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "Search",
  inheritAttrs: false,
  props: initDefaultProps(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 createVNode(Input, {
        "placeholder": placeholder,
        "class": prefixCls,
        "value": value,
        "onChange": handleChange,
        "disabled": disabled,
        "allowClear": true
      }, {
        prefix: () => createVNode(SearchOutlined, null, null)
      });
    };
  }
});

export { Search as default };
//# sourceMappingURL=search.mjs.map
