Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(file-input): change API from tables to lists #1082

Merged
merged 3 commits into from
Jan 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 41 additions & 22 deletions src/platform/core/file/file-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,27 @@ export class Demo {

## API Summary

Properties:
#### Inputs

| Name | Type | Description |
| --- | --- | 650--- |
| color | string | Sets button color. Uses same color palette accepted as [MatButton].
| 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.
| select | function($event) | Event emitted when a file is selected. Emits a [File or FileList] object.
| clear | function() | Used to clear the selected files from the [TdFileInputComponent].
+ color: string
+ Sets button color. Uses same color palette accepted as [MatButton].
+ 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

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

#### Methods

+ clear: function
+ Used to clear the selected files from the [TdFileInputComponent].

## Setup

Expand Down Expand Up @@ -78,14 +89,17 @@ Example for usage:

## API Summary

Properties:
#### Inputs

| Name | Type | Description |
| --- | --- | 650--- |
| multiple | boolean | Sets whether multiple files can be selected at once in host element, or just a single file. Can also be "multiple" native attribute.
| fileSelect | function($event) | Event emitted when a file or files are selected in host [HTMLInputElement]. Emits a [FileList or File] object. Alternative to not use [(ngModel)].
+ multiple: boolean
+ Sets whether multiple files can be selected at once in host element, or just a single file.
+ Can also be "multiple" native attribute.

---
#### Events

+ fileSelect: function($event)
+ Event emitted when a file or files are selected in host [HTMLInputElement].
+ Emits a [FileList or File] object. Alternative to not use [(ngModel)].

## TdFileDropDirective: tdFileDrop

Expand All @@ -107,13 +121,18 @@ Example for usage:

## API Summary

Properties:
#### Inputs

| Name | Type | Description |
| --- | --- | 650--- |
| multiple | boolean | Sets whether multiple files can be dropped at once in host element, or just a single file. Can also be "multiple" native attribute.
| disabled | boolean | Disabled drop events for host element.
| fileDrop | function($event) | Event emitted when a file or files are dropped in host element after being validated. Emits a [FileList or File] object.
+ multiple: boolean
+ Sets whether multiple files can be dropped at once in host element, or just a single file.
+ Can also be "multiple" native attribute.
+ disabled: boolean
+ Disabled drop events for host element.

#### Events

---
+ fileDrop: function($event)
+ Event emitted when a file or files are dropped in host element after being validated.
+ Emits a [FileList or File] object.

&nbsp;