UNPKG

@covalent/echarts

Version:
2 lines 6.52 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("echarts/lib/component/tooltip"),require("@angular/core"),require("@covalent/echarts/base")):"function"==typeof define&&define.amd?define("@covalent/echarts/tooltip",["exports","@angular/common","echarts/lib/component/tooltip","@angular/core","@covalent/echarts/base"],e):e((t.covalent=t.covalent||{},t.covalent.echarts=t.covalent.echarts||{},t.covalent.echarts.tooltip={}),t.ng.common,null,t.ng.core,t.covalent.echarts.base)}(this,function(t,e,o,n,r){"use strict";var i=function c(){},s=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"ng-template[tdTooltipFormatter]"}]}],t}(),a=function(){function t(t,e,o){this._changeDetectorRef=t,this._elementRef=e,this._optionsService=o,this._state={},this._context=new i,this.config={},this.show=!0,this.trigger="axis",this.showContent=!0,this.alwaysShowContent=!1,this.triggerOn="mousemove|click",this.showDelay=0,this.hideDelay=0,this.enterable=!1,this.confine=!1,this.transitionDuration=.5,this.backgroundColor="rgba(50,50,50,0.7)",this.borderColor="#333",this.borderWidth=0,this.padding=5,this.textStyle={color:"#FFF"}}return t.prototype.ngOnChanges=function(){this._setOptions()},t.prototype.ngOnDestroy=function(){this._removeOption()},t.prototype._setOptions=function(){var t=r.assignDefined(this._state,{show:this.show,trigger:this.trigger,axisPointer:this.axisPointer,showContent:this.showContent,alwaysShowContent:this.alwaysShowContent,triggerOn:this.triggerOn,showDelay:this.showDelay,hideDelay:this.hideDelay,enterable:this.enterable,confine:this.confine,transitionDuration:this.transitionDuration,position:this.position,formatter:this.formatter?this.formatter:this.formatterTemplate?this._formatter():undefined,backgroundColor:this.backgroundColor,borderColor:this.borderColor,borderWidth:this.borderWidth,padding:this.padding,textStyle:this.textStyle,extraCssText:this.extraCssText},this.config?this.config:{});this._optionsService.setOption("tooltip",t)},t.prototype._removeOption=function(){this._optionsService.clearOption("tooltip")},t.prototype._formatter=function(){var n=this;return function(t,e,o){return n._context={$implicit:t,ticket:e},setTimeout(function(){o(e,n._elementRef.nativeElement.innerHTML)}),n._changeDetectorRef.markForCheck(),n._elementRef.nativeElement.innerHTML}},t.decorators=[{type:n.Component,args:[{selector:"td-chart-tooltip",template:'<ng-template #tooltipContent\n [ngTemplateOutlet]="formatterTemplate"\n [ngTemplateOutletContext]="_context">\n</ng-template>',changeDetection:n.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:n.ChangeDetectorRef},{type:n.ElementRef},{type:r.TdChartOptionsService}]},t.propDecorators={config:[{type:n.Input,args:["config"]}],show:[{type:n.Input,args:["show"]}],trigger:[{type:n.Input,args:["trigger"]}],axisPointer:[{type:n.Input,args:["axisPointer"]}],showContent:[{type:n.Input,args:["showContent"]}],alwaysShowContent:[{type:n.Input,args:["alwaysShowContent"]}],triggerOn:[{type:n.Input,args:["triggerOn"]}],showDelay:[{type:n.Input,args:["showDelay"]}],hideDelay:[{type:n.Input,args:["hideDelay"]}],enterable:[{type:n.Input,args:["enterable"]}],renderMode:[{type:n.Input,args:["renderMode"]}],confine:[{type:n.Input,args:["confine"]}],transitionDuration:[{type:n.Input,args:["transitionDuration"]}],position:[{type:n.Input,args:["position"]}],formatter:[{type:n.Input,args:["formatter"]}],backgroundColor:[{type:n.Input,args:["backgroundColor"]}],borderColor:[{type:n.Input,args:["borderColor"]}],borderWidth:[{type:n.Input,args:["borderWidth"]}],padding:[{type:n.Input,args:["padding"]}],textStyle:[{type:n.Input,args:["textStyle"]}],extraCssText:[{type:n.Input,args:["extraCssText"]}],formatterTemplate:[{type:n.ContentChild,args:[s,{read:n.TemplateRef}]}],fullTemplate:[{type:n.ViewChild,args:["tooltipContent"]}]},t}(),p=function(){function t(t,e,o){this._changeDetectorRef=t,this._elementRef=e,this._seriesComponent=o,this._state={},this._context=new i,this.backgroundColor="rgba(50,50,50,0.7)",this.borderColor="#333",this.borderWidth=0,this.padding=5,this.textStyle={color:"#FFF"}}return t.prototype.ngOnChanges=function(){this._setOptions()},t.prototype.ngOnDestroy=function(){this._removeOption()},t.prototype._setOptions=function(){var t=r.assignDefined(this._state,{position:this.position,backgroundColor:this.backgroundColor,borderColor:this.borderColor,borderWidth:this.borderWidth,padding:this.padding,textStyle:this.textStyle,extraCssText:this.extraCssText,formatter:this.formatter?this.formatter:this.formatterTemplate?this._formatter():undefined},this.config?this.config:{});this._seriesComponent.setStateOption("tooltip",t)},t.prototype._formatter=function(){var n=this;return function(t,e,o){return n._context={$implicit:t,ticket:e},setTimeout(function(){o(e,n._elementRef.nativeElement.innerHTML)}),n._changeDetectorRef.markForCheck(),n._elementRef.nativeElement.innerHTML}},t.prototype._removeOption=function(){this._seriesComponent.removeStateOption("tooltip")},t.decorators=[{type:n.Component,args:[{selector:"td-chart-series-tooltip",template:'<ng-template #tooltipContent\n [ngTemplateOutlet]="formatterTemplate"\n [ngTemplateOutletContext]="_context">\n</ng-template>',changeDetection:n.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:n.ChangeDetectorRef},{type:n.ElementRef},{type:r.TdSeriesComponent}]},t.propDecorators={config:[{type:n.Input,args:["config"]}],formatter:[{type:n.Input,args:["formatter"]}],position:[{type:n.Input,args:["position"]}],backgroundColor:[{type:n.Input,args:["backgroundColor"]}],borderColor:[{type:n.Input,args:["borderColor"]}],borderWidth:[{type:n.Input,args:["borderWidth"]}],padding:[{type:n.Input,args:["padding"]}],textStyle:[{type:n.Input,args:["textStyle"]}],extraCssText:[{type:n.Input,args:["extraCssText"]}],formatterTemplate:[{type:n.ContentChild,args:[s,{read:n.TemplateRef}]}],fullTemplate:[{type:n.ViewChild,args:["tooltipContent"]}]},t}(),h=[a,s,p],l=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule],declarations:[h],exports:[h]}]}],t}();t.TOOLTIP_MODULE_COMPONENTS=h,t.CovalentTooltipEchartsModule=l,t.TdTooltipContext=i,t.TdChartTooltipFormatterDirective=s,t.TdChartTooltipComponent=a,t.TdSeriesTooltipComponent=p,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=covalent-echarts-tooltip.umd.min.js.map