Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-notifications

Package Overview
Dependencies
Maintainers
3
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-notifications - npm Package Compare versions

Comparing version 19.2.60 to 19.3.43

styles/badge/_bootstrap5-dark-definition.scss

2

.eslintrc.json

@@ -244,2 +244,2 @@ {

]
}
}
/*!
* filename: ej2-notifications.umd.min.js
* version : 19.2.60
* version : 19.3.43
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-popups"],e):e(t.ej={},t.ej2Base,t.ej2Buttons,t.ej2Popups)}(this,function(t,e,i,s){"use strict";var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),n=function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",l="e-toast-container",a="e-toast-title",p="e-toast-full-width",h="e-toast-content",d="e-toast-message",c="e-toast-progress",u="e-toast-close-icon",f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("Left")],i.prototype,"X",void 0),n([e.Property("Top")],i.prototype,"Y",void 0),i}(e.ChildProperty),m=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property(null)],i.prototype,"model",void 0),n([e.Property(null)],i.prototype,"click",void 0),i}(e.ChildProperty),y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("FadeIn")],i.prototype,"effect",void 0),n([e.Property(600)],i.prototype,"duration",void 0),n([e.Property("ease")],i.prototype,"easing",void 0),i}(e.ChildProperty),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Complex({effect:"FadeIn",duration:600,easing:"ease"},y)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},y)],i.prototype,"hide",void 0),i}(e.ChildProperty),g=function(t){function y(e,i){var s=t.call(this,e,i)||this;return s.toastCollection=[],s}return o(y,t),y.prototype.getModuleName=function(){return"toast"},y.prototype.getPersistData=function(){return this.addOnPersist([])},y.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(l),e.setStyleAttribute(this.element,{position:"","z-index":""}),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isBlazorServer()||t.prototype.destroy.call(this)},y.prototype.preRender=function(){this.isDevice=e.Browser.isDevice,"300px"===this.width&&(this.width=this.isDevice&&screen.width<768?"100%":"300px"),e.isNullOrUndefined(this.target)&&(this.target=document.body),this.enableRtl&&!this.isBlazorServer()&&this.element.classList.add("e-rtl")},y.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.contentTemplate=null,this.toastTemplate=null,this.isDevice&&screen.width<768&&new e.Touch(this.element,{swipe:this.swipeHandler.bind(this)}),this.renderComplete(),this.initRenderClass=this.element.className},y.prototype.show=function(t){var i;if(e.isNullOrUndefined(t)||(this.templateChanges(t),i=JSON.parse(JSON.stringify(t)),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var s="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(s))return;"BODY"===s.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",s.style.position="relative"),this.setPositioning(this.position),s.appendChild(this.toastContainer)}this.isBlazorServer()&&this.element.classList.contains("e-control")?this.isToastModel(t):(this.toastEle=this.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||""===this.template?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget(t),e.isNullOrUndefined(i)||(e.extend(i,{element:[this.toastEle]},!0),this.toastCollection.push(i)),this.isReact&&this.renderReactTemplates())},y.prototype.showToast=function(t,e){this.toastEle=this.element.querySelector("#"+t),this.show(e)},y.prototype.isToastModel=function(t){this.toastContainer=this.element,this.setPositioning(this.position);e.isNullOrUndefined(this.element.lastElementChild)||this.setProgress(),this.setAria(),this.appendToTarget(t)},y.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(."+l+")"),s=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hideToast("swipe",i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hideToast("swipe",i)),this.animation.hide.effect=s)},y.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},y.prototype.setCSSClass=function(t){if(t){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},y.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add(p):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove(p)),this.toastEle.style.height=e.formatUnit(this.height)},y.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},y.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize();e.extend(i,i,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},y.prototype.hide=function(t){this.hideToast("",t)},y.prototype.hideToast=function(t,i){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof i||"All"!==i)e.isNullOrUndefined(i)&&(i=this.newestOnTop?this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(i,t);else for(var s=0;s<this.toastContainer.childElementCount;s++)this.destroyToast(this.toastContainer.children[s],t)},y.prototype.fetchEle=function(t,i,s){i="string"==typeof i?this.sanitizeHelper(i):i;var o,n,r,l;if(l=t.classList.contains(a)?this.element.id+"title":t.classList.contains(h)?this.element.id+"content":this.element.id+"template",n="content"===s?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var p=null;"title"!==s&&(p=document.querySelector(i),t.appendChild(p),p.style.display="");var d=e.isNullOrUndefined(p)?n:p.cloneNode(!0);"content"===s?this.contentTemplate=d:this.toastTemplate=d}}catch(t){o=e.compile(i)}if(!e.isNullOrUndefined(o))if(this.isBlazorServer()){r=o({},this,s,l,!0)}else r=o({},this,s,null,!0);return e.isNullOrUndefined(r)||!(r.length>0)||e.isNullOrUndefined(r[0].tagName)&&1===r.length?0===t.childElementCount&&(t.innerHTML=i):[].slice.call(r).forEach(function(i){e.isNullOrUndefined(i.tagName)||(i.style.display=""),t.appendChild(i)}),t},y.prototype.clearProgress=function(t){e.isNullOrUndefined(this.intervalId[t])||(clearInterval(this.intervalId[t]),delete this.intervalId[t]),e.isNullOrUndefined(this.progressObj[t])||(clearInterval(this.progressObj[t].intervalId),delete this.progressObj[t])},y.prototype.clearContainerPos=function(){var t=this;this.isBlazorServer()?this.toastContainer=null:(this.customPosition?(e.setStyleAttribute(this.toastContainer,{left:"",top:""}),this.toastContainer=null,this.customPosition=!1):([r+"-top-left",r+"-top-right",r+"-bottom-left",r+"-bottom-right",r+"-bottom-center",r+"-top-center",r+"-full-width"].forEach(function(i){!e.isNullOrUndefined(t.toastContainer)&&t.toastContainer.classList.contains(i)&&t.toastContainer.classList.remove(i)}),this.toastContainer=null),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate())},y.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},y.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},y.prototype.isBlazorServer=function(){return e.isBlazor()&&this.isServerRendered},y.prototype.destroyToast=function(t,i){for(var s,o=this,n=0;n<this.toastCollection.length;n++)this.toastCollection[n].element[0]===t&&(s=this.toastCollection[n],this.toastCollection.splice(n,1));var r={options:this,cancel:!1,type:i,element:t,toastContainer:this.toastContainer},l=this.animation.hide,a={duration:l.duration,name:l.effect,timingFunction:l.easing},p=parseInt(t.id.split("toast_")[1],10),h=this.isBlazorServer()?{options:s,toastContainer:this.toastContainer}:{options:s,toastContainer:this.toastContainer,toastObj:this};this.trigger("beforeClose",r,function(i){i.cancel||(e.isNullOrUndefined(o.progressObj[p])||e.isNullOrUndefined(t.querySelector("."+c))||(o.progressObj[p].progressEle.style.width="0%"),a.end=function(){o.clearProgress(p),o.isBlazorServer()&&!e.isNullOrUndefined(s)||e.detach(t),o.trigger("close",h),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,a))})},y.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},y.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},y.prototype.setPositioning=function(t){this.isBlazorServer()||(isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(this.customPosition=!0,e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)})))},y.prototype.setCloseButton=function(){if(this.showCloseButton){this.l10n=new e.L10n("toast",{close:"Close"},this.locale),this.l10n.setLocale(this.locale);var t=this.l10n.getConstant("close"),i=this.createElement("div",{className:u+" e-icons ",attrs:{tabindex:"0","aria-label":t}});this.toastEle.appendChild(i)}},y.prototype.setProgress=function(){if(this.timeOut>0){var t=parseInt(this.toastEle.id.split("toast_")[1],10);this.intervalId[t]=window.setTimeout(this.destroyToast.bind(this,this.toastEle),this.timeOut),this.progressObj[t]={hideEta:null,intervalId:null,maxHideTime:null,element:null,timeOutId:null,progressEle:null},this.progressObj[t].maxHideTime=parseFloat(this.timeOut+""),this.progressObj[t].hideEta=(new Date).getTime()+this.progressObj[t].maxHideTime,this.progressObj[t].element=this.toastEle,this.extendedTimeout>0&&(e.EventHandler.add(this.toastEle,"mouseover",this.toastHoverAction.bind(this,t)),e.EventHandler.add(this.toastEle,"mouseleave",this.delayedToastProgress.bind(this,t)),this.progressObj[t].timeOutId=this.intervalId[t]),this.showProgressBar&&(this.progressBarEle=this.createElement("div",{className:c}),this.toastEle.insertBefore(this.progressBarEle,this.toastEle.children[0]),this.progressObj[t].intervalId=setInterval(this.updateProgressBar.bind(this,this.progressObj[t]),10),this.progressObj[t].progressEle=this.progressBarEle)}},y.prototype.toastHoverAction=function(t){clearTimeout(this.progressObj[t].timeOutId),clearInterval(this.progressObj[t].intervalId),this.progressObj[t].hideEta=0;var i=this.progressObj[t].element;e.isNullOrUndefined(i.querySelector("."+c))||(this.progressObj[t].progressEle.style.width="0%")},y.prototype.delayedToastProgress=function(t){var i=this.progressObj[t],s=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,s),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(s.querySelector("."+c))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},y.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;e="Ltr"===this.progressDirection?100-e:e,t.progressEle.style.width=e+"%"},y.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=this.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.appendChild(t)}},y.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)){var t=this.createElement("div",{className:a});t=this.fetchEle(t,this.title,"title");var i=this.createElement("div",{className:d});i.appendChild(t),this.toastEle.appendChild(i)}},y.prototype.setContent=function(){var t=this.createElement("div",{className:h}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var s=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||s)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var o=this.createElement("div");0!==i.childNodes.length;)this.innerEle.appendChild(this.element.childNodes[0]);t.appendChild(this.innerEle),[].slice.call(t.children).forEach(function(t){o.appendChild(t.cloneNode(!0))}),this.content=o,this.appendMessageContainer(t)}}else"object"!=typeof this.content||e.isNullOrUndefined(this.content.tagName)?(t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)):(t.appendChild(this.content),this.content=this.content.cloneNode(!0),this.appendMessageContainer(t))},y.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+d).length>0)this.toastEle.querySelector("."+d).appendChild(t);else{var e=this.createElement("div",{className:d});e.appendChild(t),this.toastEle.appendChild(e)}},y.prototype.actionButtons=function(){var t=this,s=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(o.model,n),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(n,"click",o.click),s.appendChild(n)}}),s.childElementCount>0&&this.appendMessageContainer(s)},y.prototype.appendToTarget=function(t){var i=this,o=this.isBlazorServer()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",o,function(o){if(o.cancel){if(i.isBlazorServer()){var n=parseInt(i.toastEle.id.split("toast_")[1],10);i.clearProgress(n),e.detach(i.toastEle),0===i.toastContainer.childElementCount&&i.clearContainerPos()}}else i.isBlazorServer()||(i.toastEle.style.display="none"),i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.isBlazorServer()||i.toastContainer.appendChild(i.toastEle),e.removeClass([i.toastEle],"e-blazor-toast-hidden"),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=s.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t)})},y.prototype.clickHandler=function(t){var i=this;this.isBlazorServer()||t.stopPropagation();var s=t.target,o=e.closest(s,"."+r),n=this.isBlazorServer()?{element:o,cancel:!1,clickToClose:!1,originalEvent:t}:{element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=s.classList.contains(u);this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(o,"click")})},y.prototype.keyDownHandler=function(t){if(t.target.classList.contains(u)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,s=e.closest(i,"."+r);this.destroyToast(s,"key")}},y.prototype.displayToast=function(t,i){var s=this,o=this.animation.show,n={duration:o.duration,name:o.effect,timingFunction:o.easing},r=this.isBlazorServer()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){s.trigger("open",r)},new e.Animation(n).animate(t)},y.prototype.getContainer=function(){return this.element.classList.add(l),this.element},y.prototype.onPropertyChanged=function(t,e){for(var i=this.element,s=0,o=Object.keys(t);s<o.length;s++){switch(o[s]){case"enableRtl":t.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl")}}},n([e.Property("300px")],y.prototype,"width",void 0),n([e.Property("auto")],y.prototype,"height",void 0),n([e.Property(null)],y.prototype,"title",void 0),n([e.Property(null)],y.prototype,"content",void 0),n([e.Property(!0)],y.prototype,"enableHtmlSanitizer",void 0),n([e.Property(null)],y.prototype,"icon",void 0),n([e.Property(null)],y.prototype,"cssClass",void 0),n([e.Property(null)],y.prototype,"template",void 0),n([e.Property(!0)],y.prototype,"newestOnTop",void 0),n([e.Property(!1)],y.prototype,"showCloseButton",void 0),n([e.Property(!1)],y.prototype,"showProgressBar",void 0),n([e.Property(5e3)],y.prototype,"timeOut",void 0),n([e.Property("Rtl")],y.prototype,"progressDirection",void 0),n([e.Property(1e3)],y.prototype,"extendedTimeout",void 0),n([e.Complex({},v)],y.prototype,"animation",void 0),n([e.Complex({},f)],y.prototype,"position",void 0),n([e.Collection([{}],m)],y.prototype,"buttons",void 0),n([e.Property(null)],y.prototype,"target",void 0),n([e.Event()],y.prototype,"created",void 0),n([e.Event()],y.prototype,"beforeSanitizeHtml",void 0),n([e.Event()],y.prototype,"destroyed",void 0),n([e.Event()],y.prototype,"open",void 0),n([e.Event()],y.prototype,"beforeOpen",void 0),n([e.Event()],y.prototype,"beforeClose",void 0),n([e.Event()],y.prototype,"close",void 0),n([e.Event()],y.prototype,"click",void 0),y=n([e.NotifyPropertyChanges],y)}(e.Component);t.ToastPosition=f,t.ButtonModelProps=m,t.ToastAnimations=y,t.ToastAnimationSettings=v,t.Toast=g,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-popups"],e):e(t.ej={},t.ej2Base,t.ej2Buttons,t.ej2Popups)}(this,function(t,e,i,s){"use strict";var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),n=function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",a="e-toast-container",l="e-toast-title",h="e-toast-full-width",p="e-toast-content",d="e-toast-message",c="e-toast-progress",u="e-toast-close-icon",f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("Left")],i.prototype,"X",void 0),n([e.Property("Top")],i.prototype,"Y",void 0),i}(e.ChildProperty),m=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property(null)],i.prototype,"model",void 0),n([e.Property(null)],i.prototype,"click",void 0),i}(e.ChildProperty),y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("FadeIn")],i.prototype,"effect",void 0),n([e.Property(600)],i.prototype,"duration",void 0),n([e.Property("ease")],i.prototype,"easing",void 0),i}(e.ChildProperty),v=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Complex({effect:"FadeIn",duration:600,easing:"ease"},y)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},y)],i.prototype,"hide",void 0),i}(e.ChildProperty),g=function(t){function y(e,i){var s=t.call(this,e,i)||this;return s.toastCollection=[],s}return o(y,t),y.prototype.getModuleName=function(){return"toast"},y.prototype.getPersistData=function(){return this.addOnPersist([])},y.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(a),e.setStyleAttribute(this.element,{position:"","z-index":""}),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isBlazorServer()||t.prototype.destroy.call(this)},y.prototype.preRender=function(){this.isDevice=e.Browser.isDevice,"300px"===this.width&&(this.width=this.isDevice&&screen.width<768?"100%":"300px"),e.isNullOrUndefined(this.target)&&(this.target=document.body),this.enableRtl&&!this.isBlazorServer()&&this.element.classList.add("e-rtl")},y.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.contentTemplate=null,this.toastTemplate=null,this.isDevice&&screen.width<768&&new e.Touch(this.element,{swipe:this.swipeHandler.bind(this)}),this.renderComplete(),this.initRenderClass=this.element.className},y.prototype.show=function(t){var i;if(e.isNullOrUndefined(t)||(this.templateChanges(t),i=JSON.parse(JSON.stringify(t)),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var s="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(s))return;"BODY"===s.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",s.style.position="relative"),this.setPositioning(this.position),s.appendChild(this.toastContainer)}this.isBlazorServer()&&this.element.classList.contains("e-control")?this.isToastModel(t):(this.toastEle=this.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||""===this.template?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget(t),e.isNullOrUndefined(i)||(e.extend(i,{element:[this.toastEle]},!0),this.toastCollection.push(i)),this.isReact&&this.renderReactTemplates())},y.prototype.showToast=function(t,e){this.toastEle=this.element.querySelector("#"+t),this.show(e)},y.prototype.isToastModel=function(t){this.toastContainer=this.element,this.setPositioning(this.position);e.isNullOrUndefined(this.element.lastElementChild)||this.setProgress(),this.setAria(),this.appendToTarget(t)},y.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,"."+r+":not(."+a+")"),s=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hideToast("swipe",i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hideToast("swipe",i)),this.animation.hide.effect=s)},y.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},y.prototype.setCSSClass=function(t){if(t){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},y.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add(h):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove(h)),this.toastEle.style.height=e.formatUnit(this.height)},y.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},y.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize();e.extend(i,i,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},y.prototype.hide=function(t){this.hideToast("",t)},y.prototype.hideToast=function(t,i){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof i||"All"!==i)e.isNullOrUndefined(i)&&(i=this.newestOnTop?this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(i,t);else for(var s=0;s<this.toastContainer.childElementCount;s++)this.destroyToast(this.toastContainer.children[s],t)},y.prototype.fetchEle=function(t,i,s){i="string"==typeof i?this.sanitizeHelper(i):i;var o,n,r,a;if(a=t.classList.contains(l)?this.element.id+"title":t.classList.contains(p)?this.element.id+"content":this.element.id+"template",n="content"===s?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var h=null;"title"!==s&&(h=document.querySelector(i),t.appendChild(h),h.style.display="");var d=e.isNullOrUndefined(h)?n:h.cloneNode(!0);"content"===s?this.contentTemplate=d:this.toastTemplate=d}}catch(t){o=e.compile(i)}if(!e.isNullOrUndefined(o))if(this.isBlazorServer()){r=o({},this,s,a,!0)}else r=o({},this,s,null,!0);return e.isNullOrUndefined(r)||!(r.length>0)||e.isNullOrUndefined(r[0].tagName)&&1===r.length?0===t.childElementCount&&(t.innerHTML=i):[].slice.call(r).forEach(function(i){e.isNullOrUndefined(i.tagName)||(i.style.display=""),t.appendChild(i)}),t},y.prototype.clearProgress=function(t){e.isNullOrUndefined(this.intervalId[t])||(clearInterval(this.intervalId[t]),delete this.intervalId[t]),e.isNullOrUndefined(this.progressObj[t])||(clearInterval(this.progressObj[t].intervalId),delete this.progressObj[t])},y.prototype.removeToastContainer=function(t){t&&this.toastContainer.classList.contains("e-toast-util")&&e.detach(this.toastContainer)},y.prototype.clearContainerPos=function(t){var i=this;this.isBlazorServer()?this.toastContainer=null:(this.customPosition?(e.setStyleAttribute(this.toastContainer,{left:"",top:""}),this.removeToastContainer(t),this.toastContainer=null,this.customPosition=!1):([r+"-top-left",r+"-top-right",r+"-bottom-left",r+"-bottom-right",r+"-bottom-center",r+"-top-center",r+"-full-width"].forEach(function(t){!e.isNullOrUndefined(i.toastContainer)&&i.toastContainer.classList.contains(t)&&i.toastContainer.classList.remove(t)}),this.removeToastContainer(t),this.toastContainer=null),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate())},y.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},y.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},y.prototype.isBlazorServer=function(){return e.isBlazor()&&this.isServerRendered},y.prototype.destroyToast=function(t,i){for(var s,o=this,n=0;n<this.toastCollection.length;n++)this.toastCollection[n].element[0]===t&&(s=this.toastCollection[n],this.toastCollection.splice(n,1));var r={options:this,cancel:!1,type:i,element:t,toastContainer:this.toastContainer},a=this.animation.hide,l={duration:a.duration,name:a.effect,timingFunction:a.easing},h=parseInt(t.id.split("toast_")[1],10),p=this.isBlazorServer()?{options:s,toastContainer:this.toastContainer}:{options:s,toastContainer:this.toastContainer,toastObj:this};this.trigger("beforeClose",r,function(i){i.cancel||(e.isNullOrUndefined(o.progressObj[h])||e.isNullOrUndefined(t.querySelector("."+c))||(o.progressObj[h].progressEle.style.width="0%"),l.end=function(){o.clearProgress(h),o.isBlazorServer()&&!e.isNullOrUndefined(s)||e.detach(t),o.trigger("close",p),0===o.toastContainer.childElementCount&&o.clearContainerPos(!0)},new e.Animation({}).animate(t,l))})},y.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},y.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},y.prototype.setPositioning=function(t){this.isBlazorServer()||(isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(this.customPosition=!0,e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)})))},y.prototype.setCloseButton=function(){if(this.showCloseButton){this.l10n=new e.L10n("toast",{close:"Close"},this.locale),this.l10n.setLocale(this.locale);var t=this.l10n.getConstant("close"),i=this.createElement("div",{className:u+" e-icons ",attrs:{tabindex:"0","aria-label":t}});this.toastEle.classList.add("e-toast-header-close-icon"),this.toastEle.appendChild(i)}},y.prototype.setProgress=function(){if(this.timeOut>0){var t=parseInt(this.toastEle.id.split("toast_")[1],10);this.intervalId[t]=window.setTimeout(this.destroyToast.bind(this,this.toastEle),this.timeOut),this.progressObj[t]={hideEta:null,intervalId:null,maxHideTime:null,element:null,timeOutId:null,progressEle:null},this.progressObj[t].maxHideTime=parseFloat(this.timeOut+""),this.progressObj[t].hideEta=(new Date).getTime()+this.progressObj[t].maxHideTime,this.progressObj[t].element=this.toastEle,this.extendedTimeout>0&&(e.EventHandler.add(this.toastEle,"mouseover",this.toastHoverAction.bind(this,t)),e.EventHandler.add(this.toastEle,"mouseleave",this.delayedToastProgress.bind(this,t)),this.progressObj[t].timeOutId=this.intervalId[t]),this.showProgressBar&&(this.progressBarEle=this.createElement("div",{className:c}),this.toastEle.insertBefore(this.progressBarEle,this.toastEle.children[0]),this.progressObj[t].intervalId=setInterval(this.updateProgressBar.bind(this,this.progressObj[t]),10),this.progressObj[t].progressEle=this.progressBarEle)}},y.prototype.toastHoverAction=function(t){clearTimeout(this.progressObj[t].timeOutId),clearInterval(this.progressObj[t].intervalId),this.progressObj[t].hideEta=0;var i=this.progressObj[t].element;e.isNullOrUndefined(i.querySelector("."+c))||(this.progressObj[t].progressEle.style.width="0%")},y.prototype.delayedToastProgress=function(t){var i=this.progressObj[t],s=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,s),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(s.querySelector("."+c))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},y.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;e="Ltr"===this.progressDirection?100-e:e,t.progressEle.style.width=e+"%"},y.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=this.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.classList.add("e-toast-header-icon"),this.toastEle.appendChild(t)}},y.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)){var t=this.createElement("div",{className:l});t=this.fetchEle(t,this.title,"title");var i=this.createElement("div",{className:d});i.appendChild(t),this.toastEle.appendChild(i)}},y.prototype.setContent=function(){var t=this.createElement("div",{className:p}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var s=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||s)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var o=this.createElement("div");0!==i.childNodes.length;)this.innerEle.appendChild(this.element.childNodes[0]);t.appendChild(this.innerEle),[].slice.call(t.children).forEach(function(t){o.appendChild(t.cloneNode(!0))}),this.content=o,this.appendMessageContainer(t)}}else"object"!=typeof this.content||e.isNullOrUndefined(this.content.tagName)?(t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)):(t.appendChild(this.content),this.content=this.content.cloneNode(!0),this.appendMessageContainer(t))},y.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+d).length>0)this.toastEle.querySelector("."+d).appendChild(t);else{var e=this.createElement("div",{className:d});e.appendChild(t),this.toastEle.appendChild(e)}},y.prototype.actionButtons=function(){var t=this,s=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(o.model,n),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(n,"click",o.click),s.appendChild(n)}}),s.childElementCount>0&&this.appendMessageContainer(s)},y.prototype.appendToTarget=function(t){var i=this,o=this.isBlazorServer()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",o,function(o){if(o.cancel){if(i.isBlazorServer()){var n=parseInt(i.toastEle.id.split("toast_")[1],10);i.clearProgress(n),e.detach(i.toastEle),0===i.toastContainer.childElementCount&&i.clearContainerPos()}}else i.isBlazorServer()||(i.toastEle.style.display="none"),i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.isBlazorServer()||i.toastContainer.appendChild(i.toastEle),e.removeClass([i.toastEle],"e-blazor-toast-hidden"),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=s.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t)})},y.prototype.clickHandler=function(t){var i=this;this.isBlazorServer()||t.stopPropagation();var s=t.target,o=e.closest(s,"."+r),n=this.isBlazorServer()?{element:o,cancel:!1,clickToClose:!1,originalEvent:t}:{element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},a=s.classList.contains(u);this.trigger("click",n,function(t){(a&&!t.cancel||t.clickToClose)&&i.destroyToast(o,"click")})},y.prototype.keyDownHandler=function(t){if(t.target.classList.contains(u)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,s=e.closest(i,"."+r);this.destroyToast(s,"key")}},y.prototype.displayToast=function(t,i){var s=this,o=this.animation.show,n={duration:o.duration,name:o.effect,timingFunction:o.easing},r=this.isBlazorServer()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){s.trigger("open",r)},new e.Animation(n).animate(t)},y.prototype.getContainer=function(){return this.element.classList.add(a),this.element},y.prototype.onPropertyChanged=function(t,e){for(var i=this.element,s=0,o=Object.keys(t);s<o.length;s++){switch(o[s]){case"enableRtl":t.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl")}}},n([e.Property("300px")],y.prototype,"width",void 0),n([e.Property("auto")],y.prototype,"height",void 0),n([e.Property(null)],y.prototype,"title",void 0),n([e.Property(null)],y.prototype,"content",void 0),n([e.Property(!0)],y.prototype,"enableHtmlSanitizer",void 0),n([e.Property(null)],y.prototype,"icon",void 0),n([e.Property(null)],y.prototype,"cssClass",void 0),n([e.Property(null)],y.prototype,"template",void 0),n([e.Property(!0)],y.prototype,"newestOnTop",void 0),n([e.Property(!1)],y.prototype,"showCloseButton",void 0),n([e.Property(!1)],y.prototype,"showProgressBar",void 0),n([e.Property(5e3)],y.prototype,"timeOut",void 0),n([e.Property("Rtl")],y.prototype,"progressDirection",void 0),n([e.Property(1e3)],y.prototype,"extendedTimeout",void 0),n([e.Complex({},v)],y.prototype,"animation",void 0),n([e.Complex({},f)],y.prototype,"position",void 0),n([e.Collection([{}],m)],y.prototype,"buttons",void 0),n([e.Property(null)],y.prototype,"target",void 0),n([e.Event()],y.prototype,"created",void 0),n([e.Event()],y.prototype,"beforeSanitizeHtml",void 0),n([e.Event()],y.prototype,"destroyed",void 0),n([e.Event()],y.prototype,"open",void 0),n([e.Event()],y.prototype,"beforeOpen",void 0),n([e.Event()],y.prototype,"beforeClose",void 0),n([e.Event()],y.prototype,"close",void 0),n([e.Event()],y.prototype,"click",void 0),y=n([e.NotifyPropertyChanges],y)}(e.Component);!function(i){(t.ToastUtility||(t.ToastUtility={})).show=function(t,i,s){var o;document.querySelector("."+a)?o=document.querySelector("."+a):(o=e.createElement("div",{className:r+" "+a+" e-toast-util"}),document.body.appendChild(o));var n,l;if("string"==typeof t){var h=void 0,p=void 0;if(e.isNullOrUndefined(i))h="",p="";else switch(i){case"Warning":h="e-toast-warning",p="e-toast-warning-icon";break;case"Success":h="e-toast-success",p="e-toast-success-icon";break;case"Error":h="e-toast-danger",p="e-toast-error-icon";break;case"Information":h="e-toast-info",p="e-toast-info-icon"}l={content:t,cssClass:h,icon:p,timeOut:e.isNullOrUndefined(s)?5e3:s}}else l=t;return(n=new g(l)).appendTo(o),n.show(),n}}(),t.ToastPosition=f,t.ButtonModelProps=m,t.ToastAnimations=y,t.ToastAnimationSettings=v,t.Toast=g,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-notifications.umd.min.js.map

@@ -1,2 +0,2 @@

import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
import { Button } from '@syncfusion/ej2-buttons';

@@ -402,3 +402,8 @@ import { getZindexPartial } from '@syncfusion/ej2-popups';

}
clearContainerPos() {
removeToastContainer(isClosed) {
if (isClosed && this.toastContainer.classList.contains('e-toast-util')) {
detach(this.toastContainer);
}
}
clearContainerPos(isClosed) {
if (this.isBlazorServer()) {

@@ -410,2 +415,3 @@ this.toastContainer = null;

setStyleAttribute(this.toastContainer, { 'left': '', 'top': '' });
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -426,2 +432,3 @@ this.customPosition = false;

});
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -489,3 +496,3 @@ }

if (this.toastContainer.childElementCount === 0) {
this.clearContainerPos();
this.clearContainerPos(true);
}

@@ -528,2 +535,3 @@ };

const closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } });
this.toastEle.classList.add('e-toast-header-close-icon');
this.toastEle.appendChild(closeBtn);

@@ -582,2 +590,3 @@ }

const iconEle = this.createElement('div', { className: ICON + ' e-icons ' + this.icon });
this.toastEle.classList.add('e-toast-header-icon');
this.toastEle.appendChild(iconEle);

@@ -849,2 +858,79 @@ }

], Toast);
/**
* Base for creating Toast through utility method.
*/
// eslint-disable-next-line
var ToastUtility;
(function (ToastUtility) {
/**
* To display a simple toast using the 'ToastUtility' with 'ToastModal' or
* as string with toast content, type, timeOut.
* ```
* Eg : ToastUtility.show('Toast Content Message', 'Information', 7000);
*
* ```
*/
/* istanbul ignore next */
/**
*
* @param { ToastModel | string } content - Specifies the toast modal or the content of the Toast.
* @param {string} type - Specifies the type of toast.
* @param { number } timeOut - Specifies the timeOut of the toast.
* @returns {Toast} - returns the element
*/
function show(content, type, timeOut) {
let toastContainerElement;
if (document.querySelector('.' + CONTAINER)) {
toastContainerElement = document.querySelector('.' + CONTAINER);
}
else {
toastContainerElement = createElement('div', { 'className': ROOT + ' ' + CONTAINER + ' e-toast-util' });
document.body.appendChild(toastContainerElement);
}
let toastObj;
let untilToastsModel;
if (typeof (content) === 'string') {
let cssClass;
let icon;
if (!isNullOrUndefined(type)) {
switch (type) {
case 'Warning':
cssClass = 'e-toast-warning';
icon = 'e-toast-warning-icon';
break;
case 'Success':
cssClass = 'e-toast-success';
icon = 'e-toast-success-icon';
break;
case 'Error':
cssClass = 'e-toast-danger';
icon = 'e-toast-error-icon';
break;
case 'Information':
cssClass = 'e-toast-info';
icon = 'e-toast-info-icon';
break;
}
}
else {
cssClass = '';
icon = '';
}
untilToastsModel = {
content: content,
cssClass: cssClass,
icon: icon,
timeOut: !isNullOrUndefined(timeOut) ? timeOut : 5000
};
}
else {
untilToastsModel = content;
}
toastObj = new Toast(untilToastsModel);
toastObj.appendTo(toastContainerElement);
toastObj.show();
return toastObj;
}
ToastUtility.show = show;
})(ToastUtility || (ToastUtility = {}));

