import './demo14.css'; import React from 'react'; import ReactDOM from 'react-dom'; import Select from '..'; import classNames from 'classnames'; /* eslint-disable react/prop-types, react/no-multi-comp */ // prevent onBlur function preventDefault(e) { e.preventDefault(); } interface PageProps { onChange: (item: any) => void; onMouseDown: (e) => void; className: string; } class CustomMenu extends React.Component { data: { label: string; value: number }[]; constructor(props) { super(props); this.data = [ { label: 'value1', value: 1, }, { label: 'value2', value: 2, }, ]; } onClick(item) { this.props.onChange(item); } renderItems() { return this.data.map(item => (
  • {item.label}
  • )); } render() { const { className, ...others } = this.props; const cls = classNames('overlay-content', className); return ( ); } } interface PageStates { value: any; visible: boolean; } class Demo extends React.Component<{}, PageStates> { handleSelect: (value: any) => void; onVisibleChange: (visible: any) => void; constructor(props) { super(props); this.handleSelect = value => { this.setState({ value, visible: false, }); }; this.onVisibleChange = visible => { this.setState({ visible, }); }; this.state = { value: null, visible: false, }; } render() { const popupContent = (
    custom header
    custom footer
    ); const popupProps = { triggerClickKeycode: [ 13, 32, 40 ], // space, enter, down-arrow }; return (