@aliretail/react-materials-components
Version:
29 lines (23 loc) • 889 B
JavaScript
import _Select from "@alifd/next/es/select";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["value", "onChange"];
import * as React from 'react';
function FusionSelect(props) {
var value = props.value,
onChange = props.onChange,
otherProps = _objectWithoutPropertiesLoose(props, _excluded); // 如果传入的 props 中有 onSearch
if (otherProps.onSearch) {
otherProps.onSearch = function (inputValue) {
return otherProps.onSearch(inputValue, 'inputChange');
};
otherProps.onSearchClear = function (actionType) {
return otherProps.onSearch('', actionType);
};
}
return /*#__PURE__*/React.createElement(_Select, _extends({
value: value,
onChange: onChange
}, otherProps));
}
export default FusionSelect;