text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _extends2 = require('babel-runtime/helpers/extends');
  
  var _extends3 = _interopRequireDefault(_extends2);
  
  var _assign = require('babel-runtime/core-js/object/assign');
  
  var _assign2 = _interopRequireDefault(_assign);
  
  var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
  
  var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
  
  var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
  
  var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
  
  var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
  
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  
  var _createClass2 = require('babel-runtime/helpers/createClass');
  
  var _createClass3 = _interopRequireDefault(_createClass2);
  
  var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
  
  var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  
  var _inherits2 = require('babel-runtime/helpers/inherits');
  
  var _inherits3 = _interopRequireDefault(_inherits2);
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _propTypes = require('prop-types');
  
  var _propTypes2 = _interopRequireDefault(_propTypes);
  
  var _Table = require('material-ui/Table');
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function getStyles(props, context, state) {
    var tableRow = context.muiTheme.tableRow;
  
  
    var cellBgColor = 'inherit';
    if (props.hovered || state.hovered) {
      cellBgColor = tableRow.hoverColor;
    } else if (props.selected) {
      cellBgColor = tableRow.selectedColor;
    } else if (props.striped) {
      cellBgColor = tableRow.stripeColor;
    }
  
    return {
      root: {
        borderBottom: props.displayBorder && '1px solid ' + tableRow.borderColor,
        color: tableRow.textColor,
        height: tableRow.height
      },
      cell: {
        backgroundColor: cellBgColor
      }
    };
  }
  
  var DataTablesTableRow = function (_TableRow) {
    (0, _inherits3.default)(DataTablesTableRow, _TableRow);
  
    function DataTablesTableRow() {
      var _ref;
  
      var _temp, _this, _ret;
  
      (0, _classCallCheck3.default)(this, DataTablesTableRow);
  
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
  
      return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = DataTablesTableRow.__proto__ || (0, _getPrototypeOf2.default)(DataTablesTableRow)).call.apply(_ref, [this].concat(args))), _this), _this.clicked = false, _this.clickTimer = undefined, _this.onCellClick = function (event, columnIndex) {
        event.persist();
        if (_this.clicked) {
          _this.clicked = false;
          clearTimeout(_this.clickTimer);
          if (_this.props.onCellDoubleClick) {
            _this.props.onCellDoubleClick(event, _this.props.rowNumber, columnIndex);
          }
        } else {
          _this.clicked = true;
          _this.clickTimer = setTimeout(function () {
            _this.clicked = false;
            if (_this.props.selectable && _this.props.onCellClick) {
              _this.props.onCellClick(event, _this.props.rowNumber, columnIndex);
            }
            event.ctrlKey = true;
            _this.onRowClick(event);
          }, 300);
        }
      }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
    }
  
    (0, _createClass3.default)(DataTablesTableRow, [{
      key: 'render',
      value: function render() {
        var _this2 = this;
  
        var _props = this.props,
            className = _props.className,
            displayBorder = _props.displayBorder,
            hoverable = _props.hoverable,
            hovered = _props.hovered,
            onCellClick = _props.onCellClick,
            onCellDoubleClick = _props.onCellDoubleClick,
            onCellHover = _props.onCellHover,
            onCellHoverExit = _props.onCellHoverExit,
            onRowClick = _props.onRowClick,
            onRowHover = _props.onRowHover,
            onRowHoverExit = _props.onRowHoverExit,
            rowNumber = _props.rowNumber,
            selectable = _props.selectable,
            selected = _props.selected,
            striped = _props.striped,
            style = _props.style,
            other = (0, _objectWithoutProperties3.default)(_props, ['className', 'displayBorder', 'hoverable', 'hovered', 'onCellClick', 'onCellDoubleClick', 'onCellHover', 'onCellHoverExit', 'onRowClick', 'onRowHover', 'onRowHoverExit', 'rowNumber', 'selectable', 'selected', 'striped', 'style']);
        var prepareStyles = this.context.muiTheme.prepareStyles;
  
        var styles = getStyles(this.props, this.context, this.state);
  
        var rowColumns = _react2.default.Children.map(this.props.children, function (child, columnNumber) {
          if (_react2.default.isValidElement(child)) {
            return _react2.default.cloneElement(child, {
              columnNumber: columnNumber,
              hoverable: _this2.props.hoverable,
              key: _this2.props.rowNumber + '-' + columnNumber,
              onClick: _this2.onCellClick,
              onHover: _this2.onCellHover,
              onHoverExit: _this2.onCellHoverExit,
              style: (0, _assign2.default)({}, styles.cell, child.props.style)
            });
          }
        });
  
        return _react2.default.createElement(
          'tr',
          (0, _extends3.default)({
            className: className,
            style: prepareStyles((0, _assign2.default)(styles.root, style))
          }, other),
          rowColumns
        );
      }
    }]);
    return DataTablesTableRow;
  }(_Table.TableRow);
  
  DataTablesTableRow.propTypes = {
    /**
     * Children passed to table row.
     */
    children: _propTypes2.default.node,
    /**
     * The css class name of the root element.
     */
    className: _propTypes2.default.string,
    /**
     * If true, row border will be displayed for the row.
     * If false, no border will be drawn.
     */
    displayBorder: _propTypes2.default.bool,
    /**
     * Controls whether or not the row reponseds to hover events.
     */
    hoverable: _propTypes2.default.bool,
    /**
     * Controls whether or not the row should be rendered as being
     * hovered. This property is evaluated in addition to this.state.hovered
     * and can be used to synchronize the hovered state with some other
     * external events.
     */
    hovered: _propTypes2.default.bool,
    /**
     * @ignore
     * Called when a row cell is clicked.
     * rowNumber is the row number and columnId is
     * the column number or the column key.
     */
    onCellClick: _propTypes2.default.func,
    /**
     * @ignore
     * Customized handler
     * Called when a row cell is double clicked.
     */
    onCellDoubleClick: _propTypes2.default.func,
    /**
     * @ignore
     * Called when a table cell is hovered.
     * rowNumber is the row number of the hovered row
     * and columnId is the column number or the column key of the cell.
     */
    onCellHover: _propTypes2.default.func,
    /**
     * @ignore
     * Called when a table cell is no longer hovered.
     * rowNumber is the row number of the row and columnId
     * is the column number or the column key of the cell.
     */
    onCellHoverExit: _propTypes2.default.func,
    /**
     * @ignore
     * Called when row is clicked.
     */
    onRowClick: _propTypes2.default.func,
    /**
     * @ignore
     * Called when a table row is hovered.
     * rowNumber is the row number of the hovered row.
     */
    onRowHover: _propTypes2.default.func,
    /**
     * @ignore
     * Called when a table row is no longer hovered.
     * rowNumber is the row number of the row that is no longer hovered.
     */
    onRowHoverExit: _propTypes2.default.func,
    /**
     * Number to identify the row. This property is
     * automatically populated when used with the TableBody component.
     */
    rowNumber: _propTypes2.default.number,
    /**
     * If true, table rows can be selected. If multiple row
     * selection is desired, enable multiSelectable.
     * The default value is true.
     */
    selectable: _propTypes2.default.bool,
    /**
     * Indicates that a particular row is selected.
     * This property can be used to programmatically select rows.
     */
    selected: _propTypes2.default.bool,
    /**
     * Indicates whether or not the row is striped.
     */
    striped: _propTypes2.default.bool,
    /**
     * Override the inline-styles of the root element.
     */
    style: _propTypes2.default.object
  };
  exports.default = DataTablesTableRow;