UNPKG

4.98 kBSource Map (JSON)View Raw
1{"version":3,"sources":["ng://primeng/steps/steps.ts"],"names":["Steps","this","activeIndex","readonly","activeIndexChange","EventEmitter","prototype","itemClick","event","item","i","disabled","preventDefault","emit","url","command","originalEvent","index","__decorate","Input","Output","Component","selector","template","changeDetection","ChangeDetectionStrategy","Default","StepsModule","NgModule","imports","CommonModule","RouterModule","exports","declarations"],"mappings":"iwBAAAA,EAAA,WAgCA,SAAAA,IAEaC,KAAAC,YAAsB,EAItBD,KAAAE,UAAqB,EAMpBF,KAAAG,kBAAuC,IAAIC,EAAAA,aAuBzD,OArBIL,EAAAM,UAAAC,UAAA,SAAUC,EAAcC,EAAgBC,GAChCT,KAAKE,UAAYM,EAAKE,SACtBH,EAAMI,kBAIVX,KAAKG,kBAAkBS,KAAKH,GAEvBD,EAAKK,KACNN,EAAMI,iBAGNH,EAAKM,SACLN,EAAKM,QAAQ,CACTC,cAAeR,EACfC,KAAMA,EACNQ,MAAOP,MA5BVQ,EAAA,CAARC,EAAAA,2CAEQD,EAAA,CAARC,EAAAA,qCAEQD,EAAA,CAARC,EAAAA,wCAEQD,EAAA,CAARC,EAAAA,qCAEQD,EAAA,CAARC,EAAAA,0CAESD,EAAA,CAATE,EAAAA,kDAZQpB,EAAKkB,EAAA,CA3BjBG,EAAAA,UAAU,CACPC,SAAU,UACVC,SAAU,mzEAuBVC,gBAAiBC,EAAAA,wBAAwBC,WAEhC1B,GAhCb,gBA0EA,SAAA2B,KAA2B,OAAdA,EAAWT,EAAA,CALvBU,EAAAA,SAAS,CACNC,QAAS,CAACC,EAAAA,aAAaC,EAAAA,cACvBC,QAAS,CAAChC,EAAM+B,EAAAA,cAChBE,aAAc,CAACjC,MAEN2B","sourcesContent":["import {NgModule,Component,Input,Output,EventEmitter,ChangeDetectionStrategy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MenuItem} from 'primeng/api';\nimport {RouterModule} from '@angular/router';\n\n@Component({\n selector: 'p-steps',\n template: `\n <div [ngClass]=\"{'ui-steps ui-widget ui-helper-clearfix':true,'ui-steps-readonly':readonly}\" [ngStyle]=\"style\" [class]=\"styleClass\">\n <ul role=\"tablist\">\n <li *ngFor=\"let item of model; let i = index\" class=\"ui-steps-item\" #menuitem [ngStyle]=\"item.style\" [class]=\"item.styleClass\" role=\"tab\" [attr.aria-selected]=\"i === activeIndex\" [attr.aria-expanded]=\"i === activeIndex\"\n [ngClass]=\"{'ui-state-highlight ui-steps-current':(i === activeIndex),\n 'ui-state-default':(i !== activeIndex),\n 'ui-state-complete':(i < activeIndex),\n 'ui-state-disabled ui-steps-incomplete':item.disabled||(i !== activeIndex && readonly)}\">\n <a *ngIf=\"!item.routerLink\" [attr.href]=\"item.url\" class=\"ui-menuitem-link\" role=\"presentation\" (click)=\"itemClick($event, item, i)\" (keydown.enter)=\"itemClick($event, item, i)\" [attr.target]=\"item.target\" [attr.id]=\"item.id\" \n [attr.tabindex]=\"item.disabled||(i !== activeIndex && readonly) ? null : (item.tabindex ? item.tabindex : '0')\">\n <span class=\"ui-steps-number\">{{i + 1}}</span>\n <span class=\"ui-steps-title\">{{item.label}}</span>\n </a>\n <a *ngIf=\"item.routerLink\" [routerLink]=\"item.routerLink\" [queryParams]=\"item.queryParams\" role=\"presentation\" [routerLinkActive]=\"'ui-menuitem-link-active'\" [routerLinkActiveOptions]=\"item.routerLinkActiveOptions||{exact:false}\" class=\"ui-menuitem-link\" \n (click)=\"itemClick($event, item, i)\" (keydown.enter)=\"itemClick($event, item, i)\" [attr.target]=\"item.target\" [attr.id]=\"item.id\" [attr.tabindex]=\"item.disabled||(i !== activeIndex && readonly) ? null : (item.tabindex ? item.tabindex : '0')\"\n [fragment]=\"item.fragment\" [queryParamsHandling]=\"item.queryParamsHandling\" [preserveFragment]=\"item.preserveFragment\" [skipLocationChange]=\"item.skipLocationChange\" [replaceUrl]=\"item.replaceUrl\" [state]=\"item.state\">\n <span class=\"ui-steps-number\">{{i + 1}}</span>\n <span class=\"ui-steps-title\">{{item.label}}</span>\n </a>\n </li>\n </ul>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class Steps {\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<any> = new EventEmitter();\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}\n\n@NgModule({\n imports: [CommonModule,RouterModule],\n exports: [Steps,RouterModule],\n declarations: [Steps]\n})\nexport class StepsModule { }"]}
\No newline at end of file