"use strict";

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

var _tslib = require("tslib");

var _consoleComponents = require("@alicloud/console-components");

var _classnames = _interopRequireDefault(require("classnames"));

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

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

// 无状态组件
var IconHelp = function IconHelp(size, type, color, iconStyle) {
  return /*#__PURE__*/_react["default"].createElement(_consoleComponents.Icon, {
    style: (0, _tslib.__assign)({
      color: color
    }, iconStyle),
    size: size,
    type: type
  });
};

var LPBalloonIcon = function LPBalloonIcon(_a) {
  var container = _a.container,
      iconSize = _a.iconSize,
      iconType = _a.iconType,
      title = _a.title,
      children = _a.children,
      className = _a.className,
      iconColor = _a.iconColor,
      iconStyle = _a.iconStyle,
      other = (0, _tslib.__rest)(_a, ["container", "iconSize", "iconType", "title", "children", "className", "iconColor", "iconStyle"]);
  return /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])('lp-balloon-container', className)
  }, title ? /*#__PURE__*/_react["default"].createElement("span", {
    className: "lp-margin-right"
  }, title) : null, children ? /*#__PURE__*/_react["default"].createElement(_consoleComponents.Balloon, (0, _tslib.__assign)({
    popupContainer: container,
    // TODO 无法拆分一个单独的无状态组件引用，会导致trigger无效
    // trigger={<IconHelp size={size} type={type} />}
    trigger: IconHelp(iconSize, iconType, iconColor, iconStyle)
  }, other), children) : IconHelp(iconSize, iconType, iconColor, iconStyle));
};

var _default = LPBalloonIcon;
exports["default"] = _default;
LPBalloonIcon.defaultProps = {
  iconType: 'help',
  iconSize: 'small',
  closable: false,
  align: 't',
  autoFocus: false,
  triggerType: 'hover',
  iconColor: '#cccccc'
};