UNPKG

10.9 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations"),require("@angular/common"),require("@angular/router")):"function"==typeof define&&define.amd?define("primeng/panelmenu",["exports","@angular/core","@angular/animations","@angular/common","@angular/router"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.panelmenu={}),e.ng.core,e.ng.animations,e.ng.common,e.ng.router)}(this,(function(e,t,n,i,a){"use strict";var r,l=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,i){var a,r=arguments.length,l=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(r<3?a(l):r>3?a(t,n,l):a(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(){function e(e){this.ref=e}return e.prototype.handleClick=function(e,t){t.disabled?e.preventDefault():(t.expanded=!t.expanded,this.ref.detectChanges(),t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}))},e}(),c=function(e){function i(t){return e.call(this,t)||this}return l(i,e),i.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},o([t.Input()],i.prototype,"item",void 0),o([t.Input()],i.prototype,"expanded",void 0),o([t.Input()],i.prototype,"transitionOptions",void 0),i=o([t.Component({selector:"p-panelMenuSub",template:'\n <ul class="ui-submenu-list" [@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="ui-menu-separator ui-widget-content" role="separator">\n <li *ngIf="!child.separator" class="ui-menuitem ui-corner-all" [ngClass]="child.styleClass" [class.ui-helper-hidden]="child.visible === false" [ngStyle]="child.style">\n <a *ngIf="!child.routerLink" [href]="child.url||\'#\'" class="ui-menuitem-link ui-corner-all" [attr.tabindex]="item.expanded ? null : child.tabindex ? child.tabindex : \'-1\'" [attr.id]="child.id"\n [ngClass]="{\'ui-state-disabled\':child.disabled, \'ui-state-active\': child.expanded}" role="treeitem" [attr.aria-expanded]="child.expanded"\n (click)="handleClick($event,child)" [attr.target]="child.target" [attr.title]="child.title">\n <span class="ui-panelmenu-icon pi pi-fw" [ngClass]="{\'pi-caret-right\':!child.expanded,\'pi-caret-down\':child.expanded}" *ngIf="child.items"></span\n ><span class="ui-menuitem-icon" [ngClass]="child.icon" *ngIf="child.icon"></span\n ><span class="ui-menuitem-text">{{child.label}}</span>\n </a>\n <a *ngIf="child.routerLink" [routerLink]="child.routerLink" [queryParams]="child.queryParams" [routerLinkActive]="\'ui-menuitem-link-active\'" [routerLinkActiveOptions]="child.routerLinkActiveOptions||{exact:false}" class="ui-menuitem-link ui-corner-all" \n [ngClass]="{\'ui-state-disabled\':child.disabled}" [attr.tabindex]="item.expanded ? null : child.tabindex ? child.tabindex : \'-1\'" [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="ui-panelmenu-icon pi pi-fw" [ngClass]="{\'pi-caret-right\':!child.expanded,\'pi-caret-down\':child.expanded}" *ngIf="child.items"></span\n ><span class="ui-menuitem-icon" [ngClass]="child.icon" *ngIf="child.icon"></span\n ><span class="ui-menuitem-text">{{child.label}}</span>\n </a>\n <p-panelMenuSub [item]="child" [expanded]="child.expanded" [transitionOptions]="transitionOptions" *ngIf="child.items"></p-panelMenuSub>\n </li>\n </ng-template>\n </ul>\n ',animations:[n.trigger("submenu",[n.state("hidden",n.style({height:"0px"})),n.state("void",n.style({height:"{{height}}"}),{params:{height:"0"}}),n.state("visible",n.style({height:"*"})),n.transition("visible => hidden",n.animate("{{transitionParams}}")),n.transition("hidden => visible",n.animate("{{transitionParams}}")),n.transition("void => hidden",n.animate("{{transitionParams}}")),n.transition("void => visible",n.animate("{{transitionParams}}"))])]})],i)}(d),u=function(e){function i(t){var n=e.call(this,t)||this;return n.multiple=!0,n.transitionOptions="400ms cubic-bezier(0.86, 0, 0.07, 1)",n}return l(i,e),i.prototype.collapseAll=function(){var e,t;try{for(var n=s(this.model),i=n.next();!i.done;i=n.next()){var a=i.value;a.expanded&&(a.expanded=!1)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},i.prototype.handleClick=function(t,n){var i,a;if(!this.multiple)try{for(var r=s(this.model),l=r.next();!l.done;l=r.next()){var o=l.value;n!==o&&o.expanded&&(o.expanded=!1)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(a=r.return)&&a.call(r)}finally{if(i)throw i.error}}this.animating=!0,e.prototype.handleClick.call(this,t,n)},i.prototype.onToggleDone=function(){this.animating=!1},i.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},o([t.Input()],i.prototype,"model",void 0),o([t.Input()],i.prototype,"style",void 0),o([t.Input()],i.prototype,"styleClass",void 0),o([t.Input()],i.prototype,"multiple",void 0),o([t.Input()],i.prototype,"transitionOptions",void 0),i=o([t.Component({selector:"p-panelMenu",template:'\n <div [class]="styleClass" [ngStyle]="style" [ngClass]="\'ui-panelmenu ui-widget\'">\n <ng-container *ngFor="let item of model;let f=first;let l=last;">\n <div class="ui-panelmenu-panel" [ngClass]="{\'ui-helper-hidden\': item.visible === false}">\n <div [ngClass]="{\'ui-widget ui-panelmenu-header ui-state-default\':true,\'ui-corner-top\':f,\'ui-corner-bottom\':l&&!item.expanded,\n \'ui-state-active\':item.expanded,\'ui-state-disabled\':item.disabled}" [class]="item.styleClass" [ngStyle]="item.style">\n <a *ngIf="!item.routerLink" [href]="item.url||\'#\'" (click)="handleClick($event,item)" [attr.tabindex]="item.tabindex ? item.tabindex : \'0\'" [attr.id]="item.id"\n [attr.target]="item.target" [attr.title]="item.title" class="ui-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="ui-panelmenu-icon pi pi-fw" [ngClass]="{\'pi-chevron-right\':!item.expanded,\'pi-chevron-down\':item.expanded}"></span\n ><span class="ui-menuitem-icon" [ngClass]="item.icon" *ngIf="item.icon"></span\n ><span class="ui-menuitem-text">{{item.label}}</span>\n </a>\n <a *ngIf="item.routerLink" [routerLink]="item.routerLink" [queryParams]="item.queryParams" [routerLinkActive]="\'ui-menuitem-link-active\'" [routerLinkActiveOptions]="item.routerLinkActiveOptions||{exact:false}"\n (click)="handleClick($event,item)" [attr.target]="item.target" [attr.title]="item.title" class="ui-panelmenu-header-link" [attr.id]="item.id" [attr.tabindex]="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 *ngIf="item.items" class="ui-panelmenu-icon pi pi-fw" [ngClass]="{\'pi-chevron-right\':!item.expanded,\'pi-chevron-down\':item.expanded}"></span\n ><span class="ui-menuitem-icon" [ngClass]="item.icon" *ngIf="item.icon"></span\n ><span class="ui-menuitem-text">{{item.label}}</span>\n </a>\n </div>\n <div *ngIf="item.items" class="ui-panelmenu-content-wrapper" [@rootItem]="item.expanded ? {value: \'visible\', params: {transitionParams: animating ? transitionOptions : \'0ms\', height: \'*\'}} : {value: \'hidden\', params: {transitionParams: transitionOptions, height: \'0\'}}" (@rootItem.done)="onToggleDone()"\n [ngClass]="{\'ui-panelmenu-content-wrapper-overflown\': !item.expanded||animating}">\n <div class="ui-panelmenu-content ui-widget-content" role="region" [attr.id]="item.id +\'_content\' " [attr.aria-labelledby]="item.id +\'_header\'">\n <p-panelMenuSub [item]="item" [expanded]="true" [transitionOptions]="transitionOptions" class="ui-panelmenu-root-submenu"></p-panelMenuSub>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n ',animations:[n.trigger("rootItem",[n.state("hidden",n.style({height:"0px"})),n.state("void",n.style({height:"{{height}}"}),{params:{height:"0"}}),n.state("visible",n.style({height:"*"})),n.transition("visible => hidden",n.animate("{{transitionParams}}")),n.transition("hidden => visible",n.animate("{{transitionParams}}")),n.transition("void => hidden",n.animate("{{transitionParams}}")),n.transition("void => visible",n.animate("{{transitionParams}}"))])],changeDetection:t.ChangeDetectionStrategy.Default})],i)}(d),p=function(){function e(){}return e=o([t.NgModule({imports:[i.CommonModule,a.RouterModule],exports:[u,a.RouterModule],declarations:[u,c]})],e)}();e.BasePanelMenuItem=d,e.PanelMenu=u,e.PanelMenuModule=p,e.PanelMenuSub=c,Object.defineProperty(e,"__esModule",{value:!0})}));
2//# sourceMappingURL=primeng-panelmenu.umd.min.js.map
\No newline at end of file