primeng
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primeng) [{"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/dom"),require("@angular/router")):"function"==typeof define&&define.amd?define("primeng/menubar",["exports","@angular/core","@angular/common","primeng/dom","@angular/router"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.menubar={}),e.ng.core,e.ng.common,e.primeng.dom,e.ng.router)}(this,(function(e,t,i,n,r){"use strict";var l=this&&this.__decorate||function(e,t,i,n){var r,l=arguments.length,o=l<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(l<3?r(o):l>3?r(t,i,o):r(t,i))||o);return l>3&&o&&Object.defineProperty(t,i,o),o},o=function(){function e(e,t){this.renderer=e,this.cd=t,this.autoZIndex=!0,this.baseZIndex=0,this.menuHoverActive=!1}return Object.defineProperty(e.prototype,"parentActive",{get:function(){return this._parentActive},set:function(e){this.root||(this._parentActive=e,e||(this.activeItem=null))},enumerable:!0,configurable:!0}),e.prototype.onItemMenuClick=function(e,t,i){if(!this.autoDisplay){if(i.disabled)return;this.activeItem=this.activeMenu&&this.activeMenu.isEqualNode(t)?null:t;var r=t.children[0].nextElementSibling;if(r){var l=r.children[0];this.autoZIndex&&(l.style.zIndex=String(this.baseZIndex+ ++n.DomHandler.zindex)),this.root?(l.style.top=n.DomHandler.getOuterHeight(t.children[0])+"px",l.style.left="0px"):(l.style.top="0px",l.style.left=n.DomHandler.getOuterWidth(t.children[0])+"px")}this.menuClick=!0,this.menuHoverActive=!this.activeMenu||!this.activeMenu.isEqualNode(t),this.activeMenu=this.activeMenu&&this.activeMenu.isEqualNode(t)?null:t,this.bindEventListener()}},e.prototype.bindEventListener=function(){var e=this;this.documentClickListener||(this.documentClickListener=this.renderer.listen("document","click",(function(t){e.menuClick||(e.activeItem=null,e.menuHoverActive=!1,e.activeMenu=!1),e.menuClick=!1})))},e.prototype.onItemMouseEnter=function(e,t,i){if(this.autoDisplay||!this.autoDisplay&&this.root&&this.menuHoverActive){if(i.disabled)return;if(this.activeItem&&!this.activeItem.isEqualNode(t)||!this.activeItem){this.activeItem=t;var r=t.children[0].nextElementSibling;if(r){var l=r.children[0];l.style.zIndex=String(++n.DomHandler.zindex),this.root?(l.style.top=n.DomHandler.getOuterHeight(t.children[0])+"px",l.style.left="0px"):(l.style.top="0px",l.style.left=n.DomHandler.getOuterWidth(t.children[0])+"px")}this.activeMenu=t}}},e.prototype.itemClick=function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),this.activeItem=null)},e.prototype.listClick=function(e){this.autoDisplay&&(this.activeItem=null)},e.prototype.ngOnDestroy=function(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null)},e.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ChangeDetectorRef}]},l([t.Input()],e.prototype,"item",void 0),l([t.Input()],e.prototype,"root",void 0),l([t.Input()],e.prototype,"autoDisplay",void 0),l([t.Input()],e.prototype,"autoZIndex",void 0),l([t.Input()],e.prototype,"baseZIndex",void 0),l([t.Input()],e.prototype,"parentActive",null),e=l([t.Component({selector:"p-menubarSub",template:'\n <ul [ngClass]="{\'ui-menubar-root-list\':root, \'ui-widget-content ui-corner-all ui-submenu-list ui-shadow\':!root}"\n (click)="listClick($event)">\n <ng-template ngFor let-child [ngForOf]="(root ? item : item.items)">\n <li *ngIf="child.separator" class="ui-menu-separator ui-widget-content" [ngClass]="{\'ui-helper-hidden\': child.visible === false}">\n <li *ngIf="!child.separator" #listItem [ngClass]="{\'ui-menuitem ui-corner-all\':true,\n \'ui-menu-parent\':child.items,\'ui-menuitem-active\':listItem==activeItem,\'ui-helper-hidden\': child.visible === false}"\n (mouseenter)="onItemMouseEnter($event,listItem,child)" (click)="onItemMenuClick($event, listItem, child)">\n <a *ngIf="!child.routerLink" [href]="child.url||\'#\'" [attr.data-automationid]="child.automationId" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" (click)="itemClick($event, child)"\n [ngClass]="{\'ui-menuitem-link ui-corner-all\':true,\'ui-state-disabled\':child.disabled}" [ngStyle]="child.style" [class]="child.styleClass" \n [attr.tabindex]="child.tabindex ? child.tabindex : \'0\'" [attr.aria-haspopup]="item.items != null" [attr.aria-expanded]="item === activeItem">\n <span class="ui-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>\n <span class="ui-menuitem-text">{{child.label}}</span>\n <span class="ui-submenu-icon pi pi-fw" *ngIf="child.items" [ngClass]="{\'pi-caret-down\':root,\'pi-caret-right\':!root}"></span>\n </a>\n <a *ngIf="child.routerLink" [routerLink]="child.routerLink" [attr.data-automationid]="child.automationId" [queryParams]="child.queryParams" [routerLinkActive]="\'ui-menuitem-link-active\'" [routerLinkActiveOptions]="child.routerLinkActiveOptions||{exact:false}"\n [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" [attr.tabindex]="child.tabindex ? child.tabindex : \'0\'" role="menuitem"\n (click)="itemClick($event, child)" [ngClass]="{\'ui-menuitem-link ui-corner-all\':true,\'ui-state-disabled\':child.disabled}" [ngStyle]="child.style" [class]="child.styleClass"\n [fragment]="child.fragment" [queryParamsHandling]="child.queryParamsHandling" [preserveFragment]="child.preserveFragment" [skipLocationChange]="child.skipLocationChange" [replaceUrl]="child.replaceUrl" [state]="child.state">\n <span class="ui-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>\n <span class="ui-menuitem-text">{{child.label}}</span>\n <span class="ui-submenu-icon pi pi-fw" *ngIf="child.items" [ngClass]="{\'pi-caret-down\':root,\'pi-caret-right\':!root}"></span>\n </a>\n <p-menubarSub class="ui-submenu" [parentActive]="listItem==activeItem" [item]="child" *ngIf="child.items" [autoDisplay]="true"></p-menubarSub>\n </li>\n </ng-template>\n </ul>\n '})],e)}(),a=function(){function e(e,t){this.el=e,this.renderer=t,this.autoZIndex=!0,this.baseZIndex=0}return Object.defineProperty(e.prototype,"autoDisplay",{get:function(){return this._autoDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"utc",{set:function(e){console.log("AutoDisplay property is deprecated and functionality is not available.")},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},l([t.Input()],e.prototype,"model",void 0),l([t.Input()],e.prototype,"style",void 0),l([t.Input()],e.prototype,"styleClass",void 0),l([t.Input()],e.prototype,"autoZIndex",void 0),l([t.Input()],e.prototype,"baseZIndex",void 0),l([t.Input()],e.prototype,"autoDisplay",null),e=l([t.Component({selector:"p-menubar",template:'\n <div [ngClass]="{\'ui-menubar ui-widget ui-widget-content ui-corner-all\':true}" [class]="styleClass" [ngStyle]="style">\n <p-menubarSub [item]="model" root="root" [baseZIndex]="baseZIndex" [autoZIndex]="autoZIndex">\n <ng-content></ng-content>\n </p-menubarSub>\n <div class="ui-menubar-custom">\n <ng-content></ng-content>\n </div>\n </div>\n ',changeDetection:t.ChangeDetectionStrategy.Default})],e)}(),u=function(){function e(){}return e=l([t.NgModule({imports:[i.CommonModule,r.RouterModule],exports:[a,r.RouterModule],declarations:[a,o]})],e)}();e.Menubar=a,e.MenubarModule=u,e.MenubarSub=o,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=primeng-menubar.umd.min.js.map