@@ -859,3 +945,3 @@ /**

export { ToastPosition, ButtonModelProps, ToastAnimations, ToastAnimationSettings, Toast };
export { ToastPosition, ButtonModelProps, ToastAnimations, ToastAnimationSettings, Toast, ToastUtility };
//# sourceMappingURL=ej2-notifications.es2015.js.map

@@ -1,2 +0,2 @@

import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
import { Button } from '@syncfusion/ej2-buttons';

@@ -437,3 +437,8 @@ import { getZindexPartial } from '@syncfusion/ej2-popups';

};
Toast.prototype.clearContainerPos = function () {
Toast.prototype.removeToastContainer = function (isClosed) {
if (isClosed && this.toastContainer.classList.contains('e-toast-util')) {
detach(this.toastContainer);
}
};
Toast.prototype.clearContainerPos = function (isClosed) {
var _this = this;

@@ -446,2 +451,3 @@ if (this.isBlazorServer()) {

setStyleAttribute(this.toastContainer, { 'left': '', 'top': '' });
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -462,2 +468,3 @@ this.customPosition = false;

});
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -526,3 +533,3 @@ }

if (_this.toastContainer.childElementCount === 0) {
_this.clearContainerPos();
_this.clearContainerPos(true);
}

@@ -565,2 +572,3 @@ };

var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } });
this.toastEle.classList.add('e-toast-header-close-icon');
this.toastEle.appendChild(closeBtn);

@@ -619,2 +627,3 @@ };

var iconEle = this.createElement('div', { className: ICON + ' e-icons ' + this.icon });
this.toastEle.classList.add('e-toast-header-icon');
this.toastEle.appendChild(iconEle);

@@ -892,2 +901,79 @@ };

}(Component));
/**
* Base for creating Toast through utility method.
*/
// eslint-disable-next-line
var ToastUtility;
(function (ToastUtility) {
/**
* To display a simple toast using the 'ToastUtility' with 'ToastModal' or
* as string with toast content, type, timeOut.
* ```
* Eg : ToastUtility.show('Toast Content Message', 'Information', 7000);
*
* ```
*/
/* istanbul ignore next */
/**
*
* @param { ToastModel | string } content - Specifies the toast modal or the content of the Toast.
* @param {string} type - Specifies the type of toast.
* @param { number } timeOut - Specifies the timeOut of the toast.
* @returns {Toast} - returns the element
*/
function show(content, type, timeOut) {
var toastContainerElement;
if (document.querySelector('.' + CONTAINER)) {
toastContainerElement = document.querySelector('.' + CONTAINER);
}
else {
toastContainerElement = createElement('div', { 'className': ROOT + ' ' + CONTAINER + ' e-toast-util' });
document.body.appendChild(toastContainerElement);
}
var toastObj;
var untilToastsModel;
if (typeof (content) === 'string') {
var cssClass = void 0;
var icon = void 0;
if (!isNullOrUndefined(type)) {
switch (type) {
case 'Warning':
cssClass = 'e-toast-warning';
icon = 'e-toast-warning-icon';
break;
case 'Success':
cssClass = 'e-toast-success';
icon = 'e-toast-success-icon';
break;
case 'Error':
cssClass = 'e-toast-danger';
icon = 'e-toast-error-icon';
break;
case 'Information':
cssClass = 'e-toast-info';
icon = 'e-toast-info-icon';
break;
}
}
else {
cssClass = '';
icon = '';
}
untilToastsModel = {
content: content,
cssClass: cssClass,
icon: icon,
timeOut: !isNullOrUndefined(timeOut) ? timeOut : 5000
};
}
else {
untilToastsModel = content;
}
toastObj = new Toast(untilToastsModel);
toastObj.appendTo(toastContainerElement);
toastObj.show();
return toastObj;
}
ToastUtility.show = show;
})(ToastUtility || (ToastUtility = {}));

