Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-notifications

Package Overview
Dependencies
Maintainers
2
Versions
98
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 16.2.41 to 16.2.45

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

### Toast
#### New Features
- Provided support for `Swipe` action on Toast in devices.
#### Bug Fixes
- The issue with Toast title ellipsis has been fixed.
## 16.2.41 (2018-06-25)
### Badge

@@ -7,0 +19,0 @@

2

dist/ej2-notifications.umd.min.js

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

!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=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])};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-full-width",p="e-toast-message",d="e-toast-progress",h="e-toast-close-icon",c=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),u=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),f=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),y=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"},f)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},f)],i.prototype,"hide",void 0),i}(e.ChildProperty),m=function(t){function f(e,i){return t.call(this,e,i)||this}return s(f,t),f.prototype.getModuleName=function(){return"toast"},f.prototype.getPersistData=function(){return this.addOnPersist([])},f.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(l),e.setStyleAttribute(this.element,{position:"","z-index":""}),t.prototype.destroy.call(this)},f.prototype.preRender=function(){this.enableRtl&&this.element.classList.add("e-rtl")},f.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.titleTemplate=null,this.contentTemplate=null,this.toastTemplate=null},f.prototype.show=function(t){if(e.isNullOrUndefined(t)||(this.templateChanges(t),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var i="string"==typeof this.target?document.querySelector(this.target):this.target;if(e.isNullOrUndefined(i))return;"BODY"===i.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",i.style.position="relative"),this.setPositioning(this.position),i.appendChild(this.toastContainer)}this.toastEle=e.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||0===this.template.length?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget()},f.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.title)||e.isNullOrUndefined(this.titleTemplate)||this.title===t.title||this.clearTitleTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},f.prototype.setCSSClass=function(t){if(!e.isNullOrUndefined(t)){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},f.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add(a):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove(a)),this.toastEle.style.height=e.formatUnit(this.height)},f.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},f.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:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},f.prototype.fetchEle=function(t,i,o){var s,n,r;if(n="title"===o?this.titleTemplate:"content"===o?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var l=document.querySelector(i);t.appendChild(l),l.style.display="";var a=l.cloneNode(!0);"title"===o?this.titleTemplate=a:"content"===o?this.contentTemplate=a:this.toastTemplate=a}}catch(t){s=e.compile(i)}return e.isNullOrUndefined(s)||(r=s({},this,o)),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},f.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])},f.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.titleTemplate)||this.clearTitleTemplate(),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate()},f.prototype.clearTitleTemplate=function(){this.titleTemplate.style.display="none",document.body.appendChild(this.titleTemplate),this.titleTemplate=null},f.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},f.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},f.prototype.destroyToast=function(t){var i=this,o=this.animation.hide,s={duration:o.duration,name:o.effect,timingFunction:o.easing},n=parseInt(t.id.split("toast_")[1],10),r={toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[n])||e.isNullOrUndefined(t.querySelector("."+d))||(this.progressObj[n].progressEle.style.width="0%"),s.end=function(){i.clearProgress(n),e.detach(t),i.trigger("close",r),0===i.toastContainer.childElementCount&&i.clearContainerPos()},new e.Animation({}).animate(t,s)},f.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},f.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},f.prototype.setPositioning=function(t){"number"==typeof t.X||"number"==typeof t.Y||-1!==t.X.indexOf("%")||-1!==t.Y.indexOf("%")?(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0):this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase())},f.prototype.setCloseButton=function(){if(this.showCloseButton){var t=e.createElement("div",{className:h+" e-icons "});this.toastEle.appendChild(t)}},f.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=e.createElement("div",{className:d}),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)}},f.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("."+d))||(this.progressObj[t].progressEle.style.width="0%")},f.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("."+d))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},f.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;t.progressEle.style.width=e+"%"},f.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=e.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.appendChild(t)}},f.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)&&0!==this.title.length){var t=e.createElement("div",{className:"e-toast-title"});t=this.fetchEle(t,this.title,"title");var i=e.createElement("div",{className:p});i.appendChild(t),this.toastEle.appendChild(i)}},f.prototype.setContent=function(){if(!e.isNullOrUndefined(this.content)&&0!==this.content.length){var t=e.createElement("div",{className:"e-toast-content"});t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)}},f.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+p).length>0)this.toastEle.querySelector("."+p).appendChild(t);else{var i=e.createElement("div",{className:p});i.appendChild(t),this.toastEle.appendChild(i)}},f.prototype.actionButtons=function(){var t=e.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var s=e.createElement("button");s.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),s.classList.add("e-small"),new i.Button(o.model,s),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(s,"click",o.click),t.appendChild(s)}}),t.childElementCount>0&&this.appendMessageContainer(t)},f.prototype.appendToTarget=function(){var t={toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",t),t.cancel||(this.toastEle.style.display="none",this.newestOnTop&&0!==this.toastContainer.childElementCount?this.toastContainer.insertBefore(this.toastEle,this.toastContainer.children[0]):this.toastContainer.appendChild(this.toastEle),e.EventHandler.add(this.toastEle,"click",this.clickHandler,this),this.toastContainer.style.zIndex=o.getZindexPartial(this.toastContainer)+"",this.displayToast(this.toastEle))},f.prototype.clickHandler=function(t){var i=t.target,o=e.closest(i,"."+r),s={element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},n=i.classList.contains(h);this.trigger("click",s),(n&&!s.cancel||s.clickToClose)&&this.destroyToast(o)},f.prototype.displayToast=function(t){var i=this,o=this.animation.show,s={duration:o.duration,name:o.effect,timingFunction:o.easing},n={toastObj:this,element:this.toastEle};s.begin=function(){t.style.display=""},s.end=function(){i.trigger("open",n)},new e.Animation(s).animate(t)},f.prototype.getContainer=function(){return this.element.classList.add(l),this.element},f.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(e.Browser.isDevice&&screen.width<768?"100%":"300px")],f.prototype,"width",void 0),n([e.Property("auto")],f.prototype,"height",void 0),n([e.Property(null)],f.prototype,"title",void 0),n([e.Property(null)],f.prototype,"content",void 0),n([e.Property(null)],f.prototype,"icon",void 0),n([e.Property(null)],f.prototype,"cssClass",void 0),n([e.Property(null)],f.prototype,"template",void 0),n([e.Property(!0)],f.prototype,"newestOnTop",void 0),n([e.Property(!1)],f.prototype,"showCloseButton",void 0),n([e.Property(!1)],f.prototype,"showProgressBar",void 0),n([e.Property(5e3)],f.prototype,"timeOut",void 0),n([e.Property(1e3)],f.prototype,"extendedTimeout",void 0),n([e.Complex({},y)],f.prototype,"animation",void 0),n([e.Complex({},c)],f.prototype,"position",void 0),n([e.Collection([{}],u)],f.prototype,"buttons",void 0),n([e.Property(document.body)],f.prototype,"target",void 0),n([e.Event()],f.prototype,"created",void 0),n([e.Event()],f.prototype,"destroyed",void 0),n([e.Event()],f.prototype,"open",void 0),n([e.Event()],f.prototype,"beforeOpen",void 0),n([e.Event()],f.prototype,"close",void 0),n([e.Event()],f.prototype,"click",void 0),f=n([e.NotifyPropertyChanges],f)}(e.Component);t.ToastPosition=c,t.ButtonModelProps=u,t.ToastAnimations=f,t.ToastAnimationSettings=y,t.Toast=m,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=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])};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-full-width",p="e-toast-message",d="e-toast-progress",h="e-toast-close-icon",c=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),u=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),f=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),y=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"},f)],i.prototype,"show",void 0),n([e.Complex({effect:"FadeOut",duration:600,easing:"ease"},f)],i.prototype,"hide",void 0),i}(e.ChildProperty),m=function(t){function f(e,i){return t.call(this,e,i)||this}return s(f,t),f.prototype.getModuleName=function(){return"toast"},f.prototype.getPersistData=function(){return this.addOnPersist([])},f.prototype.destroy=function(){this.hide("All"),this.element.classList.remove(l),e.setStyleAttribute(this.element,{position:"","z-index":""}),t.prototype.destroy.call(this)},f.prototype.preRender=function(){this.isDevice=e.Browser.isDevice,this.enableRtl&&this.element.classList.add("e-rtl")},f.prototype.render=function(){this.progressObj=[],this.intervalId=[],this.titleTemplate=null,this.contentTemplate=null,this.toastTemplate=null,this.isDevice&&screen.width<768&&new e.Touch(this.element,{swipe:this.swipeHandler.bind(this)})},f.prototype.show=function(t){if(e.isNullOrUndefined(t)||(this.templateChanges(t),e.extend(this,this,t)),e.isNullOrUndefined(this.toastContainer)){this.toastContainer=this.getContainer();var i="string"==typeof this.target?document.querySelector(this.target):this.target;if(e.isNullOrUndefined(i))return;"BODY"===i.tagName?this.toastContainer.style.position="fixed":(this.toastContainer.style.position="absolute",i.style.position="relative"),this.setPositioning(this.position),i.appendChild(this.toastContainer)}this.toastEle=e.createElement("div",{className:r,id:e.getUniqueID("toast")}),this.setWidthHeight(),this.setCSSClass(this.cssClass),e.isNullOrUndefined(this.template)||0===this.template.length?this.personalizeToast():this.templateRendering(),this.setProgress(),this.setCloseButton(),this.setAria(),this.appendToTarget()},f.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)},f.prototype.templateChanges=function(t){e.isUndefined(t.content)||e.isNullOrUndefined(this.contentTemplate)||this.content===t.content||this.clearContentTemplate(),e.isUndefined(t.title)||e.isNullOrUndefined(this.titleTemplate)||this.title===t.title||this.clearTitleTemplate(),e.isUndefined(t.template)||e.isNullOrUndefined(this.toastTemplate)||this.template===t.template||this.clearToastTemplate()},f.prototype.setCSSClass=function(t){if(!e.isNullOrUndefined(t)){var i=-1!==t.indexOf(",")?",":" ";e.classList(this.toastEle,t.split(i),[])}},f.prototype.setWidthHeight=function(){"300px"===this.width?this.toastEle.style.width=e.formatUnit(this.width):"100%"===this.width?this.toastContainer.classList.add(a):(this.toastEle.style.width=e.formatUnit(this.width),this.toastContainer.classList.remove(a)),this.toastEle.style.height=e.formatUnit(this.height)},f.prototype.templateRendering=function(){this.fetchEle(this.toastEle,this.template,"template")},f.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:this.toastContainer.firstElementChild),this.destroyToast(t);else for(var i=0;i<this.toastContainer.childElementCount;i++)this.destroyToast(this.toastContainer.children[i])},f.prototype.fetchEle=function(t,i,o){var s,n,r;if(n="title"===o?this.titleTemplate:"content"===o?this.contentTemplate:this.toastTemplate,!e.isNullOrUndefined(n))return t.appendChild(n.cloneNode(!0)),t;try{if(document.querySelectorAll(i).length>0){var l=document.querySelector(i);t.appendChild(l),l.style.display="";var a=l.cloneNode(!0);"title"===o?this.titleTemplate=a:"content"===o?this.contentTemplate=a:this.toastTemplate=a}}catch(t){s=e.compile(i)}return e.isNullOrUndefined(s)||(r=s({},this,o)),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},f.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])},f.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.titleTemplate)||this.clearTitleTemplate(),e.isNullOrUndefined(this.contentTemplate)||this.clearContentTemplate(),e.isNullOrUndefined(this.toastTemplate)||this.clearToastTemplate()},f.prototype.clearTitleTemplate=function(){this.titleTemplate.style.display="none",document.body.appendChild(this.titleTemplate),this.titleTemplate=null},f.prototype.clearContentTemplate=function(){this.contentTemplate.style.display="none",document.body.appendChild(this.contentTemplate),this.contentTemplate=null},f.prototype.clearToastTemplate=function(){this.toastTemplate.style.display="none",document.body.appendChild(this.toastTemplate),this.toastTemplate=null},f.prototype.destroyToast=function(t){var i=this,o=this.animation.hide,s={duration:o.duration,name:o.effect,timingFunction:o.easing},n=parseInt(t.id.split("toast_")[1],10),r={toastContainer:this.toastContainer,toastObj:this};e.isNullOrUndefined(this.progressObj[n])||e.isNullOrUndefined(t.querySelector("."+d))||(this.progressObj[n].progressEle.style.width="0%"),s.end=function(){i.clearProgress(n),e.detach(t),i.trigger("close",r),0===i.toastContainer.childElementCount&&i.clearContainerPos()},new e.Animation({}).animate(t,s)},f.prototype.personalizeToast=function(){this.setIcon(),this.setTitle(),this.setContent(),this.actionButtons()},f.prototype.setAria=function(){e.attributes(this.toastEle,{role:"alert"})},f.prototype.setPositioning=function(t){"number"==typeof t.X||"number"==typeof t.Y||-1!==t.X.indexOf("%")||-1!==t.Y.indexOf("%")?(e.setStyleAttribute(this.toastContainer,{left:e.formatUnit(t.X),top:e.formatUnit(t.Y)}),this.customPosition=!0):this.toastContainer.classList.add(r+"-"+t.Y.toString().toLowerCase()+"-"+t.X.toString().toLowerCase())},f.prototype.setCloseButton=function(){if(this.showCloseButton){var t=e.createElement("div",{className:h+" e-icons "});this.toastEle.appendChild(t)}},f.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=e.createElement("div",{className:d}),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)}},f.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("."+d))||(this.progressObj[t].progressEle.style.width="0%")},f.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("."+d))||(i.intervalId=setInterval(this.updateProgressBar.bind(this,i),10))},f.prototype.updateProgressBar=function(t){var e=(t.hideEta-(new Date).getTime())/t.maxHideTime*100;t.progressEle.style.width=e+"%"},f.prototype.setIcon=function(){if(!e.isNullOrUndefined(this.icon)&&0!==this.icon.length){var t=e.createElement("div",{className:"e-toast-icon e-icons "+this.icon});this.toastEle.appendChild(t)}},f.prototype.setTitle=function(){if(!e.isNullOrUndefined(this.title)&&0!==this.title.length){var t=e.createElement("div",{className:"e-toast-title"});t=this.fetchEle(t,this.title,"title");var i=e.createElement("div",{className:p});i.appendChild(t),this.toastEle.appendChild(i)}},f.prototype.setContent=function(){if(!e.isNullOrUndefined(this.content)&&0!==this.content.length){var t=e.createElement("div",{className:"e-toast-content"});t=this.fetchEle(t,this.content,"content"),this.appendMessageContainer(t)}},f.prototype.appendMessageContainer=function(t){if(this.toastEle.querySelectorAll("."+p).length>0)this.toastEle.querySelector("."+p).appendChild(t);else{var i=e.createElement("div",{className:p});i.appendChild(t),this.toastEle.appendChild(i)}},f.prototype.actionButtons=function(){var t=e.createElement("div",{className:"e-toast-actions"});[].slice.call(this.buttons).forEach(function(o){if(!e.isNullOrUndefined(o.model)){var s=e.createElement("button");s.setAttribute("type","button"),(e.isNullOrUndefined(o.model.cssClass)||0===o.model.cssClass.length)&&(o.model.cssClass="e-primary"),s.classList.add("e-small"),new i.Button(o.model,s),e.isNullOrUndefined(o.click)||"function"!=typeof o.click||e.EventHandler.add(s,"click",o.click),t.appendChild(s)}}),t.childElementCount>0&&this.appendMessageContainer(t)},f.prototype.appendToTarget=function(){var t={toastObj:this,element:this.toastEle,cancel:!1};this.trigger("beforeOpen",t),t.cancel||(this.toastEle.style.display="none",this.newestOnTop&&0!==this.toastContainer.childElementCount?this.toastContainer.insertBefore(this.toastEle,this.toastContainer.children[0]):this.toastContainer.appendChild(this.toastEle),e.EventHandler.add(this.toastEle,"click",this.clickHandler,this),this.toastContainer.style.zIndex=o.getZindexPartial(this.toastContainer)+"",this.displayToast(this.toastEle))},f.prototype.clickHandler=function(t){var i=t.target,o=e.closest(i,"."+r),s={element:o,cancel:!1,clickToClose:!1,originalEvent:t,toastObj:this},n=i.classList.contains(h);this.trigger("click",s),(n&&!s.cancel||s.clickToClose)&&this.destroyToast(o)},f.prototype.displayToast=function(t){var i=this,o=this.animation.show,s={duration:o.duration,name:o.effect,timingFunction:o.easing},n={toastObj:this,element:this.toastEle};s.begin=function(){t.style.display=""},s.end=function(){i.trigger("open",n)},new e.Animation(s).animate(t)},f.prototype.getContainer=function(){return this.element.classList.add(l),this.element},f.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(e.Browser.isDevice&&screen.width<768?"100%":"300px")],f.prototype,"width",void 0),n([e.Property("auto")],f.prototype,"height",void 0),n([e.Property(null)],f.prototype,"title",void 0),n([e.Property(null)],f.prototype,"content",void 0),n([e.Property(null)],f.prototype,"icon",void 0),n([e.Property(null)],f.prototype,"cssClass",void 0),n([e.Property(null)],f.prototype,"template",void 0),n([e.Property(!0)],f.prototype,"newestOnTop",void 0),n([e.Property(!1)],f.prototype,"showCloseButton",void 0),n([e.Property(!1)],f.prototype,"showProgressBar",void 0),n([e.Property(5e3)],f.prototype,"timeOut",void 0),n([e.Property(1e3)],f.prototype,"extendedTimeout",void 0),n([e.Complex({},y)],f.prototype,"animation",void 0),n([e.Complex({},c)],f.prototype,"position",void 0),n([e.Collection([{}],u)],f.prototype,"buttons",void 0),n([e.Property(document.body)],f.prototype,"target",void 0),n([e.Event()],f.prototype,"created",void 0),n([e.Event()],f.prototype,"destroyed",void 0),n([e.Event()],f.prototype,"open",void 0),n([e.Event()],f.prototype,"beforeOpen",void 0),n([e.Event()],f.prototype,"close",void 0),n([e.Event()],f.prototype,"click",void 0),f=n([e.NotifyPropertyChanges],f)}(e.Component);t.ToastPosition=c,t.ButtonModelProps=u,t.ToastAnimations=f,t.ToastAnimationSettings=y,t.Toast=m,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, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getUniqueID, isNullOrUndefined, isUndefined, setStyleAttribute } from '@syncfusion/ej2-base';
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, NotifyPropertyChanges, Property, Touch, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getUniqueID, isNullOrUndefined, isUndefined, setStyleAttribute } from '@syncfusion/ej2-base';
import { Button } from '@syncfusion/ej2-buttons';

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

