Icard/angular-clarity-master(work.../node_modules/primeng/esm2022/terminal/terminal.mjs

143 lines
16 KiB
JavaScript

import { NgModule, Component, Input, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { DomHandler } from 'primeng/dom';
import * as i0 from "@angular/core";
import * as i1 from "./terminalservice";
import * as i2 from "@angular/common";
import * as i3 from "@angular/forms";
/**
* Terminal is a text based user interface.
* @group Components
*/
export class Terminal {
el;
terminalService;
cd;
/**
* Initial text to display on terminal.
* @group Props
*/
welcomeMessage;
/**
* Prompt text for each command.
* @group Props
*/
prompt;
/**
* Inline style of the component.
* @group Props
*/
style;
/**
* Style class of the component.
* @group Props
*/
styleClass;
commands = [];
command;
container;
commandProcessed;
subscription;
constructor(el, terminalService, cd) {
this.el = el;
this.terminalService = terminalService;
this.cd = cd;
this.subscription = terminalService.responseHandler.subscribe((response) => {
this.commands[this.commands.length - 1].response = response;
this.commandProcessed = true;
});
}
ngAfterViewInit() {
this.container = DomHandler.find(this.el.nativeElement, '.p-terminal')[0];
}
ngAfterViewChecked() {
if (this.commandProcessed) {
this.container.scrollTop = this.container.scrollHeight;
this.commandProcessed = false;
}
}
set response(value) {
if (value) {
this.commands[this.commands.length - 1].response = value;
this.commandProcessed = true;
}
}
handleCommand(event) {
if (event.keyCode == 13) {
this.commands.push({ text: this.command });
this.terminalService.sendCommand(this.command);
this.command = '';
}
}
focus(element) {
element.focus();
}
ngOnDestroy() {
if (this.subscription) {
this.subscription.unsubscribe();
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Terminal, deps: [{ token: i0.ElementRef }, { token: i1.TerminalService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: Terminal, selector: "p-terminal", inputs: { welcomeMessage: "welcomeMessage", prompt: "prompt", style: "style", styleClass: "styleClass", response: "response" }, host: { classAttribute: "p-element" }, ngImport: i0, template: `
<div [ngClass]="'p-terminal p-component'" [ngStyle]="style" [class]="styleClass" (click)="focus(in)">
<div *ngIf="welcomeMessage">{{ welcomeMessage }}</div>
<div class="p-terminal-content">
<div *ngFor="let command of commands">
<span class="p-terminal-prompt">{{ prompt }}</span>
<span class="p-terminal-command">{{ command.text }}</span>
<div class="p-terminal-response" [attr.aria-live]="'polite'">{{ command.response }}</div>
</div>
</div>
<div class="p-terminal-prompt-container">
<span class="p-terminal-content-prompt">{{ prompt }}</span>
<input #in type="text" [(ngModel)]="command" class="p-terminal-input" autocomplete="off" (keydown)="handleCommand($event)" autofocus />
</div>
</div>
`, isInline: true, styles: ["@layer primeng{.p-terminal{height:18rem;overflow:auto}.p-terminal-prompt-container{display:flex;align-items:center}.p-terminal-input{flex:1 1 auto;border:0 none;background-color:transparent;color:inherit;padding:0;outline:0 none}.p-terminal-input::-ms-clear{display:none}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Terminal, decorators: [{
type: Component,
args: [{ selector: 'p-terminal', template: `
<div [ngClass]="'p-terminal p-component'" [ngStyle]="style" [class]="styleClass" (click)="focus(in)">
<div *ngIf="welcomeMessage">{{ welcomeMessage }}</div>
<div class="p-terminal-content">
<div *ngFor="let command of commands">
<span class="p-terminal-prompt">{{ prompt }}</span>
<span class="p-terminal-command">{{ command.text }}</span>
<div class="p-terminal-response" [attr.aria-live]="'polite'">{{ command.response }}</div>
</div>
</div>
<div class="p-terminal-prompt-container">
<span class="p-terminal-content-prompt">{{ prompt }}</span>
<input #in type="text" [(ngModel)]="command" class="p-terminal-input" autocomplete="off" (keydown)="handleCommand($event)" autofocus />
</div>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
class: 'p-element'
}, styles: ["@layer primeng{.p-terminal{height:18rem;overflow:auto}.p-terminal-prompt-container{display:flex;align-items:center}.p-terminal-input{flex:1 1 auto;border:0 none;background-color:transparent;color:inherit;padding:0;outline:0 none}.p-terminal-input::-ms-clear{display:none}}\n"] }]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.TerminalService }, { type: i0.ChangeDetectorRef }], propDecorators: { welcomeMessage: [{
type: Input
}], prompt: [{
type: Input
}], style: [{
type: Input
}], styleClass: [{
type: Input
}], response: [{
type: Input
}] } });
export class TerminalModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TerminalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: TerminalModule, declarations: [Terminal], imports: [CommonModule, FormsModule], exports: [Terminal] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TerminalModule, imports: [CommonModule, FormsModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: TerminalModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule, FormsModule],
exports: [Terminal],
declarations: [Terminal]
}]
}] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVybWluYWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvdGVybWluYWwvdGVybWluYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxTQUFTLEVBQThDLEtBQUssRUFBYyx1QkFBdUIsRUFBRSxpQkFBaUIsRUFBcUIsTUFBTSxlQUFlLENBQUM7QUFDbEwsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sYUFBYSxDQUFDOzs7OztBQUd6Qzs7O0dBR0c7QUEwQkgsTUFBTSxPQUFPLFFBQVE7SUFnQ0U7SUFBdUI7SUFBeUM7SUEvQm5GOzs7T0FHRztJQUNNLGNBQWMsQ0FBcUI7SUFDNUM7OztPQUdHO0lBQ00sTUFBTSxDQUFxQjtJQUNwQzs7O09BR0c7SUFDTSxLQUFLLENBQThDO0lBQzVEOzs7T0FHRztJQUNNLFVBQVUsQ0FBcUI7SUFFeEMsUUFBUSxHQUFVLEVBQUUsQ0FBQztJQUVyQixPQUFPLENBQVU7SUFFakIsU0FBUyxDQUFXO0lBRXBCLGdCQUFnQixDQUFXO0lBRTNCLFlBQVksQ0FBZTtJQUUzQixZQUFtQixFQUFjLEVBQVMsZUFBZ0MsRUFBUyxFQUFxQjtRQUFyRix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