UNPKG

angular2-wizard-angular-material

Version:

This is an Angular2 Form Wizard component. Just like any form wizard. You can define steps and control how each step works. You can enable/disable navigation button based on validity of the current step. Currently, the component only support basic functio

374 lines (373 loc) 18.6 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 './wizard.component'; import * as import1 from '@angular/core/src/linker/view'; import * as import2 from '@angular/core/src/render/api'; import * as import3 from '@angular/core/src/linker/view_utils'; import * as import4 from '@angular/core/src/metadata/view'; import * as import5 from '@angular/core/src/linker/query_list'; 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 '../node_modules/@angular/common/src/directives/ng_class.ngfactory'; import * as import10 from '@angular/core/src/linker/view_container'; import * as import11 from '@angular/core/src/change_detection/change_detection_util'; import * as import12 from '@angular/core/src/change_detection/differs/iterable_differs'; import * as import13 from '@angular/core/src/change_detection/differs/keyvalue_differs'; import * as import14 from '@angular/core/src/linker/element_ref'; import * as import15 from '@angular/common/src/directives/ng_class'; import * as import16 from '../node_modules/@angular/common/src/directives/ng_for.ngfactory'; import * as import17 from '@angular/core/src/linker/template_ref'; import * as import18 from '@angular/common/src/directives/ng_for'; export class Wrapper_WizardComponent { /*private*/ _eventHandler:Function; context:import0.WizardComponent; /*private*/ _changed:boolean; subscription0:any; constructor() { this._changed = false; this.context = new import0.WizardComponent(); } ngOnDetach(view:import1.AppView<any>,componentView:import1.AppView<any>,el:any):void { } ngOnDestroy():void { (this.subscription0 && this.subscription0.unsubscribe()); } ngDoCheck(view:import1.AppView<any>,el:any,throwOnChange:boolean):boolean { var changed:any = this._changed; this._changed = false; return changed; } checkHost(view:import1.AppView<any>,componentView:import1.AppView<any>,el:any,throwOnChange:boolean):void { } handleEvent(eventName:string,$event:any):boolean { var result:boolean = true; return result; } subscribe(view:import1.AppView<any>,_eventHandler:any,emit0:boolean):void { this._eventHandler = _eventHandler; if (emit0) { (this.subscription0 = this.context.onStepChanged.subscribe(_eventHandler.bind(view,'onStepChanged'))); } } } var renderType_WizardComponent_Host:import2.RenderComponentType = import3.createRenderComponentType('',0,import4.ViewEncapsulation.None,([] as any[]),{}); class View_WizardComponent_Host0 extends import1.AppView<any> { _el_0:any; compView_0:import1.AppView<import0.WizardComponent>; _WizardComponent_0_3:Wrapper_WizardComponent; _query_WizardStepComponent_0_0:import5.QueryList<any>; constructor(viewUtils:import3.ViewUtils,parentView:import1.AppView<any>,parentIndex:number,parentElement:any) { super(View_WizardComponent_Host0,renderType_WizardComponent_Host,import6.ViewType.HOST,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckAlways); } createInternal(rootSelector:string):import8.ComponentRef<any> { this._el_0 = import3.selectOrCreateRenderHostElement(this.renderer,'form-wizard',import3.EMPTY_INLINE_ARRAY,rootSelector,(null as any)); this.compView_0 = new View_WizardComponent0(this.viewUtils,this,0,this._el_0); this._WizardComponent_0_3 = new Wrapper_WizardComponent(); this._query_WizardStepComponent_0_0 = new import5.QueryList<any>(); this.compView_0.create(this._WizardComponent_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._WizardComponent_0_3.context); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import0.WizardComponent) && (0 === requestNodeIndex))) { return this._WizardComponent_0_3.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { this._WizardComponent_0_3.ngDoCheck(this,this._el_0,throwOnChange); if (!throwOnChange) { if (this._query_WizardStepComponent_0_0.dirty) { this._query_WizardStepComponent_0_0.reset(([] as any[])); this._WizardComponent_0_3.context.wizardSteps = this._query_WizardStepComponent_0_0; this._query_WizardStepComponent_0_0.notifyOnChanges(); } if ((this.numberOfChecks === 0)) { this._WizardComponent_0_3.context.ngAfterContentInit(); } } this.compView_0.internalDetectChanges(throwOnChange); } destroyInternal():void { this.compView_0.destroy(); this._WizardComponent_0_3.ngOnDestroy(); } visitRootNodesInternal(cb:any,ctx:any):void { cb(this._el_0,ctx); } visitProjectableNodesInternal(nodeIndex:number,ngContentIndex:number,cb:any,ctx:any):void { if (((nodeIndex == 0) && (ngContentIndex == 0))) { } } } export const WizardComponentNgFactory:import8.ComponentFactory<import0.WizardComponent> = new import8.ComponentFactory<import0.WizardComponent>('form-wizard',View_WizardComponent_Host0,import0.WizardComponent); const styles_WizardComponent:any[] = [ '.card[_ngcontent-%COMP%] { height: 100%; }', '.card-header[_ngcontent-%COMP%] { background-color: #fff; padding: 0; font-size: 1.25rem; }', '.card-block[_ngcontent-%COMP%] { overflow-y: auto; }', '.card-footer[_ngcontent-%COMP%] { background-color: #fff; border-top: 0 none; }', '.nav-item[_ngcontent-%COMP%] { padding: 1rem 0rem; border-bottom: 0.5rem solid #ccc; }', '.active[_ngcontent-%COMP%] { font-weight: bold; color: black; border-bottom-color: #1976D2 !important; }', '.enabled[_ngcontent-%COMP%] { cursor: pointer; border-bottom-color: rgb(88, 162, 234); }', '.disabled[_ngcontent-%COMP%] { color: #ccc; }', '.completed[_ngcontent-%COMP%] { cursor: default; }' ] ; class View_WizardComponent1 extends import1.AppView<any> { _el_0:any; _NgClass_0_3:import9.Wrapper_NgClass; _text_1:any; _el_2:any; _text_3:any; _text_4:any; _map_6:any; /*private*/ _expr_7:any; constructor(viewUtils:import3.ViewUtils,parentView:import1.AppView<any>,parentIndex:number,parentElement:any,declaredViewContainer:import10.ViewContainer) { super(View_WizardComponent1,renderType_WizardComponent,import6.ViewType.EMBEDDED,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckAlways,declaredViewContainer); this._map_6 = import3.pureProxy4((p0:any,p1:any,p2:any,p3:any):{[key: string]:any} => { return { active: p0, enabled: p1, disabled: p2, completed: p3 } ; }); this._expr_7 = import11.UNINITIALIZED; } createInternal(rootSelector:string):import8.ComponentRef<any> { this._el_0 = import3.createRenderElement(this.renderer,(null as any),'li',import3.EMPTY_INLINE_ARRAY,(null as any)); this._NgClass_0_3 = new import9.Wrapper_NgClass(this.parentView.parentView.injectorGet(import12.IterableDiffers,this.parentView.parentIndex),this.parentView.parentView.injectorGet(import13.KeyValueDiffers,this.parentView.parentIndex),new import14.ElementRef(this._el_0),this.renderer); this._text_1 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_2 = import3.createRenderElement(this.renderer,this._el_0,'a',import3.EMPTY_INLINE_ARRAY,(null as any)); this._text_3 = this.renderer.createText(this._el_2,'',(null as any)); this._text_4 = this.renderer.createText(this._el_0,'\n ',(null as any)); var disposable_0:Function = import3.subscribeToRenderElement(this,this._el_2,new import3.InlineArray2(2,'click',(null as any)),this.eventHandler(this.handleEvent_2)); 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 ] ),[disposable_0]); return (null as any); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import15.NgClass) && ((0 <= requestNodeIndex) && (requestNodeIndex <= 4)))) { return this._NgClass_0_3.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { const currVal_0_0_0:any = this._map_6(this.context.$implicit.isActive,!this.context.$implicit.isDisabled,this.context.$implicit.isDisabled,this.parentView.context.isCompleted); this._NgClass_0_3.check_ngClass(currVal_0_0_0,throwOnChange,false); this._NgClass_0_3.ngDoCheck(this,this._el_0,throwOnChange); const currVal_7:any = import3.inlineInterpolate(1,'',this.context.$implicit.title,''); if (import3.checkBinding(throwOnChange,this._expr_7,currVal_7)) { this.renderer.setText(this._text_3,currVal_7); this._expr_7 = currVal_7; } } visitRootNodesInternal(cb:any,ctx:any):void { cb(this._el_0,ctx); } handleEvent_2(eventName:string,$event:any):boolean { this.markPathToRootAsCheckOnce(); var result:boolean = true; if ((eventName == 'click')) { const pd_sub_0:any = ((<any>this.parentView.context.goToStep(this.context.$implicit)) !== false); result = (pd_sub_0 && result); } return result; } } var renderType_WizardComponent:import2.RenderComponentType = import3.createRenderComponentType('',1,import4.ViewEncapsulation.Emulated,styles_WizardComponent,{}); export class View_WizardComponent0 extends import1.AppView<import0.WizardComponent> { _el_0:any; _text_1:any; _el_2:any; _text_3:any; _el_4:any; _text_5:any; _anchor_6:any; /*private*/ _vc_6:import10.ViewContainer; _TemplateRef_6_5:any; _NgFor_6_6:import16.Wrapper_NgFor; _text_7:any; _text_8:any; _text_9:any; _el_10:any; _text_11:any; _text_12:any; _text_13:any; _el_14:any; _text_15:any; _el_16:any; _text_17:any; _text_18:any; _el_19:any; _text_20:any; _text_21:any; _el_22:any; _text_23:any; _text_24:any; _text_25:any; /*private*/ _expr_29:any; /*private*/ _expr_30:any; /*private*/ _expr_31:any; /*private*/ _expr_32:any; /*private*/ _expr_33:any; /*private*/ _expr_34:any; constructor(viewUtils:import3.ViewUtils,parentView:import1.AppView<any>,parentIndex:number,parentElement:any) { super(View_WizardComponent0,renderType_WizardComponent,import6.ViewType.COMPONENT,viewUtils,parentView,parentIndex,parentElement,import7.ChangeDetectorStatus.CheckAlways); this._expr_29 = import11.UNINITIALIZED; this._expr_30 = import11.UNINITIALIZED; this._expr_31 = import11.UNINITIALIZED; this._expr_32 = import11.UNINITIALIZED; this._expr_33 = import11.UNINITIALIZED; this._expr_34 = import11.UNINITIALIZED; } createInternal(rootSelector:string):import8.ComponentRef<any> { const parentRenderNode:any = this.renderer.createViewRoot(this.parentElement); this._el_0 = import3.createRenderElement(this.renderer,parentRenderNode,'md-card',import3.EMPTY_INLINE_ARRAY,(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,'md-card-title',import3.EMPTY_INLINE_ARRAY,(null as any)); this._text_3 = this.renderer.createText(this._el_2,'\n ',(null as any)); this._el_4 = import3.createRenderElement(this.renderer,this._el_2,'ul',new import3.InlineArray2(2,'class','nav nav-justified'),(null as any)); this._text_5 = this.renderer.createText(this._el_4,'\n ',(null as any)); this._anchor_6 = this.renderer.createTemplateAnchor(this._el_4,(null as any)); this._vc_6 = new import10.ViewContainer(6,4,this,this._anchor_6); this._TemplateRef_6_5 = new import17.TemplateRef_(this,6,this._anchor_6); this._NgFor_6_6 = new import16.Wrapper_NgFor(this._vc_6.vcRef,this._TemplateRef_6_5,this.parentView.injectorGet(import12.IterableDiffers,this.parentIndex),this.ref); this._text_7 = this.renderer.createText(this._el_4,'\n ',(null as any)); this._text_8 = this.renderer.createText(this._el_2,'\n ',(null as any)); this._text_9 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_10 = import3.createRenderElement(this.renderer,this._el_0,'md-card-content',import3.EMPTY_INLINE_ARRAY,(null as any)); this._text_11 = this.renderer.createText(this._el_10,'\n ',(null as any)); this.projectNodes(this._el_10,0); this._text_12 = this.renderer.createText(this._el_10,'\n ',(null as any)); this._text_13 = this.renderer.createText(this._el_0,'\n ',(null as any)); this._el_14 = import3.createRenderElement(this.renderer,this._el_0,'md-card-actions',import3.EMPTY_INLINE_ARRAY,(null as any)); this._text_15 = this.renderer.createText(this._el_14,'\n ',(null as any)); this._el_16 = import3.createRenderElement(this.renderer,this._el_14,'button',new import3.InlineArray2(2,'md-button',''),(null as any)); this._text_17 = this.renderer.createText(this._el_16,'Previous',(null as any)); this._text_18 = this.renderer.createText(this._el_14,'\n ',(null as any)); this._el_19 = import3.createRenderElement(this.renderer,this._el_14,'button',new import3.InlineArray2(2,'md-button',''),(null as any)); this._text_20 = this.renderer.createText(this._el_19,'Next',(null as any)); this._text_21 = this.renderer.createText(this._el_14,'\n ',(null as any)); this._el_22 = import3.createRenderElement(this.renderer,this._el_14,'button',new import3.InlineArray2(2,'md-button',''),(null as any)); this._text_23 = this.renderer.createText(this._el_22,'Done',(null as any)); this._text_24 = this.renderer.createText(this._el_14,'\n ',(null as any)); this._text_25 = this.renderer.createText(this._el_0,'\n ',(null as any)); var disposable_0:Function = import3.subscribeToRenderElement(this,this._el_16,new import3.InlineArray2(2,'click',(null as any)),this.eventHandler(this.handleEvent_16)); var disposable_1:Function = import3.subscribeToRenderElement(this,this._el_19,new import3.InlineArray2(2,'click',(null as any)),this.eventHandler(this.handleEvent_19)); var disposable_2:Function = import3.subscribeToRenderElement(this,this._el_22,new import3.InlineArray2(2,'click',(null as any)),this.eventHandler(this.handleEvent_22)); this.init((null as any),((<any>this.renderer).directRenderer? (null as any): [ this._el_0, this._text_1, this._el_2, this._text_3, this._el_4, this._text_5, this._anchor_6, this._text_7, this._text_8, this._text_9, this._el_10, this._text_11, this._text_12, this._text_13, this._el_14, this._text_15, this._el_16, this._text_17, this._text_18, this._el_19, this._text_20, this._text_21, this._el_22, this._text_23, this._text_24, this._text_25 ] ),[ disposable_0, disposable_1, disposable_2 ] ); return (null as any); } injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { if (((token === import17.TemplateRef) && (6 === requestNodeIndex))) { return this._TemplateRef_6_5; } if (((token === import18.NgFor) && (6 === requestNodeIndex))) { return this._NgFor_6_6.context; } return notFoundResult; } detectChangesInternal(throwOnChange:boolean):void { const currVal_6_0_0:any = this.context.steps; this._NgFor_6_6.check_ngForOf(currVal_6_0_0,throwOnChange,false); this._NgFor_6_6.ngDoCheck(this,this._anchor_6,throwOnChange); this._vc_6.detectChangesInNestedViews(throwOnChange); const currVal_29:any = this.context.isCompleted; if (import3.checkBinding(throwOnChange,this._expr_29,currVal_29)) { this.renderer.setElementProperty(this._el_14,'hidden',currVal_29); this._expr_29 = currVal_29; } const currVal_30:boolean = (!this.context.hasPrevStep || !this.context.activeStep.showPrev); if (import3.checkBinding(throwOnChange,this._expr_30,currVal_30)) { this.renderer.setElementProperty(this._el_16,'hidden',currVal_30); this._expr_30 = currVal_30; } const currVal_31:boolean = !this.context.activeStep.isValid; if (import3.checkBinding(throwOnChange,this._expr_31,currVal_31)) { this.renderer.setElementProperty(this._el_19,'disabled',currVal_31); this._expr_31 = currVal_31; } const currVal_32:boolean = (!this.context.hasNextStep || !this.context.activeStep.showNext); if (import3.checkBinding(throwOnChange,this._expr_32,currVal_32)) { this.renderer.setElementProperty(this._el_19,'hidden',currVal_32); this._expr_32 = currVal_32; } const currVal_33:boolean = !this.context.activeStep.isValid; if (import3.checkBinding(throwOnChange,this._expr_33,currVal_33)) { this.renderer.setElementProperty(this._el_22,'disabled',currVal_33); this._expr_33 = currVal_33; } const currVal_34:any = this.context.hasNextStep; if (import3.checkBinding(throwOnChange,this._expr_34,currVal_34)) { this.renderer.setElementProperty(this._el_22,'hidden',currVal_34); this._expr_34 = currVal_34; } } destroyInternal():void { this._vc_6.destroyNestedViews(); } createEmbeddedViewInternal(nodeIndex:number):import1.AppView<any> { if ((nodeIndex == 6)) { return new View_WizardComponent1(this.viewUtils,this,6,this._anchor_6,this._vc_6); } return (null as any); } handleEvent_16(eventName:string,$event:any):boolean { this.markPathToRootAsCheckOnce(); var result:boolean = true; if ((eventName == 'click')) { const pd_sub_0:any = ((<any>this.context.previous()) !== false); result = (pd_sub_0 && result); } return result; } handleEvent_19(eventName:string,$event:any):boolean { this.markPathToRootAsCheckOnce(); var result:boolean = true; if ((eventName == 'click')) { const pd_sub_0:any = ((<any>this.context.next()) !== false); result = (pd_sub_0 && result); } return result; } handleEvent_22(eventName:string,$event:any):boolean { this.markPathToRootAsCheckOnce(); var result:boolean = true; if ((eventName == 'click')) { const pd_sub_0:any = ((<any>this.context.complete()) !== false); result = (pd_sub_0 && result); } return result; } }