@progress/kendo-angular-upload 9.0.4 → 11.0.0-develop.101

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.
Files changed (136) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +4 -4
  3. package/README.md +1 -1
  4. package/common/action-buttons-layout.d.ts +1 -1
  5. package/common/util.d.ts +1 -1
  6. package/common/validation-util.d.ts +1 -1
  7. package/dropzone-base.d.ts +2 -2
  8. package/dropzone-external.directive.d.ts +1 -1
  9. package/dropzone-internal.directive.d.ts +1 -1
  10. package/dropzone.component.d.ts +11 -3
  11. package/dropzone.service.d.ts +1 -1
  12. package/{esm2015/types/chunk-metadata.js → esm2020/common/action-buttons-layout.mjs} +1 -1
  13. package/{esm2015/common/util.js → esm2020/common/util.mjs} +13 -10
  14. package/{esm2015/common/validation-util.js → esm2020/common/validation-util.mjs} +2 -2
  15. package/{esm2015/dropzone-base.js → esm2020/dropzone-base.mjs} +5 -5
  16. package/{esm2015/dropzone-external.directive.js → esm2020/dropzone-external.directive.mjs} +5 -5
  17. package/{esm2015/dropzone-internal.directive.js → esm2020/dropzone-internal.directive.mjs} +11 -7
  18. package/esm2020/dropzone.component.mjs +134 -0
  19. package/{esm2015/dropzone.service.js → esm2020/dropzone.service.mjs} +5 -5
  20. package/{esm2015/events/cancel-event.js → esm2020/events/cancel-event.mjs} +1 -1
  21. package/{esm2015/events/clear-event.js → esm2020/events/clear-event.mjs} +1 -1
  22. package/{esm2015/events/error-event.js → esm2020/events/error-event.mjs} +1 -1
  23. package/{esm2015/events/pause-event.js → esm2020/events/pause-event.mjs} +1 -1
  24. package/{esm2015/events/preventable-event.js → esm2020/events/preventable-event.mjs} +1 -1
  25. package/{esm2015/events/remove-event.js → esm2020/events/remove-event.mjs} +1 -1
  26. package/{esm2015/events/resume-event.js → esm2020/events/resume-event.mjs} +1 -1
  27. package/{esm2015/events/select-event.js → esm2020/events/select-event.mjs} +1 -1
  28. package/{esm2015/events/success-event.js → esm2020/events/success-event.mjs} +1 -1
  29. package/{esm2015/events/upload-event.js → esm2020/events/upload-event.mjs} +1 -1
  30. package/{esm2015/events/upload-progress-event.js → esm2020/events/upload-progress-event.mjs} +1 -1
  31. package/{esm2015/events.js → esm2020/events.mjs} +1 -1
  32. package/{esm2015/file-select.directive.js → esm2020/file-select.directive.mjs} +7 -5
  33. package/{esm2015/fileselect.component.js → esm2020/fileselect.component.mjs} +100 -60
  34. package/{esm2015/fileselect.module.js → esm2020/fileselect.module.mjs} +7 -6
  35. package/{esm2015/main.js → esm2020/index.mjs} +2 -1
  36. package/{esm2015/localization/custom-messages.component.js → esm2020/localization/custom-messages.component.mjs} +5 -4
  37. package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -4
  38. package/{esm2015/localization/messages.js → esm2020/localization/messages.mjs} +4 -4
  39. package/{esm2015/navigation.service.js → esm2020/navigation.service.mjs} +56 -40
  40. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
  41. package/{esm2015/kendo-angular-upload.js → esm2020/progress-kendo-angular-upload.mjs} +2 -2
  42. package/esm2020/rendering/file-list-item-action-button.component.mjs +262 -0
  43. package/{esm2015/rendering/file-list-item-base.js → esm2020/rendering/file-list-item-base.mjs} +5 -4
  44. package/{esm2015/rendering/file-list-item.js → esm2020/rendering/file-list-item.mjs} +7 -5
  45. package/esm2020/rendering/file-list-multiple-items.component.mjs +186 -0
  46. package/esm2020/rendering/file-list-single-item.component.mjs +185 -0
  47. package/{esm2015/rendering/file-list.component.js → esm2020/rendering/file-list.component.mjs} +16 -11
  48. package/{esm2015/rendering/upload-action-buttons.component.js → esm2020/rendering/upload-action-buttons.component.mjs} +8 -5
  49. package/{esm2015/rendering/upload-status-total.component.js → esm2020/rendering/upload-status-total.component.mjs} +51 -22
  50. package/{esm2015/shared.module.js → esm2020/shared.module.mjs} +15 -9
  51. package/{esm2015/templates/file-info-template.directive.js → esm2020/templates/file-info-template.directive.mjs} +5 -5
  52. package/{esm2015/templates/file-template.directive.js → esm2020/templates/file-template.directive.mjs} +5 -5
  53. package/{esm2015/templates/template-context.directive.js → esm2020/templates/template-context.directive.mjs} +5 -5
  54. package/{esm2015/common/action-buttons-layout.js → esm2020/types/async-settings.mjs} +1 -1
  55. package/{esm2015/types/chunk-info.js → esm2020/types/chunk-info.mjs} +1 -1
  56. package/{esm2015/types/chunk-map.js → esm2020/types/chunk-map.mjs} +1 -1
  57. package/{esm2015/types/async-settings.js → esm2020/types/chunk-metadata.mjs} +1 -1
  58. package/esm2020/types/chunk-settings.mjs +5 -0
  59. package/esm2020/types/direction.mjs +5 -0
  60. package/{esm2015/types/file-groups.js → esm2020/types/file-groups.mjs} +19 -1
  61. package/esm2020/types/file-info.mjs +5 -0
  62. package/{esm2015/types/file-map.js → esm2020/types/file-map.mjs} +26 -26
  63. package/esm2020/types/file-restrictions.mjs +5 -0
  64. package/{esm2015/types/file-state.js → esm2020/types/file-state.mjs} +1 -1
  65. package/esm2020/types/operation-type.mjs +5 -0
  66. package/{esm2015/types.js → esm2020/types.mjs} +1 -1
  67. package/{esm2015/upload.component.js → esm2020/upload.component.mjs} +125 -80
  68. package/{esm2015/upload.module.js → esm2020/upload.module.mjs} +8 -7
  69. package/{esm2015/upload.service.js → esm2020/upload.service.mjs} +35 -35
  70. package/{esm2015/uploads.module.js → esm2020/uploads.module.mjs} +5 -5
  71. package/events/cancel-event.d.ts +1 -1
  72. package/events/clear-event.d.ts +1 -1
  73. package/events/error-event.d.ts +1 -1
  74. package/events/pause-event.d.ts +1 -1
  75. package/events/preventable-event.d.ts +1 -1
  76. package/events/remove-event.d.ts +1 -1
  77. package/events/resume-event.d.ts +1 -1
  78. package/events/select-event.d.ts +1 -1
  79. package/events/success-event.d.ts +1 -1
  80. package/events/upload-event.d.ts +1 -1
  81. package/events/upload-progress-event.d.ts +3 -3
  82. package/events.d.ts +1 -1
  83. package/fesm2015/progress-kendo-angular-upload.mjs +4997 -0
  84. package/{fesm2015/kendo-angular-upload.js → fesm2020/progress-kendo-angular-upload.mjs} +829 -592
  85. package/file-select.directive.d.ts +1 -1
  86. package/fileselect.component.d.ts +13 -8
  87. package/fileselect.module.d.ts +8 -7
  88. package/{main.d.ts → index.d.ts} +2 -1
  89. package/localization/custom-messages.component.d.ts +1 -1
  90. package/localization/localized-messages.directive.d.ts +1 -1
  91. package/localization/messages.d.ts +1 -1
  92. package/navigation.service.d.ts +4 -3
  93. package/package-metadata.d.ts +1 -1
  94. package/package.json +30 -55
  95. package/{kendo-angular-upload.d.ts → progress-kendo-angular-upload.d.ts} +2 -2
  96. package/rendering/file-list-item-action-button.component.d.ts +8 -2
  97. package/rendering/file-list-item-base.d.ts +2 -2
  98. package/rendering/file-list-item.d.ts +1 -1
  99. package/rendering/file-list-multiple-items.component.d.ts +3 -1
  100. package/rendering/file-list-single-item.component.d.ts +3 -1
  101. package/rendering/file-list.component.d.ts +1 -1
  102. package/rendering/upload-action-buttons.component.d.ts +1 -1
  103. package/rendering/upload-status-total.component.d.ts +8 -1
  104. package/schematics/ngAdd/index.js +8 -6
  105. package/shared.module.d.ts +5 -2
  106. package/templates/file-info-template.directive.d.ts +1 -1
  107. package/templates/file-template.directive.d.ts +1 -1
  108. package/templates/template-context.directive.d.ts +1 -1
  109. package/types/async-settings.d.ts +1 -1
  110. package/types/chunk-info.d.ts +1 -1
  111. package/types/chunk-map.d.ts +1 -1
  112. package/types/chunk-metadata.d.ts +1 -1
  113. package/types/chunk-settings.d.ts +1 -1
  114. package/types/direction.d.ts +1 -1
  115. package/types/file-groups.d.ts +22 -1
  116. package/types/file-info.d.ts +1 -1
  117. package/types/file-map.d.ts +1 -1
  118. package/types/file-restrictions.d.ts +1 -1
  119. package/types/file-state.d.ts +1 -1
  120. package/types/operation-type.d.ts +1 -1
  121. package/types.d.ts +1 -1
  122. package/upload.component.d.ts +15 -10
  123. package/upload.module.d.ts +8 -7
  124. package/upload.service.d.ts +1 -1
  125. package/uploads.module.d.ts +1 -1
  126. package/bundles/kendo-angular-upload.umd.js +0 -5
  127. package/esm2015/dropzone.component.js +0 -112
  128. package/esm2015/rendering/file-list-item-action-button.component.js +0 -226
  129. package/esm2015/rendering/file-list-multiple-items.component.js +0 -172
  130. package/esm2015/rendering/file-list-single-item.component.js +0 -154
  131. package/esm2015/types/chunk-settings.js +0 -5
  132. package/esm2015/types/direction.js +0 -5
  133. package/esm2015/types/file-info.js +0 -5
  134. package/esm2015/types/file-restrictions.js +0 -5
  135. package/esm2015/types/operation-type.js +0 -5
  136. package/schematics/ngAdd/index.js.map +0 -1
