<h2 mat-dialog-title>{{ titleForm }}</h2>
<mat-progress-bar mode="indeterminate" *ngIf="isLoadingForm"></mat-progress-bar>
<mat-dialog-content [formGroup]="formGroup">
  <div>
    <div style="height: 82px; padding-top: 5px;">
      <mat-form-field appearance="outline" class="w-100">
        <mat-label> Descripción del Documento </mat-label>
        <input matInput formControlName="DESCRIPCION" />
        <mat-error *ngIf="DESCRIPCION.hasError('required')"> El campo Descripción es Obligatorio </mat-error>
      </mat-form-field>
    </div>
    <div style="height: 82px; padding-top: 5px;">
      <mat-form-field appearance="outline" class="w-100">
        <mat-label> Tipo de Documento </mat-label>
        <mat-select formControlName="TIPO" (ngModelChange)="selectedTypeDocument()">
          <mat-option *ngFor="let typeDocument of elementDialog.arrTypeDocuments" [value]="typeDocument">
            {{ typeDocument.TIDO_TIPO }}
          </mat-option>
        </mat-select>
        <mat-error *ngIf="TIPO.hasError('required')"> El campo Tipo de Documento es Obligatorio </mat-error>
      </mat-form-field>
    </div>
    <div [ngClass]=" !inputFileDisable ? 'input-file' : 'input-file-disable' " (click)="getFile()">
      <mat-icon matSuffix style="margin-right: 5px;">file_upload </mat-icon>
      <span> {{  resourcesService.resizeText(labelDocument, 27) }} </span>
      <input id="upfile" type="file" (change)="loadDocument($event)" [accept]="documentExtension" />
    </div>
  </div>
</mat-dialog-content>
<mat-dialog-actions align="end">
  <button mat-button mat-dialog-close cdkFocusInitial>Cancelar</button>
  <button mat-button [disabled]="formGroup.invalid" (click)="alert()">Guardar</button>
</mat-dialog-actions>
