| 1 |
- define("ngx-tooltip/TooltipContent",["require","exports","@angular/core"],function(t,e,o){var n=function(){function t(t,e){this.element=t,this.cdr=e,this.placement="bottom",this.animation=!0,this.top=-1e5,this.left=-1e5,this.isIn=!1,this.isFade=!1}return t.prototype.ngAfterViewInit=function(){this.show(),this.cdr.detectChanges()},t.prototype.show=function(){if(this.hostElement){var t=this.positionElements(this.hostElement,this.element.nativeElement.children[0],this.placement);this.top=t.top,this.left=t.left,this.isIn=!0,this.animation&&(this.isFade=!0)}},t.prototype.hide=function(){this.top=-1e5,this.left=-1e5,this.isIn=!0,this.animation&&(this.isFade=!1)},t.prototype.positionElements=function(t,e,o,n){void 0===n&&(n=!1);var i,s=o.split("-"),p=s[0],a=s[1]||"center",r=n?this.offset(t):this.position(t),l=e.offsetWidth,c=e.offsetHeight,d={center:function(){return r.left+r.width/2-l/2},left:function(){return r.left},right:function(){return r.left+r.width}},f={center:function(){return r.top+r.height/2-c/2},top:function(){return r.top},bottom:function(){return r.top+r.height}};switch(p){case"right":i={top:f[a](),left:d[p]()};break;case"left":i={top:f[a](),left:r.left-l};break;case"bottom":i={top:f[p](),left:d[a]()};break;default:i={top:r.top-c,left:d[a]()}}return i},t.prototype.position=function(t){var e={top:0,left:0},o=this.offset(t),n=this.parentOffsetEl(t);n!==window.document&&(e=this.offset(n),e.top+=n.clientTop-n.scrollTop,e.left+=n.clientLeft-n.scrollLeft);var i=t.getBoundingClientRect();return{width:i.width||t.offsetWidth,height:i.height||t.offsetHeight,top:o.top-e.top,left:o.left-e.left}},t.prototype.offset=function(t){var e=t.getBoundingClientRect();return{width:e.width||t.offsetWidth,height:e.height||t.offsetHeight,top:e.top+(window.pageYOffset||window.document.documentElement.scrollTop),left:e.left+(window.pageXOffset||window.document.documentElement.scrollLeft)}},t.prototype.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:window.getComputedStyle?window.getComputedStyle(t)[e]:t.style[e]},t.prototype.isStaticPositioned=function(t){return"static"===(this.getStyle(t,"position")||"static")},t.prototype.parentOffsetEl=function(t){for(var e=t.offsetParent||window.document;e&&e!==window.document&&this.isStaticPositioned(e);)e=e.offsetParent;return e||window.document},t}();__decorate([o.Input(),__metadata("design:type",HTMLElement)],n.prototype,"hostElement",void 0),__decorate([o.Input(),__metadata("design:type",String)],n.prototype,"content",void 0),__decorate([o.Input(),__metadata("design:type",String)],n.prototype,"placement",void 0),__decorate([o.Input(),__metadata("design:type",Boolean)],n.prototype,"animation",void 0),n=__decorate([o.Component({selector:"tooltip-content",template:'\n<div class="tooltip {{ placement }}"\n [style.top]="top + \'px\'"\n [style.left]="left + \'px\'"\n [class.in]="isIn"\n [class.fade]="isFade"\n role="tooltip">\n <div class="tooltip-arrow"></div> \n <div class="tooltip-inner">\n <ng-content></ng-content>\n {{ content }}\n </div> \n</div>\n'}),__metadata("design:paramtypes",[o.ElementRef,o.ChangeDetectorRef])],n),e.TooltipContent=n}),define("ngx-tooltip/Tooltip",["require","exports","@angular/core","ngx-tooltip/TooltipContent"],function(t,e,o,n){var i=function(){function t(t,e){this.viewContainerRef=t,this.resolver=e,this.tooltipAnimation=!0,this.tooltipPlacement="bottom"}return t.prototype.show=function(){if(!this.tooltipDisabled&&!this.visible)if(this.visible=!0,"string"==typeof this.content){var t=this.resolver.resolveComponentFactory(n.TooltipContent);if(!this.visible)return;this.tooltip=this.viewContainerRef.createComponent(t),this.tooltip.instance.hostElement=this.viewContainerRef.element.nativeElement,this.tooltip.instance.content=this.content,this.tooltip.instance.placement=this.tooltipPlacement,this.tooltip.instance.animation=this.tooltipAnimation}else{var e=this.content;e.hostElement=this.viewContainerRef.element.nativeElement,e.placement=this.tooltipPlacement,e.animation=this.tooltipAnimation,e.show()}},t.prototype.hide=function(){this.visible&&(this.visible=!1,this.tooltip&&this.tooltip.destroy(),this.content instanceof n.TooltipContent&&this.content.hide())},t}();__decorate([o.Input("tooltip"),__metadata("design:type",Object)],i.prototype,"content",void 0),__decorate([o.Input(),__metadata("design:type",Boolean)],i.prototype,"tooltipDisabled",void 0),__decorate([o.Input(),__metadata("design:type",Boolean)],i.prototype,"tooltipAnimation",void 0),__decorate([o.Input(),__metadata("design:type",String)],i.prototype,"tooltipPlacement",void 0),__decorate([o.HostListener("focusin"),o.HostListener("mouseenter"),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],i.prototype,"show",null),__decorate([o.HostListener("focusout"),o.HostListener("mouseleave"),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],i.prototype,"hide",null),i=__decorate([o.Directive({selector:"[tooltip]"}),__metadata("design:paramtypes",[o.ViewContainerRef,o.ComponentFactoryResolver])],i),e.Tooltip=i}),define("ngx-tooltip/index",["require","exports","@angular/core","@angular/common","ngx-tooltip/Tooltip","ngx-tooltip/TooltipContent","ngx-tooltip/Tooltip","ngx-tooltip/TooltipContent"],function(t,e,o,n,i,s,p,a){function r(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}r(p),r(a);var l=function(){function t(){}return t}();l=__decorate([o.NgModule({imports:[n.CommonModule],declarations:[i.Tooltip,s.TooltipContent],exports:[i.Tooltip,s.TooltipContent],entryComponents:[s.TooltipContent]})],l),e.TooltipModule=l}),define("ngx-tooltip",["require","exports","ngx-tooltip/index"],function(t,e,o){function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}n(o)});
|