@syncfusion/ej2-notifications
Advanced tools
Comparing version 17.4.39 to 17.4.40
@@ -9,2 +9,10 @@ # Changelog | ||
- `#254606` - Web accessibility related issues have been resolved. | ||
## 17.4.39 (2019-12-17) | ||
### Toast | ||
#### Bug Fixes | ||
`#F149339`, `#256583` - The issue with passing empty string value to cssClass API has been fixed. | ||
@@ -11,0 +19,0 @@ |
/*! | ||
* filename: ej2-notifications.umd.min.js | ||
* version : 17.4.39 | ||
* version : 17.4.40 | ||
* Copyright Syncfusion Inc. 2001 - 2019. 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,o){"use strict";var s=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),n=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(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",d="e-toast-content",h="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 s(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 s(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 s(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),g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(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),v=function(t){function y(e,i){var o=t.call(this,e,i)||this;return o.toastCollection=[],o}return s(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":""}),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.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()},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 o="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(o))return;"BODY"===o.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",o.style.position="relative"),this.setPositioning(this.position),o.appendChild(this.toastContainer)}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))},y.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(."+l+")"),o=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hide(i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hide(i)),this.animation.hide.effect=o)},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){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof t||"All"!==t)e.isNullOrUndefined(t)&&(t=this.newestOnTop?this.toastContainer.lastElementChild.classList.contains("blazor-template")?this.toastContainer.lastElementChild.previousSibling:this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},y.prototype.fetchEle=function(t,i,o){i="string"==typeof i?this.sanitizeHelper(i):i;var s,n,r,l,p,h=Object.keys(window);if(l=t.classList.contains(a)?this.element.id+"title":t.classList.contains(d)?this.element.id+"content":this.element.id+"template",n="content"===o?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var c=null;"title"!==o&&(c=document.querySelector(i),t.appendChild(c),c.style.display="");var u=e.isNullOrUndefined(c)?n:c.cloneNode(!0);"content"===o?this.contentTemplate=u:this.toastTemplate=u}}catch(t){s=e.compile(i),p=i}if(!e.isNullOrUndefined(s))if(e.isBlazor()){var f=!(-1!==h.indexOf("ejsInterop")&&!this.isStringTemplate&&0===p.indexOf("<div>Blazor"))||this.isStringTemplate;r=s({},this,o,l,f)}else r=s({},this,o,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)}),-1===h.indexOf("ejsInterop")||this.isStringTemplate||0!==p.indexOf("<div>Blazor")||this.blazorTemplate(l)),t},y.prototype.blazorTemplate=function(t){t===this.element.id+"title"?e.updateBlazorTemplate(t,"Title",this,!1):t===this.element.id+"content"?e.updateBlazorTemplate(t,"Content",this,!1):e.updateBlazorTemplate(t,"Template",this,!1)},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.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.destroyToast=function(t){for(var i,o=this,s=0;s<this.toastCollection.length;s++)this.toastCollection[s].element[0]===t&&(i=this.toastCollection[s],this.toastCollection.splice(s,1));var n=this.animation.hide,r={duration:n.duration,name:n.effect,timingFunction:n.easing},l=parseInt(t.id.split("toast_")[1],10),a=e.isBlazor()?{options:i,toastContainer:this.toastContainer}:{options:i,toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[l])||e.isNullOrUndefined(t.querySelector("."+c))||(this.progressObj[l].progressEle.style.width="0%"),r.end=function(){o.clearProgress(l),t.querySelector(".blazor-inner-template")||e.detach(t),o.trigger("close",a),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,r)},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){isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0)},y.prototype.setCloseButton=function(){if(this.showCloseButton){var t=this.createElement("div",{className:u+" e-icons "});this.toastEle.appendChild(t)}},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],o=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,o),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(o.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;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:h});i.appendChild(t),this.toastEle.appendChild(i)}},y.prototype.setContent=function(){var t=this.createElement("div",{className:d}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var o=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||o)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var s=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){s.appendChild(t.cloneNode(!0))}),this.content=s,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("."+h).length>0)this.toastEle.querySelector("."+h).appendChild(t);else{var e=this.createElement("div",{className:h});e.appendChild(t),this.toastEle.appendChild(e)}},y.prototype.actionButtons=function(){var t=this,o=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(s){if(!e.isNullOrUndefined(s.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(s.model.cssClass)||0===s.model.cssClass.length)&&(s.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(s.model,n),e.isNullOrUndefined(s.click)||"function"!=typeof s.click||e.EventHandler.add(n,"click",s.click),o.appendChild(n)}}),o.childElementCount>0&&this.appendMessageContainer(o)},y.prototype.appendToTarget=function(t){var i=this,s=e.isBlazor()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",s,function(s){s.cancel||(i.toastEle.style.display="none",i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.toastContainer.appendChild(i.toastEle),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),i.toastContainer.style.zIndex=o.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t))})},y.prototype.clickHandler=function(t){var i=this;e.isBlazor()||t.stopPropagation();var o=t.target,s=e.closest(o,"."+r),n=e.isBlazor()?{element:s,cancel:!1,clickToClose:!1,originalEvent:t}:{element:s,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=o.classList.contains(u);this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(s)})},y.prototype.displayToast=function(t,i){var o=this,s=this.animation.show,n={duration:s.duration,name:s.effect,timingFunction:s.easing},r=e.isBlazor()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){o.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,o=0,s=Object.keys(t);o<s.length;o++){switch(s[o]){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(1e3)],y.prototype,"extendedTimeout",void 0),n([e.Complex({},g)],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,"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=g,t.Toast=v,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,o){"use strict";var s=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),n=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(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",d="e-toast-content",h="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 s(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 s(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 s(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),g=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(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),v=function(t){function y(e,i){var o=t.call(this,e,i)||this;return o.toastCollection=[],o}return s(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":""}),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.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()},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 o="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(o))return;"BODY"===o.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",o.style.position="relative"),this.setPositioning(this.position),o.appendChild(this.toastContainer)}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))},y.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(."+l+")"),o=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hide(i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hide(i)),this.animation.hide.effect=o)},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){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof t||"All"!==t)e.isNullOrUndefined(t)&&(t=this.newestOnTop?this.toastContainer.lastElementChild.classList.contains("blazor-template")?this.toastContainer.lastElementChild.previousSibling:this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},y.prototype.fetchEle=function(t,i,o){i="string"==typeof i?this.sanitizeHelper(i):i;var s,n,r,l,p,h=Object.keys(window);if(l=t.classList.contains(a)?this.element.id+"title":t.classList.contains(d)?this.element.id+"content":this.element.id+"template",n="content"===o?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var c=null;"title"!==o&&(c=document.querySelector(i),t.appendChild(c),c.style.display="");var u=e.isNullOrUndefined(c)?n:c.cloneNode(!0);"content"===o?this.contentTemplate=u:this.toastTemplate=u}}catch(t){s=e.compile(i),p=i}if(!e.isNullOrUndefined(s))if(e.isBlazor()){var f=!(-1!==h.indexOf("ejsInterop")&&!this.isStringTemplate&&0===p.indexOf("<div>Blazor"))||this.isStringTemplate;r=s({},this,o,l,f)}else r=s({},this,o,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)}),-1===h.indexOf("ejsInterop")||this.isStringTemplate||0!==p.indexOf("<div>Blazor")||this.blazorTemplate(l)),t},y.prototype.blazorTemplate=function(t){t===this.element.id+"title"?e.updateBlazorTemplate(t,"Title",this,!1):t===this.element.id+"content"?e.updateBlazorTemplate(t,"Content",this,!1):e.updateBlazorTemplate(t,"Template",this,!1)},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.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.destroyToast=function(t){for(var i,o=this,s=0;s<this.toastCollection.length;s++)this.toastCollection[s].element[0]===t&&(i=this.toastCollection[s],this.toastCollection.splice(s,1));var n=this.animation.hide,r={duration:n.duration,name:n.effect,timingFunction:n.easing},l=parseInt(t.id.split("toast_")[1],10),a=e.isBlazor()?{options:i,toastContainer:this.toastContainer}:{options:i,toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[l])||e.isNullOrUndefined(t.querySelector("."+c))||(this.progressObj[l].progressEle.style.width="0%"),r.end=function(){o.clearProgress(l),t.querySelector(".blazor-inner-template")||e.detach(t),o.trigger("close",a),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,r)},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){isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0)},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],o=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,o),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(o.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;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:h});i.appendChild(t),this.toastEle.appendChild(i)}},y.prototype.setContent=function(){var t=this.createElement("div",{className:d}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var o=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||o)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var s=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){s.appendChild(t.cloneNode(!0))}),this.content=s,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("."+h).length>0)this.toastEle.querySelector("."+h).appendChild(t);else{var e=this.createElement("div",{className:h});e.appendChild(t),this.toastEle.appendChild(e)}},y.prototype.actionButtons=function(){var t=this,o=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(s){if(!e.isNullOrUndefined(s.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(s.model.cssClass)||0===s.model.cssClass.length)&&(s.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(s.model,n),e.isNullOrUndefined(s.click)||"function"!=typeof s.click||e.EventHandler.add(n,"click",s.click),o.appendChild(n)}}),o.childElementCount>0&&this.appendMessageContainer(o)},y.prototype.appendToTarget=function(t){var i=this,s=e.isBlazor()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",s,function(s){s.cancel||(i.toastEle.style.display="none",i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.toastContainer.appendChild(i.toastEle),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=o.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t))})},y.prototype.clickHandler=function(t){var i=this;e.isBlazor()||t.stopPropagation();var o=t.target,s=e.closest(o,"."+r),n=e.isBlazor()?{element:s,cancel:!1,clickToClose:!1,originalEvent:t}:{element:s,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=o.classList.contains(u);this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(s)})},y.prototype.keyDownHandler=function(t){if(t.target.classList.contains(u)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,o=e.closest(i,"."+r);this.destroyToast(o)}},y.prototype.displayToast=function(t,i){var o=this,s=this.animation.show,n={duration:s.duration,name:s.effect,timingFunction:s.easing},r=e.isBlazor()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){o.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,o=0,s=Object.keys(t);o<s.length;o++){switch(s[o]){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(1e3)],y.prototype,"extendedTimeout",void 0),n([e.Complex({},g)],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,"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=g,t.Toast=v,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, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, setStyleAttribute, updateBlazorTemplate } from '@syncfusion/ej2-base'; | ||
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, setStyleAttribute, updateBlazorTemplate } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -453,3 +453,7 @@ import { getZindexPartial } from '@syncfusion/ej2-popups'; | ||
} | ||
let closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ' }); | ||
let localeText = { close: 'Close' }; | ||
this.l10n = new L10n('toast', localeText, this.locale); | ||
this.l10n.setLocale(this.locale); | ||
let closeIconTitle = this.l10n.getConstant('close'); | ||
let closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } }); | ||
this.toastEle.appendChild(closeBtn); | ||
@@ -602,2 +606,3 @@ } | ||
EventHandler.add(this.toastEle, 'click', this.clickHandler, this); | ||
EventHandler.add(this.toastEle, 'keydown', this.keyDownHandler, this); | ||
this.toastContainer.style.zIndex = getZindexPartial(this.toastContainer) + ''; | ||
@@ -626,2 +631,10 @@ this.displayToast(this.toastEle, toastObj); | ||
} | ||
keyDownHandler(e) { | ||
if (e.target.classList.contains(CLOSEBTN) && | ||
(e.keyCode === 13 || e.keyCode === 32)) { | ||
let target = e.target; | ||
let toastEle = closest(target, '.' + ROOT); | ||
this.destroyToast(toastEle); | ||
} | ||
} | ||
displayToast(toastEle, toastObj) { | ||
@@ -628,0 +641,0 @@ let showAnimate = this.animation.show; |
@@ -1,2 +0,2 @@ | ||
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, attributes, classList, closest, compile, detach, extend, formatUnit, getUniqueID, isBlazor, isNullOrUndefined, isUndefined, setStyleAttribute, updateBlazorTemplate } from '@syncfusion/ej2-base'; | ||
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, setStyleAttribute, updateBlazorTemplate } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -490,3 +490,7 @@ import { getZindexPartial } from '@syncfusion/ej2-popups'; | ||
} | ||
var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ' }); | ||
var localeText = { close: 'Close' }; | ||
this.l10n = new L10n('toast', localeText, this.locale); | ||
this.l10n.setLocale(this.locale); | ||
var closeIconTitle = this.l10n.getConstant('close'); | ||
var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } }); | ||
this.toastEle.appendChild(closeBtn); | ||
@@ -641,2 +645,3 @@ }; | ||
EventHandler.add(_this.toastEle, 'click', _this.clickHandler, _this); | ||
EventHandler.add(_this.toastEle, 'keydown', _this.keyDownHandler, _this); | ||
_this.toastContainer.style.zIndex = getZindexPartial(_this.toastContainer) + ''; | ||
@@ -666,2 +671,10 @@ _this.displayToast(_this.toastEle, toastObj); | ||
}; | ||
Toast.prototype.keyDownHandler = function (e) { | ||
if (e.target.classList.contains(CLOSEBTN) && | ||
(e.keyCode === 13 || e.keyCode === 32)) { | ||
var target = e.target; | ||
var toastEle = closest(target, '.' + ROOT); | ||
this.destroyToast(toastEle); | ||
} | ||
}; | ||
Toast.prototype.displayToast = function (toastEle, toastObj) { | ||
@@ -668,0 +681,0 @@ var _this = this; |
/*! | ||
* filename: ej2-notifications.min.js | ||
* version : 17.4.39 | ||
* version : 17.4.40 | ||
* Copyright Syncfusion Inc. 2001 - 2019. 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,o){"use strict";var s=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),n=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",l="e-toast-message",a="e-toast-progress",p=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),n([e.Property("Left")],i.prototype,"X",void 0),n([e.Property("Top")],i.prototype,"Y",void 0),i}(e.ChildProperty),h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),n([e.Property(null)],i.prototype,"model",void 0),n([e.Property(null)],i.prototype,"click",void 0),i}(e.ChildProperty),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(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),c=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),n([e.Complex({effect:"FadeIn",duration:600,easing:"ease"},d)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},d)],i.prototype,"hide",void 0),i}(e.ChildProperty),u=function(t){function d(e,i){var o=t.call(this,e,i)||this;return o.toastCollection=[],o}return s(d,t),d.prototype.getModuleName=function(){return"toast"},d.prototype.getPersistData=function(){return this.addOnPersist([])},d.prototype.destroy=function(){this.hide("All"),this.element.classList.remove("e-toast-container"),e.setStyleAttribute(this.element,{position:"","z-index":""}),t.prototype.destroy.call(this)},d.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.element.classList.add("e-rtl")},d.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()},d.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 o="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(o))return;"BODY"===o.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",o.style.position="relative"),this.setPositioning(this.position),o.appendChild(this.toastContainer)}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))},d.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(.e-toast-container)"),o=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hide(i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hide(i)),this.animation.hide.effect=o)},d.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()},d.prototype.setCSSClass=function(t){if(t){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},d.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)},d.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},d.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize(),o={cancel:!1,helper:null};e.extend(i,i,o),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},d.prototype.hide=function(t){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof t||"All"!==t)e.isNullOrUndefined(t)&&(t=this.newestOnTop?this.toastContainer.lastElementChild.classList.contains("blazor-template")?this.toastContainer.lastElementChild.previousSibling:this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},d.prototype.fetchEle=function(t,i,o){i="string"==typeof i?this.sanitizeHelper(i):i;var s,n,r,l,a,p=Object.keys(window);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"===o?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"!==o&&(h=document.querySelector(i),t.appendChild(h),h.style.display="");var d=e.isNullOrUndefined(h)?n:h.cloneNode(!0);"content"===o?this.contentTemplate=d:this.toastTemplate=d}}catch(t){s=e.compile(i),a=i}return e.isNullOrUndefined(s)||(r=e.isBlazor()?s({},this,o,l,!(-1!==p.indexOf("ejsInterop")&&!this.isStringTemplate&&0===a.indexOf("<div>Blazor"))||this.isStringTemplate):s({},this,o,null,!0)),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)}),-1===p.indexOf("ejsInterop")||this.isStringTemplate||0!==a.indexOf("<div>Blazor")||this.blazorTemplate(l)),t},d.prototype.blazorTemplate=function(t){t===this.element.id+"title"?e.updateBlazorTemplate(t,"Title",this,!1):t===this.element.id+"content"?e.updateBlazorTemplate(t,"Content",this,!1):e.updateBlazorTemplate(t,"Template",this,!1)},d.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])},d.prototype.clearContainerPos=function(){var t=this;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()},d.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},d.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},d.prototype.destroyToast=function(t){for(var i,o=this,s=0;s<this.toastCollection.length;s++)this.toastCollection[s].element[0]===t&&(i=this.toastCollection[s],this.toastCollection.splice(s,1));var n=this.animation.hide,r={duration:n.duration,name:n.effect,timingFunction:n.easing},l=parseInt(t.id.split("toast_")[1],10),p=e.isBlazor()?{options:i,toastContainer:this.toastContainer}:{options:i,toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[l])||e.isNullOrUndefined(t.querySelector("."+a))||(this.progressObj[l].progressEle.style.width="0%"),r.end=function(){o.clearProgress(l),t.querySelector(".blazor-inner-template")||e.detach(t),o.trigger("close",p),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,r)},d.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},d.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},d.prototype.setPositioning=function(t){isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0)},d.prototype.setCloseButton=function(){if(this.showCloseButton){var t=this.createElement("div",{className:"e-toast-close-icon e-icons "});this.toastEle.appendChild(t)}},d.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)}},d.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%")},d.prototype.delayedToastProgress=function(t){var i=this.progressObj[t],o=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,o),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(o.querySelector("."+a))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},d.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;t.progressEle.style.width=e+"%"},d.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)}},d.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)}},d.prototype.setContent=function(){var t=this.createElement("div",{className:"e-toast-content"}),i=this.element;if(e.isNullOrUndefined(this.content)||""===this.content){var o=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||o)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var s=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){s.appendChild(t.cloneNode(!0))}),this.content=s,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))},d.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)}},d.prototype.actionButtons=function(){var t=this,o=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(s){if(!e.isNullOrUndefined(s.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(s.model.cssClass)||0===s.model.cssClass.length)&&(s.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(s.model,n),e.isNullOrUndefined(s.click)||"function"!=typeof s.click||e.EventHandler.add(n,"click",s.click),o.appendChild(n)}}),o.childElementCount>0&&this.appendMessageContainer(o)},d.prototype.appendToTarget=function(t){var i=this,s=e.isBlazor()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",s,function(s){s.cancel||(i.toastEle.style.display="none",i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.toastContainer.appendChild(i.toastEle),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),i.toastContainer.style.zIndex=o.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t))})},d.prototype.clickHandler=function(t){var i=this;e.isBlazor()||t.stopPropagation();var o=t.target,s=e.closest(o,"."+r),n=e.isBlazor()?{element:s,cancel:!1,clickToClose:!1,originalEvent:t}:{element:s,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=o.classList.contains("e-toast-close-icon");this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(s)})},d.prototype.displayToast=function(t,i){var o=this,s=this.animation.show,n={duration:s.duration,name:s.effect,timingFunction:s.easing},r=e.isBlazor()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){o.trigger("open",r)},new e.Animation(n).animate(t)},d.prototype.getContainer=function(){return this.element.classList.add("e-toast-container"),this.element},d.prototype.onPropertyChanged=function(t,e){for(var i=this.element,o=0,s=Object.keys(t);o<s.length;o++)switch(s[o]){case"enableRtl":t.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl")}},n([e.Property("300px")],d.prototype,"width",void 0),n([e.Property("auto")],d.prototype,"height",void 0),n([e.Property(null)],d.prototype,"title",void 0),n([e.Property(null)],d.prototype,"content",void 0),n([e.Property(!0)],d.prototype,"enableHtmlSanitizer",void 0),n([e.Property(null)],d.prototype,"icon",void 0),n([e.Property(null)],d.prototype,"cssClass",void 0),n([e.Property(null)],d.prototype,"template",void 0),n([e.Property(!0)],d.prototype,"newestOnTop",void 0),n([e.Property(!1)],d.prototype,"showCloseButton",void 0),n([e.Property(!1)],d.prototype,"showProgressBar",void 0),n([e.Property(5e3)],d.prototype,"timeOut",void 0),n([e.Property(1e3)],d.prototype,"extendedTimeout",void 0),n([e.Complex({},c)],d.prototype,"animation",void 0),n([e.Complex({},p)],d.prototype,"position",void 0),n([e.Collection([{}],h)],d.prototype,"buttons",void 0),n([e.Property(null)],d.prototype,"target",void 0),n([e.Event()],d.prototype,"created",void 0),n([e.Event()],d.prototype,"beforeSanitizeHtml",void 0),n([e.Event()],d.prototype,"destroyed",void 0),n([e.Event()],d.prototype,"open",void 0),n([e.Event()],d.prototype,"beforeOpen",void 0),n([e.Event()],d.prototype,"close",void 0),n([e.Event()],d.prototype,"click",void 0),d=n([e.NotifyPropertyChanges],d)}(e.Component);return t.ToastPosition=p,t.ButtonModelProps=h,t.ToastAnimations=d,t.ToastAnimationSettings=c,t.Toast=u,t}({},ej.base,ej.buttons,ej.popups),this.ejs=ej; | ||
this.ej=this.ej||{},this.ej.notifications=function(t,e,i,o){"use strict";var s=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),n=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r},r="e-toast",l="e-toast-message",a="e-toast-progress",p="e-toast-close-icon",h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(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 s(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 s(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 s(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),m=function(t){function c(e,i){var o=t.call(this,e,i)||this;return o.toastCollection=[],o}return s(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":""}),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.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()},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 o="string"==typeof this.target?document.querySelector(this.target):document.body;if(e.isNullOrUndefined(o))return;"BODY"===o.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",o.style.position="relative"),this.setPositioning(this.position),o.appendChild(this.toastContainer)}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))},c.prototype.swipeHandler=function(t){var i=e.closest(t.originalEvent.target,".e-toast:not(.e-toast-container)"),o=this.animation.hide.effect;e.isNullOrUndefined(i)||("Right"===t.swipeDirection?(this.animation.hide.effect="SlideRightOut",this.hide(i)):"Left"===t.swipeDirection&&(this.animation.hide.effect="SlideLeftOut",this.hide(i)),this.animation.hide.effect=o)},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(),o={cancel:!1,helper:null};e.extend(i,i,o),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){if(!e.isNullOrUndefined(this.toastContainer)&&0!==this.toastContainer.childElementCount)if("string"!=typeof t||"All"!==t)e.isNullOrUndefined(t)&&(t=this.newestOnTop?this.toastContainer.lastElementChild.classList.contains("blazor-template")?this.toastContainer.lastElementChild.previousSibling:this.toastContainer.lastElementChild:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},c.prototype.fetchEle=function(t,i,o){i="string"==typeof i?this.sanitizeHelper(i):i;var s,n,r,l,a,p=Object.keys(window);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"===o?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"!==o&&(h=document.querySelector(i),t.appendChild(h),h.style.display="");var d=e.isNullOrUndefined(h)?n:h.cloneNode(!0);"content"===o?this.contentTemplate=d:this.toastTemplate=d}}catch(t){s=e.compile(i),a=i}return e.isNullOrUndefined(s)||(r=e.isBlazor()?s({},this,o,l,!(-1!==p.indexOf("ejsInterop")&&!this.isStringTemplate&&0===a.indexOf("<div>Blazor"))||this.isStringTemplate):s({},this,o,null,!0)),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)}),-1===p.indexOf("ejsInterop")||this.isStringTemplate||0!==a.indexOf("<div>Blazor")||this.blazorTemplate(l)),t},c.prototype.blazorTemplate=function(t){t===this.element.id+"title"?e.updateBlazorTemplate(t,"Title",this,!1):t===this.element.id+"content"?e.updateBlazorTemplate(t,"Content",this,!1):e.updateBlazorTemplate(t,"Template",this,!1)},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;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.destroyToast=function(t){for(var i,o=this,s=0;s<this.toastCollection.length;s++)this.toastCollection[s].element[0]===t&&(i=this.toastCollection[s],this.toastCollection.splice(s,1));var n=this.animation.hide,r={duration:n.duration,name:n.effect,timingFunction:n.easing},l=parseInt(t.id.split("toast_")[1],10),p=e.isBlazor()?{options:i,toastContainer:this.toastContainer}:{options:i,toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[l])||e.isNullOrUndefined(t.querySelector("."+a))||(this.progressObj[l].progressEle.style.width="0%"),r.end=function(){o.clearProgress(l),t.querySelector(".blazor-inner-template")||e.detach(t),o.trigger("close",p),0===o.toastContainer.childElementCount&&o.clearContainerPos()},new e.Animation({}).animate(t,r)},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){isNaN(parseFloat(t.X))&&isNaN(parseFloat(t.Y))?this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase()):(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0)},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"),o=this.createElement("div",{className:p+" e-icons ",attrs:{tabindex:"0","aria-label":i}});this.toastEle.appendChild(o)}},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],o=i.element;i.timeOutId=window.setTimeout(this.destroyToast.bind(this,o),this.extendedTimeout),i.maxHideTime=parseFloat(this.extendedTimeout+""),i.hideEta=(new Date).getTime()+i.maxHideTime,e.isNullOrUndefined(o.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;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 o=""!==this.element.innerHTML.replace(/\s/g,"");if((i.children.length>0||o)&&(!i.firstElementChild||!i.firstElementChild.classList.contains(r))){this.innerEle=document.createDocumentFragment();for(var s=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){s.appendChild(t.cloneNode(!0))}),this.content=s,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,o=this.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(s){if(!e.isNullOrUndefined(s.model)){var n=t.createElement("button");n.setAttribute("type","button"),(e.isNullOrUndefined(s.model.cssClass)||0===s.model.cssClass.length)&&(s.model.cssClass="e-primary"),n.classList.add("e-small"),new i.Button(s.model,n),e.isNullOrUndefined(s.click)||"function"!=typeof s.click||e.EventHandler.add(n,"click",s.click),o.appendChild(n)}}),o.childElementCount>0&&this.appendMessageContainer(o)},c.prototype.appendToTarget=function(t){var i=this,s=e.isBlazor()?{options:t,element:this.toastEle,cancel:!1}:{options:t,toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",s,function(s){s.cancel||(i.toastEle.style.display="none",i.newestOnTop&&0!==i.toastContainer.childElementCount?i.toastContainer.insertBefore(i.toastEle,i.toastContainer.children[0]):i.toastContainer.appendChild(i.toastEle),e.EventHandler.add(i.toastEle,"click",i.clickHandler,i),e.EventHandler.add(i.toastEle,"keydown",i.keyDownHandler,i),i.toastContainer.style.zIndex=o.getZindexPartial(i.toastContainer)+"",i.displayToast(i.toastEle,t))})},c.prototype.clickHandler=function(t){var i=this;e.isBlazor()||t.stopPropagation();var o=t.target,s=e.closest(o,"."+r),n=e.isBlazor()?{element:s,cancel:!1,clickToClose:!1,originalEvent:t}:{element:s,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},l=o.classList.contains(p);this.trigger("click",n,function(t){(l&&!t.cancel||t.clickToClose)&&i.destroyToast(s)})},c.prototype.keyDownHandler=function(t){if(t.target.classList.contains(p)&&(13===t.keyCode||32===t.keyCode)){var i=t.target,o=e.closest(i,"."+r);this.destroyToast(o)}},c.prototype.displayToast=function(t,i){var o=this,s=this.animation.show,n={duration:s.duration,name:s.effect,timingFunction:s.easing},r=e.isBlazor()?{options:i,element:this.toastEle}:{options:i,toastObj:this,element:this.toastEle};n.begin=function(){t.style.display=""},n.end=function(){o.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,o=0,s=Object.keys(t);o<s.length;o++)switch(s[o]){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(1e3)],c.prototype,"extendedTimeout",void 0),n([e.Complex({},u)],c.prototype,"animation",void 0),n([e.Complex({},h)],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,"close",void 0),n([e.Event()],c.prototype,"click",void 0),c=n([e.NotifyPropertyChanges],c)}(e.Component);return t.ToastPosition=h,t.ButtonModelProps=d,t.ToastAnimations=c,t.ToastAnimationSettings=u,t.Toast=m,t}({},ej.base,ej.buttons,ej.popups),this.ejs=ej; | ||
//# sourceMappingURL=ej2-notifications.min.js.map |
/*! | ||
* filename: index.d.ts | ||
* version : 17.4.39 | ||
* version : 17.4.40 | ||
* Copyright Syncfusion Inc. 2001 - 2019. 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@17.2.48", | ||
"_id": "@syncfusion/ej2-notifications@17.4.39", | ||
"_inBundle": false, | ||
"_integrity": "sha512-GPH2/kQTEJlO4FL6dhX1OUd1Ru5UGV4Tj0do42SINoQJxgkAqMXC11lJxT8qdD0QeLhkU/3aa6xm7iDdvCLAUw==", | ||
"_integrity": "sha512-NMBZEWeADpegKLK+So2lOrIm75s3Km2L1CCPZ95AKklMP+iYDz6QbN9UQq6wKzT0eouHoia/P9BoutXjdlq3JA==", | ||
"_location": "/@syncfusion/ej2-notifications", | ||
@@ -27,4 +27,4 @@ "_phantomChildren": {}, | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-notifications/-/ej2-notifications-17.2.48.tgz", | ||
"_shasum": "748de0db083f9ed916d54525d09ba1adfab1d58c", | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-notifications/-/ej2-notifications-17.4.39.tgz", | ||
"_shasum": "ec27154fe1c790779ed60e4c6f7667f3001c761f", | ||
"_spec": "@syncfusion/ej2-notifications@*", | ||
@@ -73,4 +73,4 @@ "_where": "/jenkins/workspace/ation_hotfix_17.2.0.34_Vol2-DDPJ6C2YEWTWLLKKNA7AG2JBE6DYTCTNGMHGORWGAYAVCL6L7OLQ/packages/included", | ||
"typings": "index.d.ts", | ||
"version": "17.4.39", | ||
"version": "17.4.40", | ||
"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 } from '@syncfusion/ej2-base';import { EmitType, Collection, Complex, setStyleAttribute, Event, Effect, detach, AnimationModel } from '@syncfusion/ej2-base';import { attributes, extend, closest, compile as templateCompiler, classList, BaseEventArgs, isUndefined} from '@syncfusion/ej2-base';import { SwipeEventArgs, Touch, updateBlazorTemplate, isBlazor, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups'; | ||
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, updateBlazorTemplate, isBlazor, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups'; | ||
import {PositionX,PositionY,BeforeSanitizeHtmlArgs,ToastOpenArgs,ToastBeforeOpenArgs,ToastCloseArgs,ToastClickEventArgs} from "./toast"; | ||
@@ -3,0 +3,0 @@ import {ComponentModel} from '@syncfusion/ej2-base'; |
@@ -219,2 +219,3 @@ import { Component, ChildProperty, INotifyPropertyChanged } from '@syncfusion/ej2-base'; | ||
private toastCollection; | ||
private l10n; | ||
/** | ||
@@ -440,2 +441,3 @@ * Initializes a new instance of the Toast class. | ||
private clickHandler; | ||
private keyDownHandler; | ||
private displayToast; | ||
@@ -442,0 +444,0 @@ private getContainer; |
@@ -22,3 +22,3 @@ var __extends = (this && this.__extends) || (function () { | ||
import { Browser, isNullOrUndefined as isNOU, getUniqueID, formatUnit, EventHandler } from '@syncfusion/ej2-base'; | ||
import { Collection, Complex, setStyleAttribute, Event, detach } from '@syncfusion/ej2-base'; | ||
import { Collection, Complex, setStyleAttribute, Event, detach, L10n } from '@syncfusion/ej2-base'; | ||
import { attributes, extend, closest, compile as templateCompiler, classList, isUndefined } from '@syncfusion/ej2-base'; | ||
@@ -498,3 +498,7 @@ import { Touch, updateBlazorTemplate, isBlazor, SanitizeHtmlHelper } from '@syncfusion/ej2-base'; | ||
} | ||
var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ' }); | ||
var localeText = { close: 'Close' }; | ||
this.l10n = new L10n('toast', localeText, this.locale); | ||
this.l10n.setLocale(this.locale); | ||
var closeIconTitle = this.l10n.getConstant('close'); | ||
var closeBtn = this.createElement('div', { className: CLOSEBTN + ' e-icons ', attrs: { tabindex: '0', 'aria-label': closeIconTitle } }); | ||
this.toastEle.appendChild(closeBtn); | ||
@@ -649,2 +653,3 @@ }; | ||
EventHandler.add(_this.toastEle, 'click', _this.clickHandler, _this); | ||
EventHandler.add(_this.toastEle, 'keydown', _this.keyDownHandler, _this); | ||
_this.toastContainer.style.zIndex = getZindexPartial(_this.toastContainer) + ''; | ||
@@ -674,2 +679,10 @@ _this.displayToast(_this.toastEle, toastObj); | ||
}; | ||
Toast.prototype.keyDownHandler = function (e) { | ||
if (e.target.classList.contains(CLOSEBTN) && | ||
(e.keyCode === 13 || e.keyCode === 32)) { | ||
var target = e.target; | ||
var toastEle = closest(target, '.' + ROOT); | ||
this.destroyToast(toastEle); | ||
} | ||
}; | ||
Toast.prototype.displayToast = function (toastEle, toastObj) { | ||
@@ -676,0 +689,0 @@ var _this = this; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
789363
14553