Browse Source
Merge pull request #7475 from engix-ltd/timezone_and_entity_appearance
[3.4.2] UI: Form field appearance in timezone and entity autocomplete components
pull/7592/head
Igor Kulikov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
10 additions and
2 deletions
-
ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.html
-
ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.ts
-
ui-ngx/src/app/shared/components/time/timezone-select.component.html
-
ui-ngx/src/app/shared/components/time/timezone-select.component.ts
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
limitations under the License. |
|
|
|
|
|
|
|
--> |
|
|
|
<mat-form-field [formGroup]="selectEntityFormGroup" class="mat-block"> |
|
|
|
<mat-form-field [formGroup]="selectEntityFormGroup" class="mat-block" [appearance]="appearance"> |
|
|
|
<input matInput type="text" placeholder="{{ entityText | translate }}" |
|
|
|
#entityInput |
|
|
|
formControlName="entity" |
|
|
|
|
|
|
|
@ -25,6 +25,7 @@ import { |
|
|
|
Output, |
|
|
|
ViewChild |
|
|
|
} from '@angular/core'; |
|
|
|
import { MatFormFieldAppearance } from '@angular/material/form-field/form-field'; |
|
|
|
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; |
|
|
|
import { merge, Observable, of, Subject } from 'rxjs'; |
|
|
|
import { catchError, debounceTime, map, share, switchMap, tap } from 'rxjs/operators'; |
|
|
|
@ -96,6 +97,9 @@ export class EntityAutocompleteComponent implements ControlValueAccessor, OnInit |
|
|
|
@Input() |
|
|
|
requiredText: string; |
|
|
|
|
|
|
|
@Input() |
|
|
|
appearance: MatFormFieldAppearance = 'legacy'; |
|
|
|
|
|
|
|
private requiredValue: boolean; |
|
|
|
get required(): boolean { |
|
|
|
return this.requiredValue; |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
limitations under the License. |
|
|
|
|
|
|
|
--> |
|
|
|
<mat-form-field [formGroup]="selectTimezoneFormGroup" fxFlex class="mat-block"> |
|
|
|
<mat-form-field [formGroup]="selectTimezoneFormGroup" fxFlex class="mat-block" [appearance]="appearance"> |
|
|
|
<mat-label translate>timezone.timezone</mat-label> |
|
|
|
<input matInput type="text" placeholder="{{ 'timezone.select-timezone' | translate }}" |
|
|
|
#timezoneInput |
|
|
|
|
|
|
|
@ -16,6 +16,7 @@ |
|
|
|
|
|
|
|
import { AfterViewInit, Component, forwardRef, Input, NgZone, OnInit, ViewChild } from '@angular/core'; |
|
|
|
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; |
|
|
|
import { MatFormFieldAppearance } from '@angular/material/form-field/form-field'; |
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
import { map, mergeMap, share, tap } from 'rxjs/operators'; |
|
|
|
import { Store } from '@ngrx/store'; |
|
|
|
@ -44,6 +45,9 @@ export class TimezoneSelectComponent implements ControlValueAccessor, OnInit, Af |
|
|
|
|
|
|
|
defaultTimezoneId: string = null; |
|
|
|
|
|
|
|
@Input() |
|
|
|
appearance: MatFormFieldAppearance = 'legacy'; |
|
|
|
|
|
|
|
@Input() |
|
|
|
set defaultTimezone(timezone: string) { |
|
|
|
if (this.defaultTimezoneId !== timezone) { |
|
|
|
|