| 1 |
- System.register("ngx-tooltip/TooltipContent",["@angular/core"],function(t,e){var o,n;e&&e.id;return{setters:[function(t){o=t}],execute:function(){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("-"),r=s[0],a=s[1]||"center",p=n?this.offset(t):this.position(t),l=e.offsetWidth,c=e.offsetHeight,d={center:function(){return p.left+p.width/2-l/2},left:function(){return p.left},right:function(){return p.left+p.width}},f={center:function(){return p.top+p.height/2-c/2},top:function(){return p.top},bottom:function(){return p.top+p.height}};switch(r){case"right":i={top:f[a](),left:d[r]()};break;case"left":i={top:f[a](),left:p.left-l};break;case"bottom":i={top:f[r](),left:d[a]()};break;default:i={top:p.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),t("TooltipContent",n)}}}),System.register("ngx-tooltip/Tooltip",["@angular/core","ngx-tooltip/TooltipContent"],function(t,e){var o,n,i;e&&e.id;return{setters:[function(t){o=t},function(t){n=t}],execute:function(){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),t("Tooltip",i)}}}),System.register("ngx-tooltip/index",["@angular/core","@angular/common","ngx-tooltip/Tooltip","ngx-tooltip/TooltipContent"],function(t,e){function o(e){var o={};for(var n in e)"default"===n||p.hasOwnProperty(n)||(o[n]=e[n]);t(o)}var n,i,s,r,a,p=(e&&e.id,{TooltipModule:!0});return{setters:[function(t){n=t},function(t){i=t},function(t){s=t,o(t)},function(t){r=t,o(t)}],execute:function(){a=function(){function t(){}return t}(),a=__decorate([n.NgModule({imports:[i.CommonModule],declarations:[s.Tooltip,r.TooltipContent],exports:[s.Tooltip,r.TooltipContent],entryComponents:[r.TooltipContent]})],a),t("TooltipModule",a)}}}),System.register("ngx-tooltip",["ngx-tooltip/index"],function(t,e){function o(e){var o={};for(var n in e)"default"!==n&&(o[n]=e[n]);t(o)}e&&e.id;return{setters:[function(t){o(t)}],execute:function(){}}});
|