<commit_before>import React, { PropTypes, Component } from 'react';
import classNames from 'classnames';
import ClickListener from '../internal/ClickListener';
import Icon from './Icon';
if (!process.env.EXCLUDE_SASS) {
  import('@console/bluemix-components/consumables/scss/components/overflow-menu/overflow-menu.scss');
}

class OverflowMenu extends Component {

  static propTypes = {
    open: PropTypes.bool,
    children: PropTypes.node,
    className: PropTypes.string,
    tabIndex: PropTypes.number,
    id: PropTypes.string,
    ariaLabel: PropTypes.string,
    onClick: PropTypes.func,
    onFocus: PropTypes.func,
    onKeyDown: PropTypes.func,
    handleClick: PropTypes.func,
    iconDescription: PropTypes.string.isRequired,
  }

  static defaultProps = {
    ariaLabel: 'list of options',
    iconDescription: 'open and close list of options',
    open: false,
    onClick: () => {},
    tabIndex: 0,
  }

  state = {
    open: this.props.open,
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.open !== this.props.open) {
      this.setState({ open: nextProps.open });
    }
  }

  closeMenu = () => {
    this.setState({
      open: false,
    });
  }

  handleClick = (evt) => {
    this.setState({ open: !this.state.open });
    this.props.onClick(evt);
  }

  handleKeyPress = (evt) => {
    const key = evt.key || evt.which;
    console.log('here');

    if (key === 'Enter' || key === 13 || key === ' ' || key === 32) {
      this.setState({ open: !this.state.open });
    }
  }

  handleClickOutside = () => {
    this.closeMenu();
  }

  render() {
    const {
      id,
      tabIndex,
      ariaLabel,
      children,
      iconDescription,
      onClick, // eslint-disable-line
      ...other,
    } = this.props;

    const overflowMenuClasses = classNames(<commit_msg>chore(log): remove redundant console.log() (#566)<commit_after>import React, { PropTypes, Component } from 'react';
import classNames from 'classnames';
import ClickListener from '../internal/ClickListener';
import Icon from './Icon';
if (!process.env.EXCLUDE_SASS) {
  import('@console/bluemix-components/consumables/scss/components/overflow-menu/overflow-menu.scss');
}

class OverflowMenu extends Component {

  static propTypes = {
    open: PropTypes.bool,
    children: PropTypes.node,
    className: PropTypes.string,
    tabIndex: PropTypes.number,
    id: PropTypes.string,
    ariaLabel: PropTypes.string,
    onClick: PropTypes.func,
    onFocus: PropTypes.func,
    onKeyDown: PropTypes.func,
    handleClick: PropTypes.func,
    iconDescription: PropTypes.string.isRequired,
  }

  static defaultProps = {
    ariaLabel: 'list of options',
    iconDescription: 'open and close list of options',
    open: false,
    onClick: () => {},
    tabIndex: 0,
  }

  state = {
    open: this.props.open,
  }

  componentWillReceiveProps(nextProps) {
    if (nextProps.open !== this.props.open) {
      this.setState({ open: nextProps.open });
    }
  }

  closeMenu = () => {
    this.setState({
      open: false,
    });
  }

  handleClick = (evt) => {
    this.setState({ open: !this.state.open });
    this.props.onClick(evt);
  }

  handleKeyPress = (evt) => {
    const key = evt.key || evt.which;

    if (key === 'Enter' || key === 13 || key === ' ' || key === 32) {
      this.setState({ open: !this.state.open });
    }
  }

  handleClickOutside = () => {
    this.closeMenu();
  }

  render() {
    const {
      id,
      tabIndex,
      ariaLabel,
      children,
      iconDescription,
      onClick, // eslint-disable-line
      ...other,
    } = this.props;

    const overflowMenuClasses = classNames(
{'fraction_non_alphanumeric': 0.1466299862448418, 'fraction_numerical': 0.003576341127922971, 'mean_word_length': 2.843551797040169, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4196356', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1164, 'n_words': 244}