Skip to content

Commit

Permalink
feat(docs): change file-upload API from tables to lists in README (Te…
Browse files Browse the repository at this point in the history
…radata#1085)

* feat(file-upload): change API from tables to lists

* feat(file-upload): change API from tables to lists

* chore(): cleanup layout

* feat(file-upload): change API from tables to lists

* chore(): update readme
  • Loading branch information
jennmedellin authored and emoralesb05 committed Jan 16, 2018
1 parent e5382df commit 02da377
Showing 1 changed file with 38 additions and 26 deletions.
64 changes: 38 additions & 26 deletions src/platform/core/file/file-upload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,34 @@ export class Demo {

## API Summary

Properties:

| Name | Type | Description |
| --- | --- | 650--- |
| `defaultColor` | `string` | Sets browse button color. Uses same color palette accepted as [MatButton] and defaults to 'primary'.
| `activeColor` | `string` | Sets upload button color. Uses same color palette accepted as [MatButton] and defaults to 'accent'.
| `cancelColor` | `string` | Sets cancel button color. Uses same color palette accepted as [MatButton] and defaults to 'warn'.
| `multiple` | `boolean` | Sets if multiple files can be dropped/selected at once in [TdFileUploadComponent].
| `accept` | `string` | Sets files accepted when opening the file browser dialog. Same as "accept" attribute in `<input/>` element.
| `disabled` | `boolean` | Disables [TdFileUploadComponent] and clears selected/dropped files.
| `upload` | `function($event)` | Event emitted when upload button is clicked. Emits a [File or FileList] object.
| `select` | `function($event)` | Event emitted when a file is selected. Emits a [File or FileList] object.
| `cancel` | `function()` | Event emitted when cancel button is clicked.
#### Inputs

+ defaultColor: string
+ Sets browse button color. Uses same color palette accepted as [MatButton] and defaults to 'primary'.
+ activeColor: string
+ Sets upload button color. Uses same color palette accepted as [MatButton] and defaults to 'accent'.
+ cancelColor: string
+ Sets cancel button color. Uses same color palette accepted as [MatButton] and defaults to 'warn'.
+ multiple: boolean
+ Sets if multiple files can be dropped/selected at once in [TdFileUploadComponent].
+ accept: string
+ Sets files accepted when opening the file browser dialog. Same as "accept" attribute in `<input/>` element.
+ disabled: boolean
+ Disables [TdFileUploadComponent] and clears selected/dropped files.

#### Events

+ upload: function($event)
+ Event emitted when upload button is clicked. Emits a [File or FileList] object.
+ select: function($event)
+ Event emitted when a file is selected. Emits a [File or FileList] object.
+ cancel: function
+ Event emitted when cancel button is clicked.

#### Methods

+ cancel: function
+ Method used to clear the files selected.

## Setup

Expand All @@ -81,10 +96,18 @@ export class MyModule {}

## tdFileService

## Usage

Service provided with methods that wrap complexity for as easier file upload experience.

## API Summary

#### Methods

+ upload: function(IUploadState)
+ Uses underlying [XMLHttpRequest] to upload a file to a url.
+ Will be depricated when angular fixes [Http] to allow [FormData] as body.

## Usage

Recieves as parameter an object that implements the [IUploadOptions] interface. You have to assign a value either to `[file]` or to `[formData]`. If `[file]` is assigned then `[formData]` will be ignored; when only `[formData]` is assigned then it will be sent as form data.

```typescript
Expand Down Expand Up @@ -124,14 +147,3 @@ export class Demo {

}
```

## API Summary

Methods:

| Name | Type | Description |
| --- | --- | 650--- |
| upload | function(IUploadState) | Uses underlying [XMLHttpRequest] to upload a file to a url. Will be depricated when angular fixes [Http] to allow [FormData] as body.


---

0 comments on commit 02da377

Please sign in to comment.