text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _extends2 = require('babel-runtime/helpers/extends');
  
  var _extends3 = _interopRequireDefault(_extends2);
  
  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 _simpleAssign = require('simple-assign');
  
  var _simpleAssign2 = _interopRequireDefault(_simpleAssign);
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function getStyles(props, context) {
    var tableRowColumn = context.muiTheme.tableRowColumn;
  
  
    var styles = {
      root: {
        paddingLeft: tableRowColumn.spacing,
        paddingRight: tableRowColumn.spacing,
        height: tableRowColumn.height,
        textAlign: 'left',
        fontSize: 13,
        overflow: 'hidden',
        whiteSpace: 'nowrap',
        textOverflow: 'ellipsis'
      }
    };
  
    if (_react2.default.Children.count(props.children) === 1 && !isNaN(props.children)) {
      styles.textAlign = 'right';
    }
  
    return styles;
  }
  
  var TableRowColumn = function (_Component) {
    (0, _inherits3.default)(TableRowColumn, _Component);
  
    function TableRowColumn() {
      var _ref;
  
      var _temp, _this, _ret;
  
      (0, _classCallCheck3.default)(this, TableRowColumn);
  
      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 = TableRowColumn.__proto__ || (0, _getPrototypeOf2.default)(TableRowColumn)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
        hovered: false
      }, _this.onClick = function (event) {
        if (_this.props.onClick) {
          _this.props.onClick(event, _this.props.columnNumber);
        }
      }, _this.onMouseEnter = function (event) {
        if (_this.props.hoverable) {
          _this.setState({ hovered: true });
          if (_this.props.onHover) {
            _this.props.onHover(event, _this.props.columnNumber);
          }
        }
      }, _this.onMouseLeave = function (event) {
        if (_this.props.hoverable) {
          _this.setState({ hovered: false });
          if (_this.props.onHoverExit) {
            _this.props.onHoverExit(event, _this.props.columnNumber);
          }
        }
      }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
    }
  
    (0, _createClass3.default)(TableRowColumn, [{
      key: 'render',
      value: function render() {
        var _props = this.props,
            children = _props.children,
            className = _props.className,
            columnNumber = _props.columnNumber,
            hoverable = _props.hoverable,
            onClick = _props.onClick,
            onHover = _props.onHover,
            onHoverExit = _props.onHoverExit,
            style = _props.style,
            other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'columnNumber', 'hoverable', 'onClick', 'onHover', 'onHoverExit', 'style']);
        var prepareStyles = this.context.muiTheme.prepareStyles;
  
        var styles = getStyles(this.props, this.context);
  
        var handlers = {
          onClick: this.onClick,
          onMouseEnter: this.onMouseEnter,
          onMouseLeave: this.onMouseLeave
        };
  
        return _react2.default.createElement(
          'td',
          (0, _extends3.default)({
            className: className,
            style: prepareStyles((0, _simpleAssign2.default)(styles.root, style))
          }, handlers, other),
          children
        );
      }
    }]);
    return TableRowColumn;
  }(_react.Component);
  
  TableRowColumn.defaultProps = {
    hoverable: false
  };
  TableRowColumn.contextTypes = {
    muiTheme: _react.PropTypes.object.isRequired
  };
  process.env.NODE_ENV !== "production" ? TableRowColumn.propTypes = {
    children: _react.PropTypes.node,
    /**
     * The css class name of the root element.
     */
    className: _react.PropTypes.string,
    /**
     * @ignore
     * Number to identify the header row. This property
     * is automatically populated when used with TableHeader.
     */
    columnNumber: _react.PropTypes.number,
    /**
     * @ignore
     * If true, this column responds to hover events.
     */
    hoverable: _react.PropTypes.bool,
    /** @ignore */
    onClick: _react.PropTypes.func,
    /** @ignore */
    onHover: _react.PropTypes.func,
    /**
     * @ignore
     * Callback function for hover exit event.
     */
    onHoverExit: _react.PropTypes.func,
    /**
     * Override the inline-styles of the root element.
     */
    style: _react.PropTypes.object
  } : void 0;
  exports.default = TableRowColumn;