UNPKG

@syncfusion/ej2-react-notifications

Version:

A package of Essential JS 2 notification components such as Toast and Badge which used to notify important information to end-users. for React

50 lines (49 loc) 2.1 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import * as React from 'react'; import { Message } from '@syncfusion/ej2-notifications'; import { ComponentBase, applyMixins } from '@syncfusion/ej2-react-base'; /** * The React Message component displays messages with severity by differentiating icons and colors to denote the importance and context of the message to the end user. * ```html * <MessageComponent id='msg' showCloseIcon={true}>Editing is restricted</MessageComponent> * ``` */ var MessageComponent = /** @class */ (function (_super) { __extends(MessageComponent, _super); function MessageComponent(props) { var _this = _super.call(this, props) || this; _this.initRenderCalled = false; _this.checkInjectedModules = false; _this.statelessTemplateProps = null; _this.templateProps = null; _this.immediateRender = false; _this.isReactMock = true; _this.portals = []; return _this; } MessageComponent.prototype.render = function () { this.isReactMock = false; if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) { _super.prototype.render.call(this); this.initRenderCalled = true; } else { return React.createElement('div', this.getDefaultAttributes(), [].concat(this.props.children, this.portals)); } }; return MessageComponent; }(Message)); export { MessageComponent }; applyMixins(MessageComponent, [ComponentBase, React.Component]);