Skip to content

Commit 7cd08ae

Browse files
feat(module:upload): support standalone component (#8203)
* feat(module:upload): support standalone component * feat(module:upload): support standalone component * feat(module:upload): support standalone component
1 parent d7e387f commit 7cd08ae

7 files changed

Lines changed: 116 additions & 103 deletions

File tree

‎components/upload/doc/index.en-US.md‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,39 @@ import { NzUploadModule } from 'ng-zorro-antd/upload';
2323

2424
> You can consult [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload/wiki) about how to implement server-side upload interface.
2525
26-
### nz-upload
27-
28-
| Property | Description | Type | Default |
29-
| --- | --- | --- | --- |
30-
| `[nzAccept]` | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | `string` | - |
31-
| `[nzAction]` | Required. Uploading URL | `string \| ((file: NzUploadFile) => string \| Observable<string>)` | - |
32-
| `[nzDirectory]` | support uploading the whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | `boolean` | `false` |
33-
| `[nzBeforeUpload]` | Hook function, which will be executed before uploading. Uploading will be stopped with `false` or an Observable. **Warning: this function is not supported in IE9**. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile, fileList: NzUploadFile[]) => boolean \| Observable<boolean>` | - |
34-
| `[nzCustomRequest]` | Override for the default XHR behavior allowing for additional customization and the ability to implement your own XMLHttpRequest. NOTICE: Must use `=>` to define the method. | `(item) => Subscription` | - |
35-
| `[nzData]` | Uploading params or function which can return uploading params. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
36-
| `[nzDisabled]` | disable upload button | `boolean` | `false` |
37-
| `[nzFileList]` | List of files, two-way data-binding | `NzUploadFile[]` | - |
38-
| `[nzLimit]` | limit single upload count when `nzMultiple` has opened. `0` unlimited | `number` | `0` |
39-
| `[nzSize]` | limit file size (KB). `0` unlimited | `number` | `0` |
40-
| `[nzFileType]` | limit file type, e.g: `image/png,image/jpeg,image/gif,image/bmp` | `string` | - |
41-
| `[nzFilter]` | Custom filter when choosed file | `UploadFilter[]` | - |
42-
| `[nzHeaders]` | Set request headers, valid above IE10. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
43-
| `[nzListType]` | Built-in stylesheets, support for three types: `text`, `picture` or `picture-card` | `'text' \| 'picture' \| 'picture-card'` | `'text'` |
44-
| `[nzMultiple]` | Whether to support selected multiple files. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | `boolean` | `false` |
45-
| `[nzName]` | The name of the uploading file | `string` | `'file'` |
46-
| `[nzShowUploadList]` | Whether to show the default upload list, could be an object to specify `showPreviewIcon`, `showRemoveIcon` and `showDownloadIcon` individually | `boolean \| { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean }` | `true` |
47-
| `[nzShowButton]` | Show upload button | `boolean` | `true` |
48-
| `[nzWithCredentials]` | ajax upload with cookie sent | `boolean` | `false` |
49-
| `[nzOpenFileDialogOnClick]` | click open file dialog | `boolean` | `true` |
50-
| `[nzPreview]` | A callback function will be executed when the file link or preview icon is clicked. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => void` | - |
51-
| `[nzPreviewFile]` | Customize preview file logic. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => Observable<dataURL: string>` | - |
52-
| `[nzPreviewIsImage]` | Customize the preview file is an image, generally used when the image URL is in a non-standard format. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean` | - |
53-
| `[nzRemove]` | A callback function will be executed when the removing file button is clicked, remove event will be prevented when the return value is `false` or an Observable. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean \| Observable<boolean>` | - |
54-
| `(nzChange)` | A callback function, can be executed when uploading state is changing | `EventEmitter<NzUploadChangeParam>` | - |
55-
| `[nzDownload]` | Click the method to download the file, pass the method to perform the method logic, do not pass the default jump to the new TAB. | `(file: NzUploadFile) => void` | Jump to new TAB |
56-
| `[nzTransformFile]` | Customize transform file before request | `(file: NzUploadFile) => NzUploadTransformFileType` | - |
57-
| `[nzIconRender]` | Custom show icon | `TemplateRef<{ $implicit: NzUploadFile }>` | - |
58-
| `[nzFileListRender]` | Custom file list | `TemplateRef<{ $implicit: NzUploadFile[] }>` | - |
26+
### nz-upload:standalone
27+
28+
| Property | Description | Type | Default |
29+
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------- |
30+
| `[nzAccept]` | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | `string` | - |
31+
| `[nzAction]` | Required. Uploading URL | `string \| ((file: NzUploadFile) => string \| Observable<string>)` | - |
32+
| `[nzDirectory]` | support uploading the whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | `boolean` | `false` |
33+
| `[nzBeforeUpload]` | Hook function, which will be executed before uploading. Uploading will be stopped with `false` or an Observable. **Warning: this function is not supported in IE9**. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile, fileList: NzUploadFile[]) => boolean \| Observable<boolean>` | - |
34+
| `[nzCustomRequest]` | Override for the default XHR behavior allowing for additional customization and the ability to implement your own XMLHttpRequest. NOTICE: Must use `=>` to define the method. | `(item) => Subscription` | - |
35+
| `[nzData]` | Uploading params or function which can return uploading params. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
36+
| `[nzDisabled]` | disable upload button | `boolean` | `false` |
37+
| `[nzFileList]` | List of files, two-way data-binding | `NzUploadFile[]` | - |
38+
| `[nzLimit]` | limit single upload count when `nzMultiple` has opened. `0` unlimited | `number` | `0` |
39+
| `[nzSize]` | limit file size (KB). `0` unlimited | `number` | `0` |
40+
| `[nzFileType]` | limit file type, e.g: `image/png,image/jpeg,image/gif,image/bmp` | `string` | - |
41+
| `[nzFilter]` | Custom filter when choosed file | `UploadFilter[]` | - |
42+
| `[nzHeaders]` | Set request headers, valid above IE10. NOTICE: Must use `=>` to define the method. | `Object \| ((file: NzUploadFile) => Object \| Observable<{}>)` | - |
43+
| `[nzListType]` | Built-in stylesheets, support for three types: `text`, `picture` or `picture-card` | `'text' \| 'picture' \| 'picture-card'` | `'text'` |
44+
| `[nzMultiple]` | Whether to support selected multiple files. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | `boolean` | `false` |
45+
| `[nzName]` | The name of the uploading file | `string` | `'file'` |
46+
| `[nzShowUploadList]` | Whether to show the default upload list, could be an object to specify `showPreviewIcon`, `showRemoveIcon` and `showDownloadIcon` individually | `boolean \| { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean }` | `true` |
47+
| `[nzShowButton]` | Show upload button | `boolean` | `true` |
48+
| `[nzWithCredentials]` | ajax upload with cookie sent | `boolean` | `false` |
49+
| `[nzOpenFileDialogOnClick]` | click open file dialog | `boolean` | `true` |
50+
| `[nzPreview]` | A callback function will be executed when the file link or preview icon is clicked. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => void` | - |
51+
| `[nzPreviewFile]` | Customize preview file logic. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => Observable<dataURL: string>` | - |
52+
| `[nzPreviewIsImage]` | Customize the preview file is an image, generally used when the image URL is in a non-standard format. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean` | - |
53+
| `[nzRemove]` | A callback function will be executed when the removing file button is clicked, remove event will be prevented when the return value is `false` or an Observable. NOTICE: Must use `=>` to define the method. | `(file: NzUploadFile) => boolean \| Observable<boolean>` | - |
54+
| `(nzChange)` | A callback function, can be executed when uploading state is changing | `EventEmitter<NzUploadChangeParam>` | - |
55+
| `[nzDownload]` | Click the method to download the file, pass the method to perform the method logic, do not pass the default jump to the new TAB. | `(file: NzUploadFile) => void` | Jump to new TAB |
56+
| `[nzTransformFile]` | Customize transform file before request | `(file: NzUploadFile) => NzUploadTransformFileType` | - |
57+
| `[nzIconRender]` | Custom show icon | `TemplateRef<{ $implicit: NzUploadFile }>` | - |
58+
| `[nzFileListRender]` | Custom file list | `TemplateRef<{ $implicit: NzUploadFile[] }>` | - |
5959

6060
#### nzChange
6161

0 commit comments

Comments
 (0)