LP1904036 Date select fill container option
authorBill Erickson <berickxx@gmail.com>
Fri, 19 Mar 2021 16:40:36 +0000 (12:40 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:27 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css
Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts

index 6c31a77..07ce23f 100644 (file)
@@ -2,7 +2,8 @@
   {{initialDate | formatValue:'timestamp'}}
 </ng-container>
 <ng-container *ngIf="!readOnly">
-  <div class="input-group eg-date-select form-validated">
+  <div class="input-group eg-date-select form-validated" 
+    [ngClass]="{'date-select-width': !noMaxWidth}">
     <input 
       class="form-control"
       type="text"
index bd6e681..6d9e62d 100644 (file)
@@ -30,6 +30,10 @@ export class DateSelectComponent implements OnInit, ControlValueAccessor {
     @Input() disabled: boolean;
     @Input() readOnly: boolean;
 
+    // Sometimes it's helpful to allow the date selector to expand
+    // to fill its container for visual consistency with other inputs.
+    @Input() noMaxWidth = false;
+
     current: NgbDateStruct;
 
     @Output() onChangeAsDate: EventEmitter<Date>;