@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
package/dist/es/common/util.js
DELETED
|
@@ -1,234 +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
|
-
/* tslint:disable: no-bitwise */
|
|
6
|
-
import { FileState } from '../types';
|
|
7
|
-
import { guid } from '@progress/kendo-angular-common';
|
|
8
|
-
import { fileGroupMap } from '../types/file-groups';
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export var getTotalFilesSizeMessage = function (files) {
|
|
13
|
-
var totalSize = 0;
|
|
14
|
-
var i;
|
|
15
|
-
if (typeof files[0].size === "number") {
|
|
16
|
-
for (i = 0; i < files.length; i++) {
|
|
17
|
-
if (files[i].size) {
|
|
18
|
-
totalSize += files[i].size;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return "";
|
|
24
|
-
}
|
|
25
|
-
totalSize /= 1024;
|
|
26
|
-
if (totalSize < 1024) {
|
|
27
|
-
return totalSize.toFixed(2) + " KB";
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return (totalSize / 1024).toFixed(2) + " MB";
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var stripPath = function (name) {
|
|
34
|
-
var slashIndex = name.lastIndexOf("\\");
|
|
35
|
-
return (slashIndex !== -1) ? name.substr(slashIndex + 1) : name;
|
|
36
|
-
};
|
|
37
|
-
var ɵ0 = stripPath;
|
|
38
|
-
var getFileExtension = function (fileName) {
|
|
39
|
-
var rFileExtension = /\.([^\.]+)$/;
|
|
40
|
-
var matches = fileName.match(rFileExtension);
|
|
41
|
-
return matches ? matches[0] : "";
|
|
42
|
-
};
|
|
43
|
-
var ɵ1 = getFileExtension;
|
|
44
|
-
/**
|
|
45
|
-
* @hidden
|
|
46
|
-
*/
|
|
47
|
-
export var validateInitialFileInfo = function (file) {
|
|
48
|
-
if (file instanceof Object && file.hasOwnProperty("name")) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* @hidden
|
|
55
|
-
*/
|
|
56
|
-
export var validateInitialFileSelectFile = function (file) {
|
|
57
|
-
if (file instanceof File || validateInitialFileInfo(file)) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*/
|
|
65
|
-
export var getInitialFileInfo = function (fakeFile) {
|
|
66
|
-
fakeFile.extension = fakeFile.extension || getFileExtension(fakeFile.name);
|
|
67
|
-
fakeFile.name = fakeFile.name;
|
|
68
|
-
fakeFile.size = fakeFile.size || 0;
|
|
69
|
-
if (!fakeFile.hasOwnProperty("state")) {
|
|
70
|
-
fakeFile.state = FileState.Initial;
|
|
71
|
-
}
|
|
72
|
-
if (!fakeFile.hasOwnProperty("uid")) {
|
|
73
|
-
fakeFile.uid = guid();
|
|
74
|
-
}
|
|
75
|
-
return fakeFile;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* @hidden
|
|
79
|
-
*/
|
|
80
|
-
export var convertFileToFileInfo = function (file) {
|
|
81
|
-
var fileInfo = getFileInfo(file);
|
|
82
|
-
fileInfo.uid = guid();
|
|
83
|
-
// Used to differentiate initial FileInfo objects and actual Files
|
|
84
|
-
fileInfo.state = FileState.Selected;
|
|
85
|
-
return fileInfo;
|
|
86
|
-
};
|
|
87
|
-
var getFileInfo = function (rawFile) {
|
|
88
|
-
var fileName = rawFile.name;
|
|
89
|
-
var fileSize = rawFile.size;
|
|
90
|
-
return {
|
|
91
|
-
extension: getFileExtension(fileName),
|
|
92
|
-
name: fileName,
|
|
93
|
-
rawFile: rawFile,
|
|
94
|
-
size: fileSize,
|
|
95
|
-
state: FileState.Selected
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
var ɵ2 = getFileInfo;
|
|
99
|
-
/**
|
|
100
|
-
* @hidden
|
|
101
|
-
*/
|
|
102
|
-
export var getAllFileInfo = function (rawFiles) {
|
|
103
|
-
var allFileInfo = new Array();
|
|
104
|
-
var i;
|
|
105
|
-
for (i = 0; i < rawFiles.length; i++) {
|
|
106
|
-
allFileInfo.push(getFileInfo(rawFiles[i]));
|
|
107
|
-
}
|
|
108
|
-
return allFileInfo;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* @hidden
|
|
112
|
-
*/
|
|
113
|
-
export var fileHasValidationErrors = function (file) {
|
|
114
|
-
if (file.validationErrors && file.validationErrors.length > 0) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
return false;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @hidden
|
|
121
|
-
*/
|
|
122
|
-
export var filesHaveValidationErrors = function (files) {
|
|
123
|
-
for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
|
|
124
|
-
var file = files_1[_i];
|
|
125
|
-
if (fileHasValidationErrors(file)) {
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* @hidden
|
|
133
|
-
*/
|
|
134
|
-
export var inputFiles = function (input) {
|
|
135
|
-
if (input.files) {
|
|
136
|
-
return getAllFileInfo(input.files);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
//Required for testing
|
|
140
|
-
var fileNames = input.value.split("|").map(function (file, index) {
|
|
141
|
-
var fileName = file.trim();
|
|
142
|
-
return {
|
|
143
|
-
extension: getFileExtension(fileName),
|
|
144
|
-
name: stripPath(fileName),
|
|
145
|
-
rawFile: null,
|
|
146
|
-
size: (index + 1) * 1000,
|
|
147
|
-
state: FileState.Selected
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
return fileNames;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* @hidden
|
|
155
|
-
*/
|
|
156
|
-
export var assignGuidToFiles = function (files, isUnique) {
|
|
157
|
-
var uid = guid();
|
|
158
|
-
return files.map(function (file) {
|
|
159
|
-
file.uid = isUnique ? guid() : uid;
|
|
160
|
-
return file;
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* @hidden
|
|
165
|
-
*/
|
|
166
|
-
export var supportsFormData = function () {
|
|
167
|
-
return typeof (FormData) !== "undefined";
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* @hidden
|
|
171
|
-
*/
|
|
172
|
-
export var userAgent = function () {
|
|
173
|
-
return navigator.userAgent;
|
|
174
|
-
};
|
|
175
|
-
var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
|
|
176
|
-
/**
|
|
177
|
-
* @hidden
|
|
178
|
-
*/
|
|
179
|
-
export var IGNORE_TARGET_CLASSES = 'k-icon k-select k-input k-multiselect-wrap';
|
|
180
|
-
/**
|
|
181
|
-
* @hidden
|
|
182
|
-
*/
|
|
183
|
-
export var UPLOAD_CLASSES = 'k-upload-button k-clear-selected k-upload-selected k-upload-action';
|
|
184
|
-
var isVisible = function (element) {
|
|
185
|
-
var rect = element.getBoundingClientRect();
|
|
186
|
-
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
|
|
187
|
-
};
|
|
188
|
-
var ɵ3 = isVisible;
|
|
189
|
-
var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
|
|
190
|
-
var ɵ4 = toClassList;
|
|
191
|
-
/**
|
|
192
|
-
* @hidden
|
|
193
|
-
*/
|
|
194
|
-
export var hasClasses = function (element, classNames) {
|
|
195
|
-
var namesList = toClassList(classNames);
|
|
196
|
-
return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* @hidden
|
|
200
|
-
*/
|
|
201
|
-
export var isFocusable = function (element, checkVisibility) {
|
|
202
|
-
if (checkVisibility === void 0) { checkVisibility = true; }
|
|
203
|
-
if (element.tagName) {
|
|
204
|
-
var tagName = element.tagName.toLowerCase();
|
|
205
|
-
var tabIndex = element.getAttribute('tabIndex');
|
|
206
|
-
var validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
|
|
207
|
-
var focusable = false;
|
|
208
|
-
if (focusableRegex.test(tagName)) {
|
|
209
|
-
focusable = !element.disabled;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
focusable = validTabIndex;
|
|
213
|
-
}
|
|
214
|
-
return focusable && (!checkVisibility || isVisible(element));
|
|
215
|
-
}
|
|
216
|
-
return false;
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* @hidden
|
|
220
|
-
*/
|
|
221
|
-
export var getFileGroupCssClass = function (fileExtension) {
|
|
222
|
-
var initial = 'k-i-file';
|
|
223
|
-
for (var group in fileGroupMap) {
|
|
224
|
-
if (fileGroupMap[group].indexOf(fileExtension) >= 0) {
|
|
225
|
-
return initial + "-" + group;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return initial;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* @hidden
|
|
232
|
-
*/
|
|
233
|
-
export var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
234
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4 };
|
|
@@ -1,64 +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 INVALIDMAXFILESIZE = "invalidMaxFileSize";
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export var INVALIDMINFILESIZE = "invalidMinFileSize";
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export var INVALIDFILEEXTENSION = "invalidFileExtension";
|
|
17
|
-
var validateFileExtension = function (file, allowedExtensions) {
|
|
18
|
-
if (allowedExtensions.length > 0) {
|
|
19
|
-
if (allowedExtensions.indexOf(file.extension.toLowerCase()) < 0) {
|
|
20
|
-
file.validationErrors = file.validationErrors || [];
|
|
21
|
-
if (file.validationErrors.indexOf(INVALIDFILEEXTENSION) < 0) {
|
|
22
|
-
file.validationErrors.push(INVALIDFILEEXTENSION);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var ɵ0 = validateFileExtension;
|
|
28
|
-
var validateFileSize = function (file, minFileSize, maxFileSize) {
|
|
29
|
-
if (minFileSize !== 0 && file.size < minFileSize) {
|
|
30
|
-
file.validationErrors = file.validationErrors || [];
|
|
31
|
-
if (file.validationErrors.indexOf(INVALIDMINFILESIZE) < 0) {
|
|
32
|
-
file.validationErrors.push(INVALIDMINFILESIZE);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (maxFileSize !== 0 && file.size > maxFileSize) {
|
|
36
|
-
file.validationErrors = file.validationErrors || [];
|
|
37
|
-
if (file.validationErrors.indexOf(INVALIDMAXFILESIZE) < 0) {
|
|
38
|
-
file.validationErrors.push(INVALIDMAXFILESIZE);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var ɵ1 = validateFileSize;
|
|
43
|
-
var parseAllowedExtensions = function (extensions) {
|
|
44
|
-
var allowedExtensions = extensions.map(function (ext) {
|
|
45
|
-
var parsedExt = (ext.substring(0, 1) === ".") ? ext : ("." + ext);
|
|
46
|
-
return parsedExt.toLowerCase();
|
|
47
|
-
});
|
|
48
|
-
return allowedExtensions;
|
|
49
|
-
};
|
|
50
|
-
var ɵ2 = parseAllowedExtensions;
|
|
51
|
-
/**
|
|
52
|
-
* @hidden
|
|
53
|
-
*/
|
|
54
|
-
export var validateFiles = function (files, restrictionInfo) {
|
|
55
|
-
var allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions);
|
|
56
|
-
var maxFileSize = restrictionInfo.maxFileSize;
|
|
57
|
-
var minFileSize = restrictionInfo.minFileSize;
|
|
58
|
-
var i;
|
|
59
|
-
for (i = 0; i < files.length; i++) {
|
|
60
|
-
validateFileExtension(files[i], allowedExtensions);
|
|
61
|
-
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
export { ɵ0, ɵ1, ɵ2 };
|
package/dist/es/dropzone-base.js
DELETED
|
@@ -1,66 +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 { HostListener } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
var DropZoneBase = /** @class */ (function () {
|
|
11
|
-
function DropZoneBase(element, renderer, hoverClass) {
|
|
12
|
-
this.element = element;
|
|
13
|
-
this.renderer = renderer;
|
|
14
|
-
this.hideIntervalElement = null;
|
|
15
|
-
this.hoverClass = hoverClass;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
DropZoneBase.prototype.onElementDragEnterListener = function () {
|
|
21
|
-
var _this = this;
|
|
22
|
-
this.addClass(this.hoverClass);
|
|
23
|
-
this.lastDragElement = new Date();
|
|
24
|
-
if (!this.hideIntervalElement) {
|
|
25
|
-
this.hideIntervalElement = setInterval(function () {
|
|
26
|
-
if (_this.calculateTimeDiff(_this.lastDragElement) < 100) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
_this.removeClass(_this.hoverClass);
|
|
30
|
-
clearInterval(_this.hideIntervalElement);
|
|
31
|
-
_this.hideIntervalElement = null;
|
|
32
|
-
}, 100);
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @hidden
|
|
38
|
-
*/
|
|
39
|
-
DropZoneBase.prototype.onElementDragOverListener = function () {
|
|
40
|
-
this.lastDragElement = new Date();
|
|
41
|
-
return false;
|
|
42
|
-
};
|
|
43
|
-
DropZoneBase.prototype.calculateTimeDiff = function (prevEvent) {
|
|
44
|
-
return new Date().getTime() - prevEvent.getTime();
|
|
45
|
-
};
|
|
46
|
-
DropZoneBase.prototype.addClass = function (className) {
|
|
47
|
-
this.renderer.addClass(this.element.nativeElement, className);
|
|
48
|
-
};
|
|
49
|
-
DropZoneBase.prototype.removeClass = function (className) {
|
|
50
|
-
this.renderer.removeClass(this.element.nativeElement, className);
|
|
51
|
-
};
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
HostListener('dragenter'),
|
|
54
|
-
tslib_1.__metadata("design:type", Function),
|
|
55
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
56
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
57
|
-
], DropZoneBase.prototype, "onElementDragEnterListener", null);
|
|
58
|
-
tslib_1.__decorate([
|
|
59
|
-
HostListener('dragover'),
|
|
60
|
-
tslib_1.__metadata("design:type", Function),
|
|
61
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
62
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
63
|
-
], DropZoneBase.prototype, "onElementDragOverListener", null);
|
|
64
|
-
return DropZoneBase;
|
|
65
|
-
}());
|
|
66
|
-
export { DropZoneBase };
|
|
@@ -1,98 +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, HostListener, Input } from '@angular/core';
|
|
7
|
-
import { assignGuidToFiles, getAllFileInfo, isPresent } from './common/util';
|
|
8
|
-
import { validateFiles } from './common/validation-util';
|
|
9
|
-
import { DropZoneService } from './dropzone.service';
|
|
10
|
-
import { UploadComponent } from './upload.component';
|
|
11
|
-
var UploadDropZoneDirective = /** @class */ (function () {
|
|
12
|
-
function UploadDropZoneDirective(dropZoneService) {
|
|
13
|
-
this.dropZoneService = dropZoneService;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
UploadDropZoneDirective.prototype.onElementDragEnter = function () {
|
|
19
|
-
return false;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
UploadDropZoneDirective.prototype.onElementDragOver = function () {
|
|
25
|
-
return false;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
UploadDropZoneDirective.prototype.onDropListener = function (event) {
|
|
31
|
-
var components = this.componentInstance;
|
|
32
|
-
if (!isPresent(components)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
components.forEach(function (component) {
|
|
36
|
-
var droppedFiles = event.dataTransfer.files;
|
|
37
|
-
if (droppedFiles.length > 0 && !component.disabled) {
|
|
38
|
-
var files = getAllFileInfo(droppedFiles);
|
|
39
|
-
if (component instanceof UploadComponent) {
|
|
40
|
-
files = assignGuidToFiles(files, !component.batch);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
files = assignGuidToFiles(files, true);
|
|
44
|
-
}
|
|
45
|
-
if (!component.multiple) {
|
|
46
|
-
files.splice(1, files.length - 1);
|
|
47
|
-
component.clearFiles();
|
|
48
|
-
}
|
|
49
|
-
validateFiles(files, component.restrictions);
|
|
50
|
-
component.addFiles(files);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return false;
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(UploadDropZoneDirective.prototype, "componentInstance", {
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
get: function () {
|
|
60
|
-
return this.dropZoneService.getComponents(this.zoneId);
|
|
61
|
-
},
|
|
62
|
-
enumerable: true,
|
|
63
|
-
configurable: true
|
|
64
|
-
});
|
|
65
|
-
tslib_1.__decorate([
|
|
66
|
-
Input('kendoUploadDropZone'),
|
|
67
|
-
tslib_1.__metadata("design:type", String)
|
|
68
|
-
], UploadDropZoneDirective.prototype, "zoneId", void 0);
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
HostListener('dragenter'),
|
|
71
|
-
tslib_1.__metadata("design:type", Function),
|
|
72
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
73
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
74
|
-
], UploadDropZoneDirective.prototype, "onElementDragEnter", null);
|
|
75
|
-
tslib_1.__decorate([
|
|
76
|
-
HostListener('dragover'),
|
|
77
|
-
tslib_1.__metadata("design:type", Function),
|
|
78
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
79
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
80
|
-
], UploadDropZoneDirective.prototype, "onElementDragOver", null);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
HostListener('drop', ['$event']),
|
|
83
|
-
tslib_1.__metadata("design:type", Function),
|
|
84
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
85
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
86
|
-
], UploadDropZoneDirective.prototype, "onDropListener", null);
|
|
87
|
-
UploadDropZoneDirective = tslib_1.__decorate([
|
|
88
|
-
Directive({
|
|
89
|
-
providers: [
|
|
90
|
-
DropZoneService
|
|
91
|
-
],
|
|
92
|
-
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
93
|
-
}),
|
|
94
|
-
tslib_1.__metadata("design:paramtypes", [DropZoneService])
|
|
95
|
-
], UploadDropZoneDirective);
|
|
96
|
-
return UploadDropZoneDirective;
|
|
97
|
-
}());
|
|
98
|
-
export { UploadDropZoneDirective };
|
|
@@ -1,110 +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, Renderer2, NgZone } from '@angular/core';
|
|
7
|
-
import { assignGuidToFiles, getAllFileInfo } from './common/util';
|
|
8
|
-
import { validateFiles } from './common/validation-util';
|
|
9
|
-
import { DropZoneBase } from './dropzone-base';
|
|
10
|
-
import { UploadService } from './upload.service';
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
var DropZoneInternalDirective = /** @class */ (function (_super) {
|
|
15
|
-
tslib_1.__extends(DropZoneInternalDirective, _super);
|
|
16
|
-
function DropZoneInternalDirective(element, renderer, ngZone, uploadService) {
|
|
17
|
-
var _this = _super.call(this, element, renderer, 'k-dropzone-hover') || this;
|
|
18
|
-
_this.ngZone = ngZone;
|
|
19
|
-
_this.uploadService = uploadService;
|
|
20
|
-
_this.initialClassName = true;
|
|
21
|
-
_this.hideIntervalDocument = null;
|
|
22
|
-
_this.activeClass = 'k-dropzone-active';
|
|
23
|
-
_this.ngZone.runOutsideAngular(function () {
|
|
24
|
-
_this.unsubscribeDocumentDragEnter = _this.renderer.listen('document', 'dragenter', function () { return _this.onDocumentDragEnter(); });
|
|
25
|
-
_this.unsubscribeDocumentDragOver = _this.renderer.listen('document', 'dragover', function () { return _this.onDocumentDragOver(); });
|
|
26
|
-
});
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
DropZoneInternalDirective.prototype.ngOnDestroy = function () {
|
|
30
|
-
var _this = this;
|
|
31
|
-
this.ngZone.runOutsideAngular(function () {
|
|
32
|
-
if (_this.unsubscribeDocumentDragEnter) {
|
|
33
|
-
_this.unsubscribeDocumentDragEnter();
|
|
34
|
-
}
|
|
35
|
-
if (_this.unsubscribeDocumentDragOver) {
|
|
36
|
-
_this.unsubscribeDocumentDragOver();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
DropZoneInternalDirective.prototype.onDocumentDragEnter = function () {
|
|
41
|
-
var _this = this;
|
|
42
|
-
this.addClass(this.activeClass);
|
|
43
|
-
this.lastDragDocument = new Date();
|
|
44
|
-
if (!this.hideIntervalDocument) {
|
|
45
|
-
this.hideIntervalDocument = setInterval(function () {
|
|
46
|
-
if (_this.calculateTimeDiff(_this.lastDragDocument) < 100) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
_this.removeClass(_this.activeClass);
|
|
50
|
-
clearInterval(_this.hideIntervalDocument);
|
|
51
|
-
_this.hideIntervalDocument = null;
|
|
52
|
-
}, 100);
|
|
53
|
-
}
|
|
54
|
-
return false;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
DropZoneInternalDirective.prototype.onDocumentDragOver = function () {
|
|
60
|
-
this.lastDragDocument = new Date();
|
|
61
|
-
return false;
|
|
62
|
-
};
|
|
63
|
-
DropZoneInternalDirective.prototype.onDropListener = function (event) {
|
|
64
|
-
var droppedFiles = event.dataTransfer.files;
|
|
65
|
-
if (droppedFiles.length > 0 && !this.disabled) {
|
|
66
|
-
var files = getAllFileInfo(droppedFiles);
|
|
67
|
-
files = assignGuidToFiles(files, !this.uploadService.async.batch);
|
|
68
|
-
if (!this.multiple) {
|
|
69
|
-
files.splice(1, files.length - 1);
|
|
70
|
-
this.uploadService.clearFiles();
|
|
71
|
-
}
|
|
72
|
-
validateFiles(files, this.restrictions);
|
|
73
|
-
this.uploadService.addFiles(files);
|
|
74
|
-
}
|
|
75
|
-
return false;
|
|
76
|
-
};
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
Input(),
|
|
79
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
80
|
-
], DropZoneInternalDirective.prototype, "disabled", void 0);
|
|
81
|
-
tslib_1.__decorate([
|
|
82
|
-
Input(),
|
|
83
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
84
|
-
], DropZoneInternalDirective.prototype, "multiple", void 0);
|
|
85
|
-
tslib_1.__decorate([
|
|
86
|
-
Input(),
|
|
87
|
-
tslib_1.__metadata("design:type", Object)
|
|
88
|
-
], DropZoneInternalDirective.prototype, "restrictions", void 0);
|
|
89
|
-
tslib_1.__decorate([
|
|
90
|
-
HostBinding('class.k-dropzone'),
|
|
91
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
92
|
-
], DropZoneInternalDirective.prototype, "initialClassName", void 0);
|
|
93
|
-
tslib_1.__decorate([
|
|
94
|
-
HostListener('drop', ['$event']),
|
|
95
|
-
tslib_1.__metadata("design:type", Function),
|
|
96
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
97
|
-
tslib_1.__metadata("design:returntype", Boolean)
|
|
98
|
-
], DropZoneInternalDirective.prototype, "onDropListener", null);
|
|
99
|
-
DropZoneInternalDirective = tslib_1.__decorate([
|
|
100
|
-
Directive({
|
|
101
|
-
selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n "
|
|
102
|
-
}),
|
|
103
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
104
|
-
Renderer2,
|
|
105
|
-
NgZone,
|
|
106
|
-
UploadService])
|
|
107
|
-
], DropZoneInternalDirective);
|
|
108
|
-
return DropZoneInternalDirective;
|
|
109
|
-
}(DropZoneBase));
|
|
110
|
-
export { DropZoneInternalDirective };
|
|
@@ -1,99 +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 { Component, ElementRef, HostBinding, Input, Renderer2 } from '@angular/core';
|
|
7
|
-
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { DropZoneBase } from './dropzone-base';
|
|
9
|
-
/* tslint:disable: no-use-before-declare */
|
|
10
|
-
/**
|
|
11
|
-
* Represents the [Kendo UI UploadDropZone component for Angular]({% slug overview_upload %}).
|
|
12
|
-
*/
|
|
13
|
-
var UploadDropZoneComponent = /** @class */ (function (_super) {
|
|
14
|
-
tslib_1.__extends(UploadDropZoneComponent, _super);
|
|
15
|
-
function UploadDropZoneComponent(element, renderer, localization) {
|
|
16
|
-
var _this = _super.call(this, element, renderer, 'k-external-dropzone-hover') || this;
|
|
17
|
-
_this.localization = localization;
|
|
18
|
-
_this.hostClass = true;
|
|
19
|
-
_this.localizationChangeSubscription = _this.localization.changes.subscribe(function (_a) {
|
|
20
|
-
var rtl = _a.rtl;
|
|
21
|
-
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
22
|
-
});
|
|
23
|
-
return _this;
|
|
24
|
-
}
|
|
25
|
-
Object.defineProperty(UploadDropZoneComponent.prototype, "dirAttribute", {
|
|
26
|
-
get: function () {
|
|
27
|
-
return this.direction;
|
|
28
|
-
},
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
*/
|
|
35
|
-
UploadDropZoneComponent.prototype.textFor = function (key) {
|
|
36
|
-
return this.localization.get(key);
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(UploadDropZoneComponent.prototype, "iconClasses", {
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
get: function () {
|
|
43
|
-
if (this.icon) {
|
|
44
|
-
return "k-icon k-i-" + this.icon;
|
|
45
|
-
}
|
|
46
|
-
if (this.iconClass) {
|
|
47
|
-
return "" + this.iconClass;
|
|
48
|
-
}
|
|
49
|
-
return 'k-icon k-i-upload';
|
|
50
|
-
},
|
|
51
|
-
enumerable: true,
|
|
52
|
-
configurable: true
|
|
53
|
-
});
|
|
54
|
-
UploadDropZoneComponent.prototype.ngOnDestroy = function () {
|
|
55
|
-
if (this.localizationChangeSubscription) {
|
|
56
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
tslib_1.__decorate([
|
|
60
|
-
HostBinding('class.k-external-dropzone'),
|
|
61
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
62
|
-
], UploadDropZoneComponent.prototype, "hostClass", void 0);
|
|
63
|
-
tslib_1.__decorate([
|
|
64
|
-
HostBinding('attr.dir'),
|
|
65
|
-
tslib_1.__metadata("design:type", String),
|
|
66
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
67
|
-
], UploadDropZoneComponent.prototype, "dirAttribute", null);
|
|
68
|
-
tslib_1.__decorate([
|
|
69
|
-
Input(),
|
|
70
|
-
tslib_1.__metadata("design:type", String)
|
|
71
|
-
], UploadDropZoneComponent.prototype, "zoneId", void 0);
|
|
72
|
-
tslib_1.__decorate([
|
|
73
|
-
Input(),
|
|
74
|
-
tslib_1.__metadata("design:type", String)
|
|
75
|
-
], UploadDropZoneComponent.prototype, "icon", void 0);
|
|
76
|
-
tslib_1.__decorate([
|
|
77
|
-
Input(),
|
|
78
|
-
tslib_1.__metadata("design:type", String)
|
|
79
|
-
], UploadDropZoneComponent.prototype, "iconClass", void 0);
|
|
80
|
-
UploadDropZoneComponent = tslib_1.__decorate([
|
|
81
|
-
Component({
|
|
82
|
-
exportAs: 'kendoUploadDropZone',
|
|
83
|
-
providers: [
|
|
84
|
-
LocalizationService,
|
|
85
|
-
{
|
|
86
|
-
provide: L10N_PREFIX,
|
|
87
|
-
useValue: 'kendo.uploaddropzone'
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
selector: 'kendo-uploaddropzone',
|
|
91
|
-
template: "\n <ng-container kendoUploadDropZoneLocalizedMessages\n i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'\n externalDropFilesHere='Drag and drop files here to upload'\n >\n </ng-container>\n <div class='k-dropzone-inner' [kendoUploadDropZone]=\"zoneId\">\n <span [ngClass]=\"iconClasses\"></span>\n <span class=\"k-dropzone-hint\">{{ textFor('externalDropFilesHere') }}</span>\n <span class=\"k-dropzone-note\">\n <ng-content></ng-content>\n </span>\n </div>\n "
|
|
92
|
-
}),
|
|
93
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
94
|
-
Renderer2,
|
|
95
|
-
LocalizationService])
|
|
96
|
-
], UploadDropZoneComponent);
|
|
97
|
-
return UploadDropZoneComponent;
|
|
98
|
-
}(DropZoneBase));
|
|
99
|
-
export { UploadDropZoneComponent };
|