"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var React = _interopRequireWildcard(require("react"));
require("./index.scss");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var XtDialog = /*#__PURE__*/function (_Component) {
  (0, _inheritsLoose2["default"])(XtDialog, _Component);
  function XtDialog() {
    return _Component.apply(this, arguments) || this;
  }
  var _proto = XtDialog.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      _this$props$title = _this$props.title,
      title = _this$props$title === void 0 ? '配置组件数据' : _this$props$title,
      _this$props$height = _this$props.height,
      height = _this$props$height === void 0 ? '70%' : _this$props$height,
      _this$props$top = _this$props.top,
      top = _this$props$top === void 0 ? '100px' : _this$props$top,
      onClose = _this$props.onClose,
      _this$props$visible = _this$props.visible,
      visible = _this$props$visible === void 0 ? false : _this$props$visible,
      content = _this$props.content,
      _this$props$closeIcon = _this$props.closeIcon,
      closeIcon = _this$props$closeIcon === void 0 ? 'close' : _this$props$closeIcon,
      _this$props$titleIcon = _this$props.titleIcon,
      titleIcon = _this$props$titleIcon === void 0 ? 'edit' : _this$props$titleIcon;
    var style = {
      style: {
        width: this.props.width || '60%',
        borderRadius: '12px',
        boxShadow: '0 9px 29px 0 rgba(0, 0, 0, 0.2)'
      }
    };
    var titleNode = /*#__PURE__*/React.createElement("div", {
      className: "titleStyle"
    }, /*#__PURE__*/React.createElement(_icon["default"], {
      type: titleIcon,
      size: "small"
    }), /*#__PURE__*/React.createElement("span", null, title));
    var closeIconNode = /*#__PURE__*/React.createElement(_icon["default"], {
      type: closeIcon,
      size: "xs"
    });
    return /*#__PURE__*/React.createElement(_dialog["default"], (0, _extends2["default"])({
      footer: false,
      height: height,
      title: titleNode,
      visible: visible,
      top: top,
      "close-icon": closeIconNode,
      onClose: onClose,
      className: "xt-dialog"
    }, style), content);
  };
  return XtDialog;
}(React.Component);
exports["default"] = XtDialog;
XtDialog.displayName = 'XtDialog';