'use strict';

import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
import { KeyDownable } from '../KeyDownable';
export var ListRow =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(ListRow, _React$Component);

  function ListRow() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = ListRow.prototype;

  _proto.render = function render() {
    var _this$props = this.props,
        children = _this$props.children,
        testAutomationId = _this$props.testAutomationId,
        keyDownableProps = _this$props.keyDownableProps,
        onClick = _this$props.onClick,
        props = _objectWithoutPropertiesLoose(_this$props, ["children", "testAutomationId", "keyDownableProps", "onClick"]);

    return React.createElement(KeyDownable, _extends({}, keyDownableProps, {
      onClick: onClick
    }), function (_ref) {
      var onRowClick = _ref.onClick,
          onKeyDown = _ref.onKeyDown;
      return React.createElement("tr", _extends({
        "data-test-automation-id": testAutomationId
      }, props, {
        onClick: onRowClick,
        onKeyDown: onKeyDown
      }), children);
    });
  };

  return ListRow;
}(React.Component);

_defineProperty(ListRow, "defaultProps", {
  children: null,
  testAutomationId: 'row',
  onClick: null,
  keyDownableProps: {
    preventDefaultKeyDown: false,
    preventDefaultMouseDown: false
  }
});

_defineProperty(ListRow, "propTypes", {
  children: PropTypes.node,
  testAutomationId: PropTypes.string,
  onClick: PropTypes.func,
  keyDownableProps: PropTypes.shape({
    preventDefaultKeyDown: PropTypes.bool,
    preventDefaultMouseDown: PropTypes.bool
  })
});