<nz-table
  class="table-container"
  #rowSelectionTable
  [nzData]="data"
  [nzScroll]="{ y: 'calc(100vh - 29rem)' }"
>
  <thead
    (nzSortChange)="sort($event)"
  >
    <tr>
      <th nzWidth="62px"></th>
      <th nzShowSort nzSortKey="name">Name</th>
      <th nzWidth="200px" nzShowSort nzSortKey="updateon">Last</th>
    </tr>
  </thead>
  <tbody>
    <tr
      *ngFor="let data of rowSelectionTable.data"
      (dragstart)="onHandleDragStart($event, data)"
      (drop)="data.type === 1 ? dropFolderHandler($event, data) : null"
      (dragover)="data.type === 1 ? dragOverHandler($event, data) : null"
      (dragleave)="data.type === 1 ? dragLeaveHandler($event) : null"
    >
      <td
        nzShowCheckbox
        [(nzChecked)]="data._checked"
        [nzDisabled]="data.disabled"
        (nzCheckedChange)="onHandleChecked(data)"
      ></td>
      <td>
        <div
          class="td-type-name-wrap"
          *ngIf="data.type === 1"
        >
          <img
            class="p-icon"
            src="./assets/folder.png"
            (dblclick)="dbClickFolder(data)"
          />
          <span>
            <div class="p-name" [title]="data.name" *ngIf="!data._inEdit" (dblclick)="onUpdateName(data)">
              {{data.name}}
            </div>
            <input
              class="p-name-input"
              appAutofocusSelect
              *ngIf="data._inEdit"
              (blur)="onConfirmFolderName(data)"
              (keydown.enter)="onConfirmFolderName(data)"
              [(ngModel)]="data._name"/>
          </span>
          <img class="p-share-pic" *ngIf="isInLinkFolder" src="./assets/link_share.png" (dblclick)="dbClickFile(data)">
        </div>
        <div
          class="td-type-name-wrap"
          *ngIf="data.type === 2"
        >
          <img
            class="p-icon"
            src="./assets/cw.png"
            (dblclick)="dbClickFile(data)"
          />
          <span>
            <div class="p-name" title="{{data.name}}" *ngIf="!data._inEdit" (dblclick)="onUpdateName(data)">
              {{data.name}}
            </div>
            <input
              class="p-name-input"
              appAutofocusSelect
              *ngIf="data._inEdit"
              (blur)="onConfirmCoursewareName(data)"
              (keydown.enter)="onConfirmCoursewareName(data)"
              [(ngModel)]="data._name"/>
          </span>
          <img class="p-share-pic" *ngIf="isInLinkFolder" src="./assets/link_share.png" (dblclick)="dbClickFile(data)">
        </div>
      </td>
      <td>{{data.updateon | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
    </tr>
  </tbody>
</nz-table>