@@ -902,3 +988,3 @@ /**

export { ToastPosition, ButtonModelProps, ToastAnimations, ToastAnimationSettings, Toast };
export { ToastPosition, ButtonModelProps, ToastAnimations, ToastAnimationSettings, Toast, ToastUtility };
//# sourceMappingURL=ej2-notifications.es5.js.map
/*!
* filename: ej2-notifications.min.js
* version : 19.2.60
* version : 19.3.43
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
this.ej=this.ej||{},this.ej.notifications=function(t,e,i,s){"use strict";var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),n=function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",l="e-toast-message",a="e-toast-progress",h="e-toast-close-icon",p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("Left")],i.prototype,"X",void 0),n([e.Property("Top")],i.prototype,"Y",void 0),i}(e.ChildProperty),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property(null)],i.prototype,"model",void 0),n([e.Property(null)],i.prototype,"click",void 0),i}(e.ChildProperty),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("FadeIn")],i.prototype,"effect",void 0),n([e.Property(600)],i.prototype,"duration",void 0),n([e.Property("ease")],i.prototype,"easing",void 0),i}(e.ChildProperty),u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Complex({effect:"FadeIn",duration:600,easing:"ease"},c)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},c)],i.prototype,"hide",void 0),i}(e.ChildProperty),f=function(t){function c(e,i){var s=t.call(this,e,i)||this;return s.toastCollection=[],s}return o(c,t),c.prototype.getModuleName=function(){return"toast"},c.prototype.getPersistData=function(){return this.addOnPersist([])},c.prototype.destroy=function(){this.hide("All"),this.element.classList.remove("e-toast-container"),e.setStyleAttribute(this.element,{position:"","z-index":""}),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isBlazorServer()||t.prototype.destroy.call(this)},c.prototype.preRender=function(){this.isDevice=e.Browser.isDevice,"300px"===this.width&&(this.width=this.isDevice&&screen.width<768?"100%":"300px"),e.isNullOrUndefined(this.target)&&(this.target=document.body),this.enableRtl&&!this.isBlazorServer()&&this.element.classList.add("e-rtl")},c.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.contentTemplate=null,this.toastTemplate=null,this.isDevice&&screen.width<768&&new e.Touch(this.element,{swipe:this.swipeHandler.bind(this)}),this.renderComplete(),this.initRenderClass=this.element.className},c.prototype.show=function(t){var i;if(e.isNullOrUndefined(t)||(this.templateChanges(t),i=JSON.parse(JSON.stringify(t)),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var s="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(s))return;"BODY"===s.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",s.style.position="relative"),this.setPositioning(this.position),s.appendChild(this.toastContainer)}if(this.isBlazorServer()&&this.element.classList.contains("e-control"))return void this.isToastModel(t);this.toastEle=this.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||""===this.template?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget(t),e.isNullOrUndefined(i)||(e.extend(i,{element:[this.toastEle]},!0),this.toastCollection.push(i)),this.isReact&&this.renderReactTemplates()},c.prototype.showToast=function(t,e){this.toastEle=this.element.querySelector("#"+t),this.show(e)},c.prototype.isToastModel=function(t){this.toastContainer=this.element,this.setPositioning(this.position);var i=this;e.isNullOrUndefined(i.element.lastElementChild)||this.setProgress(),this.setAria(),this.appendToTarget(t)},c.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(.e-toast-container)"),s=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hideToast("swipe",i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hideToast("swipe",i)),this.animation.hide.effect=s)},c.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},c.prototype.setCSSClass=function(t){if(t){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},c.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add("e-toast-full-width"):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove("e-toast-full-width")),this.toastEle.style.height=e.formatUnit(this.height)},c.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},c.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize(),s={cancel:!1,helper:null};e.extend(i,i,s),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},c.prototype.hide=function(t){this.hideToast("",t)},c.prototype.hideToast=function(t,i){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof i||"All"!==i)e.isNullOrUndefined(i)&&(i=this.newestOnTop?this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(i,t);else for(var s=0;s<this.toastContainer.childElementCount;s++)this.destroyToast(this.toastContainer.children[s],t)},c.prototype.fetchEle=function(t,i,s){i="string"==typeof i?this.sanitizeHelper(i):i;var o,n,r,l;if(l=t.classList.contains("e-toast-title")?this.element.id+"title":t.classList.contains("e-toast-content")?this.element.id+"content":this.element.id+"template",n="content"===s?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var a=null;"title"!==s&&(a=document.querySelector(i),t.appendChild(a),a.style.display="");var h=e.isNullOrUndefined(a)?n:a.cloneNode(!0);"content"===s?this.contentTemplate=h:this.toastTemplate=h}}catch(t){o=e.compile(i)}if(!e.isNullOrUndefined(o))if(this.isBlazorServer()){r=o({},this,s,l,!0)}else r=o({},this,s,null,!0);return e.isNullOrUndefined(r)||!(r.length>0)||e.isNullOrUndefined(r[0].tagName)&&1===r.length?0===t.childElementCount&&(t.innerHTML=i):[].slice.call(r).forEach(function(i){e.isNullOrUndefined(i.tagName)||(i.style.display=""),t.appendChild(i)}),t},c.prototype.clearProgress=function(t){e.isNullOrUndefined(this.intervalId[t])||(clearInterval(this.intervalId[t]),delete this.intervalId[t]),e.isNullOrUndefined(this.progressObj[t])||(clearInterval(this.progressObj[t].intervalId),delete this.progressObj[t])},c.prototype.clearContainerPos=function(){var t=this;if(this.isBlazorServer())return void(this.toastContainer=null);this.customPosition?(e.setStyleAttribute(this.toastContainer,{left:"",top:""}),this.toastContainer=null,this.customPosition=!1):([r+"-top-left",r+"-top-right",r+"-bottom-left",r+"-bottom-right",r+"-bottom-center",r+"-top-center",r+"-full-width"].forEach(function(i){!e.isNullOrUndefined(t.toastContainer)&&t.toastContainer.classList.contains(i)&&t.toastContainer.classList.remove(i)}),this.toastContainer=null),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate()},c.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},c.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},c.prototype.isBlazorServer=function(){return e.isBlazor()&&this.isServerRendered},c.prototype.destroyToast=function(t,i){for(var s,o=this,n=0;n<this.toastCollection.length;n++)this.toastCollection[n].element[0]===t&&(s=this.toastCollection[n],this.toastCollection.splice(n,1));var r={options:this,cancel:!1,type:i,element:t,toastContainer:this.toastContainer},l=this.animation.hide,h={duration:l.duration,name:l.effect,timingFunction:l.easing},p=parseInt(t.id.split("toast_")[1],10),d=this.isBlazorServer()?{options:s,toastContainer:this.toastContainer}:{options:s,toastContainer:this.toastContainer,toastObj:this};this.trigger("beforeClose",r,function(i){i.cancel||(e.isNullOrUndefined(o.progressObj[p])||e.isNullOrUndefined(t.querySelector("."+a))||(o.progressObj[p].progressEle.style.width="0%"),h.end=function(){o.clearProgress(p),o.isBlazorServer()&&!e.isNullOrUndefined(s)||e.detach(t),o.trigger("close",d),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,h))})},c.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},c.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},c.prototype.setPositioning=function(t){this.isBlazorServer()||(isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(this.customPosition=!0,e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)})))},c.prototype.setCloseButton=function(){if(this.showCloseButton){var t={close:"Close"};this.l10n=new e.L10n("toast",t,this.locale),this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("close"),s=this.createElement("div",{className:h+" e-icons ",attrs:{tabindex:"0","aria-label":i}});this.toastEle.appendChild(s)}},c.prototype.setProgress=function(){if(this.timeOut>0){var t=parseInt(this.toastEle.id.split("toast_")[1],10);this.intervalId[t]=window.setTimeout(this.destroyToast.bind(this,this.toastEle),this.timeOut),this.progressObj[t]={hideEta:null,intervalId:null,maxHideTime:null,element:null,timeOutId:null,progressEle:null},this.progressObj[t].maxHideTime=parseFloat(this.timeOut+""),this.progressObj[t].hideEta=(new Date).getTime()+this.progressObj[t].maxHideTime,this.progressObj[t].element=this.toastEle,this.extendedTimeout>0&&(e.EventHandler.add(this.toastEle,"mouseover",this.toastHoverAction.bind(this,t)),e.EventHandler.add(this.toastEle,"mouseleave",this.delayedToastProgress.bind(this,t)),this.progressObj[t].timeOutId=this.intervalId[t]),this.showProgressBar&&(this.progressBarEle=this.createElement("div",{className:a}),this.toastEle.insertBefore(this.progressBarEle,this.toastEle.children[0]),this.progressObj[t].intervalId=setInterval(this.updateProgressBar.bind(this,this.progressObj[t]),10),this.progressObj[t].progressEle=this.progressBarEle)}},c.prototype.toastHoverAction=function(t){clearTimeout(this.progressObj[t].timeOutId),clearInterval(this.progressObj[t].intervalId),this.progressObj[t].hideEta=0;var i=this.progressObj[t].element;e.isNullOrUndefined(i.querySelector("."+a))||(this.progressObj[t].progressEle.style.width="0%")},c.prototype.delayedToastProgress=function(t){var i=this.progressObj[t],s=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,s),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(s.querySelector("."+a))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},c.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;e="Ltr"===this.progressDirection?100-e:e,t.progressEle.style.width=e+"%"},c.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=this.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.appendChild(t)}},c.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)){var t=this.createElement("div",{className:"e-toast-title"});t=this.fetchEle(t,this.title,"title");var i=this.createElement("div",{className:l});i.appendChild(t),this.toastEle.appendChild(i)}},c.prototype.setContent=function(){var t=this.createElement("div",{className:"e-toast-content"}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var s=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||s)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var o=this.createElement("div");0!==i.childNodes.length;)this.innerEle.appendChild(this.element.childNodes[0]);t.appendChild(this.innerEle),[].slice.call(t.children).forEach(function(t){o.appendChild(t.cloneNode(!0))}),this.content=o,this.appendMessageContainer(t)}}else"object"!=typeof this.content||e.isNullOrUndefined(this.content.tagName)?(t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)):(t.appendChild(this.content),this.content=this.content.cloneNode(!0),this.appendMessageContainer(t))},c.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+l).length>0)this.toastEle.querySelector("."+l).appendChild(t);else{var e=this.createElement("div",{className:l});e.appendChild(t),this.toastEle.appendChild(e)}},c.prototype.actionButtons=function(){var t=this,s=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(o.model,n),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(n,"click",o.click),s.appendChild(n)}}),s.childElementCount>0&&this.appendMessageContainer(s)},c.prototype.appendToTarget=function(t){var i=this,o=this.isBlazorServer()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",o,function(o){if(o.cancel){if(i.isBlazorServer()){var n=parseInt(i.toastEle.id.split("toast_")[1],10);i.clearProgress(n),e.detach(i.toastEle),0===i.toastContainer.childElementCount&&i.clearContainerPos()}}else i.isBlazorServer()||(i.toastEle.style.display="none"),i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.isBlazorServer()||i.toastContainer.appendChild(i.toastEle),e.removeClass([i.toastEle],"e-blazor-toast-hidden"),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=s.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t)})},c.prototype.clickHandler=function(t){var i=this;this.isBlazorServer()||t.stopPropagation();var s=t.target,o=e.closest(s,"."+r),n=this.isBlazorServer()?{element:o,cancel:!1,clickToClose:!1,originalEvent:t}:{element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=s.classList.contains(h);this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(o,"click")})},c.prototype.keyDownHandler=function(t){if(t.target.classList.contains(h)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,s=e.closest(i,"."+r);this.destroyToast(s,"key")}},c.prototype.displayToast=function(t,i){var s=this,o=this.animation.show,n={duration:o.duration,name:o.effect,timingFunction:o.easing},r=this.isBlazorServer()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){s.trigger("open",r)},new e.Animation(n).animate(t)},c.prototype.getContainer=function(){return this.element.classList.add("e-toast-container"),this.element},c.prototype.onPropertyChanged=function(t,e){for(var i=this.element,s=0,o=Object.keys(t);s<o.length;s++)switch(o[s]){case"enableRtl":t.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl")}},n([e.Property("300px")],c.prototype,"width",void 0),n([e.Property("auto")],c.prototype,"height",void 0),n([e.Property(null)],c.prototype,"title",void 0),n([e.Property(null)],c.prototype,"content",void 0),n([e.Property(!0)],c.prototype,"enableHtmlSanitizer",void 0),n([e.Property(null)],c.prototype,"icon",void 0),n([e.Property(null)],c.prototype,"cssClass",void 0),n([e.Property(null)],c.prototype,"template",void 0),n([e.Property(!0)],c.prototype,"newestOnTop",void 0),n([e.Property(!1)],c.prototype,"showCloseButton",void 0),n([e.Property(!1)],c.prototype,"showProgressBar",void 0),n([e.Property(5e3)],c.prototype,"timeOut",void 0),n([e.Property("Rtl")],c.prototype,"progressDirection",void 0),n([e.Property(1e3)],c.prototype,"extendedTimeout",void 0),n([e.Complex({},u)],c.prototype,"animation",void 0),n([e.Complex({},p)],c.prototype,"position",void 0),n([e.Collection([{}],d)],c.prototype,"buttons",void 0),n([e.Property(null)],c.prototype,"target",void 0),n([e.Event()],c.prototype,"created",void 0),n([e.Event()],c.prototype,"beforeSanitizeHtml",void 0),n([e.Event()],c.prototype,"destroyed",void 0),n([e.Event()],c.prototype,"open",void 0),n([e.Event()],c.prototype,"beforeOpen",void 0),n([e.Event()],c.prototype,"beforeClose",void 0),n([e.Event()],c.prototype,"close",void 0),n([e.Event()],c.prototype,"click",void 0),c=n([e.NotifyPropertyChanges],c)}(e.Component);return t.ToastPosition=p,t.ButtonModelProps=d,t.ToastAnimations=c,t.ToastAnimationSettings=u,t.Toast=f,t}({},ej.base,ej.buttons,ej.popups),this.ejs=ej;
this.ej=this.ej||{},this.ej.notifications=function(t,e,i,s){"use strict";var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),n=function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",a="e-toast-container",l="e-toast-message",h="e-toast-progress",d="e-toast-close-icon",p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("Left")],i.prototype,"X",void 0),n([e.Property("Top")],i.prototype,"Y",void 0),i}(e.ChildProperty),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property(null)],i.prototype,"model",void 0),n([e.Property(null)],i.prototype,"click",void 0),i}(e.ChildProperty),u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Property("FadeIn")],i.prototype,"effect",void 0),n([e.Property(600)],i.prototype,"duration",void 0),n([e.Property("ease")],i.prototype,"easing",void 0),i}(e.ChildProperty),f=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return o(i,t),n([e.Complex({effect:"FadeIn",duration:600,easing:"ease"},u)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},u)],i.prototype,"hide",void 0),i}(e.ChildProperty),m=function(t){function u(e,i){var s=t.call(this,e,i)||this;return s.toastCollection=[],s}return o(u,t),u.prototype.getModuleName=function(){return"toast"},u.prototype.getPersistData=function(){return this.addOnPersist([])},u.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(a),e.setStyleAttribute(this.element,{position:"","z-index":""}),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isBlazorServer()||t.prototype.destroy.call(this)},u.prototype.preRender=function(){this.isDevice=e.Browser.isDevice,"300px"===this.width&&(this.width=this.isDevice&&screen.width<768?"100%":"300px"),e.isNullOrUndefined(this.target)&&(this.target=document.body),this.enableRtl&&!this.isBlazorServer()&&this.element.classList.add("e-rtl")},u.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.contentTemplate=null,this.toastTemplate=null,this.isDevice&&screen.width<768&&new e.Touch(this.element,{swipe:this.swipeHandler.bind(this)}),this.renderComplete(),this.initRenderClass=this.element.className},u.prototype.show=function(t){var i;if(e.isNullOrUndefined(t)||(this.templateChanges(t),i=JSON.parse(JSON.stringify(t)),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var s="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(s))return;"BODY"===s.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",s.style.position="relative"),this.setPositioning(this.position),s.appendChild(this.toastContainer)}if(this.isBlazorServer()&&this.element.classList.contains("e-control"))return void this.isToastModel(t);this.toastEle=this.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||""===this.template?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget(t),e.isNullOrUndefined(i)||(e.extend(i,{element:[this.toastEle]},!0),this.toastCollection.push(i)),this.isReact&&this.renderReactTemplates()},u.prototype.showToast=function(t,e){this.toastEle=this.element.querySelector("#"+t),this.show(e)},u.prototype.isToastModel=function(t){this.toastContainer=this.element,this.setPositioning(this.position);var i=this;e.isNullOrUndefined(i.element.lastElementChild)||this.setProgress(),this.setAria(),this.appendToTarget(t)},u.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,"."+r+":not(."+a+")"),s=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hideToast("swipe",i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hideToast("swipe",i)),this.animation.hide.effect=s)},u.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},u.prototype.setCSSClass=function(t){if(t){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},u.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add("e-toast-full-width"):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove("e-toast-full-width")),this.toastEle.style.height=e.formatUnit(this.height)},u.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},u.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize(),s={cancel:!1,helper:null};e.extend(i,i,s),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},u.prototype.hide=function(t){this.hideToast("",t)},u.prototype.hideToast=function(t,i){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof i||"All"!==i)e.isNullOrUndefined(i)&&(i=this.newestOnTop?this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(i,t);else for(var s=0;s<this.toastContainer.childElementCount;s++)this.destroyToast(this.toastContainer.children[s],t)},u.prototype.fetchEle=function(t,i,s){i="string"==typeof i?this.sanitizeHelper(i):i;var o,n,r,a;if(a=t.classList.contains("e-toast-title")?this.element.id+"title":t.classList.contains("e-toast-content")?this.element.id+"content":this.element.id+"template",n="content"===s?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var l=null;"title"!==s&&(l=document.querySelector(i),t.appendChild(l),l.style.display="");var h=e.isNullOrUndefined(l)?n:l.cloneNode(!0);"content"===s?this.contentTemplate=h:this.toastTemplate=h}}catch(t){o=e.compile(i)}if(!e.isNullOrUndefined(o))if(this.isBlazorServer()){r=o({},this,s,a,!0)}else r=o({},this,s,null,!0);return e.isNullOrUndefined(r)||!(r.length>0)||e.isNullOrUndefined(r[0].tagName)&&1===r.length?0===t.childElementCount&&(t.innerHTML=i):[].slice.call(r).forEach(function(i){e.isNullOrUndefined(i.tagName)||(i.style.display=""),t.appendChild(i)}),t},u.prototype.clearProgress=function(t){e.isNullOrUndefined(this.intervalId[t])||(clearInterval(this.intervalId[t]),delete this.intervalId[t]),e.isNullOrUndefined(this.progressObj[t])||(clearInterval(this.progressObj[t].intervalId),delete this.progressObj[t])},u.prototype.removeToastContainer=function(t){t&&this.toastContainer.classList.contains("e-toast-util")&&e.detach(this.toastContainer)},u.prototype.clearContainerPos=function(t){var i=this;if(this.isBlazorServer())return void(this.toastContainer=null);this.customPosition?(e.setStyleAttribute(this.toastContainer,{left:"",top:""}),this.removeToastContainer(t),this.toastContainer=null,this.customPosition=!1):([r+"-top-left",r+"-top-right",r+"-bottom-left",r+"-bottom-right",r+"-bottom-center",r+"-top-center",r+"-full-width"].forEach(function(t){!e.isNullOrUndefined(i.toastContainer)&&i.toastContainer.classList.contains(t)&&i.toastContainer.classList.remove(t)}),this.removeToastContainer(t),this.toastContainer=null),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate()},u.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},u.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},u.prototype.isBlazorServer=function(){return e.isBlazor()&&this.isServerRendered},u.prototype.destroyToast=function(t,i){for(var s,o=this,n=0;n<this.toastCollection.length;n++)this.toastCollection[n].element[0]===t&&(s=this.toastCollection[n],this.toastCollection.splice(n,1));var r={options:this,cancel:!1,type:i,element:t,toastContainer:this.toastContainer},a=this.animation.hide,l={duration:a.duration,name:a.effect,timingFunction:a.easing},d=parseInt(t.id.split("toast_")[1],10),p=this.isBlazorServer()?{options:s,toastContainer:this.toastContainer}:{options:s,toastContainer:this.toastContainer,toastObj:this};this.trigger("beforeClose",r,function(i){i.cancel||(e.isNullOrUndefined(o.progressObj[d])||e.isNullOrUndefined(t.querySelector("."+h))||(o.progressObj[d].progressEle.style.width="0%"),l.end=function(){o.clearProgress(d),o.isBlazorServer()&&!e.isNullOrUndefined(s)||e.detach(t),o.trigger("close",p),0===o.toastContainer.childElementCount&&o.clearContainerPos(!0)},new e.Animation({}).animate(t,l))})},u.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},u.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},u.prototype.setPositioning=function(t){this.isBlazorServer()||(isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(this.customPosition=!0,e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)})))},u.prototype.setCloseButton=function(){if(this.showCloseButton){var t={close:"Close"};this.l10n=new e.L10n("toast",t,this.locale),this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("close"),s=this.createElement("div",{className:d+" e-icons ",attrs:{tabindex:"0","aria-label":i}});this.toastEle.classList.add("e-toast-header-close-icon"),this.toastEle.appendChild(s)}},u.prototype.setProgress=function(){if(this.timeOut>0){var t=parseInt(this.toastEle.id.split("toast_")[1],10);this.intervalId[t]=window.setTimeout(this.destroyToast.bind(this,this.toastEle),this.timeOut),this.progressObj[t]={hideEta:null,intervalId:null,maxHideTime:null,element:null,timeOutId:null,progressEle:null},this.progressObj[t].maxHideTime=parseFloat(this.timeOut+""),this.progressObj[t].hideEta=(new Date).getTime()+this.progressObj[t].maxHideTime,this.progressObj[t].element=this.toastEle,this.extendedTimeout>0&&(e.EventHandler.add(this.toastEle,"mouseover",this.toastHoverAction.bind(this,t)),e.EventHandler.add(this.toastEle,"mouseleave",this.delayedToastProgress.bind(this,t)),this.progressObj[t].timeOutId=this.intervalId[t]),this.showProgressBar&&(this.progressBarEle=this.createElement("div",{className:h}),this.toastEle.insertBefore(this.progressBarEle,this.toastEle.children[0]),this.progressObj[t].intervalId=setInterval(this.updateProgressBar.bind(this,this.progressObj[t]),10),this.progressObj[t].progressEle=this.progressBarEle)}},u.prototype.toastHoverAction=function(t){clearTimeout(this.progressObj[t].timeOutId),clearInterval(this.progressObj[t].intervalId),this.progressObj[t].hideEta=0;var i=this.progressObj[t].element;e.isNullOrUndefined(i.querySelector("."+h))||(this.progressObj[t].progressEle.style.width="0%")},u.prototype.delayedToastProgress=function(t){var i=this.progressObj[t],s=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,s),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(s.querySelector("."+h))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},u.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;e="Ltr"===this.progressDirection?100-e:e,t.progressEle.style.width=e+"%"},u.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=this.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.classList.add("e-toast-header-icon"),this.toastEle.appendChild(t)}},u.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)){var t=this.createElement("div",{className:"e-toast-title"});t=this.fetchEle(t,this.title,"title");var i=this.createElement("div",{className:l});i.appendChild(t),this.toastEle.appendChild(i)}},u.prototype.setContent=function(){var t=this.createElement("div",{className:"e-toast-content"}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var s=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||s)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var o=this.createElement("div");0!==i.childNodes.length;)this.innerEle.appendChild(this.element.childNodes[0]);t.appendChild(this.innerEle),[].slice.call(t.children).forEach(function(t){o.appendChild(t.cloneNode(!0))}),this.content=o,this.appendMessageContainer(t)}}else"object"!=typeof this.content||e.isNullOrUndefined(this.content.tagName)?(t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)):(t.appendChild(this.content),this.content=this.content.cloneNode(!0),this.appendMessageContainer(t))},u.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+l).length>0)this.toastEle.querySelector("."+l).appendChild(t);else{var e=this.createElement("div",{className:l});e.appendChild(t),this.toastEle.appendChild(e)}},u.prototype.actionButtons=function(){var t=this,s=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(o.model,n),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(n,"click",o.click),s.appendChild(n)}}),s.childElementCount>0&&this.appendMessageContainer(s)},u.prototype.appendToTarget=function(t){var i=this,o=this.isBlazorServer()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",o,function(o){if(o.cancel){if(i.isBlazorServer()){var n=parseInt(i.toastEle.id.split("toast_")[1],10);i.clearProgress(n),e.detach(i.toastEle),0===i.toastContainer.childElementCount&&i.clearContainerPos()}}else i.isBlazorServer()||(i.toastEle.style.display="none"),i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.isBlazorServer()||i.toastContainer.appendChild(i.toastEle),e.removeClass([i.toastEle],"e-blazor-toast-hidden"),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=s.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t)})},u.prototype.clickHandler=function(t){var i=this;this.isBlazorServer()||t.stopPropagation();var s=t.target,o=e.closest(s,"."+r),n=this.isBlazorServer()?{element:o,cancel:!1,clickToClose:!1,originalEvent:t}:{element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},a=s.classList.contains(d);this.trigger("click",n,function(t){(a&&!t.cancel||t.clickToClose)&&i.destroyToast(o,"click")})},u.prototype.keyDownHandler=function(t){if(t.target.classList.contains(d)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,s=e.closest(i,"."+r);this.destroyToast(s,"key")}},u.prototype.displayToast=function(t,i){var s=this,o=this.animation.show,n={duration:o.duration,name:o.effect,timingFunction:o.easing},r=this.isBlazorServer()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){s.trigger("open",r)},new e.Animation(n).animate(t)},u.prototype.getContainer=function(){return this.element.classList.add(a),this.element},u.prototype.onPropertyChanged=function(t,e){for(var i=this.element,s=0,o=Object.keys(t);s<o.length;s++)switch(o[s]){case"enableRtl":t.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl")}},n([e.Property("300px")],u.prototype,"width",void 0),n([e.Property("auto")],u.prototype,"height",void 0),n([e.Property(null)],u.prototype,"title",void 0),n([e.Property(null)],u.prototype,"content",void 0),n([e.Property(!0)],u.prototype,"enableHtmlSanitizer",void 0),n([e.Property(null)],u.prototype,"icon",void 0),n([e.Property(null)],u.prototype,"cssClass",void 0),n([e.Property(null)],u.prototype,"template",void 0),n([e.Property(!0)],u.prototype,"newestOnTop",void 0),n([e.Property(!1)],u.prototype,"showCloseButton",void 0),n([e.Property(!1)],u.prototype,"showProgressBar",void 0),n([e.Property(5e3)],u.prototype,"timeOut",void 0),n([e.Property("Rtl")],u.prototype,"progressDirection",void 0),n([e.Property(1e3)],u.prototype,"extendedTimeout",void 0),n([e.Complex({},f)],u.prototype,"animation",void 0),n([e.Complex({},p)],u.prototype,"position",void 0),n([e.Collection([{}],c)],u.prototype,"buttons",void 0),n([e.Property(null)],u.prototype,"target",void 0),n([e.Event()],u.prototype,"created",void 0),n([e.Event()],u.prototype,"beforeSanitizeHtml",void 0),n([e.Event()],u.prototype,"destroyed",void 0),n([e.Event()],u.prototype,"open",void 0),n([e.Event()],u.prototype,"beforeOpen",void 0),n([e.Event()],u.prototype,"beforeClose",void 0),n([e.Event()],u.prototype,"close",void 0),n([e.Event()],u.prototype,"click",void 0),u=n([e.NotifyPropertyChanges],u)}(e.Component);return function(t){function i(t,i,s){var o;document.querySelector("."+a)?o=document.querySelector("."+a):(o=e.createElement("div",{className:r+" "+a+" e-toast-util"}),document.body.appendChild(o));var n,l;if("string"==typeof t){var h=void 0,d=void 0;if(e.isNullOrUndefined(i))h="",d="";else switch(i){case"Warning":h="e-toast-warning",d="e-toast-warning-icon";break;case"Success":h="e-toast-success",d="e-toast-success-icon";break;case"Error":h="e-toast-danger",d="e-toast-error-icon";break;case"Information":h="e-toast-info",d="e-toast-info-icon"}l={content:t,cssClass:h,icon:d,timeOut:e.isNullOrUndefined(s)?5e3:s}}else l=t;return(n=new m(l)).appendTo(o),n.show(),n}t.show=i}(t.ToastUtility||(t.ToastUtility={})),t.ToastPosition=p,t.ButtonModelProps=c,t.ToastAnimations=u,t.ToastAnimationSettings=f,t.Toast=m,t}({},ej.base,ej.buttons,ej.popups),this.ejs=ej;
//# sourceMappingURL=ej2-notifications.min.js.map
/*!
* filename: index.d.ts
* version : 19.2.60
* version : 19.3.43
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

{
"_from": "@syncfusion/ej2-notifications@*",
"_id": "@syncfusion/ej2-notifications@18.3.35",
"_id": "@syncfusion/ej2-notifications@18.24.1",
"_inBundle": false,
"_integrity": "sha512-PyTw+XrVl2cbYs2meu+vNknsaYlCOB2FXZLw22/XyhoBydGmGDRgGmOedMCr3JgyBioXLlaMUnAG5z51+8Ur9w==",
"_integrity": "sha512-6BgqLVj3Hpmhg/RS1lD3/h+Wex9ELOKqa313u8n4lIwxUgYPA3VAGfOYsCxFPKMaM2EU4UGXOezyaRwIeyy4TA==",
"_location": "/@syncfusion/ej2-notifications",

@@ -27,4 +27,4 @@ "_phantomChildren": {},

],
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-notifications/-/ej2-notifications-18.3.35.tgz",
"_shasum": "ae0cb6e31d6a39432c872c7f638e6a798ab8799e",
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-notifications/-/ej2-notifications-18.24.1.tgz",
"_shasum": "da28ec2c5d10e4dca9fac8437001c105467965ae",
"_spec": "@syncfusion/ej2-notifications@*",

@@ -37,5 +37,5 @@ "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",

"dependencies": {
"@syncfusion/ej2-base": "~19.2.60",
"@syncfusion/ej2-buttons": "~19.2.60",
"@syncfusion/ej2-popups": "~19.2.60"
"@syncfusion/ej2-base": "~19.3.43",
"@syncfusion/ej2-buttons": "~19.3.43",
"@syncfusion/ej2-popups": "~19.3.43"
},

@@ -74,4 +74,4 @@ "deprecated": false,

"typings": "index.d.ts",
"version": "19.2.60",
"version": "19.3.43",
"sideEffects": false
}

@@ -1,2 +0,2 @@

import { Component, Property, ChildProperty, INotifyPropertyChanged, NotifyPropertyChanges, Animation } from '@syncfusion/ej2-base';import { Browser, isNullOrUndefined as isNOU, getUniqueID, formatUnit, EventHandler, KeyboardEventArgs } from '@syncfusion/ej2-base';import { EmitType, Collection, Complex, setStyleAttribute, Event, Effect, detach, AnimationModel, L10n } from '@syncfusion/ej2-base';import { attributes, extend, closest, compile as templateCompiler, classList, BaseEventArgs, isUndefined } from '@syncfusion/ej2-base';import { SwipeEventArgs, Touch, isBlazor, SanitizeHtmlHelper, removeClass } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups';
import { Component, Property, ChildProperty, INotifyPropertyChanged, NotifyPropertyChanges, Animation, createElement } from '@syncfusion/ej2-base';import { Browser, isNullOrUndefined as isNOU, getUniqueID, formatUnit, EventHandler, KeyboardEventArgs } from '@syncfusion/ej2-base';import { EmitType, Collection, Complex, setStyleAttribute, Event, Effect, detach, AnimationModel, L10n } from '@syncfusion/ej2-base';import { attributes, extend, closest, compile as templateCompiler, classList, BaseEventArgs, isUndefined } from '@syncfusion/ej2-base';import { SwipeEventArgs, Touch, isBlazor, SanitizeHtmlHelper, removeClass } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups';
import {PositionX,PositionY,ProgressDirectionType,BeforeSanitizeHtmlArgs,ToastOpenArgs,ToastBeforeOpenArgs,ToastBeforeCloseArgs,ToastCloseArgs,ToastClickEventArgs} from "./toast";

@@ -3,0 +3,0 @@ import {ComponentModel} from '@syncfusion/ej2-base';

@@ -538,2 +538,3 @@ import { Component, ChildProperty, INotifyPropertyChanged } from '@syncfusion/ej2-base';

private clearProgress;
private removeToastContainer;
private clearContainerPos;

@@ -572,1 +573,22 @@ private clearContentTemplate;

}
/**
* Base for creating Toast through utility method.
*/
export declare namespace ToastUtility {
/**
* To display a simple toast using the 'ToastUtility' with 'ToastModal' or
* as string with toast content, type, timeOut.
* ```
* Eg : ToastUtility.show('Toast Content Message', 'Information', 7000);
*
* ```
*/
/**
*
* @param { ToastModel | string } content - Specifies the toast modal or the content of the Toast.
* @param {string} type - Specifies the type of toast.
* @param { number } timeOut - Specifies the timeOut of the toast.
* @returns {Toast} - returns the element
*/
function show(content: ToastModel | string, type?: string, timeOut?: number): Toast;
}

