-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce File Uploader component (#2947)
* [ci skip] Fix(File Uploader):Introduncing new fiori3 file uploader component * [ci skip]Fix:File uploader adding unit test case and review comments fix * [ci skip]Fix:File uploader fixing lint errors * [ci skip] Fix(File Uploader):Introduncing new fiori3 file uploader component * [ci skip]Fix:(File uploader) changes to fix lint error after rebasing * [ci skip]Fix:(File uploader) changes to fix merge issue * [ci skip] Fix(file uploader): reomve insline style * [ci skip] Fix(file uploader): resolve conflicts * [ci skip] Fix(file uploader): adding unique id's to example pages * Fix(Core)File Uploader: Introducing new file uploader component * Fix(File Uploader):Changes contains fix for file uploader review comments given by Edrez and Mikerodonnel * Fix(File uploader):Adding @hidden annotation * Fix(File Uploader):fix for build error * Fix(file uploader):update new style version * Fix(file uploader):test case fix * Fix(file uploader): remove changelog.md file * Fix(File Uploader): Modifieing the description for compact file uploader example * Fix(File uploader) Changing to SharedDocumetationPage module
- Loading branch information
Showing
48 changed files
with
1,307 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...oader/examples/file-uploader-compact-example/file-uploader-compact-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<fd-file-uploader | ||
#fileUploaderCompact | ||
[id]="fileUploaderCompact" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose File to upload'" | ||
[buttonLabel]="'Browse...'" | ||
[buttonAriaLabel]="'browse file'" | ||
[(ngModel)]="files" | ||
[multiple]="true" | ||
[accept]="'.png,.jpg'" | ||
[compact]="true" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
Files Selected: | ||
<br /> | ||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br /> | ||
</span> |
6 changes: 6 additions & 0 deletions
6
...oader/examples/file-uploader-compact-example/file-uploader-compact-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
12 changes: 12 additions & 0 deletions
12
...ploader/examples/file-uploader-compact-example/file-uploader-compact-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-compact-example', | ||
templateUrl: './file-uploader-compact-example.component.html', | ||
styleUrls: ['./file-uploader-compact-example.component.scss'] | ||
}) | ||
export class FileUploaderCompactExampleComponent { | ||
|
||
files: File[]; | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...es/file-uploader-drag-disabled-example/file-uploader-drag-disabled-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<fd-file-uploader | ||
#fileUploaderDrag | ||
[id]="fileUploaderDrag" | ||
[(ngModel)]="files" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose File to upload'" | ||
[buttonLabel]="'Drag a .jpg file on me!'" | ||
[buttonAriaLabel]="'browse file'" | ||
(selectedFilesChanged)="handleFileSection()" | ||
(selectedInvalidFiles)="handleInvalidFiles($event)" | ||
[accept]="'.png'" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
|
||
Files Selected: | ||
<br /> | ||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br /> | ||
</span> | ||
|
||
<br /> | ||
|
||
Invalid Files: | ||
<br /> | ||
<span *ngFor="let file of invalidFiles"> | ||
<span class="red">{{ file.name }} </span><br | ||
/></span> |
6 changes: 6 additions & 0 deletions
6
...es/file-uploader-drag-disabled-example/file-uploader-drag-disabled-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
21 changes: 21 additions & 0 deletions
21
...ples/file-uploader-drag-disabled-example/file-uploader-drag-disabled-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-drag-disabled-example', | ||
templateUrl: './file-uploader-drag-disabled-example.component.html', | ||
styleUrls: ['./file-uploader-drag-disabled-example.component.scss'] | ||
}) | ||
export class FileUploaderDragDisabledExampleComponent { | ||
|
||
files: File[]; | ||
invalidFiles: File[]; | ||
|
||
handleFileSection(): void { | ||
alert('Files selected successfully!!!'); | ||
} | ||
|
||
handleInvalidFiles($event): void { | ||
alert(' Invalid file selection '); | ||
this.invalidFiles = $event; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...nt-docs/file-uploader/examples/file-uploader-example/file-uploader-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<fd-file-uploader | ||
#fileUploader | ||
[id]="fileUploader" | ||
[(ngModel)]="files" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Select the file '" | ||
[buttonLabel]="'Browse'" | ||
[buttonAriaLabel]="'browse file'" | ||
[multiple]="true" | ||
[accept]="'.png,.jpg'" | ||
(selectedFilesChanged)="handleFileSection()" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
Files Selected: | ||
<br /> | ||
|
||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br /> | ||
</span> |
6 changes: 6 additions & 0 deletions
6
...nt-docs/file-uploader/examples/file-uploader-example/file-uploader-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
15 changes: 15 additions & 0 deletions
15
...nent-docs/file-uploader/examples/file-uploader-example/file-uploader-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-example', | ||
templateUrl: './file-uploader-example.component.html', | ||
styleUrls: ['./file-uploader-example.component.scss'] | ||
}) | ||
export class FileUploaderExampleComponent { | ||
|
||
files: File[]; | ||
|
||
handleFileSection(): void { | ||
alert('Files selected successfully!!!'); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...file-uploader/examples/file-uploader-max-example/file-uploader-max-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<fd-file-uploader | ||
#fileUploaderMax | ||
[id]="fileUploaderMax" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose File to upload'" | ||
[buttonLabel]="'Browse...'" | ||
[buttonAriaLabel]="'browse file'" | ||
[multiple]="true" | ||
[(ngModel)]="files" | ||
(selectedFilesChanged)="handleFileSection()" | ||
(selectedInvalidFiles)="handleInvalidFiles($event)" | ||
[maxFileSize]="'1MB'" | ||
></fd-file-uploader> | ||
|
||
<br /> | ||
<br /> | ||
Selected Files: | ||
<br /> | ||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br | ||
/></span> | ||
|
||
<br /> | ||
|
||
Invalid Files: | ||
<br /> | ||
<span *ngFor="let file of invalidFiles"> | ||
<span class="red">{{ file.name }} </span><br | ||
/></span> |
6 changes: 6 additions & 0 deletions
6
...file-uploader/examples/file-uploader-max-example/file-uploader-max-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
22 changes: 22 additions & 0 deletions
22
...s/file-uploader/examples/file-uploader-max-example/file-uploader-max-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-max-example', | ||
templateUrl: './file-uploader-max-example.component.html', | ||
styleUrls: ['./file-uploader-max-example.component.scss'] | ||
}) | ||
export class FileUploaderMaxExampleComponent { | ||
files: File[]; | ||
invalidFiles: File[]; | ||
|
||
handleFileSection(): void { | ||
|
||
alert('Files selected successfully!!!'); | ||
|
||
} | ||
|
||
handleInvalidFiles($event): void { | ||
alert(' Invalid file selection '); | ||
this.invalidFiles = $event; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...e-uploader-min-and-max-size-example/file-uploader-min-and-max-size-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<fd-file-uploader | ||
#fileUploaderMinAndMax | ||
[id]="fileUploaderMinAndMax" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose File to upload'" | ||
[buttonLabel]="'Browse...'" | ||
[buttonAriaLabel]="'browse file'" | ||
[(ngModel)]="files" | ||
[multiple]="true" | ||
(selectedFilesChanged)="handleFileSection()" | ||
(selectedInvalidFiles)="handleInvalidFiles($event)" | ||
[minFileSize]="'1KB'" | ||
[maxFileSize]="'1MB'" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
|
||
Files Selected: | ||
<br /> | ||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br | ||
/></span> | ||
|
||
<br /> | ||
|
||
Invalid Files: | ||
<br /> | ||
<span *ngFor="let file of invalidFiles"> | ||
<span class="red">{{ file.name }} </span><br | ||
/></span> |
6 changes: 6 additions & 0 deletions
6
...e-uploader-min-and-max-size-example/file-uploader-min-and-max-size-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
21 changes: 21 additions & 0 deletions
21
...ile-uploader-min-and-max-size-example/file-uploader-min-and-max-size-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-min-and-max-size-example', | ||
templateUrl: './file-uploader-min-and-max-size-example.component.html', | ||
styleUrls: ['./file-uploader-min-and-max-size-example.component.scss'] | ||
}) | ||
export class FileUploaderMinAndMaxSizeExampleComponent { | ||
files: File[]; | ||
invalidFiles: File[]; | ||
|
||
handleFileSection(): void { | ||
alert('Files selected successfully!!!'); | ||
} | ||
|
||
handleInvalidFiles($event): void { | ||
alert(' Invalid file selection '); | ||
this.invalidFiles = $event; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...file-uploader/examples/file-uploader-min-example/file-uploader-min-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<fd-file-uploader | ||
#fileUploaderMin | ||
[id]="fileUploaderMin" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose File to upload'" | ||
[buttonLabel]="'Browse...'" | ||
[buttonAriaLabel]="'browse file'" | ||
[multiple]="true" | ||
[(ngModel)]="files" | ||
(selectedFilesChanged)="handleFileSection()" | ||
(selectedInvalidFiles)="handleInvalidFiles($event)" | ||
[minFileSize]="'3KB'" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
|
||
Files Selected: | ||
<br /> | ||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br | ||
/></span> | ||
|
||
<br /> | ||
|
||
Invalid Files: | ||
<br /> | ||
<span *ngFor="let file of invalidFiles"> | ||
<span class="red">{{ file.name }} </span><br /> | ||
</span> |
6 changes: 6 additions & 0 deletions
6
...file-uploader/examples/file-uploader-min-example/file-uploader-min-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
23 changes: 23 additions & 0 deletions
23
...s/file-uploader/examples/file-uploader-min-example/file-uploader-min-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-min-example', | ||
templateUrl: './file-uploader-min-example.component.html', | ||
styleUrls: ['./file-uploader-min-example.component.scss'] | ||
}) | ||
export class FileUploaderMinExampleComponent { | ||
|
||
files: File[]; | ||
invalidFiles: File[]; | ||
handleFileSection(): void { | ||
|
||
alert('Files selected successfully!!!'); | ||
|
||
} | ||
|
||
handleInvalidFiles($event): void { | ||
alert(' Invalid file selection '); | ||
this.invalidFiles = $event; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...examples/file-uploader-truncation-example/file-uploader-truncation-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<fd-file-uploader | ||
#fileUploaderTruncation | ||
[id]="fileUploaderTruncation" | ||
[ariaLabel]="'Choose file'" | ||
[ariaLabelledBy]="'Choose file'" | ||
[placeholder]="'Choose file to upload to the server '" | ||
[buttonLabel]="'Browse'" | ||
[buttonAriaLabel]="'browse file'" | ||
[multiple]="true" | ||
[(ngModel)]="files" | ||
[accept]="'.png,.jpg'" | ||
(selectedFilesChanged)="this.files = $event" | ||
> | ||
</fd-file-uploader> | ||
|
||
<br /><br /> | ||
Files Selected: | ||
<br /> | ||
|
||
<span *ngFor="let file of files"> | ||
<span class="green">{{ file.name }} </span><br /> | ||
</span> |
6 changes: 6 additions & 0 deletions
6
...examples/file-uploader-truncation-example/file-uploader-truncation-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.red { | ||
color: red; | ||
} | ||
.green { | ||
color: seagreen; | ||
} |
11 changes: 11 additions & 0 deletions
11
...r/examples/file-uploader-truncation-example/file-uploader-truncation-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'fd-file-uploader-truncation-example', | ||
templateUrl: './file-uploader-truncation-example.component.html', | ||
styleUrls: ['./file-uploader-truncation-example.component.scss'] | ||
}) | ||
export class FileUploaderTruncationExampleComponent { | ||
|
||
files: File[]; | ||
} |
Oops, something went wrong.