import { Component, OnInit, Injector, ChangeDetectionStrategy } from "@angular/core"; import { InputBase } from "./input-base"; import { InlineTextConfig } from "../types/inline-configs"; @Component({ selector: "inline-editor-password", styleUrls: ["./input.component.css"], template: ``, changeDetection: ChangeDetectionStrategy.OnPush, }) export class InputPasswordComponent extends InputBase implements OnInit { constructor(injector: Injector) { super(injector); this.isRegexTestable = true; this.isLengthTestable = true; } public config: InlineTextConfig; public showText(): string { const isEmpty = this.state.isEmpty(); const value = String(this.state.getState().value); return isEmpty ? this.config.empty : "*".repeat(value.length); } }