Files
flights_web_raw/apps/angular/node_modules/primeng/bundles/primeng-ripple.umd.min.js
T

2 lines
2.8 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/dom"),require("primeng/api")):"function"==typeof define&&define.amd?define("primeng/ripple",["exports","@angular/core","@angular/common","primeng/dom","primeng/api"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.ripple={}),e.ng.core,e.ng.common,e.primeng.dom,e.primeng.api)}(this,(function(e,t,n,i,o){"use strict";var r=function(){function e(e,t,n){this.el=e,this.zone=t,this.config=n}return e.prototype.ngAfterViewInit=function(){var e=this;this.config&&this.config.ripple&&this.zone.runOutsideAngular((function(){e.create(),e.mouseDownListener=e.onMouseDown.bind(e),e.el.nativeElement.addEventListener("mousedown",e.mouseDownListener)}))},e.prototype.onMouseDown=function(e){var t=this.getInk();if(t&&"none"!==getComputedStyle(t,null).display){if(i.DomHandler.removeClass(t,"p-ink-active"),!i.DomHandler.getHeight(t)&&!i.DomHandler.getWidth(t)){var n=Math.max(i.DomHandler.getOuterWidth(this.el.nativeElement),i.DomHandler.getOuterHeight(this.el.nativeElement));t.style.height=n+"px",t.style.width=n+"px"}var o=i.DomHandler.getOffset(this.el.nativeElement),r=e.pageX-o.left+document.body.scrollTop-i.DomHandler.getWidth(t)/2,a=e.pageY-o.top+document.body.scrollLeft-i.DomHandler.getHeight(t)/2;t.style.top=a+"px",t.style.left=r+"px",i.DomHandler.addClass(t,"p-ink-active")}},e.prototype.getInk=function(){for(var e=0;e<this.el.nativeElement.children.length;e++)if(-1!==this.el.nativeElement.children[e].className.indexOf("p-ink"))return this.el.nativeElement.children[e];return null},e.prototype.resetInk=function(){var e=this.getInk();e&&i.DomHandler.removeClass(e,"p-ink-active")},e.prototype.onAnimationEnd=function(e){i.DomHandler.removeClass(e.currentTarget,"p-ink-active")},e.prototype.create=function(){var e=document.createElement("span");e.className="p-ink",this.el.nativeElement.appendChild(e),this.animationListener=this.onAnimationEnd.bind(this),e.addEventListener("animationend",this.animationListener)},e.prototype.remove=function(){var e=this.getInk();e&&(this.el.nativeElement.removeEventListener("mousedown",this.mouseDownListener),e.removeEventListener("animationend",this.animationListener),i.DomHandler.removeElement(e))},e.prototype.ngOnDestroy=function(){this.config&&this.config.ripple&&this.remove()},e}();r.decorators=[{type:t.Directive,args:[{selector:"[pRipple]",host:{"[class.p-ripple]":"true"}}]}],r.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone},{type:o.PrimeNGConfig,decorators:[{type:t.Optional}]}]};var a=function(){};a.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[r],declarations:[r]}]}],e.Ripple=r,e.RippleModule=a,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=primeng-ripple.umd.min.js.map