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

2 lines
3.7 KiB
JavaScript

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common"),require("primeng/dom"),require("rxjs")):"function"==typeof define&&define.amd?define("primeng/terminal",["exports","@angular/core","@angular/forms","@angular/common","primeng/dom","rxjs"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.terminal={}),e.ng.core,e.ng.forms,e.ng.common,e.primeng.dom,e.rxjs)}(this,(function(e,n,t,o,s,r){"use strict";var i=function(){function e(){this.commandSource=new r.Subject,this.responseSource=new r.Subject,this.commandHandler=this.commandSource.asObservable(),this.responseHandler=this.responseSource.asObservable()}return e.prototype.sendCommand=function(e){e&&this.commandSource.next(e)},e.prototype.sendResponse=function(e){e&&this.responseSource.next(e)},e}();i.decorators=[{type:n.Injectable}];var a=function(){function e(e,n,t){var o=this;this.el=e,this.terminalService=n,this.cd=t,this.commands=[],this.subscription=n.responseHandler.subscribe((function(e){o.commands[o.commands.length-1].response=e,o.commandProcessed=!0}))}return e.prototype.ngAfterViewInit=function(){this.container=s.DomHandler.find(this.el.nativeElement,".p-terminal")[0]},e.prototype.ngAfterViewChecked=function(){this.commandProcessed&&(this.container.scrollTop=this.container.scrollHeight,this.commandProcessed=!1)},Object.defineProperty(e.prototype,"response",{set:function(e){e&&(this.commands[this.commands.length-1].response=e,this.commandProcessed=!0)},enumerable:!1,configurable:!0}),e.prototype.handleCommand=function(e){13==e.keyCode&&(this.commands.push({text:this.command}),this.terminalService.sendCommand(this.command),this.command="")},e.prototype.focus=function(e){e.focus()},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},e}();a.decorators=[{type:n.Component,args:[{selector:"p-terminal",template:'\n <div [ngClass]="\'p-terminal p-component\'" [ngStyle]="style" [class]="styleClass" (click)="focus(in)">\n <div *ngIf="welcomeMessage">{{welcomeMessage}}</div>\n <div class="p-terminal-content">\n <div *ngFor="let command of commands">\n <span class="p-terminal-prompt">{{prompt}}</span>\n <span class="p-terminal-command">{{command.text}}</span>\n <div class="p-terminal-response">{{command.response}}</div>\n </div>\n </div>\n <div class="p-terminal-prompt-container">\n <span class="p-terminal-content-prompt">{{prompt}}</span>\n <input #in type="text" [(ngModel)]="command" class="p-terminal-input" autocomplete="off" (keydown)="handleCommand($event)" autofocus>\n </div>\n </div>\n ',changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None,styles:[".p-terminal{height:18rem;overflow:auto}.p-terminal-prompt-container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}.p-terminal-input{-ms-flex:1 1 auto;background-color:rgba(0,0,0,0);border:0;color:inherit;flex:1 1 auto;outline:0 none;padding:0}.p-terminal-input::-ms-clear{display:none}"]}]}],a.ctorParameters=function(){return[{type:n.ElementRef},{type:i},{type:n.ChangeDetectorRef}]},a.propDecorators={welcomeMessage:[{type:n.Input}],prompt:[{type:n.Input}],style:[{type:n.Input}],styleClass:[{type:n.Input}],response:[{type:n.Input}]};var m=function(){};m.decorators=[{type:n.NgModule,args:[{imports:[o.CommonModule,t.FormsModule],exports:[a],declarations:[a]}]}],e.Terminal=a,e.TerminalModule=m,e.TerminalService=i,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=primeng-terminal.umd.min.js.map