@progress/kendo-angular-upload 8.0.2 → 9.0.0-dev.202204191139
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 +32 -102
- 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,102 +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
|
-
var Messages = /** @class */ (function (_super) {
|
|
12
|
-
tslib_1.__extends(Messages, _super);
|
|
13
|
-
function Messages() {
|
|
14
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
15
|
-
}
|
|
16
|
-
tslib_1.__decorate([
|
|
17
|
-
Input(),
|
|
18
|
-
tslib_1.__metadata("design:type", String)
|
|
19
|
-
], Messages.prototype, "cancel", void 0);
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
Input(),
|
|
22
|
-
tslib_1.__metadata("design:type", String)
|
|
23
|
-
], Messages.prototype, "clearSelectedFiles", void 0);
|
|
24
|
-
tslib_1.__decorate([
|
|
25
|
-
Input(),
|
|
26
|
-
tslib_1.__metadata("design:type", String)
|
|
27
|
-
], Messages.prototype, "dropFilesHere", void 0);
|
|
28
|
-
tslib_1.__decorate([
|
|
29
|
-
Input(),
|
|
30
|
-
tslib_1.__metadata("design:type", String)
|
|
31
|
-
], Messages.prototype, "externalDropFilesHere", void 0);
|
|
32
|
-
tslib_1.__decorate([
|
|
33
|
-
Input(),
|
|
34
|
-
tslib_1.__metadata("design:type", String)
|
|
35
|
-
], Messages.prototype, "filesBatchStatus", void 0);
|
|
36
|
-
tslib_1.__decorate([
|
|
37
|
-
Input(),
|
|
38
|
-
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], Messages.prototype, "filesBatchStatusFailed", void 0);
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
Input(),
|
|
42
|
-
tslib_1.__metadata("design:type", String)
|
|
43
|
-
], Messages.prototype, "filesBatchStatusUploaded", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
Input(),
|
|
46
|
-
tslib_1.__metadata("design:type", String)
|
|
47
|
-
], Messages.prototype, "fileStatusFailed", void 0);
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
Input(),
|
|
50
|
-
tslib_1.__metadata("design:type", String)
|
|
51
|
-
], Messages.prototype, "fileStatusUploaded", void 0);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
Input(),
|
|
54
|
-
tslib_1.__metadata("design:type", String)
|
|
55
|
-
], Messages.prototype, "headerStatusPaused", void 0);
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
Input(),
|
|
58
|
-
tslib_1.__metadata("design:type", String)
|
|
59
|
-
], Messages.prototype, "headerStatusUploaded", void 0);
|
|
60
|
-
tslib_1.__decorate([
|
|
61
|
-
Input(),
|
|
62
|
-
tslib_1.__metadata("design:type", String)
|
|
63
|
-
], Messages.prototype, "headerStatusUploading", void 0);
|
|
64
|
-
tslib_1.__decorate([
|
|
65
|
-
Input(),
|
|
66
|
-
tslib_1.__metadata("design:type", String)
|
|
67
|
-
], Messages.prototype, "invalidFileExtension", void 0);
|
|
68
|
-
tslib_1.__decorate([
|
|
69
|
-
Input(),
|
|
70
|
-
tslib_1.__metadata("design:type", String)
|
|
71
|
-
], Messages.prototype, "invalidMaxFileSize", void 0);
|
|
72
|
-
tslib_1.__decorate([
|
|
73
|
-
Input(),
|
|
74
|
-
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], Messages.prototype, "invalidMinFileSize", void 0);
|
|
76
|
-
tslib_1.__decorate([
|
|
77
|
-
Input(),
|
|
78
|
-
tslib_1.__metadata("design:type", String)
|
|
79
|
-
], Messages.prototype, "pause", void 0);
|
|
80
|
-
tslib_1.__decorate([
|
|
81
|
-
Input(),
|
|
82
|
-
tslib_1.__metadata("design:type", String)
|
|
83
|
-
], Messages.prototype, "remove", void 0);
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
Input(),
|
|
86
|
-
tslib_1.__metadata("design:type", String)
|
|
87
|
-
], Messages.prototype, "resume", void 0);
|
|
88
|
-
tslib_1.__decorate([
|
|
89
|
-
Input(),
|
|
90
|
-
tslib_1.__metadata("design:type", String)
|
|
91
|
-
], Messages.prototype, "retry", void 0);
|
|
92
|
-
tslib_1.__decorate([
|
|
93
|
-
Input(),
|
|
94
|
-
tslib_1.__metadata("design:type", String)
|
|
95
|
-
], Messages.prototype, "select", void 0);
|
|
96
|
-
tslib_1.__decorate([
|
|
97
|
-
Input(),
|
|
98
|
-
tslib_1.__metadata("design:type", String)
|
|
99
|
-
], Messages.prototype, "uploadSelectedFiles", void 0);
|
|
100
|
-
return Messages;
|
|
101
|
-
}(ComponentMessages));
|
|
102
|
-
export { Messages };
|
|
@@ -1,166 +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 { Injectable, EventEmitter } from '@angular/core';
|
|
7
|
-
import { UploadService } from './upload.service';
|
|
8
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
var NavigationService = /** @class */ (function () {
|
|
13
|
-
function NavigationService(uploadService) {
|
|
14
|
-
this.uploadService = uploadService;
|
|
15
|
-
this.onActionButtonAction = new EventEmitter();
|
|
16
|
-
this.onActionButtonFocus = new EventEmitter();
|
|
17
|
-
this.onFileAction = new EventEmitter();
|
|
18
|
-
this.onFileFocus = new EventEmitter();
|
|
19
|
-
this.onTab = new EventEmitter();
|
|
20
|
-
this.onWrapperFocus = new EventEmitter();
|
|
21
|
-
this.onSelectButtonFocus = new EventEmitter();
|
|
22
|
-
this.actionButtonsVisible = false;
|
|
23
|
-
this.focused = false;
|
|
24
|
-
this._focusedIndex = -1;
|
|
25
|
-
}
|
|
26
|
-
NavigationService.prototype.action = function (event) {
|
|
27
|
-
var key = event.keyCode;
|
|
28
|
-
return this.keyBindings[key];
|
|
29
|
-
};
|
|
30
|
-
NavigationService.prototype.process = function (event) {
|
|
31
|
-
var handler = this.action(event);
|
|
32
|
-
if (handler) {
|
|
33
|
-
handler(event.shiftKey);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
NavigationService.prototype.computeKeys = function (direction) {
|
|
37
|
-
var _this = this;
|
|
38
|
-
var _a;
|
|
39
|
-
this.keyBindings = (_a = {},
|
|
40
|
-
_a[Keys.Enter] = function () { return _this.handleEnter(); },
|
|
41
|
-
_a[Keys.Escape] = function () { return _this.handleEscape(); },
|
|
42
|
-
_a[Keys.Delete] = function () { return _this.handleDelete(); },
|
|
43
|
-
_a[Keys.Tab] = function (shifted) { return _this.handleTab(shifted); },
|
|
44
|
-
_a[Keys.ArrowUp] = function () { return _this.handleUp(); },
|
|
45
|
-
_a[Keys.ArrowDown] = function () { return _this.handleDown(); },
|
|
46
|
-
_a[this.invertKeys(direction, Keys.ArrowLeft, Keys.ArrowRight)] = function () { return _this.handleLeft(); },
|
|
47
|
-
_a[this.invertKeys(direction, Keys.ArrowRight, Keys.ArrowLeft)] = function () { return _this.handleRight(); },
|
|
48
|
-
_a);
|
|
49
|
-
};
|
|
50
|
-
NavigationService.prototype.invertKeys = function (direction, original, inverted) {
|
|
51
|
-
return direction === 'rtl' ? inverted : original;
|
|
52
|
-
};
|
|
53
|
-
NavigationService.prototype.focusSelectButton = function () {
|
|
54
|
-
this.focused = true;
|
|
55
|
-
this._focusedIndex = -1;
|
|
56
|
-
this.onSelectButtonFocus.emit();
|
|
57
|
-
};
|
|
58
|
-
NavigationService.prototype.handleEnter = function () {
|
|
59
|
-
if (this.lastIndex >= 0) {
|
|
60
|
-
if (this.focusedIndex <= this.lastFileIndex) {
|
|
61
|
-
this.onFileAction.emit(Keys.Enter);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (this.actionButtonsVisible && this.focusedIndex <= this.lastIndex) {
|
|
65
|
-
this.onActionButtonAction.emit(this.focusedIndex < this.lastIndex ? "clear" : "upload");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
NavigationService.prototype.handleDelete = function () {
|
|
70
|
-
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
71
|
-
this.onFileAction.emit(Keys.Delete);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
NavigationService.prototype.handleEscape = function () {
|
|
75
|
-
if (this.focusedIndex >= 0 && this.focusedIndex <= this.lastFileIndex) {
|
|
76
|
-
this.onFileAction.emit(Keys.Escape);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
NavigationService.prototype.handleLeft = function () {
|
|
80
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex) {
|
|
81
|
-
this.focusedIndex -= 1;
|
|
82
|
-
this.onActionButtonFocus.emit("clear");
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
NavigationService.prototype.handleRight = function () {
|
|
86
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastIndex - 1) {
|
|
87
|
-
this.focusedIndex += 1;
|
|
88
|
-
this.onActionButtonFocus.emit("upload");
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
NavigationService.prototype.handleTab = function (shifted) {
|
|
92
|
-
if (this.focusedIndex >= 0 && shifted) {
|
|
93
|
-
this.focusedIndex = -1;
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
this.onTab.emit();
|
|
97
|
-
};
|
|
98
|
-
NavigationService.prototype.handleDown = function () {
|
|
99
|
-
if (this.lastIndex >= 0 && this.focusedIndex < this.lastIndex) {
|
|
100
|
-
if (this.focusedIndex < this.lastFileIndex) {
|
|
101
|
-
this.focusedIndex += 1;
|
|
102
|
-
this.onFileFocus.emit(this.focusedIndex);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (this.actionButtonsVisible && this.focusedIndex === this.lastFileIndex) {
|
|
106
|
-
this.focusedIndex += 1;
|
|
107
|
-
this.onActionButtonFocus.emit("clear");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
NavigationService.prototype.handleUp = function () {
|
|
112
|
-
if (this.lastIndex >= 0 && this.focusedIndex > -1) {
|
|
113
|
-
this.focusedIndex -= 1;
|
|
114
|
-
if (this.focusedIndex === -1) {
|
|
115
|
-
this.onSelectButtonFocus.emit();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (this.focusedIndex <= this.lastFileIndex) {
|
|
119
|
-
this.onFileFocus.emit(this.focusedIndex);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (this.actionButtonsVisible && this.focusedIndex <= this.lastIndex) {
|
|
123
|
-
this.focusedIndex = this.lastFileIndex;
|
|
124
|
-
this.onFileFocus.emit(this.focusedIndex);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
Object.defineProperty(NavigationService.prototype, "focusedIndex", {
|
|
129
|
-
get: function () {
|
|
130
|
-
return this._focusedIndex;
|
|
131
|
-
},
|
|
132
|
-
set: function (index) {
|
|
133
|
-
if (!this.focused) {
|
|
134
|
-
this.onWrapperFocus.emit();
|
|
135
|
-
}
|
|
136
|
-
this._focusedIndex = index;
|
|
137
|
-
this.focused = true;
|
|
138
|
-
if (this._focusedIndex >= 0 && this._focusedIndex <= this.lastFileIndex) {
|
|
139
|
-
this.onFileFocus.emit(index);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
enumerable: true,
|
|
143
|
-
configurable: true
|
|
144
|
-
});
|
|
145
|
-
Object.defineProperty(NavigationService.prototype, "lastFileIndex", {
|
|
146
|
-
get: function () {
|
|
147
|
-
return this.actionButtonsVisible ? this.lastIndex - 2 : this.lastIndex;
|
|
148
|
-
},
|
|
149
|
-
enumerable: true,
|
|
150
|
-
configurable: true
|
|
151
|
-
});
|
|
152
|
-
Object.defineProperty(NavigationService.prototype, "lastIndex", {
|
|
153
|
-
get: function () {
|
|
154
|
-
var fileCount = this.uploadService.files.count;
|
|
155
|
-
return this.actionButtonsVisible ? fileCount + 1 : fileCount - 1;
|
|
156
|
-
},
|
|
157
|
-
enumerable: true,
|
|
158
|
-
configurable: true
|
|
159
|
-
});
|
|
160
|
-
NavigationService = tslib_1.__decorate([
|
|
161
|
-
Injectable(),
|
|
162
|
-
tslib_1.__metadata("design:paramtypes", [UploadService])
|
|
163
|
-
], NavigationService);
|
|
164
|
-
return NavigationService;
|
|
165
|
-
}());
|
|
166
|
-
export { NavigationService };
|
|
@@ -1,15 +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
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export var packageMetadata = {
|
|
9
|
-
name: '@progress/kendo-angular-upload',
|
|
10
|
-
productName: 'Kendo UI for Angular',
|
|
11
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate: 1646671545,
|
|
13
|
-
version: '',
|
|
14
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
|
-
};
|
|
@@ -1,169 +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 { FileState } from '../types';
|
|
8
|
-
import { UploadService } from '../upload.service';
|
|
9
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
|
-
import { NavigationService } from './../navigation.service';
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
var FileListItemActionButtonComponent = /** @class */ (function () {
|
|
15
|
-
function FileListItemActionButtonComponent(uploadService, localization, navigation) {
|
|
16
|
-
this.uploadService = uploadService;
|
|
17
|
-
this.localization = localization;
|
|
18
|
-
this.navigation = navigation;
|
|
19
|
-
this.actionFocused = false;
|
|
20
|
-
this.retryFocused = false;
|
|
21
|
-
this.pauseResumeFocused = false;
|
|
22
|
-
}
|
|
23
|
-
FileListItemActionButtonComponent.prototype.onFocus = function (type) {
|
|
24
|
-
if (type === 'action') {
|
|
25
|
-
this.actionFocused = true;
|
|
26
|
-
}
|
|
27
|
-
if (type === 'retry') {
|
|
28
|
-
this.retryFocused = true;
|
|
29
|
-
}
|
|
30
|
-
if (type === 'pauseResume') {
|
|
31
|
-
this.pauseResumeFocused = true;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
FileListItemActionButtonComponent.prototype.onBlur = function (type) {
|
|
35
|
-
if (type === 'retry') {
|
|
36
|
-
this.retryFocused = false;
|
|
37
|
-
}
|
|
38
|
-
if (type === 'action') {
|
|
39
|
-
this.actionFocused = false;
|
|
40
|
-
}
|
|
41
|
-
if (type === 'pauseResume') {
|
|
42
|
-
this.pauseResumeFocused = false;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
FileListItemActionButtonComponent.prototype.onRetryClick = function () {
|
|
46
|
-
if (this.disabled) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.uploadService.retryFiles(this.file.uid);
|
|
50
|
-
};
|
|
51
|
-
FileListItemActionButtonComponent.prototype.onRemoveCancelClick = function (event) {
|
|
52
|
-
if (this.disabled) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
event.stopImmediatePropagation();
|
|
56
|
-
var uid = this.file.uid;
|
|
57
|
-
if (this.file.state === FileState.Uploading) {
|
|
58
|
-
this.uploadService.cancelFiles(uid);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this.uploadService.removeFiles(uid);
|
|
62
|
-
}
|
|
63
|
-
this.navigation.focusSelectButton();
|
|
64
|
-
};
|
|
65
|
-
FileListItemActionButtonComponent.prototype.onPauseResumeClick = function () {
|
|
66
|
-
if (this.disabled) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
var uid = this.file.uid;
|
|
70
|
-
if (this.file.state === FileState.Paused) {
|
|
71
|
-
this.uploadService.resumeFile(uid);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.uploadService.pauseFile(uid);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "actionButtonTitle", {
|
|
78
|
-
get: function () {
|
|
79
|
-
if (this.file.state === FileState.Uploading) {
|
|
80
|
-
return this.localization.get('cancel');
|
|
81
|
-
}
|
|
82
|
-
return this.localization.get('remove');
|
|
83
|
-
},
|
|
84
|
-
enumerable: true,
|
|
85
|
-
configurable: true
|
|
86
|
-
});
|
|
87
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "retryButtonTitle", {
|
|
88
|
-
get: function () {
|
|
89
|
-
return this.localization.get('retry');
|
|
90
|
-
},
|
|
91
|
-
enumerable: true,
|
|
92
|
-
configurable: true
|
|
93
|
-
});
|
|
94
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "pauseResumeButtonTitle", {
|
|
95
|
-
get: function () {
|
|
96
|
-
if (this.file.state === FileState.Uploading) {
|
|
97
|
-
return this.localization.get('pause');
|
|
98
|
-
}
|
|
99
|
-
return this.localization.get('resume');
|
|
100
|
-
},
|
|
101
|
-
enumerable: true,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "isUploading", {
|
|
105
|
-
get: function () {
|
|
106
|
-
return this.file.state === FileState.Uploading;
|
|
107
|
-
},
|
|
108
|
-
enumerable: true,
|
|
109
|
-
configurable: true
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "isFailed", {
|
|
112
|
-
get: function () {
|
|
113
|
-
return this.file.state === FileState.Failed;
|
|
114
|
-
},
|
|
115
|
-
enumerable: true,
|
|
116
|
-
configurable: true
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "isPaused", {
|
|
119
|
-
get: function () {
|
|
120
|
-
return this.file.state === FileState.Paused;
|
|
121
|
-
},
|
|
122
|
-
enumerable: true,
|
|
123
|
-
configurable: true
|
|
124
|
-
});
|
|
125
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "isResumable", {
|
|
126
|
-
get: function () {
|
|
127
|
-
var service = this.uploadService;
|
|
128
|
-
var isResumable = service.async.chunk && service.chunk.resumable;
|
|
129
|
-
var isUploading = (this.file.state === FileState.Paused) || (this.file.state === FileState.Uploading);
|
|
130
|
-
return isResumable && isUploading;
|
|
131
|
-
},
|
|
132
|
-
enumerable: true,
|
|
133
|
-
configurable: true
|
|
134
|
-
});
|
|
135
|
-
Object.defineProperty(FileListItemActionButtonComponent.prototype, "isActionButtonVisible", {
|
|
136
|
-
get: function () {
|
|
137
|
-
if ((this.file.state === FileState.Uploaded || this.file.state === FileState.Initial) &&
|
|
138
|
-
!this.uploadService.async.removeUrl && this.uploadService.component === 'Upload') {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
},
|
|
143
|
-
enumerable: true,
|
|
144
|
-
configurable: true
|
|
145
|
-
});
|
|
146
|
-
tslib_1.__decorate([
|
|
147
|
-
Input(),
|
|
148
|
-
tslib_1.__metadata("design:type", Object)
|
|
149
|
-
], FileListItemActionButtonComponent.prototype, "file", void 0);
|
|
150
|
-
tslib_1.__decorate([
|
|
151
|
-
Input(),
|
|
152
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
153
|
-
], FileListItemActionButtonComponent.prototype, "disabled", void 0);
|
|
154
|
-
tslib_1.__decorate([
|
|
155
|
-
Input(),
|
|
156
|
-
tslib_1.__metadata("design:type", Number)
|
|
157
|
-
], FileListItemActionButtonComponent.prototype, "progress", void 0);
|
|
158
|
-
FileListItemActionButtonComponent = tslib_1.__decorate([
|
|
159
|
-
Component({
|
|
160
|
-
selector: 'kendo-upload-file-list-item-action-button',
|
|
161
|
-
template: "\n <strong class=\"k-upload-status\">\n <span class=\"k-upload-pct\" *ngIf=\"isUploading || isPaused\">{{progress}}%</span>\n\n <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\"\n [ngClass]=\"{ 'k-focus': this.retryFocused }\"\n [attr.tabIndex]=\"-1\"\n (focus)=\"onFocus('retry')\"\n (blur)=\"onBlur('retry')\"\n (click)=\"onRetryClick()\">\n <span class=\"k-icon k-button-icon k-retry k-i-refresh-sm\"\n [attr.aria-label]=\"retryButtonTitle\"\n [attr.title]=\"retryButtonTitle\">\n </span>\n </button>\n\n <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\"\n [ngClass]=\"{ 'k-focus': this.pauseResumeFocused }\"\n [attr.tabIndex]=\"-1\"\n (focus)=\"onFocus('pauseResume')\"\n (blur)=\"onBlur('pauseResume')\"\n (click)=\"onPauseResumeClick()\">\n <span class=\"k-icon k-button-icon\"\n [ngClass]=\"{\n 'k-i-play-sm': isPaused,\n 'k-i-pause-sm': !isPaused\n }\"\n [attr.aria-label]='pauseResumeButtonTitle'\n [attr.title]='pauseResumeButtonTitle'>\n </span>\n </button>\n\n <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\"\n [ngClass]=\"{ 'k-focus': this.actionFocused }\"\n [attr.tabIndex]=\"-1\"\n (focus)=\"onFocus('action')\"\n (blur)=\"onBlur('action')\"\n (click)=\"onRemoveCancelClick($event)\">\n <span class=\"k-icon k-button-icon\"\n [ngClass]=\"{\n 'k-i-cancel': isUploading,\n 'k-delete k-i-x': !isUploading\n }\"\n [attr.aria-label]='actionButtonTitle'\n [attr.title]='actionButtonTitle'>\n </span>\n </button>\n </strong>\n "
|
|
162
|
-
}),
|
|
163
|
-
tslib_1.__metadata("design:paramtypes", [UploadService,
|
|
164
|
-
LocalizationService,
|
|
165
|
-
NavigationService])
|
|
166
|
-
], FileListItemActionButtonComponent);
|
|
167
|
-
return FileListItemActionButtonComponent;
|
|
168
|
-
}());
|
|
169
|
-
export { FileListItemActionButtonComponent };
|
|
@@ -1,41 +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 { fileHasValidationErrors, filesHaveValidationErrors, getTotalFilesSizeMessage } from '../common/util';
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
var FileListItemBase = /** @class */ (function () {
|
|
10
|
-
function FileListItemBase(uploadService) {
|
|
11
|
-
this.uploadService = uploadService;
|
|
12
|
-
this.progressComplete = 0;
|
|
13
|
-
}
|
|
14
|
-
FileListItemBase.prototype.subscribeUploadProgress = function (uploadProgressHandler) {
|
|
15
|
-
this.uploadProgressSubscription = this.uploadService.uploadProgressEvent.subscribe(uploadProgressHandler);
|
|
16
|
-
};
|
|
17
|
-
FileListItemBase.prototype.fileHasValidationErrors = function (file) {
|
|
18
|
-
return fileHasValidationErrors(file);
|
|
19
|
-
};
|
|
20
|
-
FileListItemBase.prototype.filesHaveValidationErrors = function (files) {
|
|
21
|
-
return filesHaveValidationErrors(files);
|
|
22
|
-
};
|
|
23
|
-
FileListItemBase.prototype.ngOnDestroy = function () {
|
|
24
|
-
this.uploadProgressSubscription.unsubscribe();
|
|
25
|
-
};
|
|
26
|
-
FileListItemBase.prototype.getFileValidationMessage = function (file) {
|
|
27
|
-
var validationMessage;
|
|
28
|
-
if (file.validationErrors && file.validationErrors.length > 0) {
|
|
29
|
-
validationMessage = this.localization.get(file.validationErrors[0]);
|
|
30
|
-
}
|
|
31
|
-
return validationMessage;
|
|
32
|
-
};
|
|
33
|
-
FileListItemBase.prototype.getTotalFilesSizeMessage = function (files) {
|
|
34
|
-
return getTotalFilesSizeMessage(files);
|
|
35
|
-
};
|
|
36
|
-
FileListItemBase.prototype.textFor = function (key) {
|
|
37
|
-
return this.localization.get(key);
|
|
38
|
-
};
|
|
39
|
-
return FileListItemBase;
|
|
40
|
-
}());
|
|
41
|
-
export { FileListItemBase };
|
|
@@ -1,165 +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
|
-
var FileListItemDirective = /** @class */ (function () {
|
|
15
|
-
function FileListItemDirective(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
|
-
FileListItemDirective.prototype.focus = function () {
|
|
23
|
-
this.element.nativeElement.focus();
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(FileListItemDirective.prototype, "uidAttribute", {
|
|
26
|
-
get: function () {
|
|
27
|
-
return this.files[0].uid;
|
|
28
|
-
},
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(FileListItemDirective.prototype, "tabIndex", {
|
|
33
|
-
get: function () {
|
|
34
|
-
return "-1";
|
|
35
|
-
},
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileError", {
|
|
40
|
-
get: function () {
|
|
41
|
-
return this.files[0].state === FileState.Failed;
|
|
42
|
-
},
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileInvalid", {
|
|
47
|
-
get: function () {
|
|
48
|
-
return filesHaveValidationErrors(this.files);
|
|
49
|
-
},
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileProgress", {
|
|
54
|
-
get: function () {
|
|
55
|
-
return this.files[0].state === FileState.Uploading ||
|
|
56
|
-
this.files[0].state === FileState.Paused;
|
|
57
|
-
},
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileSuccess", {
|
|
62
|
-
get: function () {
|
|
63
|
-
if (this.uploadService.component === 'Upload') {
|
|
64
|
-
return this.files[0].state === FileState.Uploaded ||
|
|
65
|
-
this.files[0].state === FileState.Initial;
|
|
66
|
-
}
|
|
67
|
-
return false;
|
|
68
|
-
},
|
|
69
|
-
enumerable: true,
|
|
70
|
-
configurable: true
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(FileListItemDirective.prototype, "kStateFocused", {
|
|
73
|
-
get: function () {
|
|
74
|
-
return this.focused;
|
|
75
|
-
},
|
|
76
|
-
enumerable: true,
|
|
77
|
-
configurable: true
|
|
78
|
-
});
|
|
79
|
-
FileListItemDirective.prototype.onFocus = function () {
|
|
80
|
-
this.focused = true;
|
|
81
|
-
};
|
|
82
|
-
FileListItemDirective.prototype.onBlur = function () {
|
|
83
|
-
this.focused = false;
|
|
84
|
-
};
|
|
85
|
-
FileListItemDirective.prototype.onClick = function (event) {
|
|
86
|
-
if (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES)) {
|
|
87
|
-
this.navigationService.focusedIndex = this.index;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
tslib_1.__decorate([
|
|
91
|
-
Input(),
|
|
92
|
-
tslib_1.__metadata("design:type", Array)
|
|
93
|
-
], FileListItemDirective.prototype, "files", void 0);
|
|
94
|
-
tslib_1.__decorate([
|
|
95
|
-
Input(),
|
|
96
|
-
tslib_1.__metadata("design:type", Number)
|
|
97
|
-
], FileListItemDirective.prototype, "index", void 0);
|
|
98
|
-
tslib_1.__decorate([
|
|
99
|
-
HostBinding('class.k-file'),
|
|
100
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
101
|
-
], FileListItemDirective.prototype, "fileClass", void 0);
|
|
102
|
-
tslib_1.__decorate([
|
|
103
|
-
HostBinding('attr.data-uid'),
|
|
104
|
-
tslib_1.__metadata("design:type", String),
|
|
105
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
106
|
-
], FileListItemDirective.prototype, "uidAttribute", null);
|
|
107
|
-
tslib_1.__decorate([
|
|
108
|
-
HostBinding('attr.tabIndex'),
|
|
109
|
-
tslib_1.__metadata("design:type", String),
|
|
110
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
111
|
-
], FileListItemDirective.prototype, "tabIndex", null);
|
|
112
|
-
tslib_1.__decorate([
|
|
113
|
-
HostBinding('class.k-file-error'),
|
|
114
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
115
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
116
|
-
], FileListItemDirective.prototype, "kFileError", null);
|
|
117
|
-
tslib_1.__decorate([
|
|
118
|
-
HostBinding('class.k-file-invalid'),
|
|
119
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
120
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
121
|
-
], FileListItemDirective.prototype, "kFileInvalid", null);
|
|
122
|
-
tslib_1.__decorate([
|
|
123
|
-
HostBinding('class.k-file-progress'),
|
|
124
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
125
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
126
|
-
], FileListItemDirective.prototype, "kFileProgress", null);
|
|
127
|
-
tslib_1.__decorate([
|
|
128
|
-
HostBinding('class.k-file-success'),
|
|
129
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
130
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
131
|
-
], FileListItemDirective.prototype, "kFileSuccess", null);
|
|
132
|
-
tslib_1.__decorate([
|
|
133
|
-
HostBinding('class.k-state-focused'),
|
|
134
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
135
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
136
|
-
], FileListItemDirective.prototype, "kStateFocused", null);
|
|
137
|
-
tslib_1.__decorate([
|
|
138
|
-
HostListener("focus"),
|
|
139
|
-
tslib_1.__metadata("design:type", Function),
|
|
140
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
141
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
142
|
-
], FileListItemDirective.prototype, "onFocus", null);
|
|
143
|
-
tslib_1.__decorate([
|
|
144
|
-
HostListener("blur"),
|
|
145
|
-
tslib_1.__metadata("design:type", Function),
|
|
146
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
147
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
148
|
-
], FileListItemDirective.prototype, "onBlur", null);
|
|
149
|
-
tslib_1.__decorate([
|
|
150
|
-
HostListener('click', ['$event']),
|
|
151
|
-
tslib_1.__metadata("design:type", Function),
|
|
152
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
153
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
154
|
-
], FileListItemDirective.prototype, "onClick", null);
|
|
155
|
-
FileListItemDirective = tslib_1.__decorate([
|
|
156
|
-
Directive({
|
|
157
|
-
selector: '[kendoUploadFileListItem]'
|
|
158
|
-
}),
|
|
159
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
160
|
-
NavigationService,
|
|
161
|
-
UploadService])
|
|
162
|
-
], FileListItemDirective);
|
|
163
|
-
return FileListItemDirective;
|
|
164
|
-
}());
|
|
165
|
-
export { FileListItemDirective };
|