@progress/kendo-angular-upload 11.0.0-develop.96 → 11.0.0-develop.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,14 +10,17 @@ import { UploadService } from '../upload.service';
10
10
  import { getFileGroupCssClass, isPresent } from '../common/util';
11
11
  import { FileInfoTemplateDirective } from '../templates/file-info-template.directive';
12
12
  import { animate, state, style, transition, trigger } from '@angular/animations';
13
+ import { fileIcon } from '@progress/kendo-svg-icons';
14
+ import { fileGroupMap, fileSVGGroupMap } from '../types/file-groups';
13
15
  import * as i0 from "@angular/core";
14
16
  import * as i1 from "@progress/kendo-angular-l10n";
15
17
  import * as i2 from "../upload.service";
16
18
  import * as i3 from "@progress/kendo-angular-progressbar";
17
- import * as i4 from "./file-list-item-action-button.component";
18
- import * as i5 from "@angular/common";
19
- import * as i6 from "@progress/kendo-angular-buttons";
20
- import * as i7 from "../templates/template-context.directive";
19
+ import * as i4 from "@progress/kendo-angular-icons";
20
+ import * as i5 from "./file-list-item-action-button.component";
21
+ import * as i6 from "@angular/common";
22
+ import * as i7 from "@progress/kendo-angular-buttons";
23
+ import * as i8 from "../templates/template-context.directive";
21
24
  /**
22
25
  * @hidden
23
26
  */
