@@ -16,27 +16,35 @@ const noop = () => {};
1616@Component ( {
1717 selector : "ibm-file-uploader" ,
1818 template : `
19- <strong class="bx--label">{{title}}</strong>
20- <p class="bx--label-description">{{description}}</p>
21- <div class="bx--file">
22- <button
23- ibmButton="secondary"
24- (click)="fileInput.click()"
25- [attr.for]="fileUploaderId">
26- {{buttonText}}
27- </button>
28- <input
29- #fileInput
30- type="file"
31- class="bx--file-input"
32- [accept]="accept"
33- [id]="fileUploaderId"
34- [multiple]="multiple"
35- (change)="onFilesAdded()"/>
36- <div class="bx--file-container">
37- <ibm-file *ngFor="let fileItem of files" [fileItem]="fileItem" (remove)="removeFile(fileItem)"></ibm-file>
19+ <ng-container *ngIf="!skeleton; else skeletonTemplate">
20+ <strong class="bx--label">{{title}}</strong>
21+ <p class="bx--label-description">{{description}}</p>
22+ <div class="bx--file">
23+ <button
24+ ibmButton="secondary"
25+ (click)="fileInput.click()"
26+ [attr.for]="fileUploaderId">
27+ {{buttonText}}
28+ </button>
29+ <input
30+ #fileInput
31+ type="file"
32+ class="bx--file-input"
33+ [accept]="accept"
34+ [id]="fileUploaderId"
35+ [multiple]="multiple"
36+ (change)="onFilesAdded()"/>
37+ <div class="bx--file-container">
38+ <ibm-file *ngFor="let fileItem of files" [fileItem]="fileItem" (remove)="removeFile(fileItem)"></ibm-file>
39+ </div>
3840 </div>
39- </div>
41+ </ng-container>
42+
43+ <ng-template #skeletonTemplate>
44+ <div class="bx--skeleton__text" style="width: 100px"></div>
45+ <div class="bx--skeleton__text" style="width: 225px"></div>
46+ <button ibmButton skeleton="true"></button>
47+ </ng-template>
4048 ` ,
4149 providers : [
4250 {
@@ -75,6 +83,10 @@ export class FileUploader implements OnInit {
7583 * Defaults to `true`. Accepts multiple files.
7684 */
7785 @Input ( ) multiple = true ;
86+ /**
87+ * Set to `true` for a loading file uploader.
88+ */
89+ @Input ( ) skeleton = false ;
7890 /**
7991 * Provides a unique id for the underlying <input> node
8092 */
0 commit comments