From f8b530e0a523a0d9ff469ef716838374c395a360 Mon Sep 17 00:00:00 2001
From: Rigel Kent <sendmemail@rigelk.eu>
Date: Fri, 4 Dec 2020 15:58:55 +0100
Subject: unify inputs requiring buttons like password inputs

---
 .../shared/shared-forms/input-toggle-hidden.component.html  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 client/src/app/shared/shared-forms/input-toggle-hidden.component.html

(limited to 'client/src/app/shared/shared-forms/input-toggle-hidden.component.html')

diff --git a/client/src/app/shared/shared-forms/input-toggle-hidden.component.html b/client/src/app/shared/shared-forms/input-toggle-hidden.component.html
new file mode 100644
index 000000000..f59dc6215
--- /dev/null
+++ b/client/src/app/shared/shared-forms/input-toggle-hidden.component.html
@@ -0,0 +1,13 @@
+<div class="input-group input-group-sm">
+  <input [id]="id" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [(ngModel)]="value" (ngModelChange)="update()" [ngClass]="{ 'readonly': readonly }" [readonly]="readonly"
+         #input (click)="input.select()" (input)="update()" (change)="update()" [type]="inputType" class="form-control" />
+
+  <div *ngIf="withToggle || withCopy" class="input-group-append">
+    <button *ngIf="withToggle" (click)="toggle()" type="button" class="btn btn-outline-secondary" [title]="toggleTitle">
+      <span class="glyphicon glyphicon-eye-{{ show ? 'open' : 'close' }}"></span>
+    </button>
+    <button *ngIf="withCopy" [cdkCopyToClipboard]="input.value" (click)="activateCopiedMessage()" type="button" class="btn btn-outline-secondary" i18n-title title="Copy">
+      <span class="glyphicon glyphicon-copy"></span>
+    </button>
+  </div>
+</div>
-- 
cgit v1.2.3