@@ -20,3 +20,3 @@ var __extends = (this && this.__extends) || (function () {

};
import { Component, Property, ChildProperty, NotifyPropertyChanges, Animation } from '@syncfusion/ej2-base';
import { Component, Property, ChildProperty, NotifyPropertyChanges, Animation, createElement } from '@syncfusion/ej2-base';
import { Browser, isNullOrUndefined as isNOU, getUniqueID, formatUnit, EventHandler } from '@syncfusion/ej2-base';

@@ -447,3 +447,8 @@ import { Collection, Complex, setStyleAttribute, Event, detach, L10n } from '@syncfusion/ej2-base';

};
Toast.prototype.clearContainerPos = function () {
Toast.prototype.removeToastContainer = function (isClosed) {
if (isClosed && this.toastContainer.classList.contains('e-toast-util')) {
detach(this.toastContainer);
}
};
Toast.prototype.clearContainerPos = function (isClosed) {
var _this = this;

@@ -456,2 +461,3 @@ if (this.isBlazorServer()) {

setStyleAttribute(this.toastContainer, { 'left': '', 'top': '' });
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -472,2 +478,3 @@ this.customPosition = false;

});
this.removeToastContainer(isClosed);
this.toastContainer = null;

@@ -536,3 +543,3 @@ }

