From 92cf2140b9ffc2aeeeedca844ce81fd5f14a4bb2 Mon Sep 17 00:00:00 2001 From: jm186140 Date: Mon, 15 Jan 2018 14:50:55 -0800 Subject: [PATCH 1/5] feat(file-upload): change API from tables to lists --- src/platform/core/file/file-upload/README.md | 35 +++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/platform/core/file/file-upload/README.md b/src/platform/core/file/file-upload/README.md index baf354c527..3a6d71a8a1 100644 --- a/src/platform/core/file/file-upload/README.md +++ b/src/platform/core/file/file-upload/README.md @@ -49,19 +49,30 @@ 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 `` 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 `` 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. ## Setup From 8d16b7d36c5c0bb44d612b8c56c06a1957bc037c Mon Sep 17 00:00:00 2001 From: jm186140 Date: Mon, 15 Jan 2018 14:56:50 -0800 Subject: [PATCH 2/5] feat(file-upload): change API from tables to lists --- src/platform/core/file/file-upload/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/platform/core/file/file-upload/README.md b/src/platform/core/file/file-upload/README.md index 3a6d71a8a1..380366ea33 100644 --- a/src/platform/core/file/file-upload/README.md +++ b/src/platform/core/file/file-upload/README.md @@ -49,7 +49,6 @@ export class Demo { ## API Summary -| `defaultColor` | `string` | Sets browse button color. Uses same color palette accepted as [MatButton] and defaults to 'primary'. #### Inputs + defaultColor: string From 74be37a2adc892e174717b81497884fe3e34e738 Mon Sep 17 00:00:00 2001 From: jm186140 Date: Mon, 15 Jan 2018 15:26:31 -0800 Subject: [PATCH 3/5] chore(): cleanup layout --- src/platform/core/file/file-upload/README.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/platform/core/file/file-upload/README.md b/src/platform/core/file/file-upload/README.md index 380366ea33..731e544261 100644 --- a/src/platform/core/file/file-upload/README.md +++ b/src/platform/core/file/file-upload/README.md @@ -73,6 +73,12 @@ export class Demo { + cancel: function + Event emitted when cancel button is clicked. +##### 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. + ## Setup Import the [CovalentFileModule] in your NgModule: @@ -134,14 +140,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. - - ---- From b52bd170172a6c1dd327422555c0f98a5b45c894 Mon Sep 17 00:00:00 2001 From: jm186140 Date: Mon, 15 Jan 2018 15:53:28 -0800 Subject: [PATCH 4/5] feat(file-upload): change API from tables to lists --- src/platform/core/file/file-upload/README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/platform/core/file/file-upload/README.md b/src/platform/core/file/file-upload/README.md index 731e544261..d963be1ba1 100644 --- a/src/platform/core/file/file-upload/README.md +++ b/src/platform/core/file/file-upload/README.md @@ -64,7 +64,7 @@ export class Demo { + disabled: boolean + Disables [TdFileUploadComponent] and clears selected/dropped files. -##### Events +#### Events + upload: function($event) + Event emitted when upload button is clicked. Emits a [File or FileList] object. @@ -73,12 +73,6 @@ export class Demo { + cancel: function + Event emitted when cancel button is clicked. -##### 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. - ## Setup Import the [CovalentFileModule] in your NgModule: @@ -140,3 +134,13 @@ export class Demo { } ``` + +## 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. + +   \ No newline at end of file From 1a2daf68336cd583bbeb0412ffa8699b4947da97 Mon Sep 17 00:00:00 2001 From: emoralesb05 Date: Tue, 16 Jan 2018 15:34:27 -0800 Subject: [PATCH 5/5] chore(): update readme --- src/platform/core/file/file-upload/README.md | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/platform/core/file/file-upload/README.md b/src/platform/core/file/file-upload/README.md index d963be1ba1..3bd44600d3 100644 --- a/src/platform/core/file/file-upload/README.md +++ b/src/platform/core/file/file-upload/README.md @@ -73,6 +73,11 @@ export class Demo { + cancel: function + Event emitted when cancel button is clicked. +#### Methods + ++ cancel: function + + Method used to clear the files selected. + ## Setup Import the [CovalentFileModule] in your NgModule: @@ -91,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 @@ -134,13 +147,3 @@ export class Demo { } ``` - -## 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. - -   \ No newline at end of file