LP1953181 Adds optional LabelText to eg-combobox
authorTiffany Little <tlittle@georgialibraries.org>
Thu, 29 Dec 2022 21:04:12 +0000 (16:04 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 4 Jan 2023 15:22:06 +0000 (10:22 -0500)
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.html
Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts

index e498670..c5c53cf 100644 (file)
   </ng-container>
 </ng-container>
 
+<div class="input-group">
+<ng-container *ngIf="labelText">
+<div class="input-group-prepend">
+    <span class="input-group-text">{{labelText}}</span>
+    </div>
+</ng-container>
 <ng-container *ngIf="!readOnly">
-  <div class="d-flex">
+  <span class="d-flex">
     <input type="text" 
       class="form-control"
       [id]="domId"
@@ -43,5 +49,6 @@
       <span class="material-icons">keyboard_arrow_up</span>
       <span class="material-icons">keyboard_arrow_down</span>
     </div>
-  </div>
+  </span>
 </ng-container>
+</div>
index 735f44a..a7e3eb3 100644 (file)
@@ -64,6 +64,8 @@ export class ComboboxComponent
 
     // Applies a name attribute to the input.
     // Useful in forms.
+    @Input() labelText = '';
+    
     @Input() name: string;
 
     // Placeholder text for selector input