Browse Source

UI: Add input placeholder

pull/6650/head
fe-dev 4 years ago
parent
commit
8bccd857eb
  1. 6
      ui-ngx/src/app/modules/home/pages/security/authentication-dialog/sms-auth-dialog.component.html
  2. 4
      ui-ngx/src/app/shared/components/phone-input.component.html
  3. 1
      ui-ngx/src/app/shared/components/phone-input.component.ts

6
ui-ngx/src/app/modules/home/pages/security/authentication-dialog/sms-auth-dialog.component.html

@ -37,7 +37,11 @@
<form [formGroup]="smsConfigForm" (ngSubmit)="nextStep()">
<p class="mat-body step-description input" translate>security.2fa.dialog.sms-step-description</p>
<div fxLayout="row" fxLayoutAlign="space-between center" fxLayoutGap="8px">
<tb-phone-input fxFlex formControlName="phone" [floatLabel]="'never'"></tb-phone-input>
<tb-phone-input fxFlex
formControlName="phone"
[floatLabel]="'never'"
[placeholder]="'security.2fa.dialog.sms-step-label'">
</tb-phone-input>
<button mat-raised-button
type="submit"
color="primary"

4
ui-ngx/src/app/shared/components/phone-input.component.html

@ -28,12 +28,12 @@
</mat-select>
</div>
<mat-form-field class="phone-input" [appearance]="appearance" [floatLabel]="floatLabel">
<mat-label translate>security.2fa.dialog.sms-step-label</mat-label>
<mat-label>{{ placeholder | translate }}</mat-label>
<input
formControlName="phoneNumber"
type="tel"
matInput
placeholder="{{ 'security.2fa.dialog.sms-step-label' | translate }}"
placeholder="{{ placeholder | translate }}"
[pattern]="phoneNumberPattern"
(focus)="focus()"
autocomplete="off"

1
ui-ngx/src/app/shared/components/phone-input.component.ts

@ -61,6 +61,7 @@ export class PhoneInputComponent implements OnInit, ControlValueAccessor, Valida
@Input() required = true;
@Input() floatLabel: FloatLabelType = 'always';
@Input() appearance: MatFormFieldAppearance = 'legacy';
@Input() placeholder = 'phone-input.phone-input-label';
allCountries: Array<Country> = this.countryCodeData.allCountries;
phonePlaceholder: string;

Loading…
Cancel
Save