{"version":3,"file":"primeng-tabmenu.umd.js","sources":["../../src/app/components/tabmenu/tabmenu.ts","../../src/app/components/tabmenu/primeng-tabmenu.ts"],"sourcesContent":["import {NgModule,Component,Input,ContentChildren,QueryList,AfterContentInit,AfterViewInit,AfterViewChecked,TemplateRef,ChangeDetectionStrategy, ViewEncapsulation, ViewChild, ElementRef} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MenuItem} from 'primeng/api';\nimport {RippleModule} from 'primeng/ripple';\nimport {PrimeTemplate, SharedModule} from 'primeng/api';\nimport {RouterModule} from '@angular/router';\nimport {DomHandler} from 'primeng/dom';\n\n@Component({\n selector: 'p-tabMenu',\n template: `\n
\n \n
\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./tabmenu.css']\n})\nexport class TabMenu implements AfterContentInit,AfterViewInit,AfterViewChecked {\n\n @Input() model: MenuItem[];\n\n @Input() activeItem: MenuItem;\n\n @Input() popup: boolean;\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @ViewChild('navbar') navbar: ElementRef;\n\n @ViewChild('inkbar') inkbar: ElementRef;\n\n @ContentChildren(PrimeTemplate) templates: QueryList;\n\n itemTemplate: TemplateRef;\n\n tabChanged: boolean;\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch(item.getType()) {\n case 'item':\n this.itemTemplate = item.template;\n break;\n \n default:\n this.itemTemplate = item.template;\n break;\n }\n });\n }\n\n ngAfterViewInit() {\n this.updateInkBar();\n }\n\n ngAfterViewChecked() {\n if (this.tabChanged) {\n this.updateInkBar();\n this.tabChanged = false;\n }\n }\n\n itemClick(event: Event, item: MenuItem) {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n\n if (item.command) {\n item.command({\n originalEvent: event,\n item: item\n });\n }\n\n this.activeItem = item;\n this.tabChanged = true;\n }\n\n updateInkBar() {\n let tabHeader = DomHandler.findSingle(this.navbar.nativeElement, 'li.p-highlight');\n if (tabHeader) {\n this.inkbar.nativeElement.style.width = DomHandler.getWidth(tabHeader) + 'px';\n this.inkbar.nativeElement.style.left = DomHandler.getOffset(tabHeader).left - DomHandler.getOffset(this.navbar.nativeElement).left + 'px';\n }\n }\n}\n\n@NgModule({\n imports: [CommonModule,RouterModule,SharedModule,RippleModule],\n exports: [TabMenu,RouterModule,SharedModule],\n declarations: [TabMenu]\n})\nexport class TabMenuModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["DomHandler","Component","ChangeDetectionStrategy","ViewEncapsulation","Input","ViewChild","ContentChildren","PrimeTemplate","NgModule","CommonModule","RouterModule","SharedModule","RippleModule"],"mappings":";;;;;;;QA4CA;;QAsBI,oCAAkB,GAAlB;YAAA,iBAYC;YAXG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAC,IAAI;gBACxB,QAAO,IAAI,CAAC,OAAO,EAAE;oBACjB,KAAK,MAAM;wBACP,KAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;wBACtC,MAAM;oBAEN;wBACI,KAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;wBACtC,MAAM;iBACT;aACJ,CAAC,CAAC;SACN;QAED,iCAAe,GAAf;YACI,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;QAED,oCAAkB,GAAlB;YACI,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjB,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;aAC3B;SACJ;QAED,2BAAS,GAAT,UAAU,KAAY,EAAE,IAAc;YAClC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,OAAO;aACV;YAED,IAAI,IAAI,CAAC,OAAO,EAAE;gBACd,IAAI,CAAC,OAAO,CAAC;oBACT,aAAa,EAAE,KAAK;oBACpB,IAAI,EAAE,IAAI;iBACb,CAAC,CAAC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