Skip to content

Commit

Permalink
fix(module:upload): fix deprecated icon class property (#3230)
Browse files Browse the repository at this point in the history
close #3228
  • Loading branch information
cipchk authored and vthinkxie committed Apr 17, 2019
1 parent 87f2386 commit bc4e7da
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/upload/demo/avatar.ts
Expand Up @@ -15,7 +15,7 @@ import { Observable, Observer } from 'rxjs';
(nzChange)="handleChange($event)"
>
<ng-container *ngIf="!avatarUrl">
<i class="upload-icon" nz-icon [type]="loading ? 'loading' : 'plus'"></i>
<i class="upload-icon" nz-icon [nzType]="loading ? 'loading' : 'plus'"></i>
<div class="ant-upload-text">Upload</div>
</ng-container>
<img *ngIf="avatarUrl" [src]="avatarUrl" class="avatar" />
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/basic.ts
Expand Up @@ -4,7 +4,7 @@ import { Component } from '@angular/core';
selector: 'nz-demo-upload-basic',
template: `
<nz-upload nzAction="https://jsonplaceholder.typicode.com/posts/">
<button nz-button><i nz-icon type="upload"></i><span>Click to Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Click to Upload</span></button>
</nz-upload>
`
})
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/custom-request.ts
Expand Up @@ -7,7 +7,7 @@ import { forkJoin } from 'rxjs';
selector: 'nz-demo-upload-custom-request',
template: `
<nz-upload nzAction="https://jsonplaceholder.typicode.com/posts/" [nzCustomRequest]="customReq">
<button nz-button><i nz-icon type="upload"></i><span>Click to Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Click to Upload</span></button>
</nz-upload>
`
})
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/directory.ts
Expand Up @@ -4,7 +4,7 @@ import { Component } from '@angular/core';
selector: 'nz-demo-upload-directory',
template: `
<nz-upload nzAction="https://jsonplaceholder.typicode.com/posts/" nzDirectory>
<button nz-button><i nz-icon type="upload"></i> Upload Directory</button>
<button nz-button><i nz-icon nzType="upload"></i> Upload Directory</button>
</nz-upload>
`
})
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/drag.ts
Expand Up @@ -12,7 +12,7 @@ import { NzMessageService } from 'ng-zorro-antd';
(nzChange)="handleChange($event)"
>
<p class="ant-upload-drag-icon">
<i nz-icon type="inbox"></i>
<i nz-icon nzType="inbox"></i>
</p>
<p class="ant-upload-text">Click or drag file to this area to upload</p>
<p class="ant-upload-hint">
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/file-list.ts
Expand Up @@ -4,7 +4,7 @@ import { Component } from '@angular/core';
selector: 'nz-demo-upload-file-list',
template: `
<nz-upload nzAction="https://jsonplaceholder.typicode.com/posts/" [nzFileList]="fileList">
<button nz-button><i nz-icon type="upload"></i><span>Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
`
})
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/filter.ts
Expand Up @@ -13,7 +13,7 @@ import { Observable, Observer } from 'rxjs';
[nzFilter]="filters"
(nzChange)="handleChange($event)"
>
<button nz-button><i nz-icon type="upload"></i><span>Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
`
})
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/manually.ts
Expand Up @@ -7,7 +7,7 @@ import { filter } from 'rxjs/operators';
selector: 'nz-demo-upload-manually',
template: `
<nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">
<button nz-button><i nz-icon type="upload"></i><span>Select File</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Select File</span></button>
</nz-upload>
<button
nz-button
Expand Down
2 changes: 1 addition & 1 deletion components/upload/demo/picture-card.ts
Expand Up @@ -13,7 +13,7 @@ import { UploadFile } from 'ng-zorro-antd';
[nzShowUploadList]="showUploadList"
[nzPreview]="handlePreview"
>
<i nz-icon type="plus"></i>
<i nz-icon nzType="plus"></i>
<div class="ant-upload-text">Upload</div>
</nz-upload>
<nz-modal
Expand Down
4 changes: 2 additions & 2 deletions components/upload/demo/picture-style.ts
Expand Up @@ -5,7 +5,7 @@ import { Component } from '@angular/core';
template: `
<div class="clearfix">
<nz-upload nzAction="https://jsonplaceholder.typicode.com/posts/" nzListType="picture" [(nzFileList)]="fileList1">
<button nz-button><i nz-icon type="upload"></i><span>Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
</div>
<br /><br />
Expand All @@ -17,7 +17,7 @@ import { Component } from '@angular/core';
[(nzFileList)]="fileList2"
>
<button nz-button>
<span><i nz-icon type="upload"></i> Upload</span>
<span><i nz-icon nzType="upload"></i> Upload</span>
</button>
</nz-upload>
</div>
Expand Down
12 changes: 6 additions & 6 deletions components/upload/nz-upload-list.component.html
Expand Up @@ -5,7 +5,7 @@
</ng-container>
<ng-template #thumbUrlCheck>
<i *ngIf="!file.thumbUrl && !file.url; else thumbTpl"
class="ant-upload-list-item-thumbnail" nz-icon type="picture" theme="twotone"></i>
class="ant-upload-list-item-thumbnail" nz-icon nzType="picture" theme="twotone"></i>
</ng-template>
<ng-template #thumbTpl>
<a class="ant-upload-list-item-thumbnail" target="_blank" rel="noopener noreferrer"
Expand All @@ -14,8 +14,8 @@
<img *ngIf="isImageUrl(file); else noThumbTpl" [src]="file.thumbUrl || file.url" [attr.alt]="file.name" />
</a>
</ng-template>
<ng-template #noThumbTpl><i class="ant-upload-list-item-icon" nz-icon type="file" theme="twotone"></i></ng-template>
<ng-template #noPicTpl><i nz-icon [type]="file.status === 'uploading' ? 'loading' : 'paper-clip'"></i></ng-template>
<ng-template #noThumbTpl><i class="ant-upload-list-item-icon" nz-icon nzType="file" theme="twotone"></i></ng-template>
<ng-template #noPicTpl><i nz-icon [nzType]="file.status === 'uploading' ? 'loading' : 'paper-clip'"></i></ng-template>
</ng-template>
<ng-template #preview>
<ng-container *ngIf="file.url; else prevText">
Expand Down Expand Up @@ -43,13 +43,13 @@
title="{{ locale.previewFile }}"
[ngStyle]="!(file.url || file.thumbUrl) && {'opacity': .5, 'pointer-events': 'none'}"
(click)="handlePreview(file, $event)">
<i nz-icon type="eye-o"></i>
<i nz-icon nzType="eye-o"></i>
</a>
<i *ngIf="icons.showRemoveIcon" (click)="handleRemove(file, $event)" class="anticon anticon-delete" title="{{ locale.removeFile }}"></i>
<i *ngIf="icons.showRemoveIcon" (click)="handleRemove(file, $event)" nz-icon nzType="delete" title="{{ locale.removeFile }}"></i>
</span>
</ng-container>
<ng-template #close>
<i *ngIf="icons.showRemoveIcon" (click)="handleRemove(file, $event)" nz-icon type="close" title="{{ locale.removeFile }}"></i>
<i *ngIf="icons.showRemoveIcon" (click)="handleRemove(file, $event)" nz-icon nzType="close" title="{{ locale.removeFile }}"></i>
</ng-template>
<div *ngIf="file.status === 'uploading'" class="ant-upload-list-item-progress">
<nz-progress [nzPercent]="file.percent" [nzShowInfo]="false" [nzStrokeWidth]="2"></nz-progress>
Expand Down
2 changes: 1 addition & 1 deletion components/upload/upload.spec.ts
Expand Up @@ -1274,7 +1274,7 @@ describe('upload', () => {
(nzFileListChange)="nzFileListChange($event)"
(nzChange)="nzChange($event)"
>
<button nz-button><i nz-icon type="upload"></i><span>Click to Upload</span></button>
<button nz-button><i nz-icon nzType="upload"></i><span>Click to Upload</span></button>
</nz-upload>
`
})
Expand Down

0 comments on commit bc4e7da

Please sign in to comment.