"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.CTADropdown = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Dropdown = _interopRequireDefault(require("react-bootstrap/lib/Dropdown"));

var _Icon = require("./Icon");

var CTADropdown =
/*#__PURE__*/
function (_React$Component) {
  (0, _inheritsLoose2.default)(CTADropdown, _React$Component);

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

  var _proto = CTADropdown.prototype;

  _proto.getChildContext = function getChildContext() {
    return {
      isCTADropdown: true
    };
  };

  _proto.render = function render() {
    var _this$props = this.props,
        testAutomationId = _this$props.testAutomationId,
        children = _this$props.children,
        toggleMoreLabel = _this$props.toggleMoreLabel,
        props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["testAutomationId", "children", "toggleMoreLabel"]);
    return _react.default.createElement(_Dropdown.default, (0, _extends2.default)({}, props, {
      pullRight: true,
      "data-test-automation-id": testAutomationId
    }), _react.default.createElement(_Dropdown.default.Toggle, {
      "aria-label": toggleMoreLabel,
      noCaret: true
    }, _react.default.createElement(_Icon.Icon, {
      name: "more-vertical",
      className: "icon-dropdown-toggle-more"
    })), _react.default.createElement(_Dropdown.default.Menu, null, children));
  };

  return CTADropdown;
}(_react.default.Component);

exports.CTADropdown = CTADropdown;
(0, _defineProperty2.default)(CTADropdown, "propTypes", {
  testAutomationId: _propTypes.default.string,
  children: _propTypes.default.node,
  toggleMoreLabel: _propTypes.default.string
});
(0, _defineProperty2.default)(CTADropdown, "defaultProps", {
  testAutomationId: 'CATDropdown',
  children: null,
  toggleMoreLabel: 'TRANSLATE:MORE_SETTINGS'
});
(0, _defineProperty2.default)(CTADropdown, "childContextTypes", {
  isCTADropdown: _propTypes.default.bool
});