@progress/kendo-angular-upload 8.0.2-dev.202203071504 → 9.0.0-dev.202204131914
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/bundles/kendo-angular-upload.umd.js +5 -0
- package/{dist/es2015/common → common}/action-buttons-layout.d.ts +0 -0
- package/{dist/es2015/common → common}/util.d.ts +0 -0
- package/{dist/es2015/common → common}/validation-util.d.ts +0 -0
- package/{dist/es2015/dropzone-base.d.ts → dropzone-base.d.ts} +4 -1
- package/{dist/es2015/dropzone-external.directive.d.ts → dropzone-external.directive.d.ts} +4 -1
- package/{dist/es2015/dropzone-internal.directive.d.ts → dropzone-internal.directive.d.ts} +3 -0
- package/{dist/es2015/dropzone.component.d.ts → dropzone.component.d.ts} +5 -2
- package/{dist/es2015/dropzone.service.d.ts → dropzone.service.d.ts} +3 -0
- package/{dist/es2015 → esm2015}/common/action-buttons-layout.js +1 -0
- package/{dist/es2015 → esm2015}/common/util.js +1 -7
- package/{dist/es2015 → esm2015}/common/validation-util.js +0 -4
- package/{dist/es2015 → esm2015}/dropzone-base.js +18 -16
- package/{dist/es2015 → esm2015}/dropzone-external.directive.js +29 -35
- package/{dist/es2015 → esm2015}/dropzone-internal.directive.js +25 -37
- package/esm2015/dropzone.component.js +112 -0
- package/{dist/es2015 → esm2015}/dropzone.service.js +8 -7
- package/{dist/es2015 → esm2015}/events/cancel-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/clear-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/error-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/pause-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/remove-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/resume-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/select-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/success-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/upload-event.js +1 -0
- package/{dist/es2015 → esm2015}/events/upload-progress-event.js +1 -0
- package/{dist/es → esm2015}/events.js +0 -0
- package/esm2015/file-select.directive.js +100 -0
- package/{dist/es2015 → esm2015}/fileselect.component.js +160 -132
- package/esm2015/fileselect.module.js +35 -0
- package/{dist/es/types/chunk-info.js → esm2015/kendo-angular-upload.js} +4 -0
- package/esm2015/localization/custom-messages.component.js +50 -0
- package/esm2015/localization/localized-messages.directive.js +40 -0
- package/esm2015/localization/messages.js +59 -0
- package/{dist/es → esm2015}/main.js +0 -0
- package/{dist/es2015 → esm2015}/navigation.service.js +9 -9
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/rendering/file-list-item-action-button.component.js +70 -28
- package/{dist/es2015 → esm2015}/rendering/file-list-item-base.js +9 -0
- package/esm2015/rendering/file-list-item.js +107 -0
- package/esm2015/rendering/file-list-multiple-items.component.js +172 -0
- package/esm2015/rendering/file-list-single-item.component.js +154 -0
- package/esm2015/rendering/file-list.component.js +145 -0
- package/esm2015/rendering/upload-action-buttons.component.js +136 -0
- package/esm2015/rendering/upload-status-total.component.js +60 -0
- package/{dist/es2015 → esm2015}/shared.module.js +45 -18
- package/esm2015/templates/file-info-template.directive.js +22 -0
- package/esm2015/templates/file-template.directive.js +22 -0
- package/esm2015/templates/template-context.directive.js +34 -0
- package/{dist/es2015 → esm2015}/types/async-settings.js +1 -0
- package/{dist/es2015 → esm2015}/types/chunk-info.js +1 -0
- package/{dist/es2015 → esm2015}/types/chunk-map.js +0 -0
- package/{dist/es → esm2015}/types/chunk-metadata.js +1 -0
- package/{dist/es → esm2015}/types/chunk-settings.js +1 -0
- package/{dist/es → esm2015}/types/direction.js +1 -0
- package/{dist/es2015 → esm2015}/types/file-groups.js +3 -5
- package/{dist/es → esm2015}/types/file-info.js +1 -0
- package/{dist/es2015 → esm2015}/types/file-map.js +0 -0
- package/{dist/es → esm2015}/types/file-restrictions.js +1 -0
- package/{dist/es → esm2015}/types/file-state.js +0 -0
- package/{dist/es → esm2015}/types/operation-type.js +1 -0
- package/{dist/es → esm2015}/types.js +0 -0
- package/{dist/es2015 → esm2015}/upload.component.js +262 -243
- package/esm2015/upload.module.js +43 -0
- package/{dist/es2015 → esm2015}/upload.service.js +10 -9
- package/{dist/es2015 → esm2015}/uploads.module.js +17 -12
- package/{dist/es2015/events → events}/cancel-event.d.ts +4 -0
- package/{dist/es2015/events → events}/clear-event.d.ts +1 -0
- package/{dist/es2015/events → events}/error-event.d.ts +10 -0
- package/{dist/es2015/events → events}/pause-event.d.ts +4 -0
- package/{dist/es2015/events → events}/preventable-event.d.ts +0 -0
- package/{dist/es2015/events → events}/remove-event.d.ts +9 -2
- package/{dist/es2015/events → events}/resume-event.d.ts +4 -0
- package/{dist/es2015/events → events}/select-event.d.ts +4 -0
- package/{dist/es2015/events → events}/success-event.d.ts +10 -0
- package/{dist/es2015/events → events}/upload-event.d.ts +9 -2
- package/{dist/es2015/events → events}/upload-progress-event.d.ts +7 -0
- package/{dist/es2015/events.d.ts → events.d.ts} +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-upload.js} +2192 -2010
- package/{dist/es2015/file-select.directive.d.ts → file-select.directive.d.ts} +7 -4
- package/{dist/es2015/fileselect.component.d.ts → fileselect.component.d.ts} +14 -6
- package/fileselect.module.d.ts +20 -0
- package/{dist/es/common/action-buttons-layout.js → kendo-angular-upload.d.ts} +5 -0
- package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
- package/{dist/es2015/navigation.service.d.ts → navigation.service.d.ts} +7 -3
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +36 -104
- package/{dist/es2015/rendering → rendering}/file-list-item-action-button.component.d.ts +11 -8
- package/{dist/es2015/rendering → rendering}/file-list-item-base.d.ts +3 -0
- package/{dist/es2015/rendering → rendering}/file-list-item.d.ts +10 -7
- package/{dist/es2015/rendering → rendering}/file-list-multiple-items.component.d.ts +7 -4
- package/{dist/es2015/rendering → rendering}/file-list-single-item.component.d.ts +9 -6
- package/{dist/es2015/rendering → rendering}/file-list.component.d.ts +3 -0
- package/{dist/es2015/rendering → rendering}/upload-action-buttons.component.d.ts +7 -4
- package/{dist/es2015/rendering → rendering}/upload-status-total.component.d.ts +3 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/shared.module.d.ts +36 -0
- package/{dist/es2015/templates → templates}/file-info-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/file-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/template-context.directive.d.ts +4 -1
- package/{dist/es2015/types → types}/async-settings.d.ts +0 -0
- package/{dist/es2015/types → types}/chunk-info.d.ts +0 -0
- package/{dist/es2015/types → types}/chunk-map.d.ts +0 -0
- package/{dist/es2015/types → types}/chunk-metadata.d.ts +0 -0
- package/{dist/es2015/types → types}/chunk-settings.d.ts +0 -0
- package/{dist/es2015/types → types}/direction.d.ts +0 -0
- package/{dist/es2015/types → types}/file-groups.d.ts +0 -0
- package/{dist/es2015/types → types}/file-info.d.ts +0 -0
- package/{dist/es2015/types → types}/file-map.d.ts +5 -5
- package/{dist/es2015/types → types}/file-restrictions.d.ts +0 -0
- package/{dist/es2015/types → types}/file-state.d.ts +0 -0
- package/{dist/es2015/types → types}/operation-type.d.ts +0 -0
- package/{dist/es2015/types.d.ts → types.d.ts} +0 -0
- package/{dist/es2015/upload.component.d.ts → upload.component.d.ts} +42 -21
- package/upload.module.d.ts +22 -0
- package/{dist/es2015/upload.service.d.ts → upload.service.d.ts} +4 -1
- package/{dist/es2015/uploads.module.d.ts → uploads.module.d.ts} +6 -0
- package/dist/cdn/js/kendo-angular-upload.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/common/util.js +0 -234
- package/dist/es/common/validation-util.js +0 -64
- package/dist/es/dropzone-base.js +0 -66
- package/dist/es/dropzone-external.directive.js +0 -98
- package/dist/es/dropzone-internal.directive.js +0 -110
- package/dist/es/dropzone.component.js +0 -99
- package/dist/es/dropzone.service.js +0 -33
- package/dist/es/events/cancel-event.js +0 -41
- package/dist/es/events/clear-event.js +0 -43
- package/dist/es/events/error-event.js +0 -45
- package/dist/es/events/pause-event.js +0 -42
- package/dist/es/events/preventable-event.js +0 -29
- package/dist/es/events/remove-event.js +0 -47
- package/dist/es/events/resume-event.js +0 -42
- package/dist/es/events/select-event.js +0 -45
- package/dist/es/events/success-event.js +0 -49
- package/dist/es/events/upload-event.js +0 -47
- package/dist/es/events/upload-progress-event.js +0 -42
- package/dist/es/file-select.directive.js +0 -141
- package/dist/es/fileselect.component.js +0 -484
- package/dist/es/fileselect.module.js +0 -30
- package/dist/es/index.js +0 -21
- package/dist/es/localization/custom-messages.component.js +0 -53
- package/dist/es/localization/localized-messages.directive.js +0 -35
- package/dist/es/localization/messages.js +0 -102
- package/dist/es/navigation.service.js +0 -166
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/rendering/file-list-item-action-button.component.js +0 -169
- package/dist/es/rendering/file-list-item-base.js +0 -41
- package/dist/es/rendering/file-list-item.js +0 -165
- package/dist/es/rendering/file-list-multiple-items.component.js +0 -107
- package/dist/es/rendering/file-list-single-item.component.js +0 -112
- package/dist/es/rendering/file-list.component.js +0 -98
- package/dist/es/rendering/upload-action-buttons.component.js +0 -149
- package/dist/es/rendering/upload-status-total.component.js +0 -42
- package/dist/es/shared.module.js +0 -68
- package/dist/es/templates/file-info-template.directive.js +0 -22
- package/dist/es/templates/file-template.directive.js +0 -22
- package/dist/es/templates/template-context.directive.js +0 -40
- package/dist/es/types/async-settings.js +0 -4
- package/dist/es/types/chunk-map.js +0 -36
- package/dist/es/types/file-groups.js +0 -45
- package/dist/es/types/file-map.js +0 -170
- package/dist/es/upload.component.js +0 -967
- package/dist/es/upload.module.js +0 -34
- package/dist/es/upload.service.js +0 -448
- package/dist/es/uploads.module.js +0 -47
- package/dist/es2015/dropzone.component.js +0 -100
- package/dist/es2015/events.js +0 -14
- package/dist/es2015/file-select.directive.js +0 -123
- package/dist/es2015/fileselect.module.d.ts +0 -9
- package/dist/es2015/fileselect.module.js +0 -27
- package/dist/es2015/index.d.ts +0 -21
- package/dist/es2015/index.js +0 -21
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/custom-messages.component.js +0 -45
- package/dist/es2015/localization/localized-messages.directive.js +0 -35
- package/dist/es2015/localization/messages.js +0 -96
- package/dist/es2015/main.js +0 -24
- package/dist/es2015/rendering/file-list-item.js +0 -136
- package/dist/es2015/rendering/file-list-multiple-items.component.js +0 -128
- package/dist/es2015/rendering/file-list-single-item.component.js +0 -117
- package/dist/es2015/rendering/file-list.component.js +0 -123
- package/dist/es2015/rendering/upload-action-buttons.component.js +0 -141
- package/dist/es2015/rendering/upload-status-total.component.js +0 -51
- package/dist/es2015/shared.module.d.ts +0 -17
- package/dist/es2015/templates/file-info-template.directive.js +0 -21
- package/dist/es2015/templates/file-template.directive.js +0 -21
- package/dist/es2015/templates/template-context.directive.js +0 -35
- package/dist/es2015/types/chunk-metadata.js +0 -4
- package/dist/es2015/types/chunk-settings.js +0 -4
- package/dist/es2015/types/direction.js +0 -4
- package/dist/es2015/types/file-info.js +0 -4
- package/dist/es2015/types/file-restrictions.js +0 -4
- package/dist/es2015/types/file-state.js +0 -34
- package/dist/es2015/types/operation-type.js +0 -4
- package/dist/es2015/types.js +0 -5
- package/dist/es2015/upload.module.d.ts +0 -9
- package/dist/es2015/upload.module.js +0 -31
- package/dist/fesm5/index.js +0 -4653
- package/dist/npm/common/action-buttons-layout.js +0 -6
- package/dist/npm/common/util.js +0 -240
- package/dist/npm/common/validation-util.js +0 -68
- package/dist/npm/dropzone-base.js +0 -68
- package/dist/npm/dropzone-external.directive.js +0 -100
- package/dist/npm/dropzone-internal.directive.js +0 -112
- package/dist/npm/dropzone.component.js +0 -101
- package/dist/npm/dropzone.service.js +0 -35
- package/dist/npm/events/cancel-event.js +0 -43
- package/dist/npm/events/clear-event.js +0 -45
- package/dist/npm/events/error-event.js +0 -47
- package/dist/npm/events/pause-event.js +0 -44
- package/dist/npm/events/preventable-event.js +0 -31
- package/dist/npm/events/remove-event.js +0 -49
- package/dist/npm/events/resume-event.js +0 -44
- package/dist/npm/events/select-event.js +0 -47
- package/dist/npm/events/success-event.js +0 -51
- package/dist/npm/events/upload-event.js +0 -49
- package/dist/npm/events/upload-progress-event.js +0 -44
- package/dist/npm/events.js +0 -26
- package/dist/npm/file-select.directive.js +0 -143
- package/dist/npm/fileselect.component.js +0 -486
- package/dist/npm/fileselect.module.js +0 -32
- package/dist/npm/index.js +0 -39
- package/dist/npm/localization/custom-messages.component.js +0 -55
- package/dist/npm/localization/localized-messages.directive.js +0 -37
- package/dist/npm/localization/messages.js +0 -104
- package/dist/npm/main.js +0 -45
- package/dist/npm/navigation.service.js +0 -168
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/rendering/file-list-item-action-button.component.js +0 -171
- package/dist/npm/rendering/file-list-item-base.js +0 -43
- package/dist/npm/rendering/file-list-item.js +0 -167
- package/dist/npm/rendering/file-list-multiple-items.component.js +0 -109
- package/dist/npm/rendering/file-list-single-item.component.js +0 -114
- package/dist/npm/rendering/file-list.component.js +0 -100
- package/dist/npm/rendering/upload-action-buttons.component.js +0 -151
- package/dist/npm/rendering/upload-status-total.component.js +0 -44
- package/dist/npm/shared.module.js +0 -70
- package/dist/npm/templates/file-info-template.directive.js +0 -24
- package/dist/npm/templates/file-template.directive.js +0 -24
- package/dist/npm/templates/template-context.directive.js +0 -42
- package/dist/npm/types/async-settings.js +0 -6
- package/dist/npm/types/chunk-info.js +0 -6
- package/dist/npm/types/chunk-map.js +0 -38
- package/dist/npm/types/chunk-metadata.js +0 -6
- package/dist/npm/types/chunk-settings.js +0 -6
- package/dist/npm/types/direction.js +0 -6
- package/dist/npm/types/file-groups.js +0 -47
- package/dist/npm/types/file-info.js +0 -6
- package/dist/npm/types/file-map.js +0 -172
- package/dist/npm/types/file-restrictions.js +0 -6
- package/dist/npm/types/file-state.js +0 -36
- package/dist/npm/types/operation-type.js +0 -6
- package/dist/npm/types.js +0 -8
- package/dist/npm/upload.component.js +0 -969
- package/dist/npm/upload.module.js +0 -36
- package/dist/npm/upload.service.js +0 -450
- package/dist/npm/uploads.module.js +0 -49
- package/dist/systemjs/kendo-angular-upload.js +0 -5
|
@@ -1,96 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Input } from '@angular/core';
|
|
7
|
-
import { ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export class Messages extends ComponentMessages {
|
|
12
|
-
}
|
|
13
|
-
tslib_1.__decorate([
|
|
14
|
-
Input(),
|
|
15
|
-
tslib_1.__metadata("design:type", String)
|
|
16
|
-
], Messages.prototype, "cancel", void 0);
|
|
17
|
-
tslib_1.__decorate([
|
|
18
|
-
Input(),
|
|
19
|
-
tslib_1.__metadata("design:type", String)
|
|
20
|
-
], Messages.prototype, "clearSelectedFiles", void 0);
|
|
21
|
-
tslib_1.__decorate([
|
|
22
|
-
Input(),
|
|
23
|
-
tslib_1.__metadata("design:type", String)
|
|
24
|
-
], Messages.prototype, "dropFilesHere", void 0);
|
|
25
|
-
tslib_1.__decorate([
|
|
26
|
-
Input(),
|
|
27
|
-
tslib_1.__metadata("design:type", String)
|
|
28
|
-
], Messages.prototype, "externalDropFilesHere", void 0);
|
|
29
|
-
tslib_1.__decorate([
|
|
30
|
-
Input(),
|
|
31
|
-
tslib_1.__metadata("design:type", String)
|
|
32
|
-
], Messages.prototype, "filesBatchStatus", void 0);
|
|
33
|
-
tslib_1.__decorate([
|
|
34
|
-
Input(),
|
|
35
|
-
tslib_1.__metadata("design:type", String)
|
|
36
|
-
], Messages.prototype, "filesBatchStatusFailed", void 0);
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
Input(),
|
|
39
|
-
tslib_1.__metadata("design:type", String)
|
|
40
|
-
], Messages.prototype, "filesBatchStatusUploaded", void 0);
|
|
41
|
-
tslib_1.__decorate([
|
|
42
|
-
Input(),
|
|
43
|
-
tslib_1.__metadata("design:type", String)
|
|
44
|
-
], Messages.prototype, "fileStatusFailed", void 0);
|
|
45
|
-
tslib_1.__decorate([
|
|
46
|
-
Input(),
|
|
47
|
-
tslib_1.__metadata("design:type", String)
|
|
48
|
-
], Messages.prototype, "fileStatusUploaded", void 0);
|
|
49
|
-
tslib_1.__decorate([
|
|
50
|
-
Input(),
|
|
51
|
-
tslib_1.__metadata("design:type", String)
|
|
52
|
-
], Messages.prototype, "headerStatusPaused", void 0);
|
|
53
|
-
tslib_1.__decorate([
|
|
54
|
-
Input(),
|
|
55
|
-
tslib_1.__metadata("design:type", String)
|
|
56
|
-
], Messages.prototype, "headerStatusUploaded", void 0);
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
Input(),
|
|
59
|
-
tslib_1.__metadata("design:type", String)
|
|
60
|
-
], Messages.prototype, "headerStatusUploading", void 0);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
Input(),
|
|
63
|
-
tslib_1.__metadata("design:type", String)
|
|
64
|
-
], Messages.prototype, "invalidFileExtension", void 0);
|
|
65
|
-
tslib_1.__decorate([
|
|
66
|
-
Input(),
|
|
67
|
-
tslib_1.__metadata("design:type", String)
|
|
68
|
-
], Messages.prototype, "invalidMaxFileSize", void 0);
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
Input(),
|
|
71
|
-
tslib_1.__metadata("design:type", String)
|
|
72
|
-
], Messages.prototype, "invalidMinFileSize", void 0);
|
|
73
|
-
tslib_1.__decorate([
|
|
74
|
-
Input(),
|
|
75
|
-
tslib_1.__metadata("design:type", String)
|
|
76
|
-
], Messages.prototype, "pause", void 0);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
Input(),
|
|
79
|
-
tslib_1.__metadata("design:type", String)
|
|
80
|
-
], Messages.prototype, "remove", void 0);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
Input(),
|
|
83
|
-
tslib_1.__metadata("design:type", String)
|
|
84
|
-
], Messages.prototype, "resume", void 0);
|
|
85
|
-
tslib_1.__decorate([
|
|
86
|
-
Input(),
|
|
87
|
-
tslib_1.__metadata("design:type", String)
|
|
88
|
-
], Messages.prototype, "retry", void 0);
|
|
89
|
-
tslib_1.__decorate([
|
|
90
|
-
Input(),
|
|
91
|
-
tslib_1.__metadata("design:type", String)
|
|
92
|
-
], Messages.prototype, "select", void 0);
|
|
93
|
-
tslib_1.__decorate([
|
|
94
|
-
Input(),
|
|
95
|
-
tslib_1.__metadata("design:type", String)
|
|
96
|
-
], Messages.prototype, "uploadSelectedFiles", void 0);
|
package/dist/es2015/main.js
DELETED
|
@@ -1,24 +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 { FileSelectModule } from './fileselect.module';
|
|
6
|
-
export { UploadModule } from './upload.module';
|
|
7
|
-
export { UploadsModule } from './uploads.module';
|
|
8
|
-
export { UploadComponent } from './upload.component';
|
|
9
|
-
export { FileSelectComponent } from './fileselect.component';
|
|
10
|
-
export { UploadDropZoneComponent } from './dropzone.component';
|
|
11
|
-
export { FileSelectDirective } from './file-select.directive';
|
|
12
|
-
export { FileListComponent } from './rendering/file-list.component';
|
|
13
|
-
export { FileListSingleItemComponent } from './rendering/file-list-single-item.component';
|
|
14
|
-
export { FileListItemActionButtonComponent } from './rendering/file-list-item-action-button.component';
|
|
15
|
-
export { FileListMultipleItemsComponent } from './rendering/file-list-multiple-items.component';
|
|
16
|
-
export { FileTemplateDirective } from './templates/file-template.directive';
|
|
17
|
-
export { FileInfoTemplateDirective } from './templates/file-info-template.directive';
|
|
18
|
-
export { TemplateContextDirective } from './templates/template-context.directive';
|
|
19
|
-
export { UploadStatusTotalComponent } from './rendering/upload-status-total.component';
|
|
20
|
-
export { UploadActionButtonsComponent } from './rendering/upload-action-buttons.component';
|
|
21
|
-
export { UploadDropZoneDirective } from './dropzone-external.directive';
|
|
22
|
-
export { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
23
|
-
export * from './events';
|
|
24
|
-
export * from './types';
|
|
@@ -1,136 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core';
|
|
7
|
-
import { FileState } from '../types';
|
|
8
|
-
import { NavigationService } from '../navigation.service';
|
|
9
|
-
import { filesHaveValidationErrors, hasClasses, IGNORE_TARGET_CLASSES, isFocusable } from '../common/util';
|
|
10
|
-
import { UploadService } from '../upload.service';
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
let FileListItemDirective = class FileListItemDirective {
|
|
15
|
-
constructor(el, navigationService, uploadService) {
|
|
16
|
-
this.navigationService = navigationService;
|
|
17
|
-
this.uploadService = uploadService;
|
|
18
|
-
this.fileClass = true;
|
|
19
|
-
this.focused = false;
|
|
20
|
-
this.element = el;
|
|
21
|
-
}
|
|
22
|
-
focus() {
|
|
23
|
-
this.element.nativeElement.focus();
|
|
24
|
-
}
|
|
25
|
-
get uidAttribute() {
|
|
26
|
-
return this.files[0].uid;
|
|
27
|
-
}
|
|
28
|
-
get tabIndex() {
|
|
29
|
-
return "-1";
|
|
30
|
-
}
|
|
31
|
-
get kFileError() {
|
|
32
|
-
return this.files[0].state === FileState.Failed;
|
|
33
|
-
}
|
|
34
|
-
get kFileInvalid() {
|
|
35
|
-
return filesHaveValidationErrors(this.files);
|
|
36
|
-
}
|
|
37
|
-
get kFileProgress() {
|
|
38
|
-
return this.files[0].state === FileState.Uploading ||
|
|
39
|
-
this.files[0].state === FileState.Paused;
|
|
40
|
-
}
|
|
41
|
-
get kFileSuccess() {
|
|
42
|
-
if (this.uploadService.component === 'Upload') {
|
|
43
|
-
return this.files[0].state === FileState.Uploaded ||
|
|
44
|
-
this.files[0].state === FileState.Initial;
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
get kStateFocused() {
|
|
49
|
-
return this.focused;
|
|
50
|
-
}
|
|
51
|
-
onFocus() {
|
|
52
|
-
this.focused = true;
|
|
53
|
-
}
|
|
54
|
-
onBlur() {
|
|
55
|
-
this.focused = false;
|
|
56
|
-
}
|
|
57
|
-
onClick(event) {
|
|
58
|
-
if (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES)) {
|
|
59
|
-
this.navigationService.focusedIndex = this.index;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
tslib_1.__decorate([
|
|
64
|
-
Input(),
|
|
65
|
-
tslib_1.__metadata("design:type", Array)
|
|
66
|
-
], FileListItemDirective.prototype, "files", void 0);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
Input(),
|
|
69
|
-
tslib_1.__metadata("design:type", Number)
|
|
70
|
-
], FileListItemDirective.prototype, "index", void 0);
|
|
71
|
-
tslib_1.__decorate([
|
|
72
|
-
HostBinding('class.k-file'),
|
|
73
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
74
|
-
], FileListItemDirective.prototype, "fileClass", void 0);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
HostBinding('attr.data-uid'),
|
|
77
|
-
tslib_1.__metadata("design:type", String),
|
|
78
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
79
|
-
], FileListItemDirective.prototype, "uidAttribute", null);
|
|
80
|
-
tslib_1.__decorate([
|
|
81
|
-
HostBinding('attr.tabIndex'),
|
|
82
|
-
tslib_1.__metadata("design:type", String),
|
|
83
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
84
|
-
], FileListItemDirective.prototype, "tabIndex", null);
|
|
85
|
-
tslib_1.__decorate([
|
|
86
|
-
HostBinding('class.k-file-error'),
|
|
87
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
88
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
89
|
-
], FileListItemDirective.prototype, "kFileError", null);
|
|
90
|
-
tslib_1.__decorate([
|
|
91
|
-
HostBinding('class.k-file-invalid'),
|
|
92
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
93
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
94
|
-
], FileListItemDirective.prototype, "kFileInvalid", null);
|
|
95
|
-
tslib_1.__decorate([
|
|
96
|
-
HostBinding('class.k-file-progress'),
|
|
97
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
98
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
99
|
-
], FileListItemDirective.prototype, "kFileProgress", null);
|
|
100
|
-
tslib_1.__decorate([
|
|
101
|
-
HostBinding('class.k-file-success'),
|
|
102
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
103
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
104
|
-
], FileListItemDirective.prototype, "kFileSuccess", null);
|
|
105
|
-
tslib_1.__decorate([
|
|
106
|
-
HostBinding('class.k-state-focused'),
|
|
107
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
108
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
109
|
-
], FileListItemDirective.prototype, "kStateFocused", null);
|
|
110
|
-
tslib_1.__decorate([
|
|
111
|
-
HostListener("focus"),
|
|
112
|
-
tslib_1.__metadata("design:type", Function),
|
|
113
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
114
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
115
|
-
], FileListItemDirective.prototype, "onFocus", null);
|
|
116
|
-
tslib_1.__decorate([
|
|
117
|
-
HostListener("blur"),
|
|
118
|
-
tslib_1.__metadata("design:type", Function),
|
|
119
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
120
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
121
|
-
], FileListItemDirective.prototype, "onBlur", null);
|
|
122
|
-
tslib_1.__decorate([
|
|
123
|
-
HostListener('click', ['$event']),
|
|
124
|
-
tslib_1.__metadata("design:type", Function),
|
|
125
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
126
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
127
|
-
], FileListItemDirective.prototype, "onClick", null);
|
|
128
|
-
FileListItemDirective = tslib_1.__decorate([
|
|
129
|
-
Directive({
|
|
130
|
-
selector: '[kendoUploadFileListItem]'
|
|
131
|
-
}),
|
|
132
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
133
|
-
NavigationService,
|
|
134
|
-
UploadService])
|
|
135
|
-
], FileListItemDirective);
|
|
136
|
-
export { FileListItemDirective };
|
|
@@ -1,128 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Input, Component } from '@angular/core';
|
|
7
|
-
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
8
|
-
import { FileState } from '../types';
|
|
9
|
-
import { FileListItemBase } from './file-list-item-base';
|
|
10
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { UploadService } from '../upload.service';
|
|
12
|
-
import { isPresent } from '../common/util';
|
|
13
|
-
import { FileInfoTemplateDirective } from '../templates/file-info-template.directive';
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
let FileListMultipleItemsComponent = class FileListMultipleItemsComponent extends FileListItemBase {
|
|
18
|
-
constructor(localization, uploadService) {
|
|
19
|
-
super(uploadService);
|
|
20
|
-
this.localization = localization;
|
|
21
|
-
this.subscribeUploadProgress((args) => {
|
|
22
|
-
if (args.files[0].uid === this.files[0].uid) {
|
|
23
|
-
this.progressComplete = args.percentComplete;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
get showProgress() {
|
|
28
|
-
const showProgress = this.files[0].state === FileState.Uploading || this.files[0].state === FileState.Paused;
|
|
29
|
-
return showProgress ? 'active' : 'inactive';
|
|
30
|
-
}
|
|
31
|
-
ngOnInit() {
|
|
32
|
-
this.filesHaveErrors = super.filesHaveValidationErrors(this.files);
|
|
33
|
-
}
|
|
34
|
-
fileStatusText(file) {
|
|
35
|
-
const errors = file.validationErrors;
|
|
36
|
-
if (!isPresent(errors)) {
|
|
37
|
-
return this.getTotalFilesSizeMessage([file]);
|
|
38
|
-
}
|
|
39
|
-
return this.getFileValidationMessage(file);
|
|
40
|
-
}
|
|
41
|
-
get batchStatusText() {
|
|
42
|
-
const state = this.files[0].state;
|
|
43
|
-
const fileCount = this.files.length;
|
|
44
|
-
if (state === FileState.Uploaded) {
|
|
45
|
-
return `${fileCount} ${this.textFor('filesBatchStatusUploaded')}`;
|
|
46
|
-
}
|
|
47
|
-
if (state === FileState.Failed) {
|
|
48
|
-
return `${fileCount} ${this.textFor('filesBatchStatusFailed')}`;
|
|
49
|
-
}
|
|
50
|
-
return `${fileCount} ${this.textFor('filesBatchStatus')}`;
|
|
51
|
-
}
|
|
52
|
-
get isUploadSuccessful() {
|
|
53
|
-
return this.files[0].state === FileState.Uploaded;
|
|
54
|
-
}
|
|
55
|
-
get isUploadFailed() {
|
|
56
|
-
return this.files[0].state === FileState.Failed;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
tslib_1.__decorate([
|
|
60
|
-
Input(),
|
|
61
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
62
|
-
], FileListMultipleItemsComponent.prototype, "disabled", void 0);
|
|
63
|
-
tslib_1.__decorate([
|
|
64
|
-
Input(),
|
|
65
|
-
tslib_1.__metadata("design:type", Array)
|
|
66
|
-
], FileListMultipleItemsComponent.prototype, "files", void 0);
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
Input(),
|
|
69
|
-
tslib_1.__metadata("design:type", FileInfoTemplateDirective)
|
|
70
|
-
], FileListMultipleItemsComponent.prototype, "fileInfoTemplate", void 0);
|
|
71
|
-
FileListMultipleItemsComponent = tslib_1.__decorate([
|
|
72
|
-
Component({
|
|
73
|
-
animations: [
|
|
74
|
-
trigger('progressState', [
|
|
75
|
-
state('active', style({ opacity: 1 })),
|
|
76
|
-
state('inactive', style({ opacity: 0 })),
|
|
77
|
-
transition('void => active', style({ opacity: 0 })),
|
|
78
|
-
transition('inactive => active', style({ opacity: 1 })),
|
|
79
|
-
transition('active => inactive', animate('1s 2s ease-out'))
|
|
80
|
-
])
|
|
81
|
-
],
|
|
82
|
-
selector: 'kendo-upload-file-list-multiple-items',
|
|
83
|
-
template: `
|
|
84
|
-
<div class="k-progressbar" [@progressState]="showProgress">
|
|
85
|
-
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
86
|
-
</div>
|
|
87
|
-
<span class="k-multiple-files-group-wrapper">
|
|
88
|
-
<span class="k-file-group k-icon k-i-copy"></span>
|
|
89
|
-
</span>
|
|
90
|
-
<span class="k-multiple-files-wrapper">
|
|
91
|
-
<ng-container *ngIf="!fileInfoTemplate">
|
|
92
|
-
<span *ngFor="let file of files" class="k-file-name-size-wrapper">
|
|
93
|
-
<span [title]="file.name" class="k-file-name">
|
|
94
|
-
{{file.name}}
|
|
95
|
-
</span>
|
|
96
|
-
<span [ngClass]="{
|
|
97
|
-
'k-text-error': file.validationErrors,
|
|
98
|
-
'k-file-validation-message': file.validationErrors,
|
|
99
|
-
'k-file-size': !file.validationErrors
|
|
100
|
-
}"
|
|
101
|
-
>{{fileStatusText(file)}}</span>
|
|
102
|
-
</span>
|
|
103
|
-
<span class="k-file-information"
|
|
104
|
-
[ngClass]="{
|
|
105
|
-
'k-text-success': isUploadSuccessful,
|
|
106
|
-
'k-text-error': isUploadFailed
|
|
107
|
-
}"
|
|
108
|
-
>{{batchStatusText}}</span>
|
|
109
|
-
</ng-container>
|
|
110
|
-
<ng-template *ngIf="fileInfoTemplate"
|
|
111
|
-
[templateContext]="{
|
|
112
|
-
templateRef: fileInfoTemplate.templateRef,
|
|
113
|
-
state: files[0].state,
|
|
114
|
-
$implicit: files
|
|
115
|
-
}">
|
|
116
|
-
</ng-template>
|
|
117
|
-
</span>
|
|
118
|
-
<kendo-upload-file-list-item-action-button
|
|
119
|
-
[file]='files[0]'
|
|
120
|
-
[disabled]='disabled'
|
|
121
|
-
[progress]='progressComplete'>
|
|
122
|
-
</kendo-upload-file-list-item-action-button>
|
|
123
|
-
`
|
|
124
|
-
}),
|
|
125
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
126
|
-
UploadService])
|
|
127
|
-
], FileListMultipleItemsComponent);
|
|
128
|
-
export { FileListMultipleItemsComponent };
|
|
@@ -1,117 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Input, Component } from '@angular/core';
|
|
7
|
-
import { animate, state, style, transition, trigger } from '@angular/animations';
|
|
8
|
-
import { FileState } from '../types';
|
|
9
|
-
import { FileListItemBase } from './file-list-item-base';
|
|
10
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { UploadService } from '../upload.service';
|
|
12
|
-
import { getFileGroupCssClass, isPresent } from '../common/util';
|
|
13
|
-
import { FileInfoTemplateDirective } from '../templates/file-info-template.directive';
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
let FileListSingleItemComponent = class FileListSingleItemComponent extends FileListItemBase {
|
|
18
|
-
constructor(localization, uploadService) {
|
|
19
|
-
super(uploadService);
|
|
20
|
-
this.localization = localization;
|
|
21
|
-
this.subscribeUploadProgress((args) => {
|
|
22
|
-
if (args.files[0].uid === this.file.uid) {
|
|
23
|
-
this.progressComplete = args.percentComplete;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
get fileStatusText() {
|
|
28
|
-
const errors = this.file.validationErrors;
|
|
29
|
-
if (this.file.state === FileState.Uploaded) {
|
|
30
|
-
return `${this.textFor('fileStatusUploaded')}`;
|
|
31
|
-
}
|
|
32
|
-
if (this.file.state === FileState.Failed) {
|
|
33
|
-
return `${this.textFor('fileStatusFailed')}`;
|
|
34
|
-
}
|
|
35
|
-
if (!isPresent(errors)) {
|
|
36
|
-
return this.getTotalFilesSizeMessage([this.file]);
|
|
37
|
-
}
|
|
38
|
-
return this.getFileValidationMessage(this.file);
|
|
39
|
-
}
|
|
40
|
-
get showProgress() {
|
|
41
|
-
const showProgress = this.file.state === FileState.Uploading || this.file.state === FileState.Paused;
|
|
42
|
-
return showProgress ? 'active' : 'inactive';
|
|
43
|
-
}
|
|
44
|
-
get fileGroupClass() {
|
|
45
|
-
return getFileGroupCssClass(this.file.extension ? this.file.extension : '');
|
|
46
|
-
}
|
|
47
|
-
get isUploadSuccessful() {
|
|
48
|
-
return this.file.state === FileState.Uploaded;
|
|
49
|
-
}
|
|
50
|
-
get isUploadFailed() {
|
|
51
|
-
return this.file.state === FileState.Failed;
|
|
52
|
-
}
|
|
53
|
-
get isNotYetUploaded() {
|
|
54
|
-
return !this.isUploadFailed && !this.isUploadSuccessful;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
tslib_1.__decorate([
|
|
58
|
-
Input(),
|
|
59
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
60
|
-
], FileListSingleItemComponent.prototype, "disabled", void 0);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
Input(),
|
|
63
|
-
tslib_1.__metadata("design:type", Object)
|
|
64
|
-
], FileListSingleItemComponent.prototype, "file", void 0);
|
|
65
|
-
tslib_1.__decorate([
|
|
66
|
-
Input(),
|
|
67
|
-
tslib_1.__metadata("design:type", FileInfoTemplateDirective)
|
|
68
|
-
], FileListSingleItemComponent.prototype, "fileInfoTemplate", void 0);
|
|
69
|
-
FileListSingleItemComponent = tslib_1.__decorate([
|
|
70
|
-
Component({
|
|
71
|
-
animations: [
|
|
72
|
-
trigger('progressState', [
|
|
73
|
-
state('active', style({ opacity: 1 })),
|
|
74
|
-
state('inactive', style({ opacity: 0 })),
|
|
75
|
-
transition('void => active', style({ opacity: 0 })),
|
|
76
|
-
transition('inactive => active', style({ opacity: 1 })),
|
|
77
|
-
transition('active => inactive', animate('1s 2s ease-out'))
|
|
78
|
-
])
|
|
79
|
-
],
|
|
80
|
-
selector: 'kendo-upload-file-list-single-item',
|
|
81
|
-
template: `
|
|
82
|
-
<div class="k-progressbar" [@progressState]="showProgress">
|
|
83
|
-
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
84
|
-
</div>
|
|
85
|
-
<span class="k-file-group-wrapper">
|
|
86
|
-
<span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
|
|
87
|
-
</span>
|
|
88
|
-
<span class="k-file-name-size-wrapper">
|
|
89
|
-
<ng-container *ngIf="!fileInfoTemplate">
|
|
90
|
-
<span class="k-file-name" [title]="file.name">{{ file.name }}</span>
|
|
91
|
-
<span [ngClass]="{
|
|
92
|
-
'k-file-validation-message': file.validationErrors,
|
|
93
|
-
'k-file-size': !file.validationErrors && isNotYetUploaded,
|
|
94
|
-
'k-text-success': isUploadSuccessful,
|
|
95
|
-
'k-text-error': file.validationErrors || isUploadFailed,
|
|
96
|
-
'k-file-information': isUploadSuccessful || isUploadFailed
|
|
97
|
-
}"
|
|
98
|
-
>{{fileStatusText}}</span>
|
|
99
|
-
</ng-container>
|
|
100
|
-
<ng-template *ngIf="fileInfoTemplate"
|
|
101
|
-
[templateContext]="{
|
|
102
|
-
templateRef: fileInfoTemplate.templateRef,
|
|
103
|
-
state: file.state,
|
|
104
|
-
$implicit: [file]
|
|
105
|
-
}">
|
|
106
|
-
</ng-template>
|
|
107
|
-
</span>
|
|
108
|
-
<kendo-upload-file-list-item-action-button
|
|
109
|
-
[file]='file'
|
|
110
|
-
[disabled]='disabled'
|
|
111
|
-
[progress]='progressComplete'>
|
|
112
|
-
</kendo-upload-file-list-item-action-button>
|
|
113
|
-
`
|
|
114
|
-
}),
|
|
115
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService, UploadService])
|
|
116
|
-
], FileListSingleItemComponent);
|
|
117
|
-
export { FileListSingleItemComponent };
|
|
@@ -1,123 +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 * as tslib_1 from "tslib";
|
|
6
|
-
/* tslint:disable:component-selector */
|
|
7
|
-
import { Input, Component, ViewChildren, QueryList } from '@angular/core';
|
|
8
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
9
|
-
import { FileState } from '../types';
|
|
10
|
-
import { FileTemplateDirective } from '../templates/file-template.directive';
|
|
11
|
-
import { FileListItemDirective } from './file-list-item';
|
|
12
|
-
import { NavigationService } from '../navigation.service';
|
|
13
|
-
import { UploadService } from '../upload.service';
|
|
14
|
-
import { FileInfoTemplateDirective } from '../templates/file-info-template.directive';
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
let FileListComponent = class FileListComponent {
|
|
19
|
-
constructor(uploadService, navigation) {
|
|
20
|
-
this.uploadService = uploadService;
|
|
21
|
-
this.navigation = navigation;
|
|
22
|
-
this.onItemFocus();
|
|
23
|
-
this.onItemAction();
|
|
24
|
-
}
|
|
25
|
-
onItemFocus() {
|
|
26
|
-
this.focusSubscription = this.navigation.onFileFocus.subscribe((index) => {
|
|
27
|
-
this.fileListItems.toArray()[index].focus();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
onItemAction() {
|
|
31
|
-
this.actionSubscription = this.navigation.onFileAction.subscribe((key) => {
|
|
32
|
-
this.itemActionHandler(key);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
itemActionHandler(key) {
|
|
36
|
-
let index = this.navigation.focusedIndex;
|
|
37
|
-
let item = this.fileListItems.toArray()[index];
|
|
38
|
-
let uid = item.uidAttribute;
|
|
39
|
-
let files = this.uploadService.files.get(uid);
|
|
40
|
-
if (key === Keys.Escape && files[0].state === FileState.Uploading) {
|
|
41
|
-
this.uploadService.cancelFiles(uid);
|
|
42
|
-
this.navigation.focusSelectButton();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (key === Keys.Enter && files[0].state === FileState.Failed) {
|
|
46
|
-
this.uploadService.retryFiles(uid);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (key === Keys.Delete) {
|
|
50
|
-
if (files[0].state === FileState.Uploading) {
|
|
51
|
-
this.uploadService.cancelFiles(uid);
|
|
52
|
-
}
|
|
53
|
-
else if (this.hasDelete(item)) {
|
|
54
|
-
this.uploadService.removeFiles(uid);
|
|
55
|
-
}
|
|
56
|
-
this.navigation.focusSelectButton();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
hasDelete(item) {
|
|
60
|
-
return item.element.nativeElement.getElementsByClassName('k-delete').length > 0;
|
|
61
|
-
}
|
|
62
|
-
ngOnDestroy() {
|
|
63
|
-
this.focusSubscription.unsubscribe();
|
|
64
|
-
this.actionSubscription.unsubscribe();
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
tslib_1.__decorate([
|
|
68
|
-
Input(),
|
|
69
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
70
|
-
], FileListComponent.prototype, "disabled", void 0);
|
|
71
|
-
tslib_1.__decorate([
|
|
72
|
-
Input(),
|
|
73
|
-
tslib_1.__metadata("design:type", Array)
|
|
74
|
-
], FileListComponent.prototype, "fileList", void 0);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
Input(),
|
|
77
|
-
tslib_1.__metadata("design:type", FileTemplateDirective)
|
|
78
|
-
], FileListComponent.prototype, "fileTemplate", void 0);
|
|
79
|
-
tslib_1.__decorate([
|
|
80
|
-
Input(),
|
|
81
|
-
tslib_1.__metadata("design:type", FileInfoTemplateDirective)
|
|
82
|
-
], FileListComponent.prototype, "fileInfoTemplate", void 0);
|
|
83
|
-
tslib_1.__decorate([
|
|
84
|
-
ViewChildren(FileListItemDirective),
|
|
85
|
-
tslib_1.__metadata("design:type", QueryList)
|
|
86
|
-
], FileListComponent.prototype, "fileListItems", void 0);
|
|
87
|
-
FileListComponent = tslib_1.__decorate([
|
|
88
|
-
Component({
|
|
89
|
-
selector: '[kendo-upload-file-list]',
|
|
90
|
-
template: `
|
|
91
|
-
<ng-template ngFor
|
|
92
|
-
[ngForOf]="fileList"
|
|
93
|
-
let-files
|
|
94
|
-
let-index="index">
|
|
95
|
-
<li kendoUploadFileListItem [files]='files' [index]='index'>
|
|
96
|
-
<kendo-upload-file-list-single-item
|
|
97
|
-
class='k-file-single'
|
|
98
|
-
*ngIf='files.length === 1 && !fileTemplate'
|
|
99
|
-
[disabled]='disabled'
|
|
100
|
-
[file]='files[0]'
|
|
101
|
-
[fileInfoTemplate]="fileInfoTemplate">
|
|
102
|
-
</kendo-upload-file-list-single-item>
|
|
103
|
-
<kendo-upload-file-list-multiple-items
|
|
104
|
-
class='k-file-multiple'
|
|
105
|
-
*ngIf='files.length > 1 && !fileTemplate'
|
|
106
|
-
[disabled]='disabled'
|
|
107
|
-
[files]='files'
|
|
108
|
-
[fileInfoTemplate]="fileInfoTemplate">
|
|
109
|
-
</kendo-upload-file-list-multiple-items>
|
|
110
|
-
<ng-template *ngIf="fileTemplate"
|
|
111
|
-
[templateContext]="{
|
|
112
|
-
templateRef: fileTemplate.templateRef,
|
|
113
|
-
state: files[0].state,
|
|
114
|
-
$implicit: files
|
|
115
|
-
}"></ng-template>
|
|
116
|
-
</li>
|
|
117
|
-
</ng-template>
|
|
118
|
-
`
|
|
119
|
-
}),
|
|
120
|
-
tslib_1.__metadata("design:paramtypes", [UploadService,
|
|
121
|
-
NavigationService])
|
|
122
|
-
], FileListComponent);
|
|
123
|
-
export { FileListComponent };
|