@@ -51,6 +54,17 @@ export class FileListSingleItemComponent extends FileListItemBase {
51
54
  get fileGroupClass() {
52
55
  return getFileGroupCssClass(this.file.extension ? this.file.extension : '');
53
56
  }
57
+ get fileSVGGroupIcon() {
58
+ const initial = fileIcon;
59
+ if (this.file.extension) {
60
+ for (const group in fileGroupMap) {
61
+ if (fileGroupMap[group].indexOf(this.file.extension) >= 0) {
62
+ return fileSVGGroupMap[group];
63
+ }
64
+ }
65
+ }
66
+ return initial;
67
+ }
54
68
  get isUploadSuccessful() {
55
69
  return this.file.state === FileState.Uploaded;
56
70
  }
@@ -70,7 +84,12 @@ FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
70
84
  >
71
85
  </kendo-progressbar>
72
86
  <span class="k-file-icon-wrapper">
73
- <span class="k-file-icon k-icon" [ngClass]="fileGroupClass"></span>
87
+ <kendo-icon-wrapper
88
+ [name]="fileGroupClass"
89
+ [svgIcon]="fileSVGGroupIcon"
90
+ innerCssClass="k-file-icon"
91
+ >
92
+ </kendo-icon-wrapper>
74
93
  </span>
75
94
  <span class="k-file-info">
76
95
  <ng-container *ngIf="!fileInfoTemplate">
@@ -95,7 +114,7 @@ FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
95
114
  [disabled]='disabled'
96
115
  [progress]='progressComplete'>
97
116
  </kendo-upload-file-list-item-action-button>
98
- `, isInline: true, components: [{ type: i3.ProgressBarComponent, selector: "kendo-progressbar", inputs: ["label", "progressCssStyle", "progressCssClass", "emptyCssStyle", "emptyCssClass", "animation"], outputs: ["animationEnd"], exportAs: ["kendoProgressBar"] }, { type: i4.FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { type: i7.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
117
+ `, isInline: true, components: [{ type: i3.ProgressBarComponent, selector: "kendo-progressbar", inputs: ["label", "progressCssStyle", "progressCssClass", "emptyCssStyle", "emptyCssClass", "animation"], outputs: ["animationEnd"], exportAs: ["kendoProgressBar"] }, { type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }, { type: i5.FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { type: i8.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
99
118
  trigger('progressState', [
100
119
  state('active', style({ opacity: 1 })),
101
120
  state('inactive', style({ opacity: 0 })),
@@ -125,7 +144,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
125
144
  >
126
145
  </kendo-progressbar>
127
146
  <span class="k-file-icon-wrapper">
128
- <span class="k-file-icon k-icon" [ngClass]="fileGroupClass"></span>
147
+ <kendo-icon-wrapper
148
+ [name]="fileGroupClass"
149
+ [svgIcon]="fileSVGGroupIcon"
150
+ innerCssClass="k-file-icon"
151
+ >
152
+ </kendo-icon-wrapper>
129
153
  </span>
130
154
  <span class="k-file-info">
131
155
  <ng-container *ngIf="!fileInfoTemplate">
@@ -6,15 +6,48 @@ import { Component, Input } from '@angular/core';
6
6
  import { FileMap } from '../types/file-map';
7
7
  import { FileState } from '../types';
8
8
  import { LocalizationService } from '@progress/kendo-angular-l10n';
9
+ import { checkIcon, exclamationCircleIcon, pauseSmIcon, uploadIcon } from '@progress/kendo-svg-icons';
9
10
  import * as i0 from "@angular/core";
10
11
  import * as i1 from "@progress/kendo-angular-l10n";
11
- import * as i2 from "@angular/common";
12
+ import * as i2 from "@progress/kendo-angular-icons";
12
13
  /**
13
14
  * @hidden
14
15
  */
15
16
  export class UploadStatusTotalComponent {
16
17
  constructor(localization) {
17
18
  this.localization = localization;
19
+ this.checkmarkIcon = checkIcon;
20
+ this.exceptionSVGIcon = exclamationCircleIcon;
21
+ this.uploadSVGIcon = uploadIcon;
22
+ this.pauseSVGIcon = pauseSmIcon;
23
+ }
24
+ get iconClass() {
25
+ if (!this.isUploading && !this.isFailed) {
26
+ return 'checkmark';
27
+ }
28
+ if (!this.isUploading && this.isFailed) {
29
+ return 'exception';
30
+ }
31
+ if (this.isUploading) {
32
+ return 'upload';
33
+ }
34
+ if (this.isPaused) {
35
+ return 'pause-sm';
36
+ }
37
+ }
38
+ get SVGIconClass() {
39
+ if (!this.isUploading && !this.isFailed) {
40
+ return this.checkmarkIcon;
41
+ }
42
+ if (!this.isUploading && this.isFailed) {
43
+ return this.exceptionSVGIcon;
44
+ }
45
+ if (this.isUploading) {
46
+ return this.uploadSVGIcon;
47
+ }
48
+ if (this.isPaused) {
49
+ return this.pauseSVGIcon;
50
+ }
18
51
  }
19
52
  ngDoCheck() {
20
53
  this.isPaused = this.fileList.hasFileWithState([FileState.Paused]);
@@ -31,29 +64,23 @@ export class UploadStatusTotalComponent {
31
64
  }
32
65
  UploadStatusTotalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadStatusTotalComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
33
66
  UploadStatusTotalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: { fileList: "fileList" }, ngImport: i0, template: `
34
- <span class="k-icon"
35
- [ngClass]="{
36
- 'k-i-checkmark': !this.isUploading && !this.isFailed,
37
- 'k-i-exception': !this.isUploading && this.isFailed,
38
- 'k-i-upload': this.isUploading,
39
- 'k-i-pause-sm': this.isPaused
40
- }">
41
- </span>
67
+ <kendo-icon-wrapper
68
+ [name]="iconClass"
69
+ [svgIcon]="SVGIconClass"
70
+ >
71
+ </kendo-icon-wrapper>
42
72
  {{statusText}}
43
- `, isInline: true, directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
73
+ `, isInline: true, components: [{ type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }] });
44
74
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadStatusTotalComponent, decorators: [{
45
75
  type: Component,
46
76
  args: [{
47
77
  selector: 'kendo-upload-status-total',
48
78
  template: `
49
- <span class="k-icon"
50
- [ngClass]="{
51
- 'k-i-checkmark': !this.isUploading && !this.isFailed,
52
- 'k-i-exception': !this.isUploading && this.isFailed,
53
- 'k-i-upload': this.isUploading,
54
- 'k-i-pause-sm': this.isPaused
55
- }">
56
- </span>
79
+ <kendo-icon-wrapper
80
+ [name]="iconClass"
81
+ [svgIcon]="SVGIconClass"
82
+ >
83
+ </kendo-icon-wrapper>
57
84
  {{statusText}}
58
85
  `
59
86
  }]
@@ -20,6 +20,7 @@ import { UploadDropZoneDirective } from './dropzone-external.directive';
20
20
  import { UploadDropZoneComponent } from './dropzone.component';
21
21
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
22
22
  import { ProgressBarModule } from '@progress/kendo-angular-progressbar';
23
+ import { IconsModule } from '@progress/kendo-angular-icons';
23
24
  import * as i0 from "@angular/core";
24
25
  /**
25
26
  * @hidden
@@ -63,7 +64,7 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
63
64
  FileListSingleItemComponent,
64
65
  FileSelectDirective,
65
66
  LocalizedMessagesDirective,
66
- TemplateContextDirective], imports: [CommonModule, ButtonsModule, ProgressBarModule], exports: [FileTemplateDirective,
67
+ TemplateContextDirective], imports: [CommonModule, ButtonsModule, ProgressBarModule, IconsModule], exports: [FileTemplateDirective,
67
68
  FileInfoTemplateDirective,
68
69
  CustomMessagesComponent,
69
70
  UploadDropZoneDirective,
@@ -77,7 +78,7 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
77
78
  LocalizedMessagesDirective,
78
79
  TemplateContextDirective, CommonModule,
79
80
  ButtonsModule] });
80
- SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[CommonModule, ButtonsModule, ProgressBarModule], CommonModule,
81
+ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[CommonModule, ButtonsModule, ProgressBarModule, IconsModule], CommonModule,
81
82
  ButtonsModule] });
82
83
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
83
84
  type: NgModule,
@@ -92,6 +93,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
92
93
  CommonModule,
93
94
  ButtonsModule
94
95
  ],
95
- imports: [CommonModule, ButtonsModule, ProgressBarModule]
96
+ imports: [CommonModule, ButtonsModule, ProgressBarModule, IconsModule]
96
97
  }]
97
98
  }] });
@@ -2,6 +2,7 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ import { fileAudioIcon, fileConfigIcon, fileDiscImageIcon, fileExcelIcon, fileImageIcon, filePdfIcon, filePresentationIcon, fileProgrammingIcon, fileTxtIcon, fileVideoIcon, fileZipIcon } from "@progress/kendo-svg-icons";
5
6
  /**
6
7
  * @hidden
7
8
  */
@@ -41,3 +42,20 @@ export const fileGroupMap = {
41
42
  ".dmg", ".iso", ".toast", ".vcd", ".bin", ".cue", ".mdf"
42
43
  ]
43
44
  };
45
+ ;
46
+ /**
47
+ * @hidden
48
+ */
49
+ export const fileSVGGroupMap = {
50
+ audio: fileAudioIcon,
51
+ video: fileVideoIcon,
52
+ image: fileImageIcon,
53
+ txt: fileTxtIcon,
54
+ presentation: filePresentationIcon,
55
+ data: fileExcelIcon,
56
+ programming: fileProgrammingIcon,
57
+ pdf: filePdfIcon,
58
+ config: fileConfigIcon,
59
+ zip: fileZipIcon,
60
+ discImage: fileDiscImageIcon
61
+ };
@@ -6,6 +6,7 @@ import { NgModule } from '@angular/core';
6
6
  import { UploadComponent } from './upload.component';
7
7
  import { UploadActionButtonsComponent } from './rendering/upload-action-buttons.component';
8
8
  import { UploadStatusTotalComponent } from './rendering/upload-status-total.component';
9
+ import { IconsModule } from '@progress/kendo-angular-icons';
9
10
  import { SharedModule, PUBLIC_DIRECTIVES } from './shared.module';
10
11
  import * as i0 from "@angular/core";
11
12
  import * as i1 from "./templates/file-template.directive";
@@ -26,10 +27,10 @@ export class UploadModule {
26
27
  UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27
28
  UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
28
29
  UploadActionButtonsComponent,
29
- UploadStatusTotalComponent], imports: [SharedModule], exports: [i1.FileTemplateDirective, i2.FileInfoTemplateDirective, i3.CustomMessagesComponent, i4.UploadDropZoneDirective, i5.UploadDropZoneComponent, UploadComponent,
30
+ UploadStatusTotalComponent], imports: [SharedModule, IconsModule], exports: [i1.FileTemplateDirective, i2.FileInfoTemplateDirective, i3.CustomMessagesComponent, i4.UploadDropZoneDirective, i5.UploadDropZoneComponent, UploadComponent,
30
31
  UploadActionButtonsComponent,
31
32
  UploadStatusTotalComponent] });
32
- UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, imports: [[SharedModule]] });
33
+ UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, imports: [[SharedModule, IconsModule]] });
33
34
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadModule, decorators: [{
34
35
  type: NgModule,
35
36
  args: [{
@@ -38,6 +39,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
38
39
  PUBLIC_DIRECTIVES,
39
40
  UPLOAD_DECLARATIONS
40
41
  ],
41
- imports: [SharedModule]
42
+ imports: [SharedModule, IconsModule]
42
43
  }]
43
44
  }] });