text: "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.message=void 0;var _react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_reactDom=require("react-dom"),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_icon=require("../icon"),_icon2=_interopRequireDefault(_icon);require("./style.css");var GlobalMessage=function(e){var t=e.type,r=e.content,s=(0,_classnames2.default)("message-content",t);return _react2.default.createElement("div",{className:s},_react2.default.createElement(_icon2.default,{type:t}),_react2.default.createElement("p",null,r))};GlobalMessage.propTypes={type:_propTypes2.default.string.isRequired,content:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.node]).isRequired};var message=exports.message={success:function(e,t){this.show("success",e,t)},warn:function(e,t){this.show("warn",e,t)},error:function(e,t){this.show("error",e,t)},show:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,s=document.createElement("div");s.setAttribute("class","component-message-wrap"),s.setAttribute("style","-webkit-animation-duration: "+r+"ms"),s.setAttribute("style","animation-duration: "+r+"ms"),document.body.appendChild(s),(0,_reactDom.render)(_react2.default.createElement(GlobalMessage,{type:e,content:t}),s),setTimeout(function(){(0,_reactDom.unmountComponentAtNode)(s),s.parentNode.removeChild(s)},r)}};
  //# sourceMappingURL=index.map
  