//There is no event handler
this.isDevice = Browser.isDevice;
if (this.enableRtl) {

@@ -131,2 +132,5 @@ this.element.classList.add(RTL);

this.toastTemplate = null;
if (this.isDevice && screen.width < 768) {
new Touch(this.element, { swipe: this.swipeHandler.bind(this) });
}
}

@@ -168,2 +172,17 @@ /**

}
swipeHandler(e) {
let toastEle = closest(e.originalEvent.target, '.' + ROOT + ':not(.' + CONTAINER + ')');
let hideAnimation = this.animation.hide.effect;
if (!isNullOrUndefined(toastEle)) {
if (e.swipeDirection === 'Right') {
this.animation.hide.effect = 'SlideRightOut';
this.hide(toastEle);
}
else if (e.swipeDirection === 'Left') {
this.animation.hide.effect = 'SlideLeftOut';
this.hide(toastEle);
}
this.animation.hide.effect = hideAnimation;
}
}
templateChanges(toastObj) {

@@ -170,0 +189,0 @@ if (!isUndefined(toastObj.content) && !isNullOrUndefined(this.contentTemplate) && this.content !== toastObj.content) {

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

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

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

//There is no event handler
this.isDevice = Browser.isDevice;
if (this.enableRtl) {

@@ -162,2 +163,5 @@ this.element.classList.add(RTL);

this.toastTemplate = null;
if (this.isDevice && screen.width < 768) {
new Touch(this.element, { swipe: this.swipeHandler.bind(this) });
}
};

@@ -199,2 +203,17 @@ /**

};
Toast.prototype.swipeHandler = function (e) {
var toastEle = closest(e.originalEvent.target, '.' + ROOT + ':not(.' + CONTAINER + ')');
var hideAnimation = this.animation.hide.effect;
if (!isNullOrUndefined(toastEle)) {
if (e.swipeDirection === 'Right') {
this.animation.hide.effect = 'SlideRightOut';
this.hide(toastEle);
}
else if (e.swipeDirection === 'Left') {
this.animation.hide.effect = 'SlideLeftOut';
this.hide(toastEle);
}
this.animation.hide.effect = hideAnimation;
}
};
Toast.prototype.templateChanges = function (toastObj) {

@@ -201,0 +220,0 @@ if (!isUndefined(toastObj.content) && !isNullOrUndefined(this.contentTemplate) && this.content !== toastObj.content) {

{
"name": "@syncfusion/ej2-notifications",
"version": "16.2.41",
"version": "16.2.45",
"description": "Essential JS 2 notifications Components",

@@ -11,5 +11,5 @@ "author": "Syncfusion Inc.",

"dependencies": {
"@syncfusion/ej2-base": "~16.2.41",
"@syncfusion/ej2-buttons": "~16.2.41",
"@syncfusion/ej2-popups": "~16.2.41"
"@syncfusion/ej2-base": "~16.2.45",
"@syncfusion/ej2-buttons": "~16.2.45",
"@syncfusion/ej2-popups": "~16.2.45"
},

@@ -16,0 +16,0 @@ "devDependencies": {

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

import { Component, Property, ChildProperty, INotifyPropertyChanged, NotifyPropertyChanges, Animation } from '@syncfusion/ej2-base';import { Browser, isNullOrUndefined as isNOU, createElement, 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 { 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, createElement, 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 } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups';
import {PositionX,PositionY,ToastOpenArgs,ToastBeforeOpenArgs,ToastCloseArgs,ToastClickEventArgs} from "./toast";

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

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

private customPosition;
private isDevice;
/**

@@ -319,2 +320,3 @@ * Initializes a new instance of the Toast class.

show(toastObj?: ToastModel): void;
private swipeHandler(e);
private templateChanges(toastObj);

@@ -321,0 +323,0 @@ private setCSSClass(cssClass);

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

};
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-buttons", "@syncfusion/ej2-popups"], function (require, exports, ej2_base_1, ej2_base_2, ej2_base_3, ej2_base_4, ej2_buttons_1, ej2_popups_1) {
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-buttons", "@syncfusion/ej2-popups"], function (require, exports, ej2_base_1, ej2_base_2, ej2_base_3, ej2_base_4, ej2_base_5, ej2_buttons_1, ej2_popups_1) {
"use strict";

@@ -109,2 +109,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

Toast.prototype.preRender = function () {
this.isDevice = ej2_base_2.Browser.isDevice;
if (this.enableRtl) {

@@ -120,2 +121,5 @@ this.element.classList.add(RTL);

this.toastTemplate = null;
if (this.isDevice && screen.width < 768) {
new ej2_base_5.Touch(this.element, { swipe: this.swipeHandler.bind(this) });
}
};

@@ -152,2 +156,17 @@ Toast.prototype.show = function (toastObj) {

};
Toast.prototype.swipeHandler = function (e) {
var toastEle = ej2_base_4.closest(e.originalEvent.target, '.' + ROOT + ':not(.' + CONTAINER + ')');
var hideAnimation = this.animation.hide.effect;
if (!ej2_base_2.isNullOrUndefined(toastEle)) {
if (e.swipeDirection === 'Right') {
this.animation.hide.effect = 'SlideRightOut';
this.hide(toastEle);
}
else if (e.swipeDirection === 'Left') {
this.animation.hide.effect = 'SlideLeftOut';
this.hide(toastEle);
}
this.animation.hide.effect = hideAnimation;
}
};
Toast.prototype.templateChanges = function (toastObj) {

@@ -154,0 +173,0 @@ if (!ej2_base_4.isUndefined(toastObj.content) && !ej2_base_2.isNullOrUndefined(this.contentTemplate) && this.content !== toastObj.content) {

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 too big to display

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