{"version":3,"sources":["../../src/app/components/steps/steps.ts"],"names":["Steps","router","route","cd","this","activeIndex","readonly","activeIndexChange","EventEmitter","prototype","ngOnInit","_this","subscription","events","subscribe","markForCheck","itemClick","event","item","i","disabled","preventDefault","emit","url","command","originalEvent","index","isClickableRouterLink","routerLink","isActive","createUrlTree","relativeTo","toString","ngOnDestroy","unsubscribe","Component","args","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","Router","ActivatedRoute","ChangeDetectorRef","Input","Output","NgModule","imports","CommonModule","RouterModule","exports","declarations"],"mappings":"2dAkDI,SAAAA,EAAoBC,EAAwBC,EAA8BC,GAAtDC,KAAAH,OAAAA,EAAwBG,KAAAF,MAAAA,EAA8BE,KAAAD,GAAAA,EAZjEC,KAAAC,YAAsB,EAItBD,KAAAE,UAAqB,EAMpBF,KAAAG,kBAAuC,IAAIC,EAAAA,oBAMrDR,EAAAS,UAAAC,SAAA,WAAA,IAAAC,EAAAP,KACIA,KAAKQ,aAAeR,KAAKH,OAAOY,OAAOC,WAAU,WAAM,OAAAH,EAAKR,GAAGY,mBAGnEf,EAAAS,UAAAO,UAAA,SAAUC,EAAcC,EAAgBC,GAChCf,KAAKE,UAAYY,EAAKE,SACtBH,EAAMI,kBAIVjB,KAAKG,kBAAkBe,KAAKH,GAEvBD,EAAKK,KACNN,EAAMI,iBAGNH,EAAKM,SACLN,EAAKM,QAAQ,CACTC,cAAeR,EACfC,KAAMA,EACNQ,MAAOP,MAKnBnB,EAAAS,UAAAkB,sBAAA,SAAsBT,GAClB,OAAOA,EAAKU,aAAexB,KAAKE,WAAaY,EAAKE,UAGtDpB,EAAAS,UAAAoB,SAAA,SAASX,EAAgBQ,GACrB,OAAIR,EAAKU,WACExB,KAAKH,OAAO4B,SAASX,EAAKU,YAAY,IAAUxB,KAAKH,OAAO4B,SAASzB,KAAKH,OAAO6B,cAAc,CAACZ,EAAKU,YAAa,CAACG,WAAY3B,KAAKF,QAAQ8B,YAAY,GAExJN,IAAUtB,KAAKC,aAG9BL,EAAAS,UAAAwB,YAAA,WACI7B,KAAKQ,aAAasB,wCArFzBC,EAAAA,UAASC,KAAA,CAAC,CACPC,SAAU,UACVC,SAAU,0gFAwBVC,gBAAiBC,EAAAA,wBAAwBC,OACzCC,cAAeC,EAAAA,kBAAkBC,qmBA9BfC,EAAAA,cAAQC,EAAAA,sBAHsFC,EAAAA,0DAsC/GC,EAAAA,qBAEAA,EAAAA,wBAEAA,EAAAA,qBAEAA,EAAAA,0BAEAA,EAAAA,iCAEAC,EAAAA,gBAoDL,iCALCC,EAAAA,SAAQd,KAAA,CAAC,CACNe,QAAS,CAACC,EAAAA,aAAaC,EAAAA,cACvBC,QAAS,CAACtD,EAAMqD,EAAAA,cAChBE,aAAc,CAACvD","sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,ChangeDetectionStrategy, ViewEncapsulation, OnInit, OnDestroy, ChangeDetectorRef} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MenuItem} from 'primeng/api';\nimport {RouterModule, Router, ActivatedRoute} from '@angular/router';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'p-steps',\n template: `\n
\n \n
\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./steps.css']\n})\nexport class Steps implements OnInit, OnDestroy {\n \n @Input() activeIndex: number = 0;\n \n @Input() model: MenuItem[];\n \n @Input() readonly: boolean = true;\n \n @Input() style: any;\n \n @Input() styleClass: string;\n \n @Output() activeIndexChange: EventEmitter = new EventEmitter();\n\n constructor(private router: Router, private route:ActivatedRoute, private cd: ChangeDetectorRef) { }\n \n subscription: Subscription;\n\n ngOnInit() {\n this.subscription = this.router.events.subscribe(() => this.cd.markForCheck());\n }\n \n itemClick(event: Event, item: MenuItem, i: number) {\n if (this.readonly || item.disabled) {\n event.preventDefault();\n return;\n }\n \n this.activeIndexChange.emit(i);\n \n if (!item.url) {\n event.preventDefault();\n }\n \n if (item.command) { \n item.command({\n originalEvent: event,\n item: item,\n index: i\n });\n }\n }\n\n isClickableRouterLink(item: MenuItem) {\n return item.routerLink && !this.readonly && !item.disabled;\n }\n\n isActive(item: MenuItem, index: number) {\n if (item.routerLink)\n return this.router.isActive(item.routerLink, false) || this.router.isActive(this.router.createUrlTree([item.routerLink], {relativeTo: this.route}).toString(), false);\n else \n return index === this.activeIndex;\n }\n\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n}\n\n@NgModule({\n imports: [CommonModule,RouterModule],\n exports: [Steps,RouterModule],\n declarations: [Steps]\n})\nexport class StepsModule { }"]}