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/animations"),require("@angular/common"),require("primeng/ripple"),require("primeng/dom"),require("primeng/api")):"function"==typeof define&&define.amd?define("primeng/sidebar",["exports","@angular/core","@angular/animations","@angular/common","primeng/ripple","primeng/dom","primeng/api"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.sidebar={}),e.ng.core,e.ng.animations,e.ng.common,e.primeng.ripple,e.primeng.dom,e.primeng.api)}(this,(function(e,t,i,n,s,o,r){"use strict";var a=i.animation([i.style({transform:"{{transform}}",opacity:0}),i.animate("{{transition}}")]),p=i.animation([i.animate("{{transition}}",i.style({transform:"{{transform}}",opacity:0}))]),l=function(){function e(e,i,n){this.el=e,this.renderer=i,this.cd=n,this.blockScroll=!1,this.autoZIndex=!0,this.baseZIndex=0,this.modal=!0,this.dismissible=!0,this.showCloseIcon=!0,this.closeOnEscape=!0,this.transitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)",this.onShow=new t.EventEmitter,this.onHide=new t.EventEmitter,this.visibleChange=new t.EventEmitter,this._position="left",this._fullScreen=!1,this.transformOptions="translate3d(-100%, 0px, 0px)"}return e.prototype.ngAfterViewInit=function(){this.initialized=!0},e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"content":default:e.contentTemplate=t.template}}))},Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){switch(this._position=e,e){case"left":case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)"}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fullScreen",{get:function(){return this._fullScreen},set:function(e){this._fullScreen=e,e&&(this.transformOptions="none")},enumerable:!1,configurable:!0}),e.prototype.show=function(){this.autoZIndex&&(this.container.style.zIndex=String(this.baseZIndex+ ++o.DomHandler.zindex)),this.modal&&this.enableModality(),this.onShow.emit({})},e.prototype.hide=function(){this.onHide.emit({}),this.modal&&this.disableModality()},e.prototype.close=function(e){this.hide(),this.visibleChange.emit(!1),e.preventDefault()},e.prototype.enableModality=function(){var e=this;this.mask||(this.mask=document.createElement("div"),this.mask.style.zIndex=String(parseInt(this.container.style.zIndex)-1),o.DomHandler.addMultipleClasses(this.mask,"p-component-overlay p-sidebar-mask"),this.dismissible&&(this.maskClickListener=this.renderer.listen(this.mask,"click",(function(t){e.dismissible&&e.close(t)}))),document.body.appendChild(this.mask),this.blockScroll&&o.DomHandler.addClass(document.body,"p-overflow-hidden"))},e.prototype.disableModality=function(){this.mask&&(this.unbindMaskClickListener(),document.body.removeChild(this.mask),this.blockScroll&&o.DomHandler.removeClass(document.body,"p-overflow-hidden"),this.mask=null)},e.prototype.onAnimationStart=function(e){switch(e.toState){case"visible":this.container=e.element,this.appendContainer(),this.show(),this.closeOnEscape&&this.bindDocumentEscapeListener();break;case"hidden":this.hide(),this.unbindGlobalListeners()}},e.prototype.appendContainer=function(){this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.container):o.DomHandler.appendChild(this.container,this.appendTo))},e.prototype.bindDocumentEscapeListener=function(){var e=this,t=this.el?this.el.nativeElement.ownerDocument:"document";this.documentEscapeListener=this.renderer.listen(t,"keydown",(function(t){27==t.which&&parseInt(e.container.style.zIndex)===o.DomHandler.zindex+e.baseZIndex&&e.close(t)}))},e.prototype.unbindDocumentEscapeListener=function(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)},e.prototype.unbindMaskClickListener=function(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)},e.prototype.unbindGlobalListeners=function(){this.unbindMaskClickListener(),this.unbindDocumentEscapeListener()},e.prototype.ngOnDestroy=function(){this.initialized=!1,this.visible&&this.hide(),this.appendTo&&this.el.nativeElement.appendChild(this.container),this.unbindGlobalListeners()},e}();l.decorators=[{type:t.Component,args:[{selector:"p-sidebar",template:'\n <div #container [ngClass]="{\'p-sidebar\':true, \'p-sidebar-active\': visible,\n \'p-sidebar-left\': (position === \'left\' && !fullScreen), \'p-sidebar-right\': (position === \'right\' && !fullScreen),\n \'p-sidebar-top\': (position === \'top\' && !fullScreen), \'p-sidebar-bottom\': (position === \'bottom\' && !fullScreen),\n \'p-sidebar-full\': fullScreen}" *ngIf="visible" [@panelState]="{value: \'visible\', params: {transform: transformOptions, transition: transitionOptions}}" (@panelState.start)="onAnimationStart($event)" [ngStyle]="style" [class]="styleClass" role="complementary" [attr.aria-modal]="modal">\n <div class="p-sidebar-content">\n <button type="button" class="p-sidebar-close p-link" *ngIf="showCloseIcon" (click)="close($event)" (keydown.enter)="close($event)" [attr.aria-label]="ariaCloseLabel" pRipple>\n <span class="p-sidebar-close-icon pi pi-times"></span>\n </button>\n <ng-content></ng-content>\n <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>\n </div>\n </div>\n ',animations:[i.trigger("panelState",[i.transition("void => visible",[i.useAnimation(a)]),i.transition("visible => void",[i.useAnimation(p)])])],changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,styles:[".p-sidebar{position:fixed;transition:transform .3s}.p-sidebar-content{position:relative}.p-sidebar-close{align-items:center;display:flex;justify-content:center;overflow:hidden;position:absolute;right:0;top:0}.p-sidebar-mask{background-color:transparent;transition-property:background-color}.p-sidebar-left{height:100%;left:0;top:0;width:20rem}.p-sidebar-right{height:100%;right:0;top:0;width:20rem}.p-sidebar-top{height:10rem;left:0;top:0;width:100%}.p-sidebar-bottom{bottom:0;height:10rem;left:0;width:100%}.p-sidebar-full{height:100%;left:0;top:0;transition:none;width:100%}.p-sidebar-left.p-sidebar-sm,.p-sidebar-right.p-sidebar-sm{width:20rem}.p-sidebar-left.p-sidebar-md,.p-sidebar-right.p-sidebar-md{width:40rem}.p-sidebar-left.p-sidebar-lg,.p-sidebar-right.p-sidebar-lg{width:60rem}.p-sidebar-bottom.p-sidebar-sm,.p-sidebar-top.p-sidebar-sm{height:10rem}.p-sidebar-bottom.p-sidebar-md,.p-sidebar-top.p-sidebar-md{height:20rem}.p-sidebar-bottom.p-sidebar-lg,.p-sidebar-top.p-sidebar-lg{height:30rem}@media screen and (max-width:64em){.p-sidebar-left.p-sidebar-lg,.p-sidebar-left.p-sidebar-md,.p-sidebar-right.p-sidebar-lg,.p-sidebar-right.p-sidebar-md{width:20rem}}"]}]}],l.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:t.ChangeDetectorRef}]},l.propDecorators={appendTo:[{type:t.Input}],blockScroll:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],ariaCloseLabel:[{type:t.Input}],autoZIndex:[{type:t.Input}],baseZIndex:[{type:t.Input}],modal:[{type:t.Input}],dismissible:[{type:t.Input}],showCloseIcon:[{type:t.Input}],closeOnEscape:[{type:t.Input}],transitionOptions:[{type:t.Input}],templates:[{type:t.ContentChildren,args:[r.PrimeTemplate]}],onShow:[{type:t.Output}],onHide:[{type:t.Output}],visibleChange:[{type:t.Output}],visible:[{type:t.Input}],position:[{type:t.Input}],fullScreen:[{type:t.Input}]};var d=function(){};d.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,s.RippleModule],exports:[l],declarations:[l]}]}],e.Sidebar=l,e.SidebarModule=d,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=primeng-sidebar.umd.min.js.map