Files
flights_web_raw/apps/angular/node_modules/primeng/bundles/primeng-contextmenu.umd.min.js
T

2 lines
10 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/dom"),require("primeng/ripple"),require("@angular/router")):"function"==typeof define&&define.amd?define("primeng/contextmenu",["exports","@angular/core","@angular/common","primeng/dom","primeng/ripple","@angular/router"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.contextmenu={}),e.ng.core,e.ng.common,e.primeng.dom,e.primeng.ripple,e.ng.router)}(this,(function(e,t,n,i,o,l){"use strict";var r=function(){function e(e){this.contextMenu=e}return Object.defineProperty(e.prototype,"parentActive",{get:function(){return this._parentActive},set:function(e){this._parentActive=e,e||(this.activeItem=null)},enumerable:!1,configurable:!0}),e.prototype.onItemMouseEnter=function(e,t,n){if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),!n.disabled){this.activeItem=t;var o=t.children[0].nextElementSibling;if(o){var l=o.children[0];l.style.zIndex=++i.DomHandler.zindex,this.position(l,t)}}},e.prototype.itemClick=function(e,t){t.disabled?e.preventDefault():(t.command&&(t.command({originalEvent:e,item:t}),e.preventDefault()),t.items?e.preventDefault():this.contextMenu.hide())},e.prototype.listClick=function(e){this.activeItem=null},e.prototype.position=function(e,t){this.containerOffset=i.DomHandler.getOffset(t.parentElement);var n=i.DomHandler.getViewport(),o=e.offsetParent?e.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(e),l=i.DomHandler.getOuterWidth(t.children[0]),r=i.DomHandler.getOuterHeight(t.children[0]),s=e.offsetHeight?e.offsetHeight:i.DomHandler.getHiddenElementOuterHeight(e);parseInt(this.containerOffset.top)+r+s>n.height-i.DomHandler.calculateScrollbarHeight()?(e.style.removeProperty("top"),e.style.bottom="0px"):(e.style.removeProperty("bottom"),e.style.top="0px"),parseInt(this.containerOffset.left)+l+o>n.width-i.DomHandler.calculateScrollbarWidth()?e.style.left=-o+"px":e.style.left=l+"px"},e}();r.decorators=[{type:t.Component,args:[{selector:"p-contextMenuSub",template:'\n <ul [ngClass]="{\'p-submenu-list\':!root}">\n <ng-template ngFor let-child [ngForOf]="(root ? item : item.items)">\n <li *ngIf="child.separator" class="p-menu-separator" [ngClass]="{\'p-hidden\': child.visible === false}" role="separator">\n <li *ngIf="!child.separator" #item [ngClass]="{\'p-menuitem\':true,\'p-menuitem-active\':item==activeItem,\'p-hidden\': child.visible === false}"\n (mouseenter)="onItemMouseEnter($event,item,child)" role="none">\n <a *ngIf="!child.routerLink" [attr.href]="child.url ? child.url : null" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" [attr.tabindex]="child.disabled ? null : \'0\'" (click)="itemClick($event, child)"\n [ngClass]="{\'p-menuitem-link\':true,\'p-disabled\':child.disabled}" [ngStyle]="child.style" [class]="child.styleClass" pRipple\n [attr.aria-haspopup]="item.items != null" [attr.aria-expanded]="item === activeItem">\n <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="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 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>\n </a>\n <a *ngIf="child.routerLink" [routerLink]="child.routerLink" [queryParams]="child.queryParams" [routerLinkActive]="\'p-menuitem-link-active\'" role="menuitem"\n [routerLinkActiveOptions]="child.routerLinkActiveOptions||{exact:false}" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" [attr.tabindex]="child.disabled ? null : \'0\'"\n (click)="itemClick($event, child)" [ngClass]="{\'p-menuitem-link\':true,\'p-disabled\':child.disabled}"\n [ngStyle]="child.style" [class]="child.styleClass" pRipple\n [fragment]="child.fragment" [queryParamsHandling]="child.queryParamsHandling" [preserveFragment]="child.preserveFragment" [skipLocationChange]="child.skipLocationChange" [replaceUrl]="child.replaceUrl" [state]="child.state">\n <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="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 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>\n </a>\n <p-contextMenuSub [parentActive]="item==activeItem" [item]="child" *ngIf="child.items"></p-contextMenuSub>\n </li>\n </ng-template>\n </ul>\n ',encapsulation:t.ViewEncapsulation.None}]}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return s}))]}]}]},r.propDecorators={item:[{type:t.Input}],root:[{type:t.Input}],parentActive:[{type:t.Input}]};var s=function(){function e(e,n,i){this.el=e,this.renderer=n,this.zone=i,this.autoZIndex=!0,this.baseZIndex=0,this.triggerEvent="contextmenu",this.onShow=new t.EventEmitter,this.onHide=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;if(this.global){var t=this.el?this.el.nativeElement.ownerDocument:"document";this.triggerEventListener=this.renderer.listen(t,this.triggerEvent,(function(t){e.show(t),t.preventDefault()}))}else this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,(function(t){e.show(t),t.preventDefault(),t.stopPropagation()})));this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.containerViewChild.nativeElement):i.DomHandler.appendChild(this.containerViewChild.nativeElement,this.appendTo))},e.prototype.show=function(e){this.position(e),this.moveOnTop(),this.containerViewChild.nativeElement.style.display="block",this.parentActive=!0,i.DomHandler.fadeIn(this.containerViewChild.nativeElement,250),this.bindGlobalListeners(),e&&e.preventDefault(),this.onShow.emit()},e.prototype.hide=function(){this.containerViewChild.nativeElement.style.display="none",this.parentActive=!1,this.unbindGlobalListeners(),this.onHide.emit()},e.prototype.moveOnTop=function(){this.autoZIndex&&(this.containerViewChild.nativeElement.style.zIndex=String(this.baseZIndex+ ++i.DomHandler.zindex))},e.prototype.toggle=function(e){this.containerViewChild.nativeElement.offsetParent?this.hide():this.show(e)},e.prototype.position=function(e){if(e){var t=e.pageX+1,n=e.pageY+1,o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(this.containerViewChild.nativeElement),l=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:i.DomHandler.getHiddenElementOuterHeight(this.containerViewChild.nativeElement),r=i.DomHandler.getViewport();t+o-document.body.scrollLeft>r.width&&(t-=o),n+l-document.body.scrollTop>r.height&&(n-=l),t<document.body.scrollLeft&&(t=document.body.scrollLeft),n<document.body.scrollTop&&(n=document.body.scrollTop),this.containerViewChild.nativeElement.style.left=t+"px",this.containerViewChild.nativeElement.style.top=n+"px"}},e.prototype.bindGlobalListeners=function(){var e=this;if(!this.documentClickListener){var t=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(t,"click",(function(t){e.containerViewChild.nativeElement.offsetParent&&e.isOutsideClicked(t)&&2!==t.button&&e.hide()}))}this.zone.runOutsideAngular((function(){e.windowResizeListener||(e.windowResizeListener=e.onWindowResize.bind(e),window.addEventListener("resize",e.windowResizeListener))}))},e.prototype.unbindGlobalListeners=function(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.windowResizeListener&&(window.removeEventListener("resize",this.windowResizeListener),this.windowResizeListener=null)},e.prototype.onWindowResize=function(e){this.containerViewChild.nativeElement.offsetParent&&this.hide()},e.prototype.isOutsideClicked=function(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))},e.prototype.ngOnDestroy=function(){this.unbindGlobalListeners(),this.triggerEventListener&&this.triggerEventListener(),this.appendTo&&this.el.nativeElement.appendChild(this.containerViewChild.nativeElement)},e}();s.decorators=[{type:t.Component,args:[{selector:"p-contextMenu",template:'\n <div #container [ngClass]="\'p-contextmenu p-component\'"\n [class]="styleClass" [ngStyle]="style">\n <p-contextMenuSub [item]="model" [parentActive]="parentActive" root="root"></p-contextMenuSub>\n </div>\n ',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,styles:[".p-contextmenu{display:none;position:absolute}.p-contextmenu ul{list-style:none;margin:0;padding:0}.p-contextmenu .p-submenu-list{display:none;min-width:100%;position:absolute;z-index:1}.p-contextmenu .p-menuitem-link{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;text-decoration:none}.p-contextmenu .p-menuitem-text{line-height:1}.p-contextmenu .p-menuitem{position:relative}.p-contextmenu .p-menuitem-link .p-submenu-icon{margin-left:auto}.p-contextmenu .p-menuitem-active>p-contextmenusub>.p-submenu-list{display:block!important}"]}]}],s.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:t.NgZone}]},s.propDecorators={model:[{type:t.Input}],global:[{type:t.Input}],target:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],appendTo:[{type:t.Input}],autoZIndex:[{type:t.Input}],baseZIndex:[{type:t.Input}],triggerEvent:[{type:t.Input}],onShow:[{type:t.Output}],onHide:[{type:t.Output}],containerViewChild:[{type:t.ViewChild,args:["container"]}]};var a=function(){};a.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,l.RouterModule,o.RippleModule],exports:[s,l.RouterModule],declarations:[s,r]}]}],e.ContextMenu=s,e.ContextMenuModule=a,e.ContextMenuSub=r,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=primeng-contextmenu.umd.min.js.map