@@ -1,226 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Input, Component } from '@angular/core';
6
- import { FileState } from '../types';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "../upload.service";
9
- import * as i2 from "@progress/kendo-angular-l10n";
10
- import * as i3 from "./../navigation.service";
11
- import * as i4 from "@angular/common";
12
- /**
13
- * @hidden
14
- */
15
- export class FileListItemActionButtonComponent {
16
- constructor(uploadService, localization, navigation) {
17
- this.uploadService = uploadService;
18
- this.localization = localization;
19
- this.navigation = navigation;
20
- this.actionFocused = false;
21
- this.retryFocused = false;
22
- this.pauseResumeFocused = false;
23
- }
24
- onFocus(type) {
25
- if (type === 'action') {
26
- this.actionFocused = true;
27
- }
28
- if (type === 'retry') {
29
- this.retryFocused = true;
30
- }
31
- if (type === 'pauseResume') {
32
- this.pauseResumeFocused = true;
33
- }
34
- }
35
- onBlur(type) {
36
- if (type === 'retry') {
37
- this.retryFocused = false;
38
- }
39
- if (type === 'action') {
40
- this.actionFocused = false;
41
- }
42
- if (type === 'pauseResume') {
43
- this.pauseResumeFocused = false;
44
- }
45
- }
46
- onRetryClick() {
47
- if (this.disabled) {
48
- return;
49
- }
50
- this.uploadService.retryFiles(this.file.uid);
51
- }
52
- onRemoveCancelClick(event) {
53
- if (this.disabled) {
54
- return;
55
- }
56
- event.stopImmediatePropagation();
57
- const uid = this.file.uid;
58
- if (this.file.state === FileState.Uploading) {
59
- this.uploadService.cancelFiles(uid);
60
- }
61
- else {
62
- this.uploadService.removeFiles(uid);
63
- }
64
- this.navigation.focusSelectButton();
65
- }
66
- onPauseResumeClick() {
67
- if (this.disabled) {
68
- return;
69
- }
70
- const uid = this.file.uid;
71
- if (this.file.state === FileState.Paused) {
72
- this.uploadService.resumeFile(uid);
73
- }
74
- else {
75
- this.uploadService.pauseFile(uid);
76
- }
77
- }
78
- get actionButtonTitle() {
79
- if (this.file.state === FileState.Uploading) {
80
- return this.localization.get('cancel');
81
- }
82
- return this.localization.get('remove');
83
- }
84
- get retryButtonTitle() {
85
- return this.localization.get('retry');
86
- }
87
- get pauseResumeButtonTitle() {
88
- if (this.file.state === FileState.Uploading) {
89
- return this.localization.get('pause');
90
- }
91
- return this.localization.get('resume');
92
- }
93
- get isUploading() {
94
- return this.file.state === FileState.Uploading;
95
- }
96
- get isFailed() {
97
- return this.file.state === FileState.Failed;
98
- }
99
- get isPaused() {
100
- return this.file.state === FileState.Paused;
101
- }
102
- get isResumable() {
103
- const service = this.uploadService;
104
- const isResumable = service.async.chunk && service.chunk.resumable;
105
- const isUploading = (this.file.state === FileState.Paused) || (this.file.state === FileState.Uploading);
106
- return isResumable && isUploading;
107
- }
108
- get isActionButtonVisible() {
109
- if ((this.file.state === FileState.Uploaded || this.file.state === FileState.Initial) &&
110
- !this.uploadService.async.removeUrl && this.uploadService.component === 'Upload') {
111
- return false;
112
- }
113
- return true;
114
- }
115
- }
116
- FileListItemActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemActionButtonComponent, deps: [{ token: i1.UploadService }, { token: i2.LocalizationService }, { token: i3.NavigationService }], target: i0.ɵɵFactoryTarget.Component });
117
- FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: { file: "file", disabled: "disabled", progress: "progress" }, ngImport: i0, template: `
118
- <strong class="k-upload-status">
119
- <span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
120
-
121
- <button type="button" *ngIf="isFailed" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
122
- [ngClass]="{ 'k-focus': this.retryFocused }"
123
- [attr.tabIndex]="-1"
124
- (focus)="onFocus('retry')"
125
- (blur)="onBlur('retry')"
126
- (click)="onRetryClick()">
127
- <span class="k-icon k-button-icon k-retry k-i-refresh-sm"
128
- [attr.aria-label]="retryButtonTitle"
129
- [attr.title]="retryButtonTitle">
130
- </span>
131
- </button>
132
-
133
- <button *ngIf="isResumable" type="button" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
134
- [ngClass]="{ 'k-focus': this.pauseResumeFocused }"
135
- [attr.tabIndex]="-1"
136
- (focus)="onFocus('pauseResume')"
137
- (blur)="onBlur('pauseResume')"
138
- (click)="onPauseResumeClick()">
139
- <span class="k-icon k-button-icon"
140
- [ngClass]="{
141
- 'k-i-play-sm': isPaused,
142
- 'k-i-pause-sm': !isPaused
143
- }"
144
- [attr.aria-label]='pauseResumeButtonTitle'
145
- [attr.title]='pauseResumeButtonTitle'>
146
- </span>
147
- </button>
148
-
149
- <button type="button" *ngIf="isActionButtonVisible" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
150
- [ngClass]="{ 'k-focus': this.actionFocused }"
151
- [attr.tabIndex]="-1"
152
- (focus)="onFocus('action')"
153
- (blur)="onBlur('action')"
154
- (click)="onRemoveCancelClick($event)">
155
- <span class="k-icon k-button-icon"
156
- [ngClass]="{
157
- 'k-i-cancel': isUploading,
158
- 'k-delete k-i-x': !isUploading
159
- }"
160
- [attr.aria-label]='actionButtonTitle'
161
- [attr.title]='actionButtonTitle'>
162
- </span>
163
- </button>
164
- </strong>
165
- `, isInline: true, directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemActionButtonComponent, decorators: [{
167
- type: Component,
168
- args: [{
169
- selector: 'kendo-upload-file-list-item-action-button',
170
- template: `
171
- <strong class="k-upload-status">
172
- <span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
173
-
174
- <button type="button" *ngIf="isFailed" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
175
- [ngClass]="{ 'k-focus': this.retryFocused }"
176
- [attr.tabIndex]="-1"
177
- (focus)="onFocus('retry')"
178
- (blur)="onBlur('retry')"
179
- (click)="onRetryClick()">
180
- <span class="k-icon k-button-icon k-retry k-i-refresh-sm"
181
- [attr.aria-label]="retryButtonTitle"
182
- [attr.title]="retryButtonTitle">
183
- </span>
184
- </button>
185
-
186
- <button *ngIf="isResumable" type="button" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
187
- [ngClass]="{ 'k-focus': this.pauseResumeFocused }"
188
- [attr.tabIndex]="-1"
189
- (focus)="onFocus('pauseResume')"
190
- (blur)="onBlur('pauseResume')"
191
- (click)="onPauseResumeClick()">
192
- <span class="k-icon k-button-icon"
193
- [ngClass]="{
194
- 'k-i-play-sm': isPaused,
195
- 'k-i-pause-sm': !isPaused
196
- }"
197
- [attr.aria-label]='pauseResumeButtonTitle'
198
- [attr.title]='pauseResumeButtonTitle'>
199
- </span>
200
- </button>
201
-
202
- <button type="button" *ngIf="isActionButtonVisible" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
203
- [ngClass]="{ 'k-focus': this.actionFocused }"
204
- [attr.tabIndex]="-1"
205
- (focus)="onFocus('action')"
206
- (blur)="onBlur('action')"
207
- (click)="onRemoveCancelClick($event)">
208
- <span class="k-icon k-button-icon"
209
- [ngClass]="{
210
- 'k-i-cancel': isUploading,
211
- 'k-delete k-i-x': !isUploading
212
- }"
213
- [attr.aria-label]='actionButtonTitle'
214
- [attr.title]='actionButtonTitle'>
215
- </span>
216
- </button>
217
- </strong>
218
- `
219
- }]
220
- }], ctorParameters: function () { return [{ type: i1.UploadService }, { type: i2.LocalizationService }, { type: i3.NavigationService }]; }, propDecorators: { file: [{
221
- type: Input
222
- }], disabled: [{
223
- type: Input
224
- }], progress: [{
225
- type: Input
226
- }] } });
@@ -1,172 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Input, Component } from '@angular/core';
6
- import { animate, state, style, transition, trigger } from '@angular/animations';
7
- import { FileState } from '../types';
8
- import { FileListItemBase } from './file-list-item-base';
9
- import { isPresent } from '../common/util';
10
- import * as i0 from "@angular/core";
11
- import * as i1 from "@progress/kendo-angular-l10n";
12
- import * as i2 from "../upload.service";
13
- import * as i3 from "./file-list-item-action-button.component";
14
- import * as i4 from "@angular/common";
15
- import * as i5 from "../templates/template-context.directive";
16
- /**
17
- * @hidden
18
- */
19
- export class FileListMultipleItemsComponent extends FileListItemBase {
20
- constructor(localization, uploadService) {
21
- super(uploadService);
22
- this.localization = localization;
23
- this.subscribeUploadProgress((args) => {
24
- if (args.files[0].uid === this.files[0].uid) {
25
- this.progressComplete = args.percentComplete;
26
- }
27
- });
28
- }
29
- get showProgress() {
30
- const showProgress = this.files[0].state === FileState.Uploading || this.files[0].state === FileState.Paused;
31
- return showProgress ? 'active' : 'inactive';
32
- }
33
- ngOnInit() {
34
- this.filesHaveErrors = super.filesHaveValidationErrors(this.files);
35
- }
36
- fileStatusText(file) {
37
- const errors = file.validationErrors;
38
- if (!isPresent(errors)) {
39
- return this.getTotalFilesSizeMessage([file]);
40
- }
41
- return this.getFileValidationMessage(file);
42
- }
43
- get batchStatusText() {
44
- const state = this.files[0].state;
45
- const fileCount = this.files.length;
46
- if (state === FileState.Uploaded) {
47
- return `${fileCount} ${this.textFor('filesBatchStatusUploaded')}`;
48
- }
49
- if (state === FileState.Failed) {
50
- return `${fileCount} ${this.textFor('filesBatchStatusFailed')}`;
51
- }
52
- return `${fileCount} ${this.textFor('filesBatchStatus')}`;
53
- }
54
- get isUploadSuccessful() {
55
- return this.files[0].state === FileState.Uploaded;
56
- }
57
- get isUploadFailed() {
58
- return this.files[0].state === FileState.Failed;
59
- }
60
- }
61
- FileListMultipleItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListMultipleItemsComponent, deps: [{ token: i1.LocalizationService }, { token: i2.UploadService }], target: i0.ɵɵFactoryTarget.Component });
62
- FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: { disabled: "disabled", files: "files", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
63
- <div class="k-progressbar" [@progressState]="showProgress">
64
- <span class="k-progress" [style.width]="progressComplete + '%'"></span>
65
- </div>
66
- <span class="k-multiple-files-group-wrapper">
67
- <span class="k-file-group k-icon k-i-copy"></span>
68
- </span>
69
- <span class="k-multiple-files-wrapper">
70
- <ng-container *ngIf="!fileInfoTemplate">
71
- <span *ngFor="let file of files" class="k-file-name-size-wrapper">
72
- <span [title]="file.name" class="k-file-name">
73
- {{file.name}}
74
- </span>
75
- <span [ngClass]="{
76
- 'k-text-error': file.validationErrors,
77
- 'k-file-validation-message': file.validationErrors,
78
- 'k-file-size': !file.validationErrors
79
- }"
80
- >{{fileStatusText(file)}}</span>
81
- </span>
82
- <span class="k-file-information"
83
- [ngClass]="{
84
- 'k-text-success': isUploadSuccessful,
85
- 'k-text-error': isUploadFailed
86
- }"
87
- >{{batchStatusText}}</span>
88
- </ng-container>
89
- <ng-template *ngIf="fileInfoTemplate"
90
- [templateContext]="{
91
- templateRef: fileInfoTemplate.templateRef,
92
- state: files[0].state,
93
- $implicit: files
94
- }">
95
- </ng-template>
96
- </span>
97
- <kendo-upload-file-list-item-action-button
98
- [file]='files[0]'
99
- [disabled]='disabled'
100
- [progress]='progressComplete'>
101
- </kendo-upload-file-list-item-action-button>
102
- `, isInline: true, components: [{ type: i3.FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
103
- trigger('progressState', [
104
- state('active', style({ opacity: 1 })),
105
- state('inactive', style({ opacity: 0 })),
106
- transition('void => active', style({ opacity: 0 })),
107
- transition('inactive => active', style({ opacity: 1 })),
108
- transition('active => inactive', animate('1s 2s ease-out'))
109
- ])
110
- ] });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListMultipleItemsComponent, decorators: [{
112
- type: Component,
113
- args: [{
114
- animations: [
115
- trigger('progressState', [
116
- state('active', style({ opacity: 1 })),
117
- state('inactive', style({ opacity: 0 })),
118
- transition('void => active', style({ opacity: 0 })),
119
- transition('inactive => active', style({ opacity: 1 })),
120
- transition('active => inactive', animate('1s 2s ease-out'))
121
- ])
122
- ],
123
- selector: 'kendo-upload-file-list-multiple-items',
124
- template: `
125
- <div class="k-progressbar" [@progressState]="showProgress">
126
- <span class="k-progress" [style.width]="progressComplete + '%'"></span>
127
- </div>
128
- <span class="k-multiple-files-group-wrapper">
129
- <span class="k-file-group k-icon k-i-copy"></span>
130
- </span>
131
- <span class="k-multiple-files-wrapper">
132
- <ng-container *ngIf="!fileInfoTemplate">
133
- <span *ngFor="let file of files" class="k-file-name-size-wrapper">
134
- <span [title]="file.name" class="k-file-name">
135
- {{file.name}}
136
- </span>
137
- <span [ngClass]="{
138
- 'k-text-error': file.validationErrors,
139
- 'k-file-validation-message': file.validationErrors,
140
- 'k-file-size': !file.validationErrors
141
- }"
142
- >{{fileStatusText(file)}}</span>
143
- </span>
144
- <span class="k-file-information"
145
- [ngClass]="{
146
- 'k-text-success': isUploadSuccessful,
147
- 'k-text-error': isUploadFailed
148
- }"
149
- >{{batchStatusText}}</span>
150
- </ng-container>
151
- <ng-template *ngIf="fileInfoTemplate"
152
- [templateContext]="{
153
- templateRef: fileInfoTemplate.templateRef,
154
- state: files[0].state,
155
- $implicit: files
156
- }">
157
- </ng-template>
158
- </span>
159
- <kendo-upload-file-list-item-action-button
160
- [file]='files[0]'
161
- [disabled]='disabled'
162
- [progress]='progressComplete'>
163
- </kendo-upload-file-list-item-action-button>
164
- `
165
- }]
166
- }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.UploadService }]; }, propDecorators: { disabled: [{
167
- type: Input
168
- }], files: [{
169
- type: Input
170
- }], fileInfoTemplate: [{
171
- type: Input
172
- }] } });
@@ -1,154 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Input, Component } from '@angular/core';
6
- import { animate, state, style, transition, trigger } from '@angular/animations';
7
- import { FileState } from '../types';
8
- import { FileListItemBase } from './file-list-item-base';
9
- import { getFileGroupCssClass, isPresent } from '../common/util';
10
- import * as i0 from "@angular/core";
11
- import * as i1 from "@progress/kendo-angular-l10n";
12
- import * as i2 from "../upload.service";
13
- import * as i3 from "./file-list-item-action-button.component";
14
- import * as i4 from "@angular/common";
15
- import * as i5 from "../templates/template-context.directive";
16
- /**
17
- * @hidden
18
- */
19
- export class FileListSingleItemComponent extends FileListItemBase {
20
- constructor(localization, uploadService) {
21
- super(uploadService);
22
- this.localization = localization;
23
- this.subscribeUploadProgress((args) => {
24
- if (args.files[0].uid === this.file.uid) {
25
- this.progressComplete = args.percentComplete;
26
- }
27
- });
28
- }
29
- get fileStatusText() {
30
- const errors = this.file.validationErrors;
31
- if (this.file.state === FileState.Uploaded) {
32
- return `${this.textFor('fileStatusUploaded')}`;
33
- }
34
- if (this.file.state === FileState.Failed) {
35
- return `${this.textFor('fileStatusFailed')}`;
36
- }
37
- if (!isPresent(errors)) {
38
- return this.getTotalFilesSizeMessage([this.file]);
39
- }
40
- return this.getFileValidationMessage(this.file);
41
- }
42
- get showProgress() {
43
- const showProgress = this.file.state === FileState.Uploading || this.file.state === FileState.Paused;
44
- return showProgress ? 'active' : 'inactive';
45
- }
46
- get fileGroupClass() {
47
- return getFileGroupCssClass(this.file.extension ? this.file.extension : '');
48
- }
49
- get isUploadSuccessful() {
50
- return this.file.state === FileState.Uploaded;
51
- }
52
- get isUploadFailed() {
53
- return this.file.state === FileState.Failed;
54
- }
55
- get isNotYetUploaded() {
56
- return !this.isUploadFailed && !this.isUploadSuccessful;
57
- }
58
- }
59
- FileListSingleItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListSingleItemComponent, deps: [{ token: i1.LocalizationService }, { token: i2.UploadService }], target: i0.ɵɵFactoryTarget.Component });
60
- FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListSingleItemComponent, selector: "kendo-upload-file-list-single-item", inputs: { disabled: "disabled", file: "file", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
61
- <div class="k-progressbar" [@progressState]="showProgress">
62
- <span class="k-progress" [style.width]="progressComplete + '%'"></span>
63
- </div>
64
- <span class="k-file-group-wrapper">
65
- <span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
66
- </span>
67
- <span class="k-file-name-size-wrapper">
68
- <ng-container *ngIf="!fileInfoTemplate">
69
- <span class="k-file-name" [title]="file.name">{{ file.name }}</span>
70
- <span [ngClass]="{
71
- 'k-file-validation-message': file.validationErrors,
72
- 'k-file-size': !file.validationErrors && isNotYetUploaded,
73
- 'k-text-success': isUploadSuccessful,
74
- 'k-text-error': file.validationErrors || isUploadFailed,
75
- 'k-file-information': isUploadSuccessful || isUploadFailed
76
- }"
77
- >{{fileStatusText}}</span>
78
- </ng-container>
79
- <ng-template *ngIf="fileInfoTemplate"
80
- [templateContext]="{
81
- templateRef: fileInfoTemplate.templateRef,
82
- state: file.state,
83
- $implicit: [file]
84
- }">
85
- </ng-template>
86
- </span>
87
- <kendo-upload-file-list-item-action-button
88
- [file]='file'
89
- [disabled]='disabled'
90
- [progress]='progressComplete'>
91
- </kendo-upload-file-list-item-action-button>
92
- `, isInline: true, components: [{ type: i3.FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
93
- trigger('progressState', [
94
- state('active', style({ opacity: 1 })),
95
- state('inactive', style({ opacity: 0 })),
96
- transition('void => active', style({ opacity: 0 })),
97
- transition('inactive => active', style({ opacity: 1 })),
98
- transition('active => inactive', animate('1s 2s ease-out'))
99
- ])
100
- ] });
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListSingleItemComponent, decorators: [{
102
- type: Component,
103
- args: [{
104
- animations: [
105
- trigger('progressState', [
106
- state('active', style({ opacity: 1 })),
107
- state('inactive', style({ opacity: 0 })),
108
- transition('void => active', style({ opacity: 0 })),
109
- transition('inactive => active', style({ opacity: 1 })),
110
- transition('active => inactive', animate('1s 2s ease-out'))
111
- ])
112
- ],
113
- selector: 'kendo-upload-file-list-single-item',
114
- template: `
115
- <div class="k-progressbar" [@progressState]="showProgress">
116
- <span class="k-progress" [style.width]="progressComplete + '%'"></span>
117
- </div>
118
- <span class="k-file-group-wrapper">
119
- <span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
120
- </span>
121
- <span class="k-file-name-size-wrapper">
122
- <ng-container *ngIf="!fileInfoTemplate">
123
- <span class="k-file-name" [title]="file.name">{{ file.name }}</span>
124
- <span [ngClass]="{
125
- 'k-file-validation-message': file.validationErrors,
126
- 'k-file-size': !file.validationErrors && isNotYetUploaded,
127
- 'k-text-success': isUploadSuccessful,
128
- 'k-text-error': file.validationErrors || isUploadFailed,
129
- 'k-file-information': isUploadSuccessful || isUploadFailed
130
- }"
131
- >{{fileStatusText}}</span>
132
- </ng-container>
133
- <ng-template *ngIf="fileInfoTemplate"
134
- [templateContext]="{
135
- templateRef: fileInfoTemplate.templateRef,
136
- state: file.state,
137
- $implicit: [file]
138
- }">
139
- </ng-template>
140
- </span>
141
- <kendo-upload-file-list-item-action-button
142
- [file]='file'
143
- [disabled]='disabled'
144
- [progress]='progressComplete'>
145
- </kendo-upload-file-list-item-action-button>
146
- `
147
- }]
148
- }], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.UploadService }]; }, propDecorators: { disabled: [{
149
- type: Input
150
- }], file: [{
151
- type: Input
152
- }], fileInfoTemplate: [{
153
- type: Input
154
- }] } });
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1,5 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../tooling/schematics/ngAdd/index.ts"],"names":[],"mappings":";;AAAA,2DAKqC;AAErC,mBAAyB,OAAY;IACjC,MAAM,YAAY,mCACX,OAAO,KACV,YAAY,EAAE,eAAe,EAC7B,OAAO,EAAE,QAAQ,EACjB,YAAY,EAAE;YACV;gBACI,MAAM,EAAE,kBAAkB;gBAC1B,IAAI,EAAE,sBAAsB;aAC/B;SACJ,GACJ,CAAC;IAEF,OAAO,8BAAiB,CAAC,4BAA4B,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AACnF,CAAC;AAdD,4BAcC"}