[59329aa] | 1 | {"version":3,"file":"primeng-panelmenu.mjs","sources":["../../src/app/components/panelmenu/panelmenu.ts","../../src/app/components/panelmenu/primeng-panelmenu.ts"],"sourcesContent":["import {NgModule,Component,Input,ChangeDetectorRef,ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';\nimport {trigger,state,style,transition,animate} from '@angular/animations';\nimport {CommonModule} from '@angular/common';\nimport {MenuItem} from 'primeng/api';\nimport {RouterModule} from '@angular/router';\nimport {TooltipModule} from 'primeng/tooltip';\nimport {DomHandler} from 'primeng/dom';\n\nexport class BasePanelMenuItem {\n\n constructor(private ref: ChangeDetectorRef) {}\n\n handleClick(event, item) {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n\n item.expanded = !item.expanded;\n this.ref.detectChanges();\n\n if (!item.url) {\n event.preventDefault();\n }\n\n if (item.command) {\n item.command({\n originalEvent: event,\n item: item\n });\n }\n }\n}\n\n@Component({\n selector: 'p-panelMenuSub',\n template: `\n <ul [ngClass]=\"{'p-submenu-list': true, 'p-panelmenu-root-submenu': root}\" [@submenu]=\"expanded ? {value: 'visible', params: {transitionParams: transitionOptions, height: '*'}} : {value: 'hidden', params: {transitionParams: transitionOptions, height: '0'}}\" role=\"tree\">\n <ng-template ngFor let-child [ngForOf]=\"item.items\">\n <li *ngIf=\"child.separator\" class=\"p-menu-separator\" role=\"separator\">\n <li *ngIf=\"!child.separator\" class=\"p-menuitem\" [ngClass]=\"child.styleClass\" [class.p-hidden]=\"child.visible === false\" [ngStyle]=\"child.style\" pTooltip [tooltipOptions]=\"child.tooltipOptions\">\n <a *ngIf=\"!child.routerLink\" (keydown)=\"onItemKeyDown($event)\" [attr.href]=\"child.url\" class=\"p-menuitem-link\" [attr.tabindex]=\"!item.expanded || !parentExpanded ? null : child.disabled ? null : '0'\" [attr.id]=\"child.id\"\n [ngClass]=\"{'p-disabled':child.disabled}\" role=\"treeitem\" [attr.aria-expanded]=\"child.expanded\"\n (click)=\"handleClick($event,child)\" [attr.target]=\"child.target\" [attr.title]=\"child.title\">\n <span class=\"p-panelmenu-icon pi pi-fw\" [ngClass]=\"{'pi-angle-right':!child.expanded,'pi-angle-down':child.expanded}\" *ngIf=\"child.items\"></span>\n <span class=\"p-menuitem-icon\" [ngClass]=\"child.icon\" *ngIf=\"child.icon\"></span>\n <span class=\"p-menuitem-text\" *ngIf=\"child.escape !== false; else htmlLabel\">{{child.label}}</span>\n <ng-template #htmlLabel><span class=\"p-menuitem-text\" [innerHTML]=\"child.label\"></span></ng-template>\n </a>\n <a *ngIf=\"child.routerLink\" (keydown)=\"onItemKeyDown($event)\" [routerLink]=\"child.routerLink\" [queryParams]=\"child.queryParams\" [routerLinkActive]=\"'p-menuitem-link-active'\" [routerLinkActiveOptions]=\"child.routerLinkActiveOptions||{exact:false}\" class=\"p-menuitem-link\"\n [ngClass]=\"{'p-disabled':child.disabled}\" [attr.tabindex]=\"!item.expanded || !parentExpanded ? null : child.disabled ? null : '0'\" [attr.id]=\"child.id\" role=\"treeitem\" [attr.aria-expanded]=\"child.expanded\"\n (click)=\"handleClick($event,child)\" [attr.target]=\"child.target\" [attr.title]=\"child.title\"\n [fragment]=\"child.fragment\" [queryParamsHandling]=\"child.queryParamsHandling\" [preserveFragment]=\"child.preserveFragment\" [skipLocationChange]=\"child.skipLocationChange\" [replaceUrl]=\"child.replaceUrl\" [state]=\"child.state\">\n <span class=\"p-panelmenu-icon pi pi-fw\" [ngClass]=\"{'pi-angle-right':!child.expanded,'pi-angle-down':child.expanded}\" *ngIf=\"child.items\"></span>\n <span class=\"p-menuitem-icon\" [ngClass]=\"child.icon\" *ngIf=\"child.icon\"></span>\n <span class=\"p-menuitem-text\" *ngIf=\"child.escape !== false; else htmlRouteLabel\">{{child.label}}</span>\n <ng-template #htmlRouteLabel><span class=\"p-menuitem-text\" [innerHTML]=\"child.label\"></span></ng-template>\n </a>\n <p-panelMenuSub [item]=\"child\" [parentExpanded]=\"expanded && parentExpanded\" [expanded]=\"child.expanded\" [transitionOptions]=\"transitionOptions\" *ngIf=\"child.items\"></p-panelMenuSub>\n </li>\n </ng-template>\n </ul>\n `,\n animations: [\n trigger('submenu', [\n state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })),\n state('visible', style({\n height: '*'\n })),\n transition('visible <=> hidden', [style({overflow: 'hidden'}), animate('{{transitionParams}}')]),\n transition('void => *', animate(0))\n ])\n ],\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'p-element'\n }\n})\nexport class PanelMenuSub extends BasePanelMenuItem {\n\n @Input() item: MenuItem;\n\n @Input() expanded: boolean;\n\n @Input() parentExpanded: boolean;\n\n @Input() transitionOptions: string;\n\n @Input() root: boolean;\n\n constructor(ref: ChangeDetectorRef) {\n super(ref);\n }\n\n\n\n onItemKeyDown(event) {\n let listItem = event.currentTarget;\n\n switch (event.code) {\n case 'Space':\n case 'Enter':\n if (listItem && !DomHandler.hasClass(listItem, 'p-disabled')) {\n listItem.click();\n }\n\n event.preventDefault();\n break;\n\n default:\n break;\n }\n }\n}\n\n@Component({\n selector: 'p-panelMenu',\n template: `\n <div [class]=\"styleClass\" [ngStyle]=\"style\" [ngClass]=\"'p-panelmenu p-component'\">\n <ng-container *ngFor=\"let item of model;let f=first;let l=last;\">\n <div class=\"p-panelmenu-panel\" [ngClass]=\"{'p-hidden': item.visible === false}\">\n <div [ngClass]=\"{'p-component p-panelmenu-header':true, 'p-highlight':item.expanded,'p-disabled':item.disabled}\" [class]=\"item.styleClass\" [ngStyle]=\"item.style\" pTooltip [tooltipOptions]=\"item.tooltipOptions\">\n <a *ngIf=\"!item.routerLink\" [attr.href]=\"item.url\" (click)=\"handleClick($event,item)\" (keydown)=\"onItemKeyDown($event)\" [attr.tabindex]=\"item.disabled ? null : '0'\" [attr.id]=\"item.id\"\n [attr.target]=\"item.target\" [attr.title]=\"item.title\" class=\"p-panelmenu-header-link\" [attr.aria-expanded]=\"item.expanded\" [attr.id]=\"item.id + '_header'\" [attr.aria-controls]=\"item.id +'_content'\">\n <span *ngIf=\"item.items\" class=\"p-panelmenu-icon pi\" [ngClass]=\"{'pi-chevron-right':!item.expanded,'pi-chevron-down':item.expanded}\"></span>\n <span class=\"p-menuitem-icon\" [ngClass]=\"item.icon\" *ngIf=\"item.icon\"></span>\n <span class=\"p-menuitem-text\" *ngIf=\"item.escape !== false; else htmlLabel\">{{item.label}}</span>\n <ng-template #htmlLabel><span class=\"p-menuitem-text\" [innerHTML]=\"item.label\"></span></ng-template>\n </a>\n <a *ngIf=\"item.routerLink\" [routerLink]=\"item.routerLink\" [queryParams]=\"item.queryParams\" [routerLinkActive]=\"'p-menuitem-link-active'\" [routerLinkActiveOptions]=\"item.routerLinkActiveOptions||{exact:false}\"\n (click)=\"handleClick($event,item)\" (keydown)=\"onItemKeyDown($event)\" [attr.target]=\"item.target\" [attr.title]=\"item.title\" class=\"p-panelmenu-header-link\" [attr.id]=\"item.id\" [attr.tabindex]=\"item.disabled ? null : '0'\"\n [fragment]=\"item.fragment\" [queryParamsHandling]=\"item.queryParamsHandling\" [preserveFragment]=\"item.preserveFragment\" [skipLocationChange]=\"item.skipLocationChange\" [replaceUrl]=\"item.replaceUrl\" [state]=\"item.state\">\n <span *ngIf=\"item.items\" class=\"p-panelmenu-icon pi\" [ngClass]=\"{'pi-chevron-right':!item.expanded,'pi-chevron-down':item.expanded}\"></span>\n <span class=\"p-menuitem-icon\" [ngClass]=\"item.icon\" *ngIf=\"item.icon\"></span>\n <span class=\"p-menuitem-text\" *ngIf=\"item.escape !== false; else htmlRouteLabel\">{{item.label}}</span>\n <ng-template #htmlRouteLabel><span class=\"p-menuitem-text\" [innerHTML]=\"item.label\"></span></ng-template>\n </a>\n </div>\n <div *ngIf=\"item.items\" class=\"p-toggleable-content\" [@rootItem]=\"item.expanded ? {value: 'visible', params: {transitionParams: animating ? transitionOptions : '0ms', height: '*'}} : {value: 'hidden', params: {transitionParams: transitionOptions, height: '0'}}\" (@rootItem.done)=\"onToggleDone()\">\n <div class=\"p-panelmenu-content\" role=\"region\" [attr.id]=\"item.id +'_content' \" [attr.aria-labelledby]=\"item.id +'_header'\">\n <p-panelMenuSub [item]=\"item\" [parentExpanded]=\"item.expanded\" [expanded]=\"true\" [transitionOptions]=\"transitionOptions\" [root]=\"true\"></p-panelMenuSub>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n `,\n animations: [\n trigger('rootItem', [\n state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })),\n state('visible', style({\n height: '*'\n })),\n transition('visible <=> hidden', [style({overflow: 'hidden'}), animate('{{transitionParams}}')]),\n transition('void => *', animate(0))\n ])\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./panelmenu.css'],\n host: {\n 'class': 'p-element'\n }\n})\nexport class PanelMenu extends BasePanelMenuItem {\n\n @Input() model: MenuItem[];\n\n @Input() style: any;\n\n @Input() styleClass: string;\n\n @Input() multiple: boolean = true;\n\n @Input() transitionOptions: string = '400ms cubic-bezier(0.86, 0, 0.07, 1)';\n\n public animating: boolean;\n\n constructor(ref: ChangeDetectorRef) {\n super(ref);\n }\n\n collapseAll() {\n \tfor(let item of this.model) {\n \t\tif (item.expanded) {\n \t\t\titem.expanded = false;\n \t\t}\n \t}\n }\n\n handleClick(event, item) {\n \tif (!this.multiple) {\n for(let modelItem of this.model) {\n \t\tif (item !== modelItem && modelItem.expanded) {\n \t\t\tmodelItem.expanded = false;\n \t\t}\n \t}\n \t}\n\n this.animating = true;\n super.handleClick(event, item);\n }\n\n onToggleDone() {\n this.animating = false;\n }\n\n onItemKeyDown(event) {\n let listItem = event.currentTarget;\n\n switch (event.code) {\n case 'Space':\n case 'Enter':\n if (listItem && !DomHandler.hasClass(listItem, 'p-disabled')) {\n listItem.click();\n }\n\n event.preventDefault();\n break;\n\n default:\n break;\n }\n }\n\n}\n\n@NgModule({\n imports: [CommonModule,RouterModule,TooltipModule],\n exports: [PanelMenu,RouterModule,TooltipModule],\n declarations: [PanelMenu,PanelMenuSub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