@progress/kendo-angular-upload 8.0.2 → 9.0.0-next.202203141352
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 +113 -0
- package/{dist/es2015 → esm2015}/dropzone.service.js +8 -7
- package/{dist/es2015 → esm2015}/events/cancel-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/clear-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/error-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/pause-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/remove-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/resume-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/select-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/success-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/upload-event.js +0 -0
- package/{dist/es2015 → esm2015}/events/upload-progress-event.js +0 -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 +33 -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 +263 -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 +0 -0
- package/{dist/es2015/events → events}/clear-event.d.ts +0 -0
- package/{dist/es2015/events → events}/error-event.d.ts +0 -0
- package/{dist/es2015/events → events}/pause-event.d.ts +0 -0
- package/{dist/es2015/events → events}/preventable-event.d.ts +0 -0
- package/{dist/es2015/events → events}/remove-event.d.ts +0 -0
- package/{dist/es2015/events → events}/resume-event.d.ts +0 -0
- package/{dist/es2015/events → events}/select-event.d.ts +0 -0
- package/{dist/es2015/events → events}/success-event.d.ts +0 -0
- package/{dist/es2015/events → events}/upload-event.d.ts +0 -0
- package/{dist/es2015/events → events}/upload-progress-event.d.ts +0 -0
- package/{dist/es2015/events.d.ts → events.d.ts} +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-upload.js} +2184 -2011
- 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 +34 -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
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
5
|
import { Directive, HostListener, Input } from '@angular/core';
|
|
7
6
|
import { assignGuidToFiles, getAllFileInfo, isPresent } from './common/util';
|
|
8
7
|
import { validateFiles } from './common/validation-util';
|
|
9
8
|
import { DropZoneService } from './dropzone.service';
|
|
10
9
|
import { UploadComponent } from './upload.component';
|
|
11
|
-
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "./dropzone.service";
|
|
12
|
+
export class UploadDropZoneDirective {
|
|
12
13
|
constructor(dropZoneService) {
|
|
13
14
|
this.dropZoneService = dropZoneService;
|
|
14
15
|
}
|
|
@@ -58,36 +59,29 @@ let UploadDropZoneDirective = class UploadDropZoneDirective {
|
|
|
58
59
|
get componentInstance() {
|
|
59
60
|
return this.dropZoneService.getComponents(this.zoneId);
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
],
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
],
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
DropZoneService
|
|
88
|
-
],
|
|
89
|
-
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
90
|
-
}),
|
|
91
|
-
tslib_1.__metadata("design:paramtypes", [DropZoneService])
|
|
92
|
-
], UploadDropZoneDirective);
|
|
93
|
-
export { UploadDropZoneDirective };
|
|
62
|
+
}
|
|
63
|
+
UploadDropZoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneDirective, deps: [{ token: i1.DropZoneService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
UploadDropZoneDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: UploadDropZoneDirective, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: { zoneId: ["kendoUploadDropZone", "zoneId"] }, host: { listeners: { "dragenter": "onElementDragEnter()", "dragover": "onElementDragOver()", "drop": "onDropListener($event)" } }, providers: [
|
|
65
|
+
DropZoneService
|
|
66
|
+
], ngImport: i0 });
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneDirective, decorators: [{
|
|
68
|
+
type: Directive,
|
|
69
|
+
args: [{
|
|
70
|
+
providers: [
|
|
71
|
+
DropZoneService
|
|
72
|
+
],
|
|
73
|
+
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
74
|
+
}]
|
|
75
|
+
}], ctorParameters: function () { return [{ type: i1.DropZoneService }]; }, propDecorators: { zoneId: [{
|
|
76
|
+
type: Input,
|
|
77
|
+
args: ['kendoUploadDropZone']
|
|
78
|
+
}], onElementDragEnter: [{
|
|
79
|
+
type: HostListener,
|
|
80
|
+
args: ['dragenter']
|
|
81
|
+
}], onElementDragOver: [{
|
|
82
|
+
type: HostListener,
|
|
83
|
+
args: ['dragover']
|
|
84
|
+
}], onDropListener: [{
|
|
85
|
+
type: HostListener,
|
|
86
|
+
args: ['drop', ['$event']]
|
|
87
|
+
}] } });
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import
|
|
6
|
-
import { Directive, ElementRef, HostBinding, HostListener, Input, Renderer2, NgZone } from '@angular/core';
|
|
5
|
+
import { Directive, HostBinding, HostListener, Input } from '@angular/core';
|
|
7
6
|
import { assignGuidToFiles, getAllFileInfo } from './common/util';
|
|
8
7
|
import { validateFiles } from './common/validation-util';
|
|
9
8
|
import { DropZoneBase } from './dropzone-base';
|
|
10
|
-
import
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "./upload.service";
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
export class DropZoneInternalDirective extends DropZoneBase {
|
|
15
15
|
constructor(element, renderer, ngZone, uploadService) {
|
|
16
16
|
super(element, renderer, 'k-dropzone-hover');
|
|
17
17
|
this.ngZone = ngZone;
|
|
@@ -70,39 +70,27 @@ let DropZoneInternalDirective = class DropZoneInternalDirective extends DropZone
|
|
|
70
70
|
}
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
81
|
-
], DropZoneInternalDirective.prototype, "multiple", void 0);
|
|
82
|
-
tslib_1.__decorate([
|
|
83
|
-
Input(),
|
|
84
|
-
tslib_1.__metadata("design:type", Object)
|
|
85
|
-
], DropZoneInternalDirective.prototype, "restrictions", void 0);
|
|
86
|
-
tslib_1.__decorate([
|
|
87
|
-
HostBinding('class.k-dropzone'),
|
|
88
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
89
|
-
], DropZoneInternalDirective.prototype, "initialClassName", void 0);
|
|
90
|
-
tslib_1.__decorate([
|
|
91
|
-
HostListener('drop', ['$event']),
|
|
92
|
-
tslib_1.__metadata("design:type", Function),
|
|
93
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
94
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
95
|
-
], DropZoneInternalDirective.prototype, "onDropListener", null);
|
|
96
|
-
DropZoneInternalDirective = tslib_1.__decorate([
|
|
97
|
-
Directive({
|
|
98
|
-
selector: `
|
|
73
|
+
}
|
|
74
|
+
DropZoneInternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneInternalDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
75
|
+
DropZoneInternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: { disabled: "disabled", multiple: "multiple", restrictions: "restrictions" }, host: { listeners: { "drop": "onDropListener($event)" }, properties: { "class.k-dropzone": "this.initialClassName" } }, usesInheritance: true, ngImport: i0 });
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneInternalDirective, decorators: [{
|
|
77
|
+
type: Directive,
|
|
78
|
+
args: [{
|
|
79
|
+
selector: `
|
|
99
80
|
[kendoUploadInternalDropZone],
|
|
100
81
|
[kendoFileSelectInternalDropZone]
|
|
101
82
|
`
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
],
|
|
108
|
-
|
|
83
|
+
}]
|
|
84
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1.UploadService }]; }, propDecorators: { disabled: [{
|
|
85
|
+
type: Input
|
|
86
|
+
}], multiple: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], restrictions: [{
|
|
89
|
+
type: Input
|
|
90
|
+
}], initialClassName: [{
|
|
91
|
+
type: HostBinding,
|
|
92
|
+
args: ['class.k-dropzone']
|
|
93
|
+
}], onDropListener: [{
|
|
94
|
+
type: HostListener,
|
|
95
|
+
args: ['drop', ['$event']]
|
|
96
|
+
}] } });
|
|
@@ -0,0 +1,113 @@
|
|
|
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 { Component, HostBinding, Input } from '@angular/core';
|
|
6
|
+
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { DropZoneBase } from './dropzone-base';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
10
|
+
import * as i2 from "./localization/localized-messages.directive";
|
|
11
|
+
import * as i3 from "./dropzone-external.directive";
|
|
12
|
+
import * as i4 from "@angular/common";
|
|
13
|
+
/* eslint-disable no-use-before-declare */
|
|
14
|
+
/**
|
|
15
|
+
* Represents the [Kendo UI UploadDropZone component for Angular]({% slug overview_upload %}).
|
|
16
|
+
*/
|
|
17
|
+
export class UploadDropZoneComponent extends DropZoneBase {
|
|
18
|
+
constructor(element, renderer, localization) {
|
|
19
|
+
super(element, renderer, 'k-external-dropzone-hover');
|
|
20
|
+
this.localization = localization;
|
|
21
|
+
this.hostClass = true;
|
|
22
|
+
this.localizationChangeSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
23
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
get dirAttribute() {
|
|
27
|
+
return this.direction;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
textFor(key) {
|
|
33
|
+
return this.localization.get(key);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
get iconClasses() {
|
|
39
|
+
if (this.icon) {
|
|
40
|
+
return `k-icon k-i-${this.icon}`;
|
|
41
|
+
}
|
|
42
|
+
if (this.iconClass) {
|
|
43
|
+
return `${this.iconClass}`;
|
|
44
|
+
}
|
|
45
|
+
return 'k-icon k-i-upload';
|
|
46
|
+
}
|
|
47
|
+
ngOnDestroy() {
|
|
48
|
+
if (this.localizationChangeSubscription) {
|
|
49
|
+
this.localizationChangeSubscription.unsubscribe();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
UploadDropZoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
UploadDropZoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UploadDropZoneComponent, selector: "kendo-uploaddropzone", inputs: { zoneId: "zoneId", icon: "icon", iconClass: "iconClass" }, host: { properties: { "class.k-external-dropzone": "this.hostClass", "attr.dir": "this.dirAttribute" } }, providers: [
|
|
55
|
+
LocalizationService,
|
|
56
|
+
{
|
|
57
|
+
provide: L10N_PREFIX,
|
|
58
|
+
useValue: 'kendo.uploaddropzone'
|
|
59
|
+
}
|
|
60
|
+
], exportAs: ["kendoUploadDropZone"], usesInheritance: true, ngImport: i0, template: `
|
|
61
|
+
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
62
|
+
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
63
|
+
externalDropFilesHere='Drag and drop files here to upload'
|
|
64
|
+
>
|
|
65
|
+
</ng-container>
|
|
66
|
+
<div class='k-dropzone-inner' [kendoUploadDropZone]="zoneId">
|
|
67
|
+
<span [ngClass]="iconClasses"></span>
|
|
68
|
+
<span class="k-dropzone-hint">{{ textFor('externalDropFilesHere') }}</span>
|
|
69
|
+
<span class="k-dropzone-note">
|
|
70
|
+
<ng-content></ng-content>
|
|
71
|
+
</span>
|
|
72
|
+
</div>
|
|
73
|
+
`, isInline: true, directives: [{ type: i2.LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: i3.UploadDropZoneDirective, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: ["kendoUploadDropZone"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{
|
|
77
|
+
exportAs: 'kendoUploadDropZone',
|
|
78
|
+
providers: [
|
|
79
|
+
LocalizationService,
|
|
80
|
+
{
|
|
81
|
+
provide: L10N_PREFIX,
|
|
82
|
+
useValue: 'kendo.uploaddropzone'
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
selector: 'kendo-uploaddropzone',
|
|
86
|
+
template: `
|
|
87
|
+
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
88
|
+
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
89
|
+
externalDropFilesHere='Drag and drop files here to upload'
|
|
90
|
+
>
|
|
91
|
+
</ng-container>
|
|
92
|
+
<div class='k-dropzone-inner' [kendoUploadDropZone]="zoneId">
|
|
93
|
+
<span [ngClass]="iconClasses"></span>
|
|
94
|
+
<span class="k-dropzone-hint">{{ textFor('externalDropFilesHere') }}</span>
|
|
95
|
+
<span class="k-dropzone-note">
|
|
96
|
+
<ng-content></ng-content>
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
`
|
|
100
|
+
}]
|
|
101
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
|
|
102
|
+
type: HostBinding,
|
|
103
|
+
args: ['class.k-external-dropzone']
|
|
104
|
+
}], dirAttribute: [{
|
|
105
|
+
type: HostBinding,
|
|
106
|
+
args: ['attr.dir']
|
|
107
|
+
}], zoneId: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], icon: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], iconClass: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}] } });
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
5
|
import { Injectable } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
7
|
let components = {};
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
export class DropZoneService {
|
|
12
12
|
addComponent(component, zoneId) {
|
|
13
13
|
if (this.has(zoneId)) {
|
|
14
14
|
components[zoneId].push(component);
|
|
@@ -23,8 +23,9 @@ let DropZoneService = class DropZoneService {
|
|
|
23
23
|
has(id) {
|
|
24
24
|
return id in components;
|
|
25
25
|
}
|
|
26
|
-
}
|
|
27
|
-
DropZoneService =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
}
|
|
27
|
+
DropZoneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
28
|
+
DropZoneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService, decorators: [{
|
|
30
|
+
type: Injectable
|
|
31
|
+
}] });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { Directive, HostBinding, HostListener, Input } from '@angular/core';
|
|
6
|
+
import { assignGuidToFiles, inputFiles } from './common/util';
|
|
7
|
+
import { validateFiles } from './common/validation-util';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "./upload.service";
|
|
10
|
+
import * as i2 from "./navigation.service";
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export class FileSelectDirective {
|
|
15
|
+
constructor(uploadService, navigation, el) {
|
|
16
|
+
this.uploadService = uploadService;
|
|
17
|
+
this.navigation = navigation;
|
|
18
|
+
this.type = "file";
|
|
19
|
+
this.autocomplete = "off";
|
|
20
|
+
this.tabIndex = -1;
|
|
21
|
+
this.element = el;
|
|
22
|
+
}
|
|
23
|
+
get nameAttribute() {
|
|
24
|
+
return this.uploadService.async.saveField;
|
|
25
|
+
}
|
|
26
|
+
get multipleAttribute() {
|
|
27
|
+
return this.multiple ? "multiple" : null;
|
|
28
|
+
}
|
|
29
|
+
get dirAttribute() {
|
|
30
|
+
return this.dir;
|
|
31
|
+
}
|
|
32
|
+
get disabledAttribute() {
|
|
33
|
+
return this.disabled ? "true" : null;
|
|
34
|
+
}
|
|
35
|
+
onInputChange(event) {
|
|
36
|
+
const ua = navigator.userAgent;
|
|
37
|
+
const webkit = /(webkit)[ \/]([\w.]+)/i;
|
|
38
|
+
const ie = /(windows)[ \/]([\w.]+)/i;
|
|
39
|
+
let selectedFiles = inputFiles(event.target);
|
|
40
|
+
selectedFiles = assignGuidToFiles(selectedFiles, !this.uploadService.async.batch);
|
|
41
|
+
validateFiles(selectedFiles, this.restrictions);
|
|
42
|
+
if (!this.multiple) {
|
|
43
|
+
this.uploadService.clearFiles();
|
|
44
|
+
}
|
|
45
|
+
this.uploadService.addFiles(selectedFiles);
|
|
46
|
+
/*
|
|
47
|
+
Chrome, IE, Edge and Safari do not trigger a `change` event
|
|
48
|
+
when a file with the same name is selected a number of consecutive times.
|
|
49
|
+
As a workaround, clear the input value after handling the file.
|
|
50
|
+
*/
|
|
51
|
+
const native = this.element.nativeElement;
|
|
52
|
+
if (ua.match(webkit) || ua.match(ie)) {
|
|
53
|
+
native.type = "";
|
|
54
|
+
native.type = "file";
|
|
55
|
+
}
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
this.navigation.focusedIndex = -1;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
FileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectDirective, deps: [{ token: i1.UploadService }, { token: i2.NavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
62
|
+
FileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: { dir: "dir", disabled: "disabled", multiple: "multiple", restrictions: "restrictions" }, host: { listeners: { "change": "onInputChange($event)" }, properties: { "attr.type": "this.type", "attr.autocomplete": "this.autocomplete", "attr.tabindex": "this.tabIndex", "attr.name": "this.nameAttribute", "attr.multiple": "this.multipleAttribute", "attr.dir": "this.dirAttribute", "attr.disabled": "this.disabledAttribute" } }, ngImport: i0 });
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{
|
|
66
|
+
selector: '[kendoFileSelect]'
|
|
67
|
+
}]
|
|
68
|
+
}], ctorParameters: function () { return [{ type: i1.UploadService }, { type: i2.NavigationService }, { type: i0.ElementRef }]; }, propDecorators: { dir: [{
|
|
69
|
+
type: Input
|
|
70
|
+
}], disabled: [{
|
|
71
|
+
type: Input
|
|
72
|
+
}], multiple: [{
|
|
73
|
+
type: Input
|
|
74
|
+
}], restrictions: [{
|
|
75
|
+
type: Input
|
|
76
|
+
}], type: [{
|
|
77
|
+
type: HostBinding,
|
|
78
|
+
args: ["attr.type"]
|
|
79
|
+
}], autocomplete: [{
|
|
80
|
+
type: HostBinding,
|
|
81
|
+
args: ["attr.autocomplete"]
|
|
82
|
+
}], tabIndex: [{
|
|
83
|
+
type: HostBinding,
|
|
84
|
+
args: ["attr.tabindex"]
|
|
85
|
+
}], nameAttribute: [{
|
|
86
|
+
type: HostBinding,
|
|
87
|
+
args: ["attr.name"]
|
|
88
|
+
}], multipleAttribute: [{
|
|
89
|
+
type: HostBinding,
|
|
90
|
+
args: ["attr.multiple"]
|
|
91
|
+
}], dirAttribute: [{
|
|
92
|
+
type: HostBinding,
|
|
93
|
+
args: ["attr.dir"]
|
|
94
|
+
}], disabledAttribute: [{
|
|
95
|
+
type: HostBinding,
|
|
96
|
+
args: ["attr.disabled"]
|
|
97
|
+
}], onInputChange: [{
|
|
98
|
+
type: HostListener,
|
|
99
|
+
args: ["change", ["$event"]]
|
|
100
|
+
}] } });
|