"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

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

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

var _icons = require("../icons");

var InlineDropdown = function InlineDropdown(_ref) {
  var attributes = _ref.attributes,
      selectedItem = _ref.selectedItem;
  // TODO: Investigate
  // Needed because items with values inside have different positioning for some reason
  var html = selectedItem || '<div>&nbsp</div>';
  return /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({}, attributes, {
    style: {
      display: 'inline-flex',
      height: '50px',
      margin: '0 5px',
      cursor: 'pointer'
    }
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      display: 'inline-flex',
      minWidth: '178px',
      height: '36px',
      background: '#FFF',
      border: '1px solid #C0C3CF',
      boxSizing: 'border-box',
      borderRadius: '3px',
      position: 'relative'
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1,
      overflow: 'hidden',
      padding: '0 25px 0 8px',
      whiteSpace: 'nowrap',
      textOverflow: 'ellipsis',
      lineHeight: '35px'
    },
    dangerouslySetInnerHTML: {
      __html: html
    }
  }), /*#__PURE__*/_react["default"].createElement(_icons.Chevron, {
    direction: "down",
    style: {
      position: 'absolute',
      top: '5px',
      right: '5px'
    }
  })));
};

InlineDropdown.propTypes = {
  attributes: _propTypes["default"].object,
  selectedItem: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object])
};
var _default = InlineDropdown;
exports["default"] = _default;
//# sourceMappingURL=index.js.map