@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.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +4 -4
- package/README.md +1 -1
- package/common/action-buttons-layout.d.ts +1 -1
- package/common/util.d.ts +1 -1
- package/common/validation-util.d.ts +1 -1
- package/dropzone-base.d.ts +2 -2
- package/dropzone-external.directive.d.ts +1 -1
- package/dropzone-internal.directive.d.ts +1 -1
- package/dropzone.component.d.ts +11 -3
- package/dropzone.service.d.ts +1 -1
- package/{esm2015/types/chunk-metadata.js → esm2020/common/action-buttons-layout.mjs} +1 -1
- package/{esm2015/common/util.js → esm2020/common/util.mjs} +13 -10
- package/{esm2015/common/validation-util.js → esm2020/common/validation-util.mjs} +2 -2
- package/{esm2015/dropzone-base.js → esm2020/dropzone-base.mjs} +5 -5
- package/{esm2015/dropzone-external.directive.js → esm2020/dropzone-external.directive.mjs} +5 -5
- package/{esm2015/dropzone-internal.directive.js → esm2020/dropzone-internal.directive.mjs} +11 -7
- package/esm2020/dropzone.component.mjs +134 -0
- package/{esm2015/dropzone.service.js → esm2020/dropzone.service.mjs} +5 -5
- package/{esm2015/events/cancel-event.js → esm2020/events/cancel-event.mjs} +1 -1
- package/{esm2015/events/clear-event.js → esm2020/events/clear-event.mjs} +1 -1
- package/{esm2015/events/error-event.js → esm2020/events/error-event.mjs} +1 -1
- package/{esm2015/events/pause-event.js → esm2020/events/pause-event.mjs} +1 -1
- package/{esm2015/events/preventable-event.js → esm2020/events/preventable-event.mjs} +1 -1
- package/{esm2015/events/remove-event.js → esm2020/events/remove-event.mjs} +1 -1
- package/{esm2015/events/resume-event.js → esm2020/events/resume-event.mjs} +1 -1
- package/{esm2015/events/select-event.js → esm2020/events/select-event.mjs} +1 -1
- package/{esm2015/events/success-event.js → esm2020/events/success-event.mjs} +1 -1
- package/{esm2015/events/upload-event.js → esm2020/events/upload-event.mjs} +1 -1
- package/{esm2015/events/upload-progress-event.js → esm2020/events/upload-progress-event.mjs} +1 -1
- package/{esm2015/events.js → esm2020/events.mjs} +1 -1
- package/{esm2015/file-select.directive.js → esm2020/file-select.directive.mjs} +7 -5
- package/{esm2015/fileselect.component.js → esm2020/fileselect.component.mjs} +100 -60
- package/{esm2015/fileselect.module.js → esm2020/fileselect.module.mjs} +7 -6
- package/{esm2015/main.js → esm2020/index.mjs} +2 -1
- package/{esm2015/localization/custom-messages.component.js → esm2020/localization/custom-messages.component.mjs} +5 -4
- package/{esm2015/localization/localized-messages.directive.js → esm2020/localization/localized-messages.directive.mjs} +5 -4
- package/{esm2015/localization/messages.js → esm2020/localization/messages.mjs} +4 -4
- package/{esm2015/navigation.service.js → esm2020/navigation.service.mjs} +56 -40
- package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +3 -3
- package/{esm2015/kendo-angular-upload.js → esm2020/progress-kendo-angular-upload.mjs} +2 -2
- package/esm2020/rendering/file-list-item-action-button.component.mjs +262 -0
- package/{esm2015/rendering/file-list-item-base.js → esm2020/rendering/file-list-item-base.mjs} +5 -4
- package/{esm2015/rendering/file-list-item.js → esm2020/rendering/file-list-item.mjs} +7 -5
- package/esm2020/rendering/file-list-multiple-items.component.mjs +186 -0
- package/esm2020/rendering/file-list-single-item.component.mjs +185 -0
- package/{esm2015/rendering/file-list.component.js → esm2020/rendering/file-list.component.mjs} +16 -11
- package/{esm2015/rendering/upload-action-buttons.component.js → esm2020/rendering/upload-action-buttons.component.mjs} +8 -5
- package/{esm2015/rendering/upload-status-total.component.js → esm2020/rendering/upload-status-total.component.mjs} +51 -22
- package/{esm2015/shared.module.js → esm2020/shared.module.mjs} +15 -9
- package/{esm2015/templates/file-info-template.directive.js → esm2020/templates/file-info-template.directive.mjs} +5 -5
- package/{esm2015/templates/file-template.directive.js → esm2020/templates/file-template.directive.mjs} +5 -5
- package/{esm2015/templates/template-context.directive.js → esm2020/templates/template-context.directive.mjs} +5 -5
- package/{esm2015/common/action-buttons-layout.js → esm2020/types/async-settings.mjs} +1 -1
- package/{esm2015/types/chunk-info.js → esm2020/types/chunk-info.mjs} +1 -1
- package/{esm2015/types/chunk-map.js → esm2020/types/chunk-map.mjs} +1 -1
- package/{esm2015/types/async-settings.js → esm2020/types/chunk-metadata.mjs} +1 -1
- package/esm2020/types/chunk-settings.mjs +5 -0
- package/esm2020/types/direction.mjs +5 -0
- package/{esm2015/types/file-groups.js → esm2020/types/file-groups.mjs} +19 -1
- package/esm2020/types/file-info.mjs +5 -0
- package/{esm2015/types/file-map.js → esm2020/types/file-map.mjs} +26 -26
- package/esm2020/types/file-restrictions.mjs +5 -0
- package/{esm2015/types/file-state.js → esm2020/types/file-state.mjs} +1 -1
- package/esm2020/types/operation-type.mjs +5 -0
- package/{esm2015/types.js → esm2020/types.mjs} +1 -1
- package/{esm2015/upload.component.js → esm2020/upload.component.mjs} +125 -80
- package/{esm2015/upload.module.js → esm2020/upload.module.mjs} +8 -7
- package/{esm2015/upload.service.js → esm2020/upload.service.mjs} +35 -35
- package/{esm2015/uploads.module.js → esm2020/uploads.module.mjs} +5 -5
- package/events/cancel-event.d.ts +1 -1
- package/events/clear-event.d.ts +1 -1
- package/events/error-event.d.ts +1 -1
- package/events/pause-event.d.ts +1 -1
- package/events/preventable-event.d.ts +1 -1
- package/events/remove-event.d.ts +1 -1
- package/events/resume-event.d.ts +1 -1
- package/events/select-event.d.ts +1 -1
- package/events/success-event.d.ts +1 -1
- package/events/upload-event.d.ts +1 -1
- package/events/upload-progress-event.d.ts +3 -3
- package/events.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-upload.mjs +4997 -0
- package/{fesm2015/kendo-angular-upload.js → fesm2020/progress-kendo-angular-upload.mjs} +829 -592
- package/file-select.directive.d.ts +1 -1
- package/fileselect.component.d.ts +13 -8
- package/fileselect.module.d.ts +8 -7
- package/{main.d.ts → index.d.ts} +2 -1
- package/localization/custom-messages.component.d.ts +1 -1
- package/localization/localized-messages.directive.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/navigation.service.d.ts +4 -3
- package/package-metadata.d.ts +1 -1
- package/package.json +30 -55
- package/{kendo-angular-upload.d.ts → progress-kendo-angular-upload.d.ts} +2 -2
- package/rendering/file-list-item-action-button.component.d.ts +8 -2
- package/rendering/file-list-item-base.d.ts +2 -2
- package/rendering/file-list-item.d.ts +1 -1
- package/rendering/file-list-multiple-items.component.d.ts +3 -1
- package/rendering/file-list-single-item.component.d.ts +3 -1
- package/rendering/file-list.component.d.ts +1 -1
- package/rendering/upload-action-buttons.component.d.ts +1 -1
- package/rendering/upload-status-total.component.d.ts +8 -1
- package/schematics/ngAdd/index.js +8 -6
- package/shared.module.d.ts +5 -2
- package/templates/file-info-template.directive.d.ts +1 -1
- package/templates/file-template.directive.d.ts +1 -1
- package/templates/template-context.directive.d.ts +1 -1
- package/types/async-settings.d.ts +1 -1
- package/types/chunk-info.d.ts +1 -1
- package/types/chunk-map.d.ts +1 -1
- package/types/chunk-metadata.d.ts +1 -1
- package/types/chunk-settings.d.ts +1 -1
- package/types/direction.d.ts +1 -1
- package/types/file-groups.d.ts +22 -1
- package/types/file-info.d.ts +1 -1
- package/types/file-map.d.ts +1 -1
- package/types/file-restrictions.d.ts +1 -1
- package/types/file-state.d.ts +1 -1
- package/types/operation-type.d.ts +1 -1
- package/types.d.ts +1 -1
- package/upload.component.d.ts +15 -10
- package/upload.module.d.ts +8 -7
- package/upload.service.d.ts +1 -1
- package/uploads.module.d.ts +1 -1
- package/bundles/kendo-angular-upload.umd.js +0 -5
- package/esm2015/dropzone.component.js +0 -112
- package/esm2015/rendering/file-list-item-action-button.component.js +0 -226
- package/esm2015/rendering/file-list-multiple-items.component.js +0 -172
- package/esm2015/rendering/file-list-single-item.component.js +0 -154
- package/esm2015/types/chunk-settings.js +0 -5
- package/esm2015/types/direction.js +0 -5
- package/esm2015/types/file-info.js +0 -5
- package/esm2015/types/file-restrictions.js +0 -5
- package/esm2015/types/operation-type.js +0 -5
- package/schematics/ngAdd/index.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
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
5
|
/**
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-upload',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1673510538,
|
|
13
13
|
version: '',
|
|
14
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license
|
|
14
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
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
5
|
/**
|
|
6
6
|
* Generated bundle index. Do not edit.
|
|
7
7
|
*/
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './index';
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 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 { UploadService } from '../upload.service';
|
|
8
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
+
import { NavigationService } from './../navigation.service';
|
|
10
|
+
import { arrowRotateCwSmallIcon, cancelIcon, pauseSmIcon, playSmIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "../upload.service";
|
|
13
|
+
import * as i2 from "@progress/kendo-angular-l10n";
|
|
14
|
+
import * as i3 from "./../navigation.service";
|
|
15
|
+
import * as i4 from "@progress/kendo-angular-icons";
|
|
16
|
+
import * as i5 from "@angular/common";
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export class FileListItemActionButtonComponent {
|
|
21
|
+
constructor(uploadService, localization, navigation) {
|
|
22
|
+
this.uploadService = uploadService;
|
|
23
|
+
this.localization = localization;
|
|
24
|
+
this.navigation = navigation;
|
|
25
|
+
this.actionFocused = false;
|
|
26
|
+
this.retryFocused = false;
|
|
27
|
+
this.pauseResumeFocused = false;
|
|
28
|
+
this.retrySVGIcon = arrowRotateCwSmallIcon;
|
|
29
|
+
this.playSVGIcon = playSmIcon;
|
|
30
|
+
this.pauseSVGIcon = pauseSmIcon;
|
|
31
|
+
this.cancelSVGIcon = cancelIcon;
|
|
32
|
+
this.deleteSVGIcon = xIcon;
|
|
33
|
+
}
|
|
34
|
+
onFocus(type) {
|
|
35
|
+
if (type === 'action') {
|
|
36
|
+
this.actionFocused = true;
|
|
37
|
+
}
|
|
38
|
+
if (type === 'retry') {
|
|
39
|
+
this.retryFocused = true;
|
|
40
|
+
}
|
|
41
|
+
if (type === 'pauseResume') {
|
|
42
|
+
this.pauseResumeFocused = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
onBlur(type) {
|
|
46
|
+
if (type === 'retry') {
|
|
47
|
+
this.retryFocused = false;
|
|
48
|
+
}
|
|
49
|
+
if (type === 'action') {
|
|
50
|
+
this.actionFocused = false;
|
|
51
|
+
}
|
|
52
|
+
if (type === 'pauseResume') {
|
|
53
|
+
this.pauseResumeFocused = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
onRetryClick() {
|
|
57
|
+
if (this.disabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.uploadService.retryFiles(this.file.uid);
|
|
61
|
+
}
|
|
62
|
+
onRemoveCancelClick(event) {
|
|
63
|
+
if (this.disabled) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
event.stopImmediatePropagation();
|
|
67
|
+
const uid = this.file.uid;
|
|
68
|
+
if (this.file.state === FileState.Uploading) {
|
|
69
|
+
this.uploadService.cancelFiles(uid);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.uploadService.removeFiles(uid);
|
|
73
|
+
}
|
|
74
|
+
this.navigation.focusSelectButton();
|
|
75
|
+
}
|
|
76
|
+
onPauseResumeClick() {
|
|
77
|
+
if (this.disabled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const uid = this.file.uid;
|
|
81
|
+
if (this.file.state === FileState.Paused) {
|
|
82
|
+
this.uploadService.resumeFile(uid);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.uploadService.pauseFile(uid);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
get actionButtonTitle() {
|
|
89
|
+
if (this.file.state === FileState.Uploading) {
|
|
90
|
+
return this.localization.get('cancel');
|
|
91
|
+
}
|
|
92
|
+
return this.localization.get('remove');
|
|
93
|
+
}
|
|
94
|
+
get retryButtonTitle() {
|
|
95
|
+
return this.localization.get('retry');
|
|
96
|
+
}
|
|
97
|
+
get pauseResumeButtonTitle() {
|
|
98
|
+
if (this.file.state === FileState.Uploading) {
|
|
99
|
+
return this.localization.get('pause');
|
|
100
|
+
}
|
|
101
|
+
return this.localization.get('resume');
|
|
102
|
+
}
|
|
103
|
+
get isUploading() {
|
|
104
|
+
return this.file.state === FileState.Uploading;
|
|
105
|
+
}
|
|
106
|
+
get isFailed() {
|
|
107
|
+
return this.file.state === FileState.Failed;
|
|
108
|
+
}
|
|
109
|
+
get isPaused() {
|
|
110
|
+
return this.file.state === FileState.Paused;
|
|
111
|
+
}
|
|
112
|
+
get isResumable() {
|
|
113
|
+
const service = this.uploadService;
|
|
114
|
+
const isResumable = service.async.chunk && service.chunk.resumable;
|
|
115
|
+
const isUploading = (this.file.state === FileState.Paused) || (this.file.state === FileState.Uploading);
|
|
116
|
+
return isResumable && isUploading;
|
|
117
|
+
}
|
|
118
|
+
get isActionButtonVisible() {
|
|
119
|
+
if ((this.file.state === FileState.Uploaded || this.file.state === FileState.Initial) &&
|
|
120
|
+
!this.uploadService.async.removeUrl && this.uploadService.component === 'Upload') {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
FileListItemActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemActionButtonComponent, deps: [{ token: i1.UploadService }, { token: i2.LocalizationService }, { token: i3.NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: { file: "file", disabled: "disabled", progress: "progress" }, ngImport: i0, template: `
|
|
128
|
+
<span class="k-upload-actions">
|
|
129
|
+
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
130
|
+
|
|
131
|
+
<button
|
|
132
|
+
*ngIf="isFailed"
|
|
133
|
+
type="button"
|
|
134
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
135
|
+
[ngClass]="{ 'k-focus': this.retryFocused }"
|
|
136
|
+
[attr.tabIndex]="-1"
|
|
137
|
+
|
|
138
|
+
(focus)="onFocus('retry')"
|
|
139
|
+
(blur)="onBlur('retry')"
|
|
140
|
+
(click)="onRetryClick()"
|
|
141
|
+
>
|
|
142
|
+
<kendo-icon-wrapper
|
|
143
|
+
name="refresh-sm"
|
|
144
|
+
[svgIcon]="retrySVGIcon"
|
|
145
|
+
innerCssClass="k-retry"
|
|
146
|
+
[attr.aria-label]="retryButtonTitle"
|
|
147
|
+
[attr.title]="retryButtonTitle"
|
|
148
|
+
></kendo-icon-wrapper>
|
|
149
|
+
</button>
|
|
150
|
+
|
|
151
|
+
<button
|
|
152
|
+
*ngIf="isResumable"
|
|
153
|
+
type="button"
|
|
154
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
155
|
+
[ngClass]="{ 'k-focus': this.pauseResumeFocused }"
|
|
156
|
+
[attr.tabIndex]="-1"
|
|
157
|
+
(focus)="onFocus('pauseResume')"
|
|
158
|
+
(blur)="onBlur('pauseResume')"
|
|
159
|
+
(click)="onPauseResumeClick()"
|
|
160
|
+
>
|
|
161
|
+
<kendo-icon-wrapper
|
|
162
|
+
[name]="isPaused ? 'play-sm' : 'pause-sm'"
|
|
163
|
+
[svgIcon]="isPaused ? playSVGIcon : pauseSVGIcon"
|
|
164
|
+
[attr.aria-label]='pauseResumeButtonTitle'
|
|
165
|
+
[attr.title]='pauseResumeButtonTitle'
|
|
166
|
+
></kendo-icon-wrapper>
|
|
167
|
+
</button>
|
|
168
|
+
|
|
169
|
+
<button
|
|
170
|
+
*ngIf="isActionButtonVisible"
|
|
171
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
172
|
+
type="button"
|
|
173
|
+
[attr.tabIndex]="-1"
|
|
174
|
+
(focus)="onFocus('action')"
|
|
175
|
+
(blur)="onBlur('action')"
|
|
176
|
+
[ngClass]="{ 'k-focus': this.actionFocused }"
|
|
177
|
+
(click)="onRemoveCancelClick($event)"
|
|
178
|
+
>
|
|
179
|
+
<kendo-icon-wrapper
|
|
180
|
+
[name]="isUploading ? 'cancel' : 'x'"
|
|
181
|
+
[svgIcon]="isUploading ? cancelSVGIcon : deleteSVGIcon"
|
|
182
|
+
[innerCssClass]="!isUploading ? 'k-delete' : ''"
|
|
183
|
+
[attr.aria-label]='actionButtonTitle'
|
|
184
|
+
[attr.title]='actionButtonTitle'
|
|
185
|
+
></kendo-icon-wrapper>
|
|
186
|
+
</button>
|
|
187
|
+
</span>
|
|
188
|
+
`, isInline: true, components: [{ type: i4.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemActionButtonComponent, decorators: [{
|
|
190
|
+
type: Component,
|
|
191
|
+
args: [{
|
|
192
|
+
selector: 'kendo-upload-file-list-item-action-button',
|
|
193
|
+
template: `
|
|
194
|
+
<span class="k-upload-actions">
|
|
195
|
+
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
196
|
+
|
|
197
|
+
<button
|
|
198
|
+
*ngIf="isFailed"
|
|
199
|
+
type="button"
|
|
200
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
201
|
+
[ngClass]="{ 'k-focus': this.retryFocused }"
|
|
202
|
+
[attr.tabIndex]="-1"
|
|
203
|
+
|
|
204
|
+
(focus)="onFocus('retry')"
|
|
205
|
+
(blur)="onBlur('retry')"
|
|
206
|
+
(click)="onRetryClick()"
|
|
207
|
+
>
|
|
208
|
+
<kendo-icon-wrapper
|
|
209
|
+
name="refresh-sm"
|
|
210
|
+
[svgIcon]="retrySVGIcon"
|
|
211
|
+
innerCssClass="k-retry"
|
|
212
|
+
[attr.aria-label]="retryButtonTitle"
|
|
213
|
+
[attr.title]="retryButtonTitle"
|
|
214
|
+
></kendo-icon-wrapper>
|
|
215
|
+
</button>
|
|
216
|
+
|
|
217
|
+
<button
|
|
218
|
+
*ngIf="isResumable"
|
|
219
|
+
type="button"
|
|
220
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
221
|
+
[ngClass]="{ 'k-focus': this.pauseResumeFocused }"
|
|
222
|
+
[attr.tabIndex]="-1"
|
|
223
|
+
(focus)="onFocus('pauseResume')"
|
|
224
|
+
(blur)="onBlur('pauseResume')"
|
|
225
|
+
(click)="onPauseResumeClick()"
|
|
226
|
+
>
|
|
227
|
+
<kendo-icon-wrapper
|
|
228
|
+
[name]="isPaused ? 'play-sm' : 'pause-sm'"
|
|
229
|
+
[svgIcon]="isPaused ? playSVGIcon : pauseSVGIcon"
|
|
230
|
+
[attr.aria-label]='pauseResumeButtonTitle'
|
|
231
|
+
[attr.title]='pauseResumeButtonTitle'
|
|
232
|
+
></kendo-icon-wrapper>
|
|
233
|
+
</button>
|
|
234
|
+
|
|
235
|
+
<button
|
|
236
|
+
*ngIf="isActionButtonVisible"
|
|
237
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
238
|
+
type="button"
|
|
239
|
+
[attr.tabIndex]="-1"
|
|
240
|
+
(focus)="onFocus('action')"
|
|
241
|
+
(blur)="onBlur('action')"
|
|
242
|
+
[ngClass]="{ 'k-focus': this.actionFocused }"
|
|
243
|
+
(click)="onRemoveCancelClick($event)"
|
|
244
|
+
>
|
|
245
|
+
<kendo-icon-wrapper
|
|
246
|
+
[name]="isUploading ? 'cancel' : 'x'"
|
|
247
|
+
[svgIcon]="isUploading ? cancelSVGIcon : deleteSVGIcon"
|
|
248
|
+
[innerCssClass]="!isUploading ? 'k-delete' : ''"
|
|
249
|
+
[attr.aria-label]='actionButtonTitle'
|
|
250
|
+
[attr.title]='actionButtonTitle'
|
|
251
|
+
></kendo-icon-wrapper>
|
|
252
|
+
</button>
|
|
253
|
+
</span>
|
|
254
|
+
`
|
|
255
|
+
}]
|
|
256
|
+
}], ctorParameters: function () { return [{ type: i1.UploadService }, { type: i2.LocalizationService }, { type: i3.NavigationService }]; }, propDecorators: { file: [{
|
|
257
|
+
type: Input
|
|
258
|
+
}], disabled: [{
|
|
259
|
+
type: Input
|
|
260
|
+
}], progress: [{
|
|
261
|
+
type: Input
|
|
262
|
+
}] } });
|
package/{esm2015/rendering/file-list-item-base.js → esm2020/rendering/file-list-item-base.mjs}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
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
5
|
import { Component } from '@angular/core';
|
|
6
|
+
import { UploadService } from '../upload.service';
|
|
6
7
|
import { fileHasValidationErrors, filesHaveValidationErrors, getTotalFilesSizeMessage } from '../common/util';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
import * as i1 from "../upload.service";
|
|
@@ -40,9 +41,9 @@ export class FileListItemBase {
|
|
|
40
41
|
return this.localization.get(key);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
FileListItemBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
44
|
-
FileListItemBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
44
|
+
FileListItemBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemBase, deps: [{ token: i1.UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
FileListItemBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileListItemBase, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemBase, decorators: [{
|
|
46
47
|
type: Component,
|
|
47
48
|
args: [{ template: '' }]
|
|
48
49
|
}], ctorParameters: function () { return [{ type: i1.UploadService }]; } });
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
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 { Directive, HostBinding, HostListener, Input } from '@angular/core';
|
|
5
|
+
import { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core';
|
|
6
6
|
import { FileState } from '../types';
|
|
7
|
+
import { NavigationService } from '../navigation.service';
|
|
7
8
|
import { filesHaveValidationErrors, hasClasses, IGNORE_TARGET_CLASSES, isFocusable } from '../common/util';
|
|
9
|
+
import { UploadService } from '../upload.service';
|
|
8
10
|
import * as i0 from "@angular/core";
|
|
9
11
|
import * as i1 from "../navigation.service";
|
|
10
12
|
import * as i2 from "../upload.service";
|
|
@@ -60,9 +62,9 @@ export class FileListItemDirective {
|
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
|
-
FileListItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
64
|
-
FileListItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
65
|
+
FileListItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemDirective, deps: [{ token: i0.ElementRef }, { token: i1.NavigationService }, { token: i2.UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
66
|
+
FileListItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: FileListItemDirective, selector: "[kendoUploadFileListItem]", inputs: { files: "files", index: "index" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "click": "onClick($event)" }, properties: { "class.k-file": "this.fileClass", "attr.data-uid": "this.uidAttribute", "attr.tabIndex": "this.tabIndex", "class.k-file-error": "this.kFileError", "class.k-file-invalid": "this.kFileInvalid", "class.k-file-progress": "this.kFileProgress", "class.k-file-success": "this.kFileSuccess", "class.k-focus": "this.kStateFocused" } }, ngImport: i0 });
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListItemDirective, decorators: [{
|
|
66
68
|
type: Directive,
|
|
67
69
|
args: [{
|
|
68
70
|
selector: '[kendoUploadFileListItem]'
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 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 { FileListItemBase } from './file-list-item-base';
|
|
8
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
+
import { UploadService } from '../upload.service';
|
|
10
|
+
import { isPresent } from '../common/util';
|
|
11
|
+
import { FileInfoTemplateDirective } from '../templates/file-info-template.directive';
|
|
12
|
+
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
13
|
+
import { copyIcon } from '@progress/kendo-svg-icons';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "../upload.service";
|
|
17
|
+
import * as i3 from "@progress/kendo-angular-progressbar";
|
|
18
|
+
import * as i4 from "@progress/kendo-angular-icons";
|
|
19
|
+
import * as i5 from "./file-list-item-action-button.component";
|
|
20
|
+
import * as i6 from "@angular/common";
|
|
21
|
+
import * as i7 from "@progress/kendo-angular-buttons";
|
|
22
|
+
import * as i8 from "../templates/template-context.directive";
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export class FileListMultipleItemsComponent extends FileListItemBase {
|
|
27
|
+
constructor(localization, uploadService) {
|
|
28
|
+
super(uploadService);
|
|
29
|
+
this.localization = localization;
|
|
30
|
+
this.copySVGIcon = copyIcon;
|
|
31
|
+
this.subscribeUploadProgress((args) => {
|
|
32
|
+
if (args.files[0].uid === this.files[0].uid) {
|
|
33
|
+
this.progressComplete = args.percentComplete;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
get showProgress() {
|
|
38
|
+
const showProgress = this.files[0].state === FileState.Uploading || this.files[0].state === FileState.Paused;
|
|
39
|
+
return showProgress ? 'active' : 'inactive';
|
|
40
|
+
}
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
this.filesHaveErrors = super.filesHaveValidationErrors(this.files);
|
|
43
|
+
}
|
|
44
|
+
fileStatusText(file) {
|
|
45
|
+
const errors = file.validationErrors;
|
|
46
|
+
if (!isPresent(errors)) {
|
|
47
|
+
return this.getTotalFilesSizeMessage([file]);
|
|
48
|
+
}
|
|
49
|
+
return this.getFileValidationMessage(file);
|
|
50
|
+
}
|
|
51
|
+
get batchStatusText() {
|
|
52
|
+
const state = this.files[0].state;
|
|
53
|
+
const fileCount = this.files.length;
|
|
54
|
+
if (state === FileState.Uploaded) {
|
|
55
|
+
return `${fileCount} ${this.textFor('filesBatchStatusUploaded')}`;
|
|
56
|
+
}
|
|
57
|
+
if (state === FileState.Failed) {
|
|
58
|
+
return `${fileCount} ${this.textFor('filesBatchStatusFailed')}`;
|
|
59
|
+
}
|
|
60
|
+
return `${fileCount} ${this.textFor('filesBatchStatus')}`;
|
|
61
|
+
}
|
|
62
|
+
get isUploadSuccessful() {
|
|
63
|
+
return this.files[0].state === FileState.Uploaded;
|
|
64
|
+
}
|
|
65
|
+
get isUploadFailed() {
|
|
66
|
+
return this.files[0].state === FileState.Failed;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
FileListMultipleItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListMultipleItemsComponent, deps: [{ token: i1.LocalizationService }, { token: i2.UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
70
|
+
FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: { disabled: "disabled", files: "files", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
71
|
+
<kendo-progressbar
|
|
72
|
+
[@progressState]="showProgress"
|
|
73
|
+
[value]="progressComplete"
|
|
74
|
+
[label]="{ visible: false }"
|
|
75
|
+
>
|
|
76
|
+
</kendo-progressbar>
|
|
77
|
+
<span class="k-file-icon-wrapper">
|
|
78
|
+
<kendo-icon-wrapper
|
|
79
|
+
name="copy"
|
|
80
|
+
[svgIcon]="copySVGIcon"
|
|
81
|
+
innerCssClass="k-file-icon"
|
|
82
|
+
>
|
|
83
|
+
</kendo-icon-wrapper>
|
|
84
|
+
</span>
|
|
85
|
+
<span class="k-multiple-files-wrapper">
|
|
86
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
87
|
+
<span *ngFor="let file of files" class="k-file-info">
|
|
88
|
+
<span [title]="file.name" class="k-file-name">
|
|
89
|
+
{{file.name}}
|
|
90
|
+
</span>
|
|
91
|
+
<span [ngClass]="{
|
|
92
|
+
'k-file-validation-message': file.validationErrors,
|
|
93
|
+
'k-file-size': !file.validationErrors
|
|
94
|
+
}"
|
|
95
|
+
>{{fileStatusText(file)}}</span>
|
|
96
|
+
</span>
|
|
97
|
+
<span class="k-file-summary"
|
|
98
|
+
>{{batchStatusText}}</span>
|
|
99
|
+
</ng-container>
|
|
100
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
101
|
+
[templateContext]="{
|
|
102
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
103
|
+
state: files[0].state,
|
|
104
|
+
$implicit: files
|
|
105
|
+
}">
|
|
106
|
+
</ng-template>
|
|
107
|
+
</span>
|
|
108
|
+
<kendo-upload-file-list-item-action-button
|
|
109
|
+
[file]='files[0]'
|
|
110
|
+
[disabled]='disabled'
|
|
111
|
+
[progress]='progressComplete'>
|
|
112
|
+
</kendo-upload-file-list-item-action-button>
|
|
113
|
+
`, 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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { type: i8.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
|
|
114
|
+
trigger('progressState', [
|
|
115
|
+
state('active', style({ opacity: 1 })),
|
|
116
|
+
state('inactive', style({ opacity: 0 })),
|
|
117
|
+
transition('void => active', style({ opacity: 0 })),
|
|
118
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
119
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
120
|
+
])
|
|
121
|
+
] });
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileListMultipleItemsComponent, decorators: [{
|
|
123
|
+
type: Component,
|
|
124
|
+
args: [{
|
|
125
|
+
animations: [
|
|
126
|
+
trigger('progressState', [
|
|
127
|
+
state('active', style({ opacity: 1 })),
|
|
128
|
+
state('inactive', style({ opacity: 0 })),
|
|
129
|
+
transition('void => active', style({ opacity: 0 })),
|
|
130
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
131
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
132
|
+
])
|
|
133
|
+
],
|
|
134
|
+
selector: 'kendo-upload-file-list-multiple-items',
|
|
135
|
+
template: `
|
|
136
|
+
<kendo-progressbar
|
|
137
|
+
[@progressState]="showProgress"
|
|
138
|
+
[value]="progressComplete"
|
|
139
|
+
[label]="{ visible: false }"
|
|
140
|
+
>
|
|
141
|
+
</kendo-progressbar>
|
|
142
|
+
<span class="k-file-icon-wrapper">
|
|
143
|
+
<kendo-icon-wrapper
|
|
144
|
+
name="copy"
|
|
145
|
+
[svgIcon]="copySVGIcon"
|
|
146
|
+
innerCssClass="k-file-icon"
|
|
147
|
+
>
|
|
148
|
+
</kendo-icon-wrapper>
|
|
149
|
+
</span>
|
|
150
|
+
<span class="k-multiple-files-wrapper">
|
|
151
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
152
|
+
<span *ngFor="let file of files" class="k-file-info">
|
|
153
|
+
<span [title]="file.name" class="k-file-name">
|
|
154
|
+
{{file.name}}
|
|
155
|
+
</span>
|
|
156
|
+
<span [ngClass]="{
|
|
157
|
+
'k-file-validation-message': file.validationErrors,
|
|
158
|
+
'k-file-size': !file.validationErrors
|
|
159
|
+
}"
|
|
160
|
+
>{{fileStatusText(file)}}</span>
|
|
161
|
+
</span>
|
|
162
|
+
<span class="k-file-summary"
|
|
163
|
+
>{{batchStatusText}}</span>
|
|
164
|
+
</ng-container>
|
|
165
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
166
|
+
[templateContext]="{
|
|
167
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
168
|
+
state: files[0].state,
|
|
169
|
+
$implicit: files
|
|
170
|
+
}">
|
|
171
|
+
</ng-template>
|
|
172
|
+
</span>
|
|
173
|
+
<kendo-upload-file-list-item-action-button
|
|
174
|
+
[file]='files[0]'
|
|
175
|
+
[disabled]='disabled'
|
|
176
|
+
[progress]='progressComplete'>
|
|
177
|
+
</kendo-upload-file-list-item-action-button>
|
|
178
|
+
`
|
|
179
|
+
}]
|
|
180
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.UploadService }]; }, propDecorators: { disabled: [{
|
|
181
|
+
type: Input
|
|
182
|
+
}], files: [{
|
|
183
|
+
type: Input
|
|
184
|
+
}], fileInfoTemplate: [{
|
|
185
|
+
type: Input
|
|
186
|
+
}] } });
|