@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,43 +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
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var util_1 = require("../common/util");
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
var FileListItemBase = /** @class */ (function () {
|
|
12
|
-
function FileListItemBase(uploadService) {
|
|
13
|
-
this.uploadService = uploadService;
|
|
14
|
-
this.progressComplete = 0;
|
|
15
|
-
}
|
|
16
|
-
FileListItemBase.prototype.subscribeUploadProgress = function (uploadProgressHandler) {
|
|
17
|
-
this.uploadProgressSubscription = this.uploadService.uploadProgressEvent.subscribe(uploadProgressHandler);
|
|
18
|
-
};
|
|
19
|
-
FileListItemBase.prototype.fileHasValidationErrors = function (file) {
|
|
20
|
-
return util_1.fileHasValidationErrors(file);
|
|
21
|
-
};
|
|
22
|
-
FileListItemBase.prototype.filesHaveValidationErrors = function (files) {
|
|
23
|
-
return util_1.filesHaveValidationErrors(files);
|
|
24
|
-
};
|
|
25
|
-
FileListItemBase.prototype.ngOnDestroy = function () {
|
|
26
|
-
this.uploadProgressSubscription.unsubscribe();
|
|
27
|
-
};
|
|
28
|
-
FileListItemBase.prototype.getFileValidationMessage = function (file) {
|
|
29
|
-
var validationMessage;
|
|
30
|
-
if (file.validationErrors && file.validationErrors.length > 0) {
|
|
31
|
-
validationMessage = this.localization.get(file.validationErrors[0]);
|
|
32
|
-
}
|
|
33
|
-
return validationMessage;
|
|
34
|
-
};
|
|
35
|
-
FileListItemBase.prototype.getTotalFilesSizeMessage = function (files) {
|
|
36
|
-
return util_1.getTotalFilesSizeMessage(files);
|
|
37
|
-
};
|
|
38
|
-
FileListItemBase.prototype.textFor = function (key) {
|
|
39
|
-
return this.localization.get(key);
|
|
40
|
-
};
|
|
41
|
-
return FileListItemBase;
|
|
42
|
-
}());
|
|
43
|
-
exports.FileListItemBase = FileListItemBase;
|
|
@@ -1,167 +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
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
var types_1 = require("../types");
|
|
10
|
-
var navigation_service_1 = require("../navigation.service");
|
|
11
|
-
var util_1 = require("../common/util");
|
|
12
|
-
var upload_service_1 = require("../upload.service");
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
var FileListItemDirective = /** @class */ (function () {
|
|
17
|
-
function FileListItemDirective(el, navigationService, uploadService) {
|
|
18
|
-
this.navigationService = navigationService;
|
|
19
|
-
this.uploadService = uploadService;
|
|
20
|
-
this.fileClass = true;
|
|
21
|
-
this.focused = false;
|
|
22
|
-
this.element = el;
|
|
23
|
-
}
|
|
24
|
-
FileListItemDirective.prototype.focus = function () {
|
|
25
|
-
this.element.nativeElement.focus();
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(FileListItemDirective.prototype, "uidAttribute", {
|
|
28
|
-
get: function () {
|
|
29
|
-
return this.files[0].uid;
|
|
30
|
-
},
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(FileListItemDirective.prototype, "tabIndex", {
|
|
35
|
-
get: function () {
|
|
36
|
-
return "-1";
|
|
37
|
-
},
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileError", {
|
|
42
|
-
get: function () {
|
|
43
|
-
return this.files[0].state === types_1.FileState.Failed;
|
|
44
|
-
},
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileInvalid", {
|
|
49
|
-
get: function () {
|
|
50
|
-
return util_1.filesHaveValidationErrors(this.files);
|
|
51
|
-
},
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileProgress", {
|
|
56
|
-
get: function () {
|
|
57
|
-
return this.files[0].state === types_1.FileState.Uploading ||
|
|
58
|
-
this.files[0].state === types_1.FileState.Paused;
|
|
59
|
-
},
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(FileListItemDirective.prototype, "kFileSuccess", {
|
|
64
|
-
get: function () {
|
|
65
|
-
if (this.uploadService.component === 'Upload') {
|
|
66
|
-
return this.files[0].state === types_1.FileState.Uploaded ||
|
|
67
|
-
this.files[0].state === types_1.FileState.Initial;
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
},
|
|
71
|
-
enumerable: true,
|
|
72
|
-
configurable: true
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(FileListItemDirective.prototype, "kStateFocused", {
|
|
75
|
-
get: function () {
|
|
76
|
-
return this.focused;
|
|
77
|
-
},
|
|
78
|
-
enumerable: true,
|
|
79
|
-
configurable: true
|
|
80
|
-
});
|
|
81
|
-
FileListItemDirective.prototype.onFocus = function () {
|
|
82
|
-
this.focused = true;
|
|
83
|
-
};
|
|
84
|
-
FileListItemDirective.prototype.onBlur = function () {
|
|
85
|
-
this.focused = false;
|
|
86
|
-
};
|
|
87
|
-
FileListItemDirective.prototype.onClick = function (event) {
|
|
88
|
-
if (!util_1.isFocusable(event.target) && !util_1.hasClasses(event.target, util_1.IGNORE_TARGET_CLASSES)) {
|
|
89
|
-
this.navigationService.focusedIndex = this.index;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
tslib_1.__decorate([
|
|
93
|
-
core_1.Input(),
|
|
94
|
-
tslib_1.__metadata("design:type", Array)
|
|
95
|
-
], FileListItemDirective.prototype, "files", void 0);
|
|
96
|
-
tslib_1.__decorate([
|
|
97
|
-
core_1.Input(),
|
|
98
|
-
tslib_1.__metadata("design:type", Number)
|
|
99
|
-
], FileListItemDirective.prototype, "index", void 0);
|
|
100
|
-
tslib_1.__decorate([
|
|
101
|
-
core_1.HostBinding('class.k-file'),
|
|
102
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
103
|
-
], FileListItemDirective.prototype, "fileClass", void 0);
|
|
104
|
-
tslib_1.__decorate([
|
|
105
|
-
core_1.HostBinding('attr.data-uid'),
|
|
106
|
-
tslib_1.__metadata("design:type", String),
|
|
107
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
108
|
-
], FileListItemDirective.prototype, "uidAttribute", null);
|
|
109
|
-
tslib_1.__decorate([
|
|
110
|
-
core_1.HostBinding('attr.tabIndex'),
|
|
111
|
-
tslib_1.__metadata("design:type", String),
|
|
112
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
113
|
-
], FileListItemDirective.prototype, "tabIndex", null);
|
|
114
|
-
tslib_1.__decorate([
|
|
115
|
-
core_1.HostBinding('class.k-file-error'),
|
|
116
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
117
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
118
|
-
], FileListItemDirective.prototype, "kFileError", null);
|
|
119
|
-
tslib_1.__decorate([
|
|
120
|
-
core_1.HostBinding('class.k-file-invalid'),
|
|
121
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
122
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
123
|
-
], FileListItemDirective.prototype, "kFileInvalid", null);
|
|
124
|
-
tslib_1.__decorate([
|
|
125
|
-
core_1.HostBinding('class.k-file-progress'),
|
|
126
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
127
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
128
|
-
], FileListItemDirective.prototype, "kFileProgress", null);
|
|
129
|
-
tslib_1.__decorate([
|
|
130
|
-
core_1.HostBinding('class.k-file-success'),
|
|
131
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
132
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
133
|
-
], FileListItemDirective.prototype, "kFileSuccess", null);
|
|
134
|
-
tslib_1.__decorate([
|
|
135
|
-
core_1.HostBinding('class.k-state-focused'),
|
|
136
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
137
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
138
|
-
], FileListItemDirective.prototype, "kStateFocused", null);
|
|
139
|
-
tslib_1.__decorate([
|
|
140
|
-
core_1.HostListener("focus"),
|
|
141
|
-
tslib_1.__metadata("design:type", Function),
|
|
142
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
143
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
144
|
-
], FileListItemDirective.prototype, "onFocus", null);
|
|
145
|
-
tslib_1.__decorate([
|
|
146
|
-
core_1.HostListener("blur"),
|
|
147
|
-
tslib_1.__metadata("design:type", Function),
|
|
148
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
149
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
150
|
-
], FileListItemDirective.prototype, "onBlur", null);
|
|
151
|
-
tslib_1.__decorate([
|
|
152
|
-
core_1.HostListener('click', ['$event']),
|
|
153
|
-
tslib_1.__metadata("design:type", Function),
|
|
154
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
155
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
156
|
-
], FileListItemDirective.prototype, "onClick", null);
|
|
157
|
-
FileListItemDirective = tslib_1.__decorate([
|
|
158
|
-
core_1.Directive({
|
|
159
|
-
selector: '[kendoUploadFileListItem]'
|
|
160
|
-
}),
|
|
161
|
-
tslib_1.__metadata("design:paramtypes", [core_1.ElementRef,
|
|
162
|
-
navigation_service_1.NavigationService,
|
|
163
|
-
upload_service_1.UploadService])
|
|
164
|
-
], FileListItemDirective);
|
|
165
|
-
return FileListItemDirective;
|
|
166
|
-
}());
|
|
167
|
-
exports.FileListItemDirective = FileListItemDirective;
|
|
@@ -1,109 +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
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
var animations_1 = require("@angular/animations");
|
|
10
|
-
var types_1 = require("../types");
|
|
11
|
-
var file_list_item_base_1 = require("./file-list-item-base");
|
|
12
|
-
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
13
|
-
var upload_service_1 = require("../upload.service");
|
|
14
|
-
var util_1 = require("../common/util");
|
|
15
|
-
var file_info_template_directive_1 = require("../templates/file-info-template.directive");
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
var FileListMultipleItemsComponent = /** @class */ (function (_super) {
|
|
20
|
-
tslib_1.__extends(FileListMultipleItemsComponent, _super);
|
|
21
|
-
function FileListMultipleItemsComponent(localization, uploadService) {
|
|
22
|
-
var _this = _super.call(this, uploadService) || this;
|
|
23
|
-
_this.localization = localization;
|
|
24
|
-
_this.subscribeUploadProgress(function (args) {
|
|
25
|
-
if (args.files[0].uid === _this.files[0].uid) {
|
|
26
|
-
_this.progressComplete = args.percentComplete;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
Object.defineProperty(FileListMultipleItemsComponent.prototype, "showProgress", {
|
|
32
|
-
get: function () {
|
|
33
|
-
var showProgress = this.files[0].state === types_1.FileState.Uploading || this.files[0].state === types_1.FileState.Paused;
|
|
34
|
-
return showProgress ? 'active' : 'inactive';
|
|
35
|
-
},
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
|
-
FileListMultipleItemsComponent.prototype.ngOnInit = function () {
|
|
40
|
-
this.filesHaveErrors = _super.prototype.filesHaveValidationErrors.call(this, this.files);
|
|
41
|
-
};
|
|
42
|
-
FileListMultipleItemsComponent.prototype.fileStatusText = function (file) {
|
|
43
|
-
var errors = file.validationErrors;
|
|
44
|
-
if (!util_1.isPresent(errors)) {
|
|
45
|
-
return this.getTotalFilesSizeMessage([file]);
|
|
46
|
-
}
|
|
47
|
-
return this.getFileValidationMessage(file);
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(FileListMultipleItemsComponent.prototype, "batchStatusText", {
|
|
50
|
-
get: function () {
|
|
51
|
-
var state = this.files[0].state;
|
|
52
|
-
var fileCount = this.files.length;
|
|
53
|
-
if (state === types_1.FileState.Uploaded) {
|
|
54
|
-
return fileCount + " " + this.textFor('filesBatchStatusUploaded');
|
|
55
|
-
}
|
|
56
|
-
if (state === types_1.FileState.Failed) {
|
|
57
|
-
return fileCount + " " + this.textFor('filesBatchStatusFailed');
|
|
58
|
-
}
|
|
59
|
-
return fileCount + " " + this.textFor('filesBatchStatus');
|
|
60
|
-
},
|
|
61
|
-
enumerable: true,
|
|
62
|
-
configurable: true
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(FileListMultipleItemsComponent.prototype, "isUploadSuccessful", {
|
|
65
|
-
get: function () {
|
|
66
|
-
return this.files[0].state === types_1.FileState.Uploaded;
|
|
67
|
-
},
|
|
68
|
-
enumerable: true,
|
|
69
|
-
configurable: true
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(FileListMultipleItemsComponent.prototype, "isUploadFailed", {
|
|
72
|
-
get: function () {
|
|
73
|
-
return this.files[0].state === types_1.FileState.Failed;
|
|
74
|
-
},
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
tslib_1.__decorate([
|
|
79
|
-
core_1.Input(),
|
|
80
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
81
|
-
], FileListMultipleItemsComponent.prototype, "disabled", void 0);
|
|
82
|
-
tslib_1.__decorate([
|
|
83
|
-
core_1.Input(),
|
|
84
|
-
tslib_1.__metadata("design:type", Array)
|
|
85
|
-
], FileListMultipleItemsComponent.prototype, "files", void 0);
|
|
86
|
-
tslib_1.__decorate([
|
|
87
|
-
core_1.Input(),
|
|
88
|
-
tslib_1.__metadata("design:type", file_info_template_directive_1.FileInfoTemplateDirective)
|
|
89
|
-
], FileListMultipleItemsComponent.prototype, "fileInfoTemplate", void 0);
|
|
90
|
-
FileListMultipleItemsComponent = tslib_1.__decorate([
|
|
91
|
-
core_1.Component({
|
|
92
|
-
animations: [
|
|
93
|
-
animations_1.trigger('progressState', [
|
|
94
|
-
animations_1.state('active', animations_1.style({ opacity: 1 })),
|
|
95
|
-
animations_1.state('inactive', animations_1.style({ opacity: 0 })),
|
|
96
|
-
animations_1.transition('void => active', animations_1.style({ opacity: 0 })),
|
|
97
|
-
animations_1.transition('inactive => active', animations_1.style({ opacity: 1 })),
|
|
98
|
-
animations_1.transition('active => inactive', animations_1.animate('1s 2s ease-out'))
|
|
99
|
-
])
|
|
100
|
-
],
|
|
101
|
-
selector: 'kendo-upload-file-list-multiple-items',
|
|
102
|
-
template: "\n <div class=\"k-progressbar\" [@progressState]=\"showProgress\">\n <span class=\"k-progress\" [style.width]=\"progressComplete + '%'\"></span>\n </div>\n <span class=\"k-multiple-files-group-wrapper\">\n <span class=\"k-file-group k-icon k-i-copy\"></span>\n </span>\n <span class=\"k-multiple-files-wrapper\">\n <ng-container *ngIf=\"!fileInfoTemplate\">\n <span *ngFor=\"let file of files\" class=\"k-file-name-size-wrapper\">\n <span [title]=\"file.name\" class=\"k-file-name\">\n {{file.name}}\n </span>\n <span [ngClass]=\"{\n 'k-text-error': file.validationErrors,\n 'k-file-validation-message': file.validationErrors,\n 'k-file-size': !file.validationErrors\n }\"\n >{{fileStatusText(file)}}</span>\n </span>\n <span class=\"k-file-information\"\n [ngClass]=\"{\n 'k-text-success': isUploadSuccessful,\n 'k-text-error': isUploadFailed\n }\"\n >{{batchStatusText}}</span>\n </ng-container>\n <ng-template *ngIf=\"fileInfoTemplate\"\n [templateContext]=\"{\n templateRef: fileInfoTemplate.templateRef,\n state: files[0].state,\n $implicit: files\n }\">\n </ng-template>\n </span>\n <kendo-upload-file-list-item-action-button\n [file]='files[0]'\n [disabled]='disabled'\n [progress]='progressComplete'>\n </kendo-upload-file-list-item-action-button>\n "
|
|
103
|
-
}),
|
|
104
|
-
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService,
|
|
105
|
-
upload_service_1.UploadService])
|
|
106
|
-
], FileListMultipleItemsComponent);
|
|
107
|
-
return FileListMultipleItemsComponent;
|
|
108
|
-
}(file_list_item_base_1.FileListItemBase));
|
|
109
|
-
exports.FileListMultipleItemsComponent = FileListMultipleItemsComponent;
|
|
@@ -1,114 +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
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
var core_1 = require("@angular/core");
|
|
9
|
-
var animations_1 = require("@angular/animations");
|
|
10
|
-
var types_1 = require("../types");
|
|
11
|
-
var file_list_item_base_1 = require("./file-list-item-base");
|
|
12
|
-
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
13
|
-
var upload_service_1 = require("../upload.service");
|
|
14
|
-
var util_1 = require("../common/util");
|
|
15
|
-
var file_info_template_directive_1 = require("../templates/file-info-template.directive");
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
var FileListSingleItemComponent = /** @class */ (function (_super) {
|
|
20
|
-
tslib_1.__extends(FileListSingleItemComponent, _super);
|
|
21
|
-
function FileListSingleItemComponent(localization, uploadService) {
|
|
22
|
-
var _this = _super.call(this, uploadService) || this;
|
|
23
|
-
_this.localization = localization;
|
|
24
|
-
_this.subscribeUploadProgress(function (args) {
|
|
25
|
-
if (args.files[0].uid === _this.file.uid) {
|
|
26
|
-
_this.progressComplete = args.percentComplete;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "fileStatusText", {
|
|
32
|
-
get: function () {
|
|
33
|
-
var errors = this.file.validationErrors;
|
|
34
|
-
if (this.file.state === types_1.FileState.Uploaded) {
|
|
35
|
-
return "" + this.textFor('fileStatusUploaded');
|
|
36
|
-
}
|
|
37
|
-
if (this.file.state === types_1.FileState.Failed) {
|
|
38
|
-
return "" + this.textFor('fileStatusFailed');
|
|
39
|
-
}
|
|
40
|
-
if (!util_1.isPresent(errors)) {
|
|
41
|
-
return this.getTotalFilesSizeMessage([this.file]);
|
|
42
|
-
}
|
|
43
|
-
return this.getFileValidationMessage(this.file);
|
|
44
|
-
},
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "showProgress", {
|
|
49
|
-
get: function () {
|
|
50
|
-
var showProgress = this.file.state === types_1.FileState.Uploading || this.file.state === types_1.FileState.Paused;
|
|
51
|
-
return showProgress ? 'active' : 'inactive';
|
|
52
|
-
},
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "fileGroupClass", {
|
|
57
|
-
get: function () {
|
|
58
|
-
return util_1.getFileGroupCssClass(this.file.extension ? this.file.extension : '');
|
|
59
|
-
},
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "isUploadSuccessful", {
|
|
64
|
-
get: function () {
|
|
65
|
-
return this.file.state === types_1.FileState.Uploaded;
|
|
66
|
-
},
|
|
67
|
-
enumerable: true,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "isUploadFailed", {
|
|
71
|
-
get: function () {
|
|
72
|
-
return this.file.state === types_1.FileState.Failed;
|
|
73
|
-
},
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true
|
|
76
|
-
});
|
|
77
|
-
Object.defineProperty(FileListSingleItemComponent.prototype, "isNotYetUploaded", {
|
|
78
|
-
get: function () {
|
|
79
|
-
return !this.isUploadFailed && !this.isUploadSuccessful;
|
|
80
|
-
},
|
|
81
|
-
enumerable: true,
|
|
82
|
-
configurable: true
|
|
83
|
-
});
|
|
84
|
-
tslib_1.__decorate([
|
|
85
|
-
core_1.Input(),
|
|
86
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
87
|
-
], FileListSingleItemComponent.prototype, "disabled", void 0);
|
|
88
|
-
tslib_1.__decorate([
|
|
89
|
-
core_1.Input(),
|
|
90
|
-
tslib_1.__metadata("design:type", Object)
|
|
91
|
-
], FileListSingleItemComponent.prototype, "file", void 0);
|
|
92
|
-
tslib_1.__decorate([
|
|
93
|
-
core_1.Input(),
|
|
94
|
-
tslib_1.__metadata("design:type", file_info_template_directive_1.FileInfoTemplateDirective)
|
|
95
|
-
], FileListSingleItemComponent.prototype, "fileInfoTemplate", void 0);
|
|
96
|
-
FileListSingleItemComponent = tslib_1.__decorate([
|
|
97
|
-
core_1.Component({
|
|
98
|
-
animations: [
|
|
99
|
-
animations_1.trigger('progressState', [
|
|
100
|
-
animations_1.state('active', animations_1.style({ opacity: 1 })),
|
|
101
|
-
animations_1.state('inactive', animations_1.style({ opacity: 0 })),
|
|
102
|
-
animations_1.transition('void => active', animations_1.style({ opacity: 0 })),
|
|
103
|
-
animations_1.transition('inactive => active', animations_1.style({ opacity: 1 })),
|
|
104
|
-
animations_1.transition('active => inactive', animations_1.animate('1s 2s ease-out'))
|
|
105
|
-
])
|
|
106
|
-
],
|
|
107
|
-
selector: 'kendo-upload-file-list-single-item',
|
|
108
|
-
template: "\n <div class=\"k-progressbar\" [@progressState]=\"showProgress\">\n <span class=\"k-progress\" [style.width]=\"progressComplete + '%'\"></span>\n </div>\n <span class=\"k-file-group-wrapper\">\n <span class=\"k-file-group k-icon\" [ngClass]=\"fileGroupClass\"></span>\n </span>\n <span class=\"k-file-name-size-wrapper\">\n <ng-container *ngIf=\"!fileInfoTemplate\">\n <span class=\"k-file-name\" [title]=\"file.name\">{{ file.name }}</span>\n <span [ngClass]=\"{\n 'k-file-validation-message': file.validationErrors,\n 'k-file-size': !file.validationErrors && isNotYetUploaded,\n 'k-text-success': isUploadSuccessful,\n 'k-text-error': file.validationErrors || isUploadFailed,\n 'k-file-information': isUploadSuccessful || isUploadFailed\n }\"\n >{{fileStatusText}}</span>\n </ng-container>\n <ng-template *ngIf=\"fileInfoTemplate\"\n [templateContext]=\"{\n templateRef: fileInfoTemplate.templateRef,\n state: file.state,\n $implicit: [file]\n }\">\n </ng-template>\n </span>\n <kendo-upload-file-list-item-action-button\n [file]='file'\n [disabled]='disabled'\n [progress]='progressComplete'>\n </kendo-upload-file-list-item-action-button>\n "
|
|
109
|
-
}),
|
|
110
|
-
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, upload_service_1.UploadService])
|
|
111
|
-
], FileListSingleItemComponent);
|
|
112
|
-
return FileListSingleItemComponent;
|
|
113
|
-
}(file_list_item_base_1.FileListItemBase));
|
|
114
|
-
exports.FileListSingleItemComponent = FileListSingleItemComponent;
|
|
@@ -1,100 +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
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var tslib_1 = require("tslib");
|
|
8
|
-
/* tslint:disable:component-selector */
|
|
9
|
-
var core_1 = require("@angular/core");
|
|
10
|
-
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
11
|
-
var types_1 = require("../types");
|
|
12
|
-
var file_template_directive_1 = require("../templates/file-template.directive");
|
|
13
|
-
var file_list_item_1 = require("./file-list-item");
|
|
14
|
-
var navigation_service_1 = require("../navigation.service");
|
|
15
|
-
var upload_service_1 = require("../upload.service");
|
|
16
|
-
var file_info_template_directive_1 = require("../templates/file-info-template.directive");
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
var FileListComponent = /** @class */ (function () {
|
|
21
|
-
function FileListComponent(uploadService, navigation) {
|
|
22
|
-
this.uploadService = uploadService;
|
|
23
|
-
this.navigation = navigation;
|
|
24
|
-
this.onItemFocus();
|
|
25
|
-
this.onItemAction();
|
|
26
|
-
}
|
|
27
|
-
FileListComponent.prototype.onItemFocus = function () {
|
|
28
|
-
var _this = this;
|
|
29
|
-
this.focusSubscription = this.navigation.onFileFocus.subscribe(function (index) {
|
|
30
|
-
_this.fileListItems.toArray()[index].focus();
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
FileListComponent.prototype.onItemAction = function () {
|
|
34
|
-
var _this = this;
|
|
35
|
-
this.actionSubscription = this.navigation.onFileAction.subscribe(function (key) {
|
|
36
|
-
_this.itemActionHandler(key);
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
FileListComponent.prototype.itemActionHandler = function (key) {
|
|
40
|
-
var index = this.navigation.focusedIndex;
|
|
41
|
-
var item = this.fileListItems.toArray()[index];
|
|
42
|
-
var uid = item.uidAttribute;
|
|
43
|
-
var files = this.uploadService.files.get(uid);
|
|
44
|
-
if (key === kendo_angular_common_1.Keys.Escape && files[0].state === types_1.FileState.Uploading) {
|
|
45
|
-
this.uploadService.cancelFiles(uid);
|
|
46
|
-
this.navigation.focusSelectButton();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (key === kendo_angular_common_1.Keys.Enter && files[0].state === types_1.FileState.Failed) {
|
|
50
|
-
this.uploadService.retryFiles(uid);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (key === kendo_angular_common_1.Keys.Delete) {
|
|
54
|
-
if (files[0].state === types_1.FileState.Uploading) {
|
|
55
|
-
this.uploadService.cancelFiles(uid);
|
|
56
|
-
}
|
|
57
|
-
else if (this.hasDelete(item)) {
|
|
58
|
-
this.uploadService.removeFiles(uid);
|
|
59
|
-
}
|
|
60
|
-
this.navigation.focusSelectButton();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
FileListComponent.prototype.hasDelete = function (item) {
|
|
64
|
-
return item.element.nativeElement.getElementsByClassName('k-delete').length > 0;
|
|
65
|
-
};
|
|
66
|
-
FileListComponent.prototype.ngOnDestroy = function () {
|
|
67
|
-
this.focusSubscription.unsubscribe();
|
|
68
|
-
this.actionSubscription.unsubscribe();
|
|
69
|
-
};
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
core_1.Input(),
|
|
72
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
73
|
-
], FileListComponent.prototype, "disabled", void 0);
|
|
74
|
-
tslib_1.__decorate([
|
|
75
|
-
core_1.Input(),
|
|
76
|
-
tslib_1.__metadata("design:type", Array)
|
|
77
|
-
], FileListComponent.prototype, "fileList", void 0);
|
|
78
|
-
tslib_1.__decorate([
|
|
79
|
-
core_1.Input(),
|
|
80
|
-
tslib_1.__metadata("design:type", file_template_directive_1.FileTemplateDirective)
|
|
81
|
-
], FileListComponent.prototype, "fileTemplate", void 0);
|
|
82
|
-
tslib_1.__decorate([
|
|
83
|
-
core_1.Input(),
|
|
84
|
-
tslib_1.__metadata("design:type", file_info_template_directive_1.FileInfoTemplateDirective)
|
|
85
|
-
], FileListComponent.prototype, "fileInfoTemplate", void 0);
|
|
86
|
-
tslib_1.__decorate([
|
|
87
|
-
core_1.ViewChildren(file_list_item_1.FileListItemDirective),
|
|
88
|
-
tslib_1.__metadata("design:type", core_1.QueryList)
|
|
89
|
-
], FileListComponent.prototype, "fileListItems", void 0);
|
|
90
|
-
FileListComponent = tslib_1.__decorate([
|
|
91
|
-
core_1.Component({
|
|
92
|
-
selector: '[kendo-upload-file-list]',
|
|
93
|
-
template: "\n <ng-template ngFor\n [ngForOf]=\"fileList\"\n let-files\n let-index=\"index\">\n <li kendoUploadFileListItem [files]='files' [index]='index'>\n <kendo-upload-file-list-single-item\n class='k-file-single'\n *ngIf='files.length === 1 && !fileTemplate'\n [disabled]='disabled'\n [file]='files[0]'\n [fileInfoTemplate]=\"fileInfoTemplate\">\n </kendo-upload-file-list-single-item>\n <kendo-upload-file-list-multiple-items\n class='k-file-multiple'\n *ngIf='files.length > 1 && !fileTemplate'\n [disabled]='disabled'\n [files]='files'\n [fileInfoTemplate]=\"fileInfoTemplate\">\n </kendo-upload-file-list-multiple-items>\n <ng-template *ngIf=\"fileTemplate\"\n [templateContext]=\"{\n templateRef: fileTemplate.templateRef,\n state: files[0].state,\n $implicit: files\n }\"></ng-template>\n </li>\n </ng-template>\n "
|
|
94
|
-
}),
|
|
95
|
-
tslib_1.__metadata("design:paramtypes", [upload_service_1.UploadService,
|
|
96
|
-
navigation_service_1.NavigationService])
|
|
97
|
-
], FileListComponent);
|
|
98
|
-
return FileListComponent;
|
|
99
|
-
}());
|
|
100
|
-
exports.FileListComponent = FileListComponent;
|