UNPKG

@swimlane/ngx-charts

Version:

Declarative Charting Framework for Angular2 and beyond!

376 lines (375 loc) 20.4 kB
/** * @fileoverview This file is generated by the Angular 2 template compiler. * Do not edit. * @suppress {suspiciousCode,uselessCode,missingProperties} */ /* tslint:disable */ import * as import0 from '../../../../src/common/legend/advanced-legend.component'; import * as import1 from '@angular/core/src/change_detection/change_detection_util'; import * as import2 from '@angular/core/src/linker/view'; import * as import3 from '@angular/core/src/linker/view_utils'; import * as import4 from '@angular/core/src/render/api'; import * as import5 from '@angular/core/src/metadata/view'; import * as import6 from '@angular/core/src/linker/view_type'; import * as import7 from '@angular/core/src/change_detection/constants'; import * as import8 from '@angular/core/src/linker/component_factory'; import * as import9 from '../../../../src/common/count/count.directive'; import * as import10 from '../count/count.directive.ngfactory'; import * as import11 from '@angular/core/src/linker/view_container'; import * as import12 from '../../../node_modules/@angular/common/src/directives/ng_for.ngfactory'; import * as import13 from '@angular/core/src/zone/ng_zone'; import * as import14 from '@angular/core/src/linker/element_ref'; import * as import15 from '@angular/core/src/linker/template_ref'; import * as import16 from '@angular/core/src/change_detection/differs/iterable_differs'; import * as import17 from '@angular/common/src/directives/ng_for'; import * as import18 from '@angular/core/src/security'; export class Wrapper_AdvancedLegendComponent { /*private*/ _eventHandler:Function; context:import0.AdvancedLegendComponent; /*private*/ _changed:boolean; /*private*/ _changes:{[key: string]:any}; /*private*/ _expr_0:any; /*private*/ _expr_1:any; /*private*/ _expr_2:any; subscription0:any; subscription1:any; subscription2:any; constructor() { this._changed = false; this._changes = {}; this.context = new import0.AdvancedLegendComponent(); this._expr_0 = import1.UNINITIALIZED; this._expr_1 = import1.UNINITIALIZED; this._expr_2 = import1.UNINITIALIZED; } ngOnDetach(view:import2.AppView<any>,componentView:import2.AppView<any>,el:any):void { } ngOnDestroy():void { (this.subscription0 && this.subscription0.unsubscribe()); (this.subscription1 && this.subscription1.unsubscribe()); (this.subscription2 && this.subscription2.unsubscribe()); } check_width(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void { if ((forceUpdate || import3.checkBinding(throwOnChange,this._expr_0,currValue))) { this._changed = true; this.context.width = currValue; this._changes['width'] = new import1.SimpleChange(this._expr_0,currValue); this._expr_0 = currValue; } } check_data(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void { if ((forceUpdate || import3.checkBinding(throwOnChange,this._expr_1,currValue))) { this._changed = true; this.context.data = currValue; this._changes['data'] = new import1.SimpleChange(this._expr_1,currValue); this._expr_1 = currValue; } } check_colors(currValue:any,throwOnChange:boolean,forceUpdate:boolean):void { if ((forceUpdate || import3.checkBinding(throwOnChange,this._expr_2,currValue))) { this._changed = true; this.context.colors = currValue; this._changes['colors'] = new import1.SimpleChange(this._expr_2,currValue); this._expr_2 = currValue; } } ngDoCheck(view:import2.AppView<any>,el:any,throwOnChange:boolean):boolean { var changed:any = this._changed; this._changed = false; if (!throwOnChange) { if (changed) { this.context.ngOnChanges(this._changes); this._changes = {}; } } return changed; } checkHost(view:import2.AppView<any>,componentView:import2.AppView<any>,el:any,throwOnChange:boolean):void { } handleEvent(eventName:string,$event:any):boolean { var result:boolean = true; return result; } subscribe(view:import2.AppView<any>,_eventHandler:any,emit0:boolean,emit1:boolean,emit2:boolean):void { this._eventHandler = _eventHandler; if (emit0) { (this.subscription0 = this.context.select.subscribe(_eventHandler.bind(view,'select'))); } if (emit1) { (this.subscription1 = this.context.activate.subscribe(_eventHandler.bind(view,'activate'))); } if (emit2) { (this.subscription2 = this.context.deactivate.subscribe(_eventHandler.bind(view,'deactivate'))); } } } var renderType_AdvancedLegendComponent_Host:import4.RenderComponentType = import3.createRenderComponentType('',0,import5.ViewEncapsulation.None,([] as any[]),{}); class View_AdvancedLegendComponent_Host0 extends import2.AppView<any> { _el_0:any; compView_0:import2.AppView<import0.AdvancedLegendComponent>; _AdvancedLegendComponent_0_3:Wrapper_AdvancedLegendComponent; constructor(viewUtils:import3.ViewUtils,parentView:import2.AppView<any>,parentIndex:number,parentElement:any) { super(View_AdvancedLegendComponent_Host0,renderType_AdvancedLegendComponent_Host,import6.ViewType.HOST,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckAlways); } createInternal(rootSelector:string):import8.ComponentRef<any> { this._el_0 = import3.selectOrCreateRenderHostElement(this.renderer,'ngx-charts-advanced-legend',import3.EMPTY_INLINE_ARRAY,rootSelector,(null as any)); this.compView_0 = new View_AdvancedLegendComponent0(this.viewUtils,this,0,this._el_0); this._AdvancedLegendComponent_0_3 = new Wrapper_AdvancedLegendComponent(); this.compView_0.create(this._AdvancedLegendComponent_0_3.context); this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [this._el_0]),(null as any)); return new import8.ComponentRef_<any>(0,this,this._el_0,this._AdvancedLegendComponent_0_3.context); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import0.AdvancedLegendComponent) && (0 === requestNodeIndex))) { return this._AdvancedLegendComponent_0_3.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { if (this._AdvancedLegendComponent_0_3.ngDoCheck(this,this._el_0,throwOnChange)) { this.compView_0.markAsCheckOnce(); } this.compView_0.internalDetectChanges(throwOnChange); } destroyInternal():void { this.compView_0.destroy(); this._AdvancedLegendComponent_0_3.ngOnDestroy(); } visitRootNodesInternal(cb:any,ctx:any):void { cb(this._el_0,ctx); } } export const AdvancedLegendComponentNgFactory:import8.ComponentFactory<import0.AdvancedLegendComponent> = new import8.ComponentFactory<import0.AdvancedLegendComponent>('ngx-charts-advanced-legend',View_AdvancedLegendComponent_Host0,import0.AdvancedLegendComponent); const styles_AdvancedLegendComponent:any[] = ([] as any[]); var renderType_AdvancedLegendComponent:import4.RenderComponentType = import3.createRenderComponentType('',0,import5.ViewEncapsulation.None,styles_AdvancedLegendComponent,{}); export class View_AdvancedLegendComponent0 extends import2.AppView<import0.AdvancedLegendComponent> { _text_0:any; _el_1:any; _text_2:any; _el_3:any; compView_3:import2.AppView<import9.CountUpDirective>; _CountUpDirective_3_3:import10.Wrapper_CountUpDirective; _text_4:any; _text_5:any; _el_6:any; _text_7:any; _text_8:any; _el_9:any; _text_10:any; _el_11:any; _text_12:any; _anchor_13:any; /*private*/ _vc_13:import11.ViewContainer; _TemplateRef_13_5:any; _NgFor_13_6:import12.Wrapper_NgFor; _text_14:any; _text_15:any; _text_16:any; _text_17:any; /*private*/ _expr_23:any; /*private*/ _expr_24:any; constructor(viewUtils:import3.ViewUtils,parentView:import2.AppView<any>,parentIndex:number,parentElement:any) { super(View_AdvancedLegendComponent0,renderType_AdvancedLegendComponent,import6.ViewType.COMPONENT,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckOnce); this._expr_23 = import1.UNINITIALIZED; this._expr_24 = import1.UNINITIALIZED; } createInternal(rootSelector:string):import8.ComponentRef<any> { const parentRenderNode:any = this.renderer.createViewRoot(this.parentElement); this._text_0 = this.renderer.createText(parentRenderNode,'\n ',(null as any)); this._el_1 = import3.createRenderElement(this.renderer,parentRenderNode,'div',new import3.InlineArray2(2,'class','advanced-pie-legend'),(null as any)); this._text_2 = this.renderer.createText(this._el_1,'\n ',(null as any)); this._el_3 = import3.createRenderElement(this.renderer,this._el_1,'div',new import3.InlineArray4(4,'class','total-value','ngx-charts-count-up',''),(null as any)); this.compView_3 = new import10.View_CountUpDirective0(this.viewUtils,this,3,this._el_3); this._CountUpDirective_3_3 = new import10.Wrapper_CountUpDirective(this.compView_3.ref,this.parentView.injectorGet(import13.NgZone,this.parentIndex),new import14.ElementRef(this._el_3)); this._text_4 = this.renderer.createText((null as any),'\n ',(null as any)); this.compView_3.create(this._CountUpDirective_3_3.context); this._text_5 = this.renderer.createText(this._el_1,'\n ',(null as any)); this._el_6 = import3.createRenderElement(this.renderer,this._el_1,'div',new import3.InlineArray2(2,'class','total-label'),(null as any)); this._text_7 = this.renderer.createText(this._el_6,'',(null as any)); this._text_8 = this.renderer.createText(this._el_1,'\n ',(null as any)); this._el_9 = import3.createRenderElement(this.renderer,this._el_1,'div',new import3.InlineArray2(2,'class','legend-items-container'),(null as any)); this._text_10 = this.renderer.createText(this._el_9,'\n ',(null as any)); this._el_11 = import3.createRenderElement(this.renderer,this._el_9,'div',new import3.InlineArray2(2,'class','legend-items'),(null as any)); this._text_12 = this.renderer.createText(this._el_11,'\n ',(null as any)); this._anchor_13 = this.renderer.createTemplateAnchor(this._el_11,(null as any)); this._vc_13 = new import11.ViewContainer(13,11,this,this._anchor_13); this._TemplateRef_13_5 = new import15.TemplateRef_(this,13,this._anchor_13); this._NgFor_13_6 = new import12.Wrapper_NgFor(this._vc_13.vcRef,this._TemplateRef_13_5,this.parentView.injectorGet(import16.IterableDiffers,this.parentIndex),this.ref); this._text_14 = this.renderer.createText(this._el_11,'\n ',(null as any)); this._text_15 = this.renderer.createText(this._el_9,'\n ',(null as any)); this._text_16 = this.renderer.createText(this._el_1,'\n ',(null as any)); this._text_17 = this.renderer.createText(parentRenderNode,'\n ',(null as any)); this.init((null as any),((<any>this.renderer).directRenderer? (null as any): [ this._text_0, this._el_1, this._text_2, this._el_3, this._text_4, this._text_5, this._el_6, this._text_7, this._text_8, this._el_9, this._text_10, this._el_11, this._text_12, this._anchor_13, this._text_14, this._text_15, this._text_16, this._text_17 ] ),(null as any)); return (null as any); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import9.CountUpDirective) && ((3 <= requestNodeIndex) && (requestNodeIndex <= 4)))) { return this._CountUpDirective_3_3.context; } if (((token === import15.TemplateRef) && (13 === requestNodeIndex))) { return this._TemplateRef_13_5; } if (((token === import17.NgFor) && (13 === requestNodeIndex))) { return this._NgFor_13_6.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { const currVal_3_0_0:any = this.context.roundedTotal; this._CountUpDirective_3_3.check_countTo(currVal_3_0_0,throwOnChange,false); this._CountUpDirective_3_3.ngDoCheck(this,this._el_3,throwOnChange); const currVal_13_0_0:any = this.context.legendItems; this._NgFor_13_6.check_ngForOf(currVal_13_0_0,throwOnChange,false); const currVal_13_0_1:any = this.context.trackBy; this._NgFor_13_6.check_ngForTrackBy(currVal_13_0_1,throwOnChange,false); this._NgFor_13_6.ngDoCheck(this,this._anchor_13,throwOnChange); this._vc_13.detectChangesInNestedViews(throwOnChange); const currVal_23:any = this.context.width; if (import3.checkBinding(throwOnChange,this._expr_23,currVal_23)) { this.renderer.setElementStyle(this._el_1,'width',((this.viewUtils.sanitizer.sanitize(import18.SecurityContext.STYLE,currVal_23) == null)? (null as any): (this.viewUtils.sanitizer.sanitize(import18.SecurityContext.STYLE,currVal_23).toString() + 'px'))); this._expr_23 = currVal_23; } const currVal_24:any = import3.inlineInterpolate(1,'\n ',this.context.totalLabel,'\n '); if (import3.checkBinding(throwOnChange,this._expr_24,currVal_24)) { this.renderer.setText(this._text_7,currVal_24); this._expr_24 = currVal_24; } this.compView_3.internalDetectChanges(throwOnChange); } destroyInternal():void { this._vc_13.destroyNestedViews(); this.compView_3.destroy(); this._CountUpDirective_3_3.ngOnDestroy(); } createEmbeddedViewInternal(nodeIndex:number):import2.AppView<any> { if ((nodeIndex == 13)) { return new View_AdvancedLegendComponent1(this.viewUtils,this,13,this._anchor_13,this._vc_13); } return (null as any); } } class View_AdvancedLegendComponent1 extends import2.AppView<any> { _el_0:any; _text_1:any; _el_2:any; _text_3:any; _text_4:any; _el_5:any; compView_5:import2.AppView<import9.CountUpDirective>; _CountUpDirective_5_3:import10.Wrapper_CountUpDirective; _text_6:any; _text_7:any; _el_8:any; _text_9:any; _text_10:any; _el_11:any; compView_11:import2.AppView<import9.CountUpDirective>; _CountUpDirective_11_3:import10.Wrapper_CountUpDirective; _text_12:any; _text_13:any; /*private*/ _expr_18:any; /*private*/ _expr_19:any; constructor(viewUtils:import3.ViewUtils,parentView:import2.AppView<any>,parentIndex:number,parentElement:any,declaredViewContainer:import11.ViewContainer) { super(View_AdvancedLegendComponent1,renderType_AdvancedLegendComponent,import6.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckAlways,declaredViewContainer); this._expr_18 = import1.UNINITIALIZED; this._expr_19 = import1.UNINITIALIZED; } createInternal(rootSelector:string):import8.ComponentRef<any> { this._el_0 = import3.createRenderElement(this.renderer,(null as any),'div',new import3.InlineArray4(4,'class','legend-item','tabindex','-1'),(null as any)); this._text_1 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_2 = import3.createRenderElement(this.renderer,this._el_0,'div',new import3.InlineArray2(2,'class','item-color'),(null as any)); this._text_3 = this.renderer.createText(this._el_2,'\n ',(null as any)); this._text_4 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_5 = import3.createRenderElement(this.renderer,this._el_0,'div',new import3.InlineArray4(4,'class','item-value','ngx-charts-count-up',''),(null as any)); this.compView_5 = new import10.View_CountUpDirective0(this.viewUtils,this,5,this._el_5); this._CountUpDirective_5_3 = new import10.Wrapper_CountUpDirective(this.compView_5.ref,this.parentView.parentView.injectorGet(import13.NgZone,this.parentView.parentIndex),new import14.ElementRef(this._el_5)); this._text_6 = this.renderer.createText((null as any),'\n ',(null as any)); this.compView_5.create(this._CountUpDirective_5_3.context); this._text_7 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_8 = import3.createRenderElement(this.renderer,this._el_0,'div',new import3.InlineArray2(2,'class','item-label'),(null as any)); this._text_9 = this.renderer.createText(this._el_8,'',(null as any)); this._text_10 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_11 = import3.createRenderElement(this.renderer,this._el_0,'div',new import3.InlineArray4(4,'class','item-percent','ngx-charts-count-up',''),(null as any)); this.compView_11 = new import10.View_CountUpDirective0(this.viewUtils,this,11,this._el_11); this._CountUpDirective_11_3 = new import10.Wrapper_CountUpDirective(this.compView_11.ref,this.parentView.parentView.injectorGet(import13.NgZone,this.parentView.parentIndex),new import14.ElementRef(this._el_11)); this._text_12 = this.renderer.createText((null as any),'\n ',(null as any)); this.compView_11.create(this._CountUpDirective_11_3.context); this._text_13 = this.renderer.createText(this._el_0,'\n ',(null as any)); var disposable_0:Function = import3.subscribeToRenderElement(this,this._el_0,new import3.InlineArray8(6,'mouseenter',(null as any),'mouseleave',(null as any),'click',(null as any)),this.eventHandler(this.handleEvent_0)); this.init(this._el_0,((<any>this.renderer).directRenderer? (null as any): [ this._el_0, this._text_1, this._el_2, this._text_3, this._text_4, this._el_5, this._text_6, this._text_7, this._el_8, this._text_9, this._text_10, this._el_11, this._text_12, this._text_13 ] ),[disposable_0]); return (null as any); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import9.CountUpDirective) && ((5 <= requestNodeIndex) && (requestNodeIndex <= 6)))) { return this._CountUpDirective_5_3.context; } if (((token === import9.CountUpDirective) && ((11 <= requestNodeIndex) && (requestNodeIndex <= 12)))) { return this._CountUpDirective_11_3.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { const currVal_5_0_0:any = this.context.$implicit.value; this._CountUpDirective_5_3.check_countTo(currVal_5_0_0,throwOnChange,false); this._CountUpDirective_5_3.ngDoCheck(this,this._el_5,throwOnChange); const currVal_11_0_0:any = '%'; this._CountUpDirective_11_3.check_countSuffix(currVal_11_0_0,throwOnChange,false); const currVal_11_0_1:any = this.context.$implicit.percentage; this._CountUpDirective_11_3.check_countTo(currVal_11_0_1,throwOnChange,false); this._CountUpDirective_11_3.ngDoCheck(this,this._el_11,throwOnChange); const currVal_18:any = this.context.$implicit.color; if (import3.checkBinding(throwOnChange,this._expr_18,currVal_18)) { this.renderer.setElementStyle(this._el_2,'background',((this.viewUtils.sanitizer.sanitize(import18.SecurityContext.STYLE,currVal_18) == null)? (null as any): this.viewUtils.sanitizer.sanitize(import18.SecurityContext.STYLE,currVal_18).toString())); this._expr_18 = currVal_18; } const currVal_19:any = import3.inlineInterpolate(1,'',this.context.$implicit.label,''); if (import3.checkBinding(throwOnChange,this._expr_19,currVal_19)) { this.renderer.setText(this._text_9,currVal_19); this._expr_19 = currVal_19; } this.compView_5.internalDetectChanges(throwOnChange); this.compView_11.internalDetectChanges(throwOnChange); } destroyInternal():void { this.compView_5.destroy(); this.compView_11.destroy(); this._CountUpDirective_5_3.ngOnDestroy(); this._CountUpDirective_11_3.ngOnDestroy(); } visitRootNodesInternal(cb:any,ctx:any):void { cb(this._el_0,ctx); } handleEvent_0(eventName:string,$event:any):boolean { this.markPathToRootAsCheckOnce(); var result:boolean = true; if ((eventName == 'mouseenter')) { const pd_sub_0:any = ((<any>this.parentView.context.activate.emit(this.context.$implicit.label)) !== false); result = (pd_sub_0 && result); } if ((eventName == 'mouseleave')) { const pd_sub_1:any = ((<any>this.parentView.context.deactivate.emit(this.context.$implicit.label)) !== false); result = (pd_sub_1 && result); } if ((eventName == 'click')) { const pd_sub_2:any = ((<any>this.parentView.context.select.emit({ name: this.context.$implicit.label, value: this.context.$implicit.value } )) !== false); result = (pd_sub_2 && result); } return result; } }