
<h1 mat-dialog-title class="prevent-select">Contratos del empleado {{ employee.EMPLOYEE }}</h1>
<div mat-dialog-content class="prevent-select">
  <div class="is-loading animated fadeIn fast" *ngIf="isLoading">
    <mat-spinner align="center"></mat-spinner>
    <h3>Cargando datos ...</h3>
  </div>
  <div class="has-error animated fadeIn pt-64" *ngIf="!isLoading && hasError">
    <mat-icon class="red_primary_font">error</mat-icon>
    <h2>{{ errorStr }}</h2>
  </div>
  <mat-form-field appearance="outline" class="w-100 mt-8" *ngIf="!isLoading && !hasError">
    <mat-label>Buscador</mat-label>
    <input matInput [(ngModel)]="txtBuscador" (keyup)="applyFilter($event,'INP')" placeholder="Ingrese la palabra a buscar" />
    <mat-icon *ngIf="txtBuscador.length === 0" matSuffix>search</mat-icon>
    <mat-icon *ngIf="txtBuscador.length> 0" class="clickable" matTooltip="Eliminar filtro" 
    (click)="applyFilter('', 'EST')" matSuffix>close</mat-icon>
  </mat-form-field>
  <div class="animated fadeIn" [ngClass]="{ table_dialog_details_column: !isLoading && !hasError, hidden: isLoading }">
    <table mat-table [dataSource]="dataSource" matSort class="animated fadeIn">
      <ng-container matColumnDef="CONTRACT_NAME">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Nombre de Contrato</th>
        <td mat-cell *matCellDef="let element">{{ element.CONTRACT_NAME }}</td>
      </ng-container>
      <ng-container matColumnDef="START_DATE">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Fecha de Inicio</th>
        <td mat-cell *matCellDef="let element">{{ element.START_DATE }}</td>
      </ng-container>
      <ng-container matColumnDef="END_DATE">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Fecha de Término</th>
        <td mat-cell *matCellDef="let element">{{ element.END_DATE }}</td>
      </ng-container>
      <ng-container matColumnDef="CONTRACT_COST">
        <th mat-header-cell *matHeaderCellDef mat-sort-header>Valor del Contrato</th>
        <td mat-cell *matCellDef="let element">${{ element.COST }}</td>
      </ng-container>
      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
      <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
      <tr class="mat-row" *matNoDataRow>
        <td class="mat-cell p-20 align-center" colspan="12">
          <object data="assets/img/empty_data.svg" width="300"></object>
          <h2>Sin datos</h2>
        </td>
      </tr>
    </table>
  </div>
</div>
<div mat-dialog-actions align="end">
  <button mat-button mat-dialog-close>Cerrar</button>
</div>