if (_this.toastContainer.childElementCount === 0) {
_this.clearContainerPos();
_this.clearContainerPos(true);
}

@@ -575,2 +582,3 @@ };

var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } });
this.toastEle.classList.add('e-toast-header-close-icon');
this.toastEle.appendChild(closeBtn);

@@ -629,2 +637,3 @@ };

var iconEle = this.createElement('div', { className: ICON + ' e-icons ' + this.icon });
this.toastEle.classList.add('e-toast-header-icon');
this.toastEle.appendChild(iconEle);

@@ -903,1 +912,78 @@ };

export { Toast };
/**
* Base for creating Toast through utility method.
*/
// eslint-disable-next-line
export var ToastUtility;
(function (ToastUtility) {
/**
* To display a simple toast using the 'ToastUtility' with 'ToastModal' or
* as string with toast content, type, timeOut.
* ```
* Eg : ToastUtility.show('Toast Content Message', 'Information', 7000);
*
* ```
*/
/* istanbul ignore next */
/**
*
* @param { ToastModel | string } content - Specifies the toast modal or the content of the Toast.
* @param {string} type - Specifies the type of toast.
* @param { number } timeOut - Specifies the timeOut of the toast.
* @returns {Toast} - returns the element
*/
function show(content, type, timeOut) {
var toastContainerElement;
if (document.querySelector('.' + CONTAINER)) {
toastContainerElement = document.querySelector('.' + CONTAINER);
}
else {
toastContainerElement = createElement('div', { 'className': ROOT + ' ' + CONTAINER + ' e-toast-util' });
document.body.appendChild(toastContainerElement);
}
var toastObj;
var untilToastsModel;
if (typeof (content) === 'string') {
var cssClass = void 0;
var icon = void 0;
if (!isNOU(type)) {
switch (type) {
case 'Warning':
cssClass = 'e-toast-warning';
icon = 'e-toast-warning-icon';
break;
case 'Success':
cssClass = 'e-toast-success';
icon = 'e-toast-success-icon';
break;
case 'Error':
cssClass = 'e-toast-danger';
icon = 'e-toast-error-icon';
break;
case 'Information':
cssClass = 'e-toast-info';
icon = 'e-toast-info-icon';
break;
}
}
else {
cssClass = '';
icon = '';
}
untilToastsModel = {
content: content,
cssClass: cssClass,
icon: icon,
timeOut: !isNOU(timeOut) ? timeOut : 5000
};
}
else {
untilToastsModel = content;
}
toastObj = new Toast(untilToastsModel);
toastObj.appendTo(toastContainerElement);
toastObj.show();
return toastObj;
}
ToastUtility.show = show;
})(ToastUtility || (ToastUtility = {}));

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc