"use strict";

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

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

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

var _ = _interopRequireDefault(require("./assets/images/light/404.png"));

var _api_error = _interopRequireDefault(require("./assets/images/light/api_error.png"));

var _coming_soon = _interopRequireDefault(require("./assets/images/light/coming_soon.png"));

var _deleted_default = _interopRequireDefault(require("./assets/images/light/deleted_default.png"));

var _empty_default = _interopRequireDefault(require("./assets/images/light/empty_default.png"));

var _network_error = _interopRequireDefault(require("./assets/images/light/network_error.png"));

var _no_permission_default = _interopRequireDefault(require("./assets/images/light/no_permission_default.png"));

var _update = _interopRequireDefault(require("./assets/images/light/update.png"));

var _2 = _interopRequireDefault(require("./assets/images/dark/404.png"));

var _api_error2 = _interopRequireDefault(require("./assets/images/dark/api_error.png"));

var _coming_soon2 = _interopRequireDefault(require("./assets/images/dark/coming_soon.png"));

var _deleted_default2 = _interopRequireDefault(require("./assets/images/dark/deleted_default.png"));

var _empty_default2 = _interopRequireDefault(require("./assets/images/dark/empty_default.png"));

var _network_error2 = _interopRequireDefault(require("./assets/images/dark/network_error.png"));

var _no_permission_default2 = _interopRequireDefault(require("./assets/images/dark/no_permission_default.png"));

var _update2 = _interopRequireDefault(require("./assets/images/dark/update.png"));

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ImageSrcList = {
  no_permission_default_light: _no_permission_default["default"],
  no_permission_default_dark: _no_permission_default2["default"],
  '404_light': _["default"],
  '404_dark': _2["default"],
  coming_soon_light: _coming_soon["default"],
  coming_soon_dark: _coming_soon2["default"],
  deleted_default_light: _deleted_default["default"],
  deleted_default_dark: _deleted_default2["default"],
  empty_default_light: _empty_default["default"],
  empty_default_dark: _empty_default2["default"],
  network_error_light: _network_error["default"],
  network_error_dark: _network_error2["default"],
  update_light: _update["default"],
  update_dark: _update2["default"],
  api_error_light: _api_error["default"],
  api_error_dark: _api_error2["default"]
};
var bgThemeList = {
  white: {
    backgroundColor: '#ffffff',
    color: '#7f7f7f'
  },
  light: {
    backgroundColor: '#F5F5F5',
    color: '#7f7f7f'
  },
  dark: {
    backgroundColor: '#32353E',
    color: 'rgba(255,255,255,0.40)'
  }
};
/**
 * 空白页
 */

var Blank =
/*#__PURE__*/
function (_Component) {
  _inherits(Blank, _Component);

  function Blank(props) {
    var _this;

    _classCallCheck(this, Blank);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(Blank).call(this, props));

    _defineProperty(_assertThisInitialized(_this), "onClickBtn", function () {
      var clickBtn = _this.props.clickBtn;

      if (clickBtn) {
        clickBtn();
      }
    });

    _this.state = {};
    return _this;
  }

  _createClass(Blank, [{
    key: "render",
    value: function render() {
      var prefixCls = 'eh-blank';
      var _this$props = this.props,
          height = _this$props.height,
          _this$props$theme = _this$props.theme,
          theme = _this$props$theme === void 0 ? 'light' : _this$props$theme,
          _this$props$btnColor = _this$props.btnColor,
          btnColor = _this$props$btnColor === void 0 ? '#07A6F0' : _this$props$btnColor,
          title = _this$props.title,
          content = _this$props.content,
          btnText = _this$props.btnText,
          image = _this$props.image,
          imageType = _this$props.imageType;
      var bgTheme = bgThemeList[theme];
      return _react["default"].createElement("div", {
        className: prefixCls,
        style: _objectSpread({}, bgTheme, {
          height: height
        })
      }, _react["default"].createElement("div", {
        className: "".concat(prefixCls, "-container")
      }, _react["default"].createElement("div", {
        className: "".concat(prefixCls, "-container-image")
      }, _react["default"].createElement("img", {
        src: image || ImageSrcList["".concat(imageType, "_").concat(theme)] || ImageSrcList["".concat(imageType, "_light")],
        alt: "blankPage-icon"
      })), title && _react["default"].createElement("div", {
        className: "".concat(prefixCls, "-container-title")
      }, title), content && _react["default"].createElement("div", {
        className: "".concat(prefixCls, "-container-txt")
      }, content), btnText && _react["default"].createElement("div", {
        className: "".concat(prefixCls, "-container-btn")
      }, _react["default"].createElement("a", {
        style: {
          border: 'none',
          backgroundColor: "".concat(btnColor)
        },
        className: "".concat(prefixCls, "-button ").concat(prefixCls, "-button-primary"),
        onClick: this.onClickBtn
      }, _react["default"].createElement("span", null, btnText)))));
    }
  }]);

  return Blank;
}(_react.Component);

_defineProperty(Blank, "propTypes", {
  height: _propTypes["default"].string,
  theme: _propTypes["default"].oneOf(['dark', 'light', 'white']),
  btnColor: _propTypes["default"].string,
  title: _propTypes["default"].string,
  content: _propTypes["default"].string,
  btnText: _propTypes["default"].string,
  image: _propTypes["default"].string,
  clickBtn: _propTypes["default"].func,
  imageType: _propTypes["default"].oneOf(['404', 'api_error', 'coming_soon', 'deleted_default', 'empty_default', 'network_error', 'no_permission_default', 'update'])
});

_defineProperty(Blank, "defaultProps", {
  height: "".concat(window.innerHeight, "px"),
  theme: 'light',
  btnColor: '#07A6F0',
  title: '',
  content: '',
  btnText: '',
  image: '',
  imageType: 'empty_default'
});

var _default = Blank;
exports["default"] = _default;
module.exports = exports.default;