@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,17 +2,20 @@
|
|
|
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 { EventEmitter, Injectable, Directive,
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { EventEmitter, Injectable, Directive, Input, HostBinding, HostListener, Component, ViewChildren, forwardRef, Inject, ContentChild, ViewChild, Output, isDevMode, NgModule } from '@angular/core';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
-
import
|
|
8
|
+
import * as i1$1 from '@progress/kendo-angular-l10n';
|
|
9
|
+
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
10
|
import { guid, Keys, isDocumentAvailable, KendoInput, isChanged } from '@progress/kendo-angular-common';
|
|
10
11
|
import { fromEvent, merge } from 'rxjs';
|
|
11
12
|
import { filter } from 'rxjs/operators';
|
|
12
13
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
14
|
+
import * as i1 from '@angular/common/http';
|
|
15
|
+
import { HttpHeaders, HttpRequest, HttpEventType, HttpResponse } from '@angular/common/http';
|
|
15
16
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
17
|
+
import * as i4 from '@angular/common';
|
|
18
|
+
import { CommonModule } from '@angular/common';
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* @hidden
|
|
@@ -21,7 +24,7 @@ const packageMetadata = {
|
|
|
21
24
|
name: '@progress/kendo-angular-upload',
|
|
22
25
|
productName: 'Kendo UI for Angular',
|
|
23
26
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
24
|
-
publishDate:
|
|
27
|
+
publishDate: 1647265856,
|
|
25
28
|
version: '',
|
|
26
29
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
27
30
|
};
|
|
@@ -104,14 +107,14 @@ class FileMap {
|
|
|
104
107
|
get(uid) {
|
|
105
108
|
return this._files[uid];
|
|
106
109
|
}
|
|
107
|
-
setFilesState(files, state
|
|
110
|
+
setFilesState(files, state) {
|
|
108
111
|
for (let file of files) {
|
|
109
|
-
this.setFilesStateByUid(file.uid, state
|
|
112
|
+
this.setFilesStateByUid(file.uid, state);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
|
-
setFilesStateByUid(uid, state
|
|
115
|
+
setFilesStateByUid(uid, state) {
|
|
113
116
|
this.get(uid).forEach((f) => {
|
|
114
|
-
f.state = state
|
|
117
|
+
f.state = state;
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
get count() {
|
|
@@ -177,8 +180,8 @@ class FileMap {
|
|
|
177
180
|
}
|
|
178
181
|
return null;
|
|
179
182
|
}
|
|
180
|
-
getFilesWithState(state
|
|
181
|
-
return this.filesFlat.filter(file => file.state === state
|
|
183
|
+
getFilesWithState(state) {
|
|
184
|
+
return this.filesFlat.filter(file => file.state === state);
|
|
182
185
|
}
|
|
183
186
|
hasFileWithState(fileStates) {
|
|
184
187
|
let files = this._files;
|
|
@@ -592,9 +595,6 @@ class UploadProgressEvent {
|
|
|
592
595
|
}
|
|
593
596
|
}
|
|
594
597
|
|
|
595
|
-
const ɵ0 = [
|
|
596
|
-
".xlr", ".xls", ".xlsx"
|
|
597
|
-
];
|
|
598
598
|
/**
|
|
599
599
|
* @hidden
|
|
600
600
|
*/
|
|
@@ -614,7 +614,9 @@ const fileGroupMap = {
|
|
|
614
614
|
presentation: [
|
|
615
615
|
".key", ".odp", ".pps", ".ppt", ".pptx"
|
|
616
616
|
],
|
|
617
|
-
data:
|
|
617
|
+
data: [
|
|
618
|
+
".xlr", ".xls", ".xlsx"
|
|
619
|
+
],
|
|
618
620
|
programming: [
|
|
619
621
|
".tmp", ".bak", ".msi", ".cab", ".cpl", ".cur", ".dll", ".dmp", ".drv", ".icns", ".ico", ".link", ".sys", ".cfg",
|
|
620
622
|
".ini", ".asp", ".aspx", ".cer", ".csr", ".css", ".dcr", ".htm", ".html", ".js", ".php", ".rss", ".xhtml"
|
|
@@ -633,7 +635,7 @@ const fileGroupMap = {
|
|
|
633
635
|
]
|
|
634
636
|
};
|
|
635
637
|
|
|
636
|
-
/*
|
|
638
|
+
/* eslint-disable no-bitwise */
|
|
637
639
|
/**
|
|
638
640
|
* @hidden
|
|
639
641
|
*/
|
|
@@ -784,6 +786,18 @@ const assignGuidToFiles = (files, isUnique) => {
|
|
|
784
786
|
return file;
|
|
785
787
|
});
|
|
786
788
|
};
|
|
789
|
+
/**
|
|
790
|
+
* @hidden
|
|
791
|
+
*/
|
|
792
|
+
const supportsFormData = () => {
|
|
793
|
+
return typeof (FormData) !== "undefined";
|
|
794
|
+
};
|
|
795
|
+
/**
|
|
796
|
+
* @hidden
|
|
797
|
+
*/
|
|
798
|
+
const userAgent = () => {
|
|
799
|
+
return navigator.userAgent;
|
|
800
|
+
};
|
|
787
801
|
const focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
|
|
788
802
|
/**
|
|
789
803
|
* @hidden
|
|
@@ -875,7 +889,7 @@ class ChunkMap {
|
|
|
875
889
|
/**
|
|
876
890
|
* @hidden
|
|
877
891
|
*/
|
|
878
|
-
|
|
892
|
+
class UploadService {
|
|
879
893
|
constructor(http) {
|
|
880
894
|
this.http = http;
|
|
881
895
|
this.cancelEvent = new EventEmitter();
|
|
@@ -1281,16 +1295,17 @@ let UploadService = class UploadService {
|
|
|
1281
1295
|
}
|
|
1282
1296
|
return false;
|
|
1283
1297
|
}
|
|
1284
|
-
}
|
|
1285
|
-
UploadService =
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1298
|
+
}
|
|
1299
|
+
UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1300
|
+
UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadService });
|
|
1301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadService, decorators: [{
|
|
1302
|
+
type: Injectable
|
|
1303
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
1289
1304
|
|
|
1290
1305
|
/**
|
|
1291
1306
|
* @hidden
|
|
1292
1307
|
*/
|
|
1293
|
-
|
|
1308
|
+
class NavigationService {
|
|
1294
1309
|
constructor(uploadService) {
|
|
1295
1310
|
this.uploadService = uploadService;
|
|
1296
1311
|
this.onActionButtonAction = new EventEmitter();
|
|
@@ -1424,32 +1439,35 @@ let NavigationService = class NavigationService {
|
|
|
1424
1439
|
const fileCount = this.uploadService.files.count;
|
|
1425
1440
|
return this.actionButtonsVisible ? fileCount + 1 : fileCount - 1;
|
|
1426
1441
|
}
|
|
1427
|
-
}
|
|
1428
|
-
NavigationService =
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1442
|
+
}
|
|
1443
|
+
NavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, deps: [{ token: UploadService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1444
|
+
NavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService });
|
|
1445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NavigationService, decorators: [{
|
|
1446
|
+
type: Injectable
|
|
1447
|
+
}], ctorParameters: function () { return [{ type: UploadService }]; } });
|
|
1432
1448
|
|
|
1433
1449
|
/**
|
|
1434
1450
|
* Used to customize the rendering of the files in the list ([see example]({% slug templates_upload %}#toc-file-template)).
|
|
1435
1451
|
*/
|
|
1436
|
-
|
|
1452
|
+
class FileTemplateDirective {
|
|
1437
1453
|
constructor(templateRef) {
|
|
1438
1454
|
this.templateRef = templateRef;
|
|
1439
1455
|
}
|
|
1440
|
-
}
|
|
1441
|
-
FileTemplateDirective =
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
],
|
|
1456
|
+
}
|
|
1457
|
+
FileTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1458
|
+
FileTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FileTemplateDirective, selector: "[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]", ngImport: i0 });
|
|
1459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileTemplateDirective, decorators: [{
|
|
1460
|
+
type: Directive,
|
|
1461
|
+
args: [{
|
|
1462
|
+
selector: '[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]' // eslint-disable-line directive-selector-prefix
|
|
1463
|
+
}]
|
|
1464
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1447
1465
|
|
|
1448
1466
|
let components = {};
|
|
1449
1467
|
/**
|
|
1450
1468
|
* @hidden
|
|
1451
1469
|
*/
|
|
1452
|
-
|
|
1470
|
+
class DropZoneService {
|
|
1453
1471
|
addComponent(component, zoneId) {
|
|
1454
1472
|
if (this.has(zoneId)) {
|
|
1455
1473
|
components[zoneId].push(component);
|
|
@@ -1464,982 +1482,716 @@ let DropZoneService = class DropZoneService {
|
|
|
1464
1482
|
has(id) {
|
|
1465
1483
|
return id in components;
|
|
1466
1484
|
}
|
|
1467
|
-
}
|
|
1468
|
-
DropZoneService =
|
|
1469
|
-
|
|
1470
|
-
|
|
1485
|
+
}
|
|
1486
|
+
DropZoneService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1487
|
+
DropZoneService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService });
|
|
1488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneService, decorators: [{
|
|
1489
|
+
type: Injectable
|
|
1490
|
+
}] });
|
|
1471
1491
|
|
|
1472
1492
|
/**
|
|
1473
1493
|
* Used to customize the rendering of the file info section in the list. All other elements of the default template, such as file icon, action buttons, upload progress etc. will be preserved in place. ([see example]({% slug templates_upload %}#toc-file-info-template)).
|
|
1474
1494
|
*/
|
|
1475
|
-
|
|
1495
|
+
class FileInfoTemplateDirective {
|
|
1476
1496
|
constructor(templateRef) {
|
|
1477
1497
|
this.templateRef = templateRef;
|
|
1478
1498
|
}
|
|
1479
|
-
}
|
|
1480
|
-
FileInfoTemplateDirective =
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
],
|
|
1499
|
+
}
|
|
1500
|
+
FileInfoTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileInfoTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1501
|
+
FileInfoTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FileInfoTemplateDirective, selector: "[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]", ngImport: i0 });
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileInfoTemplateDirective, decorators: [{
|
|
1503
|
+
type: Directive,
|
|
1504
|
+
args: [{
|
|
1505
|
+
selector: '[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]'
|
|
1506
|
+
}]
|
|
1507
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1486
1508
|
|
|
1487
|
-
var FileSelectComponent_1;
|
|
1488
1509
|
/**
|
|
1489
1510
|
* @hidden
|
|
1490
1511
|
*/
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
useExisting: forwardRef(() => FileSelectComponent) // tslint:disable-line:no-forward-ref
|
|
1495
|
-
};
|
|
1496
|
-
let FileSelectComponent = FileSelectComponent_1 = class FileSelectComponent {
|
|
1497
|
-
constructor(uploadService, localization, navigation, dropZoneService, ngZone, renderer, cdr, wrapper) {
|
|
1512
|
+
class FileListItemDirective {
|
|
1513
|
+
constructor(el, navigationService, uploadService) {
|
|
1514
|
+
this.navigationService = navigationService;
|
|
1498
1515
|
this.uploadService = uploadService;
|
|
1499
|
-
this.
|
|
1500
|
-
this.
|
|
1501
|
-
this.
|
|
1502
|
-
this.ngZone = ngZone;
|
|
1503
|
-
this.renderer = renderer;
|
|
1504
|
-
this.cdr = cdr;
|
|
1505
|
-
/**
|
|
1506
|
-
* Disables the FileSelect.
|
|
1507
|
-
* The default value is `false`.
|
|
1508
|
-
*/
|
|
1509
|
-
this.disabled = false;
|
|
1510
|
-
/**
|
|
1511
|
-
* Enables the selection of multiple files
|
|
1512
|
-
* ([see example]({% slug fileprocessing_upload %}#toc-upload-of-sinlge-or-multiple-files)).
|
|
1513
|
-
* If set to `false`, only one file can be selected at a time.
|
|
1514
|
-
*/
|
|
1515
|
-
this.multiple = true;
|
|
1516
|
-
/**
|
|
1517
|
-
* Toggles the visibility of the file list.
|
|
1518
|
-
*/
|
|
1519
|
-
this.showFileList = true;
|
|
1520
|
-
/**
|
|
1521
|
-
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the FileSelect.
|
|
1522
|
-
*/
|
|
1523
|
-
this.tabindex = 0;
|
|
1524
|
-
/**
|
|
1525
|
-
* @hidden
|
|
1526
|
-
*/
|
|
1527
|
-
this.focusableId = `k-${guid()}`;
|
|
1528
|
-
/**
|
|
1529
|
-
* Fires when the user navigates outside the component.
|
|
1530
|
-
*/
|
|
1531
|
-
this.onBlur = new EventEmitter();
|
|
1532
|
-
/**
|
|
1533
|
-
* Fires when the component is focused.
|
|
1534
|
-
*/
|
|
1535
|
-
this.onFocus = new EventEmitter();
|
|
1536
|
-
/**
|
|
1537
|
-
* Fires when files are selected. If prevented, the selected files will not be added to the list.
|
|
1538
|
-
*/
|
|
1539
|
-
this.select = new EventEmitter();
|
|
1540
|
-
/**
|
|
1541
|
-
* Fires when a file is about to be removed. If prevented, the file will remain in the list.
|
|
1542
|
-
*/
|
|
1543
|
-
this.remove = new EventEmitter();
|
|
1544
|
-
/**
|
|
1545
|
-
* Fires when the value of the component has changed as a result of a successful `select` or `remove` operation.
|
|
1546
|
-
*/
|
|
1547
|
-
this.valueChange = new EventEmitter();
|
|
1548
|
-
this.hostDefaultClasses = true;
|
|
1549
|
-
/**
|
|
1550
|
-
* @hidden
|
|
1551
|
-
*/
|
|
1552
|
-
this._restrictions = {
|
|
1553
|
-
allowedExtensions: [],
|
|
1554
|
-
maxFileSize: 0,
|
|
1555
|
-
minFileSize: 0
|
|
1556
|
-
};
|
|
1557
|
-
this.onTouchedCallback = (_) => { };
|
|
1558
|
-
this.onChangeCallback = (_) => { };
|
|
1559
|
-
validatePackage(packageMetadata);
|
|
1560
|
-
this.wrapper = wrapper.nativeElement;
|
|
1561
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
1562
|
-
this.navigation.computeKeys(this.direction);
|
|
1563
|
-
this.fileList = this.uploadService.files;
|
|
1564
|
-
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
1565
|
-
this.direction = rtl ? 'rtl' : 'ltr';
|
|
1566
|
-
this.navigation.computeKeys(this.direction);
|
|
1567
|
-
});
|
|
1568
|
-
this.subscribeBlur();
|
|
1569
|
-
this.subscribeFocus();
|
|
1570
|
-
this.attachEventHandlers();
|
|
1571
|
-
this.setDefaultSettings();
|
|
1516
|
+
this.fileClass = true;
|
|
1517
|
+
this.focused = false;
|
|
1518
|
+
this.element = el;
|
|
1572
1519
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
*/
|
|
1576
|
-
set name(name) {
|
|
1577
|
-
this.uploadService.async.saveField = name;
|
|
1520
|
+
focus() {
|
|
1521
|
+
this.element.nativeElement.focus();
|
|
1578
1522
|
}
|
|
1579
|
-
get
|
|
1580
|
-
return this.
|
|
1523
|
+
get uidAttribute() {
|
|
1524
|
+
return this.files[0].uid;
|
|
1581
1525
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
*/
|
|
1585
|
-
set restrictions(restrictions) {
|
|
1586
|
-
let parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
|
|
1587
|
-
this._restrictions = parsedRestrictions;
|
|
1526
|
+
get tabIndex() {
|
|
1527
|
+
return "-1";
|
|
1588
1528
|
}
|
|
1589
|
-
get
|
|
1590
|
-
return this.
|
|
1529
|
+
get kFileError() {
|
|
1530
|
+
return this.files[0].state === FileState.Failed;
|
|
1591
1531
|
}
|
|
1592
|
-
get
|
|
1593
|
-
return this.
|
|
1532
|
+
get kFileInvalid() {
|
|
1533
|
+
return filesHaveValidationErrors(this.files);
|
|
1594
1534
|
}
|
|
1595
|
-
get
|
|
1596
|
-
return this.
|
|
1535
|
+
get kFileProgress() {
|
|
1536
|
+
return this.files[0].state === FileState.Uploading ||
|
|
1537
|
+
this.files[0].state === FileState.Paused;
|
|
1597
1538
|
}
|
|
1598
|
-
|
|
1599
|
-
this.
|
|
1600
|
-
|
|
1601
|
-
|
|
1539
|
+
get kFileSuccess() {
|
|
1540
|
+
if (this.uploadService.component === 'Upload') {
|
|
1541
|
+
return this.files[0].state === FileState.Uploaded ||
|
|
1542
|
+
this.files[0].state === FileState.Initial;
|
|
1602
1543
|
}
|
|
1544
|
+
return false;
|
|
1545
|
+
}
|
|
1546
|
+
get kStateFocused() {
|
|
1547
|
+
return this.focused;
|
|
1548
|
+
}
|
|
1549
|
+
onFocus() {
|
|
1550
|
+
this.focused = true;
|
|
1551
|
+
}
|
|
1552
|
+
onBlur() {
|
|
1553
|
+
this.focused = false;
|
|
1554
|
+
}
|
|
1555
|
+
onClick(event) {
|
|
1556
|
+
if (!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES)) {
|
|
1557
|
+
this.navigationService.focusedIndex = this.index;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
FileListItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemDirective, deps: [{ token: i0.ElementRef }, { token: NavigationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1562
|
+
FileListItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FileListItemDirective, selector: "[kendoUploadFileListItem]", inputs: { files: "files", index: "index" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "click": "onClick($event)" }, properties: { "class.k-file": "this.fileClass", "attr.data-uid": "this.uidAttribute", "attr.tabIndex": "this.tabIndex", "class.k-file-error": "this.kFileError", "class.k-file-invalid": "this.kFileInvalid", "class.k-file-progress": "this.kFileProgress", "class.k-file-success": "this.kFileSuccess", "class.k-state-focused": "this.kStateFocused" } }, ngImport: i0 });
|
|
1563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemDirective, decorators: [{
|
|
1564
|
+
type: Directive,
|
|
1565
|
+
args: [{
|
|
1566
|
+
selector: '[kendoUploadFileListItem]'
|
|
1567
|
+
}]
|
|
1568
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: NavigationService }, { type: UploadService }]; }, propDecorators: { files: [{
|
|
1569
|
+
type: Input
|
|
1570
|
+
}], index: [{
|
|
1571
|
+
type: Input
|
|
1572
|
+
}], fileClass: [{
|
|
1573
|
+
type: HostBinding,
|
|
1574
|
+
args: ['class.k-file']
|
|
1575
|
+
}], uidAttribute: [{
|
|
1576
|
+
type: HostBinding,
|
|
1577
|
+
args: ['attr.data-uid']
|
|
1578
|
+
}], tabIndex: [{
|
|
1579
|
+
type: HostBinding,
|
|
1580
|
+
args: ['attr.tabIndex']
|
|
1581
|
+
}], kFileError: [{
|
|
1582
|
+
type: HostBinding,
|
|
1583
|
+
args: ['class.k-file-error']
|
|
1584
|
+
}], kFileInvalid: [{
|
|
1585
|
+
type: HostBinding,
|
|
1586
|
+
args: ['class.k-file-invalid']
|
|
1587
|
+
}], kFileProgress: [{
|
|
1588
|
+
type: HostBinding,
|
|
1589
|
+
args: ['class.k-file-progress']
|
|
1590
|
+
}], kFileSuccess: [{
|
|
1591
|
+
type: HostBinding,
|
|
1592
|
+
args: ['class.k-file-success']
|
|
1593
|
+
}], kStateFocused: [{
|
|
1594
|
+
type: HostBinding,
|
|
1595
|
+
args: ['class.k-state-focused']
|
|
1596
|
+
}], onFocus: [{
|
|
1597
|
+
type: HostListener,
|
|
1598
|
+
args: ["focus"]
|
|
1599
|
+
}], onBlur: [{
|
|
1600
|
+
type: HostListener,
|
|
1601
|
+
args: ["blur"]
|
|
1602
|
+
}], onClick: [{
|
|
1603
|
+
type: HostListener,
|
|
1604
|
+
args: ['click', ['$event']]
|
|
1605
|
+
}] } });
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @hidden
|
|
1609
|
+
*/
|
|
1610
|
+
class FileListItemBase {
|
|
1611
|
+
constructor(uploadService) {
|
|
1612
|
+
this.uploadService = uploadService;
|
|
1613
|
+
this.progressComplete = 0;
|
|
1614
|
+
}
|
|
1615
|
+
subscribeUploadProgress(uploadProgressHandler) {
|
|
1616
|
+
this.uploadProgressSubscription = this.uploadService.uploadProgressEvent.subscribe(uploadProgressHandler);
|
|
1617
|
+
}
|
|
1618
|
+
fileHasValidationErrors(file) {
|
|
1619
|
+
return fileHasValidationErrors(file);
|
|
1620
|
+
}
|
|
1621
|
+
filesHaveValidationErrors(files) {
|
|
1622
|
+
return filesHaveValidationErrors(files);
|
|
1623
|
+
}
|
|
1624
|
+
ngOnDestroy() {
|
|
1625
|
+
this.uploadProgressSubscription.unsubscribe();
|
|
1626
|
+
}
|
|
1627
|
+
getFileValidationMessage(file) {
|
|
1628
|
+
let validationMessage;
|
|
1629
|
+
if (file.validationErrors && file.validationErrors.length > 0) {
|
|
1630
|
+
validationMessage = this.localization.get(file.validationErrors[0]);
|
|
1631
|
+
}
|
|
1632
|
+
return validationMessage;
|
|
1633
|
+
}
|
|
1634
|
+
getTotalFilesSizeMessage(files) {
|
|
1635
|
+
return getTotalFilesSizeMessage(files);
|
|
1603
1636
|
}
|
|
1604
|
-
/**
|
|
1605
|
-
* @hidden
|
|
1606
|
-
*/
|
|
1607
1637
|
textFor(key) {
|
|
1608
1638
|
return this.localization.get(key);
|
|
1609
1639
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
});
|
|
1640
|
+
}
|
|
1641
|
+
FileListItemBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemBase, deps: [{ token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1642
|
+
FileListItemBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListItemBase, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
1643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemBase, decorators: [{
|
|
1644
|
+
type: Component,
|
|
1645
|
+
args: [{ template: '' }]
|
|
1646
|
+
}], ctorParameters: function () { return [{ type: UploadService }]; } });
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* @hidden
|
|
1650
|
+
*/
|
|
1651
|
+
class FileListItemActionButtonComponent {
|
|
1652
|
+
constructor(uploadService, localization, navigation) {
|
|
1653
|
+
this.uploadService = uploadService;
|
|
1654
|
+
this.localization = localization;
|
|
1655
|
+
this.navigation = navigation;
|
|
1656
|
+
this.actionFocused = false;
|
|
1657
|
+
this.retryFocused = false;
|
|
1658
|
+
this.pauseResumeFocused = false;
|
|
1617
1659
|
}
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
this.blurSubscription.unsubscribe();
|
|
1660
|
+
onFocus(type) {
|
|
1661
|
+
if (type === 'action') {
|
|
1662
|
+
this.actionFocused = true;
|
|
1622
1663
|
}
|
|
1623
|
-
if (
|
|
1624
|
-
this.
|
|
1664
|
+
if (type === 'retry') {
|
|
1665
|
+
this.retryFocused = true;
|
|
1625
1666
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
this.
|
|
1667
|
+
if (type === 'pauseResume') {
|
|
1668
|
+
this.pauseResumeFocused = true;
|
|
1628
1669
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1670
|
+
}
|
|
1671
|
+
onBlur(type) {
|
|
1672
|
+
if (type === 'retry') {
|
|
1673
|
+
this.retryFocused = false;
|
|
1631
1674
|
}
|
|
1632
|
-
if (
|
|
1633
|
-
this.
|
|
1675
|
+
if (type === 'action') {
|
|
1676
|
+
this.actionFocused = false;
|
|
1677
|
+
}
|
|
1678
|
+
if (type === 'pauseResume') {
|
|
1679
|
+
this.pauseResumeFocused = false;
|
|
1634
1680
|
}
|
|
1635
1681
|
}
|
|
1636
|
-
|
|
1637
|
-
* @hidden
|
|
1638
|
-
*/
|
|
1639
|
-
handleKeydown(event) {
|
|
1682
|
+
onRetryClick() {
|
|
1640
1683
|
if (this.disabled) {
|
|
1641
1684
|
return;
|
|
1642
1685
|
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1686
|
+
this.uploadService.retryFiles(this.file.uid);
|
|
1687
|
+
}
|
|
1688
|
+
onRemoveCancelClick(event) {
|
|
1689
|
+
if (this.disabled) {
|
|
1647
1690
|
return;
|
|
1648
1691
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1692
|
+
event.stopImmediatePropagation();
|
|
1693
|
+
const uid = this.file.uid;
|
|
1694
|
+
if (this.file.state === FileState.Uploading) {
|
|
1695
|
+
this.uploadService.cancelFiles(uid);
|
|
1696
|
+
}
|
|
1697
|
+
else {
|
|
1698
|
+
this.uploadService.removeFiles(uid);
|
|
1652
1699
|
}
|
|
1700
|
+
this.navigation.focusSelectButton();
|
|
1653
1701
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
writeValue(newValue) {
|
|
1658
|
-
let isValid = true;
|
|
1659
|
-
if (newValue instanceof Array) {
|
|
1660
|
-
newValue.forEach((file) => {
|
|
1661
|
-
if (!validateInitialFileSelectFile(file)) {
|
|
1662
|
-
isValid = false;
|
|
1663
|
-
}
|
|
1664
|
-
});
|
|
1665
|
-
if (isValid) {
|
|
1666
|
-
this.uploadService.addInitialFileSelectFiles(newValue);
|
|
1667
|
-
}
|
|
1702
|
+
onPauseResumeClick() {
|
|
1703
|
+
if (this.disabled) {
|
|
1704
|
+
return;
|
|
1668
1705
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1706
|
+
const uid = this.file.uid;
|
|
1707
|
+
if (this.file.state === FileState.Paused) {
|
|
1708
|
+
this.uploadService.resumeFile(uid);
|
|
1709
|
+
}
|
|
1710
|
+
else {
|
|
1711
|
+
this.uploadService.pauseFile(uid);
|
|
1671
1712
|
}
|
|
1672
|
-
this.cdr.markForCheck();
|
|
1673
|
-
}
|
|
1674
|
-
/**
|
|
1675
|
-
* @hidden
|
|
1676
|
-
*/
|
|
1677
|
-
registerOnChange(fn) {
|
|
1678
|
-
this.onChangeCallback = fn;
|
|
1679
|
-
}
|
|
1680
|
-
/**
|
|
1681
|
-
* @hidden
|
|
1682
|
-
*/
|
|
1683
|
-
registerOnTouched(fn) {
|
|
1684
|
-
this.onTouchedCallback = fn;
|
|
1685
|
-
}
|
|
1686
|
-
/**
|
|
1687
|
-
* @hidden
|
|
1688
|
-
*/
|
|
1689
|
-
setDisabledState(isDisabled) {
|
|
1690
|
-
this.disabled = isDisabled;
|
|
1691
|
-
}
|
|
1692
|
-
/**
|
|
1693
|
-
* Removes specific file from the file list.
|
|
1694
|
-
*/
|
|
1695
|
-
removeFileByUid(uid) {
|
|
1696
|
-
this.uploadService.removeFiles(uid);
|
|
1697
|
-
}
|
|
1698
|
-
/**
|
|
1699
|
-
* Visually clears all files from the UI.
|
|
1700
|
-
*/
|
|
1701
|
-
clearFiles() {
|
|
1702
|
-
this.uploadService.clearFiles();
|
|
1703
|
-
}
|
|
1704
|
-
/**
|
|
1705
|
-
* @hidden
|
|
1706
|
-
* Used to determine if the component is empty.
|
|
1707
|
-
*/
|
|
1708
|
-
isEmpty() {
|
|
1709
|
-
return false;
|
|
1710
1713
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
this.uploadService.addFiles(files);
|
|
1714
|
+
get actionButtonTitle() {
|
|
1715
|
+
if (this.file.state === FileState.Uploading) {
|
|
1716
|
+
return this.localization.get('cancel');
|
|
1717
|
+
}
|
|
1718
|
+
return this.localization.get('remove');
|
|
1717
1719
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
*/
|
|
1721
|
-
get selectButtonTabIndex() {
|
|
1722
|
-
return this.disabled ? undefined : this.tabindex;
|
|
1720
|
+
get retryButtonTitle() {
|
|
1721
|
+
return this.localization.get('retry');
|
|
1723
1722
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
onFileSelectButtonFocus(_event) {
|
|
1728
|
-
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
1729
|
-
if (!this.navigation.focused) {
|
|
1730
|
-
this.navigation.focusedIndex = -1;
|
|
1723
|
+
get pauseResumeButtonTitle() {
|
|
1724
|
+
if (this.file.state === FileState.Uploading) {
|
|
1725
|
+
return this.localization.get('pause');
|
|
1731
1726
|
}
|
|
1727
|
+
return this.localization.get('resume');
|
|
1732
1728
|
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
*/
|
|
1736
|
-
onFileSelectButtonBlur(_event) {
|
|
1737
|
-
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
1729
|
+
get isUploading() {
|
|
1730
|
+
return this.file.state === FileState.Uploading;
|
|
1738
1731
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
return;
|
|
1742
|
-
}
|
|
1743
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1744
|
-
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
1745
|
-
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
1746
|
-
}));
|
|
1747
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.onTab).subscribe(() => {
|
|
1748
|
-
if (this.navigation.focused) {
|
|
1749
|
-
this.ngZone.run(() => {
|
|
1750
|
-
this.navigation.focused = false;
|
|
1751
|
-
this.onTouchedCallback();
|
|
1752
|
-
this.onBlur.emit();
|
|
1753
|
-
});
|
|
1754
|
-
}
|
|
1755
|
-
});
|
|
1756
|
-
});
|
|
1732
|
+
get isFailed() {
|
|
1733
|
+
return this.file.state === FileState.Failed;
|
|
1757
1734
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
this.onFocus.emit();
|
|
1761
|
-
});
|
|
1762
|
-
this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(() => {
|
|
1763
|
-
this.fileSelectButton.nativeElement.focus();
|
|
1764
|
-
});
|
|
1735
|
+
get isPaused() {
|
|
1736
|
+
return this.file.state === FileState.Paused;
|
|
1765
1737
|
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
if (file.state === FileState.Initial) {
|
|
1772
|
-
model.push(file);
|
|
1773
|
-
}
|
|
1774
|
-
if (file.state === FileState.Selected && file.rawFile && !file.validationErrors) {
|
|
1775
|
-
model.push(file.rawFile);
|
|
1776
|
-
}
|
|
1777
|
-
});
|
|
1778
|
-
}
|
|
1779
|
-
if (model.length === 0) {
|
|
1780
|
-
model = null;
|
|
1781
|
-
}
|
|
1782
|
-
this.onChangeCallback(model);
|
|
1783
|
-
this.valueChange.emit(model);
|
|
1784
|
-
});
|
|
1785
|
-
this.subs.add(this.uploadService.removeEvent.subscribe((args) => {
|
|
1786
|
-
this.remove.emit(args);
|
|
1787
|
-
}));
|
|
1788
|
-
this.subs.add(this.uploadService.selectEvent.subscribe((args) => {
|
|
1789
|
-
this.select.emit(args);
|
|
1790
|
-
}));
|
|
1738
|
+
get isResumable() {
|
|
1739
|
+
const service = this.uploadService;
|
|
1740
|
+
const isResumable = service.async.chunk && service.chunk.resumable;
|
|
1741
|
+
const isUploading = (this.file.state === FileState.Paused) || (this.file.state === FileState.Uploading);
|
|
1742
|
+
return isResumable && isUploading;
|
|
1791
1743
|
}
|
|
1792
|
-
|
|
1793
|
-
this.
|
|
1794
|
-
|
|
1744
|
+
get isActionButtonVisible() {
|
|
1745
|
+
if ((this.file.state === FileState.Uploaded || this.file.state === FileState.Initial) &&
|
|
1746
|
+
!this.uploadService.async.removeUrl && this.uploadService.component === 'Upload') {
|
|
1747
|
+
return false;
|
|
1748
|
+
}
|
|
1749
|
+
return true;
|
|
1795
1750
|
}
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
__decorate([
|
|
1802
|
-
Input(),
|
|
1803
|
-
__metadata("design:type", Boolean)
|
|
1804
|
-
], FileSelectComponent.prototype, "disabled", void 0);
|
|
1805
|
-
__decorate([
|
|
1806
|
-
Input(),
|
|
1807
|
-
__metadata("design:type", Boolean)
|
|
1808
|
-
], FileSelectComponent.prototype, "multiple", void 0);
|
|
1809
|
-
__decorate([
|
|
1810
|
-
Input(),
|
|
1811
|
-
__metadata("design:type", String),
|
|
1812
|
-
__metadata("design:paramtypes", [String])
|
|
1813
|
-
], FileSelectComponent.prototype, "name", null);
|
|
1814
|
-
__decorate([
|
|
1815
|
-
Input(),
|
|
1816
|
-
__metadata("design:type", Boolean)
|
|
1817
|
-
], FileSelectComponent.prototype, "showFileList", void 0);
|
|
1818
|
-
__decorate([
|
|
1819
|
-
Input(),
|
|
1820
|
-
__metadata("design:type", Number)
|
|
1821
|
-
], FileSelectComponent.prototype, "tabindex", void 0);
|
|
1822
|
-
__decorate([
|
|
1823
|
-
Input(),
|
|
1824
|
-
__metadata("design:type", Object),
|
|
1825
|
-
__metadata("design:paramtypes", [Object])
|
|
1826
|
-
], FileSelectComponent.prototype, "restrictions", null);
|
|
1827
|
-
__decorate([
|
|
1828
|
-
Input(),
|
|
1829
|
-
__metadata("design:type", String)
|
|
1830
|
-
], FileSelectComponent.prototype, "zoneId", void 0);
|
|
1831
|
-
__decorate([
|
|
1832
|
-
Input(),
|
|
1833
|
-
__metadata("design:type", String)
|
|
1834
|
-
], FileSelectComponent.prototype, "focusableId", void 0);
|
|
1835
|
-
__decorate([
|
|
1836
|
-
ContentChild(FileTemplateDirective, { static: false }),
|
|
1837
|
-
__metadata("design:type", FileTemplateDirective)
|
|
1838
|
-
], FileSelectComponent.prototype, "fileTemplate", void 0);
|
|
1839
|
-
__decorate([
|
|
1840
|
-
ContentChild(FileInfoTemplateDirective, { static: false }),
|
|
1841
|
-
__metadata("design:type", FileInfoTemplateDirective)
|
|
1842
|
-
], FileSelectComponent.prototype, "fileInfoTemplate", void 0);
|
|
1843
|
-
__decorate([
|
|
1844
|
-
ViewChild('fileSelect', { static: true }),
|
|
1845
|
-
__metadata("design:type", ElementRef)
|
|
1846
|
-
], FileSelectComponent.prototype, "fileSelect", void 0);
|
|
1847
|
-
__decorate([
|
|
1848
|
-
ViewChild('fileSelectButton', { static: true }),
|
|
1849
|
-
__metadata("design:type", ElementRef)
|
|
1850
|
-
], FileSelectComponent.prototype, "fileSelectButton", void 0);
|
|
1851
|
-
__decorate([
|
|
1852
|
-
Output('blur'),
|
|
1853
|
-
__metadata("design:type", EventEmitter)
|
|
1854
|
-
], FileSelectComponent.prototype, "onBlur", void 0);
|
|
1855
|
-
__decorate([
|
|
1856
|
-
Output('focus'),
|
|
1857
|
-
__metadata("design:type", EventEmitter)
|
|
1858
|
-
], FileSelectComponent.prototype, "onFocus", void 0);
|
|
1859
|
-
__decorate([
|
|
1860
|
-
Output(),
|
|
1861
|
-
__metadata("design:type", EventEmitter)
|
|
1862
|
-
], FileSelectComponent.prototype, "select", void 0);
|
|
1863
|
-
__decorate([
|
|
1864
|
-
Output(),
|
|
1865
|
-
__metadata("design:type", EventEmitter)
|
|
1866
|
-
], FileSelectComponent.prototype, "remove", void 0);
|
|
1867
|
-
__decorate([
|
|
1868
|
-
Output(),
|
|
1869
|
-
__metadata("design:type", EventEmitter)
|
|
1870
|
-
], FileSelectComponent.prototype, "valueChange", void 0);
|
|
1871
|
-
__decorate([
|
|
1872
|
-
HostBinding('class.k-widget'),
|
|
1873
|
-
HostBinding('class.k-upload'),
|
|
1874
|
-
__metadata("design:type", Boolean)
|
|
1875
|
-
], FileSelectComponent.prototype, "hostDefaultClasses", void 0);
|
|
1876
|
-
__decorate([
|
|
1877
|
-
HostBinding('class.k-disabled'),
|
|
1878
|
-
__metadata("design:type", Boolean),
|
|
1879
|
-
__metadata("design:paramtypes", [])
|
|
1880
|
-
], FileSelectComponent.prototype, "hostDisabledClass", null);
|
|
1881
|
-
__decorate([
|
|
1882
|
-
HostBinding('attr.dir'),
|
|
1883
|
-
__metadata("design:type", String),
|
|
1884
|
-
__metadata("design:paramtypes", [])
|
|
1885
|
-
], FileSelectComponent.prototype, "dir", null);
|
|
1886
|
-
__decorate([
|
|
1887
|
-
HostListener('keydown', ['$event']),
|
|
1888
|
-
__metadata("design:type", Function),
|
|
1889
|
-
__metadata("design:paramtypes", [Object]),
|
|
1890
|
-
__metadata("design:returntype", void 0)
|
|
1891
|
-
], FileSelectComponent.prototype, "handleKeydown", null);
|
|
1892
|
-
FileSelectComponent = FileSelectComponent_1 = __decorate([
|
|
1893
|
-
Component({
|
|
1894
|
-
exportAs: 'kendoFileSelect',
|
|
1895
|
-
providers: [
|
|
1896
|
-
LocalizationService,
|
|
1897
|
-
NavigationService,
|
|
1898
|
-
UploadService,
|
|
1899
|
-
DropZoneService,
|
|
1900
|
-
FILESELECT_VALUE_ACCESSOR,
|
|
1901
|
-
{
|
|
1902
|
-
provide: L10N_PREFIX,
|
|
1903
|
-
useValue: 'kendo.fileselect'
|
|
1904
|
-
},
|
|
1905
|
-
{
|
|
1906
|
-
provide: KendoInput,
|
|
1907
|
-
useExisting: forwardRef(() => FileSelectComponent_1)
|
|
1908
|
-
}
|
|
1909
|
-
],
|
|
1910
|
-
selector: 'kendo-fileselect',
|
|
1911
|
-
template: `
|
|
1912
|
-
<ng-container kendoFileSelectLocalizedMessages
|
|
1913
|
-
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
1914
|
-
dropFilesHere="Drop files here to select"
|
|
1751
|
+
}
|
|
1752
|
+
FileListItemActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemActionButtonComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1753
|
+
FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: { file: "file", disabled: "disabled", progress: "progress" }, ngImport: i0, template: `
|
|
1754
|
+
<strong class="k-upload-status">
|
|
1755
|
+
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
1915
1756
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1757
|
+
<button type="button" *ngIf="isFailed" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1758
|
+
[ngClass]="{ 'k-focus': this.retryFocused }"
|
|
1759
|
+
[attr.tabIndex]="-1"
|
|
1760
|
+
(focus)="onFocus('retry')"
|
|
1761
|
+
(blur)="onBlur('retry')"
|
|
1762
|
+
(click)="onRetryClick()">
|
|
1763
|
+
<span class="k-icon k-button-icon k-retry k-i-refresh-sm"
|
|
1764
|
+
[attr.aria-label]="retryButtonTitle"
|
|
1765
|
+
[attr.title]="retryButtonTitle">
|
|
1766
|
+
</span>
|
|
1767
|
+
</button>
|
|
1918
1768
|
|
|
1919
|
-
|
|
1920
|
-
|
|
1769
|
+
<button *ngIf="isResumable" type="button" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1770
|
+
[ngClass]="{ 'k-focus': this.pauseResumeFocused }"
|
|
1771
|
+
[attr.tabIndex]="-1"
|
|
1772
|
+
(focus)="onFocus('pauseResume')"
|
|
1773
|
+
(blur)="onBlur('pauseResume')"
|
|
1774
|
+
(click)="onPauseResumeClick()">
|
|
1775
|
+
<span class="k-icon k-button-icon"
|
|
1776
|
+
[ngClass]="{
|
|
1777
|
+
'k-i-play-sm': isPaused,
|
|
1778
|
+
'k-i-pause-sm': !isPaused
|
|
1779
|
+
}"
|
|
1780
|
+
[attr.aria-label]='pauseResumeButtonTitle'
|
|
1781
|
+
[attr.title]='pauseResumeButtonTitle'>
|
|
1782
|
+
</span>
|
|
1783
|
+
</button>
|
|
1921
1784
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1785
|
+
<button type="button" *ngIf="isActionButtonVisible" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1786
|
+
[ngClass]="{ 'k-focus': this.actionFocused }"
|
|
1787
|
+
[attr.tabIndex]="-1"
|
|
1788
|
+
(focus)="onFocus('action')"
|
|
1789
|
+
(blur)="onBlur('action')"
|
|
1790
|
+
(click)="onRemoveCancelClick($event)">
|
|
1791
|
+
<span class="k-icon k-button-icon"
|
|
1792
|
+
[ngClass]="{
|
|
1793
|
+
'k-i-cancel': isUploading,
|
|
1794
|
+
'k-delete k-i-x': !isUploading
|
|
1795
|
+
}"
|
|
1796
|
+
[attr.aria-label]='actionButtonTitle'
|
|
1797
|
+
[attr.title]='actionButtonTitle'>
|
|
1798
|
+
</span>
|
|
1799
|
+
</button>
|
|
1800
|
+
</strong>
|
|
1801
|
+
`, isInline: true, directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListItemActionButtonComponent, decorators: [{
|
|
1803
|
+
type: Component,
|
|
1804
|
+
args: [{
|
|
1805
|
+
selector: 'kendo-upload-file-list-item-action-button',
|
|
1806
|
+
template: `
|
|
1807
|
+
<strong class="k-upload-status">
|
|
1808
|
+
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
1924
1809
|
|
|
1925
|
-
|
|
1926
|
-
|
|
1810
|
+
<button type="button" *ngIf="isFailed" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1811
|
+
[ngClass]="{ 'k-focus': this.retryFocused }"
|
|
1812
|
+
[attr.tabIndex]="-1"
|
|
1813
|
+
(focus)="onFocus('retry')"
|
|
1814
|
+
(blur)="onBlur('retry')"
|
|
1815
|
+
(click)="onRetryClick()">
|
|
1816
|
+
<span class="k-icon k-button-icon k-retry k-i-refresh-sm"
|
|
1817
|
+
[attr.aria-label]="retryButtonTitle"
|
|
1818
|
+
[attr.title]="retryButtonTitle">
|
|
1819
|
+
</span>
|
|
1820
|
+
</button>
|
|
1927
1821
|
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
[
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
[
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
</ul>
|
|
1822
|
+
<button *ngIf="isResumable" type="button" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1823
|
+
[ngClass]="{ 'k-focus': this.pauseResumeFocused }"
|
|
1824
|
+
[attr.tabIndex]="-1"
|
|
1825
|
+
(focus)="onFocus('pauseResume')"
|
|
1826
|
+
(blur)="onBlur('pauseResume')"
|
|
1827
|
+
(click)="onPauseResumeClick()">
|
|
1828
|
+
<span class="k-icon k-button-icon"
|
|
1829
|
+
[ngClass]="{
|
|
1830
|
+
'k-i-play-sm': isPaused,
|
|
1831
|
+
'k-i-pause-sm': !isPaused
|
|
1832
|
+
}"
|
|
1833
|
+
[attr.aria-label]='pauseResumeButtonTitle'
|
|
1834
|
+
[attr.title]='pauseResumeButtonTitle'>
|
|
1835
|
+
</span>
|
|
1836
|
+
</button>
|
|
1837
|
+
|
|
1838
|
+
<button type="button" *ngIf="isActionButtonVisible" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
1839
|
+
[ngClass]="{ 'k-focus': this.actionFocused }"
|
|
1840
|
+
[attr.tabIndex]="-1"
|
|
1841
|
+
(focus)="onFocus('action')"
|
|
1842
|
+
(blur)="onBlur('action')"
|
|
1843
|
+
(click)="onRemoveCancelClick($event)">
|
|
1844
|
+
<span class="k-icon k-button-icon"
|
|
1845
|
+
[ngClass]="{
|
|
1846
|
+
'k-i-cancel': isUploading,
|
|
1847
|
+
'k-delete k-i-x': !isUploading
|
|
1848
|
+
}"
|
|
1849
|
+
[attr.aria-label]='actionButtonTitle'
|
|
1850
|
+
[attr.title]='actionButtonTitle'>
|
|
1851
|
+
</span>
|
|
1852
|
+
</button>
|
|
1853
|
+
</strong>
|
|
1961
1854
|
`
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
ElementRef])
|
|
1971
|
-
], FileSelectComponent);
|
|
1855
|
+
}]
|
|
1856
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }]; }, propDecorators: { file: [{
|
|
1857
|
+
type: Input
|
|
1858
|
+
}], disabled: [{
|
|
1859
|
+
type: Input
|
|
1860
|
+
}], progress: [{
|
|
1861
|
+
type: Input
|
|
1862
|
+
}] } });
|
|
1972
1863
|
|
|
1973
1864
|
/**
|
|
1974
1865
|
* @hidden
|
|
1975
1866
|
*/
|
|
1976
|
-
class
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
Input(),
|
|
1980
|
-
__metadata("design:type", String)
|
|
1981
|
-
], Messages.prototype, "cancel", void 0);
|
|
1982
|
-
__decorate([
|
|
1983
|
-
Input(),
|
|
1984
|
-
__metadata("design:type", String)
|
|
1985
|
-
], Messages.prototype, "clearSelectedFiles", void 0);
|
|
1986
|
-
__decorate([
|
|
1987
|
-
Input(),
|
|
1988
|
-
__metadata("design:type", String)
|
|
1989
|
-
], Messages.prototype, "dropFilesHere", void 0);
|
|
1990
|
-
__decorate([
|
|
1991
|
-
Input(),
|
|
1992
|
-
__metadata("design:type", String)
|
|
1993
|
-
], Messages.prototype, "externalDropFilesHere", void 0);
|
|
1994
|
-
__decorate([
|
|
1995
|
-
Input(),
|
|
1996
|
-
__metadata("design:type", String)
|
|
1997
|
-
], Messages.prototype, "filesBatchStatus", void 0);
|
|
1998
|
-
__decorate([
|
|
1999
|
-
Input(),
|
|
2000
|
-
__metadata("design:type", String)
|
|
2001
|
-
], Messages.prototype, "filesBatchStatusFailed", void 0);
|
|
2002
|
-
__decorate([
|
|
2003
|
-
Input(),
|
|
2004
|
-
__metadata("design:type", String)
|
|
2005
|
-
], Messages.prototype, "filesBatchStatusUploaded", void 0);
|
|
2006
|
-
__decorate([
|
|
2007
|
-
Input(),
|
|
2008
|
-
__metadata("design:type", String)
|
|
2009
|
-
], Messages.prototype, "fileStatusFailed", void 0);
|
|
2010
|
-
__decorate([
|
|
2011
|
-
Input(),
|
|
2012
|
-
__metadata("design:type", String)
|
|
2013
|
-
], Messages.prototype, "fileStatusUploaded", void 0);
|
|
2014
|
-
__decorate([
|
|
2015
|
-
Input(),
|
|
2016
|
-
__metadata("design:type", String)
|
|
2017
|
-
], Messages.prototype, "headerStatusPaused", void 0);
|
|
2018
|
-
__decorate([
|
|
2019
|
-
Input(),
|
|
2020
|
-
__metadata("design:type", String)
|
|
2021
|
-
], Messages.prototype, "headerStatusUploaded", void 0);
|
|
2022
|
-
__decorate([
|
|
2023
|
-
Input(),
|
|
2024
|
-
__metadata("design:type", String)
|
|
2025
|
-
], Messages.prototype, "headerStatusUploading", void 0);
|
|
2026
|
-
__decorate([
|
|
2027
|
-
Input(),
|
|
2028
|
-
__metadata("design:type", String)
|
|
2029
|
-
], Messages.prototype, "invalidFileExtension", void 0);
|
|
2030
|
-
__decorate([
|
|
2031
|
-
Input(),
|
|
2032
|
-
__metadata("design:type", String)
|
|
2033
|
-
], Messages.prototype, "invalidMaxFileSize", void 0);
|
|
2034
|
-
__decorate([
|
|
2035
|
-
Input(),
|
|
2036
|
-
__metadata("design:type", String)
|
|
2037
|
-
], Messages.prototype, "invalidMinFileSize", void 0);
|
|
2038
|
-
__decorate([
|
|
2039
|
-
Input(),
|
|
2040
|
-
__metadata("design:type", String)
|
|
2041
|
-
], Messages.prototype, "pause", void 0);
|
|
2042
|
-
__decorate([
|
|
2043
|
-
Input(),
|
|
2044
|
-
__metadata("design:type", String)
|
|
2045
|
-
], Messages.prototype, "remove", void 0);
|
|
2046
|
-
__decorate([
|
|
2047
|
-
Input(),
|
|
2048
|
-
__metadata("design:type", String)
|
|
2049
|
-
], Messages.prototype, "resume", void 0);
|
|
2050
|
-
__decorate([
|
|
2051
|
-
Input(),
|
|
2052
|
-
__metadata("design:type", String)
|
|
2053
|
-
], Messages.prototype, "retry", void 0);
|
|
2054
|
-
__decorate([
|
|
2055
|
-
Input(),
|
|
2056
|
-
__metadata("design:type", String)
|
|
2057
|
-
], Messages.prototype, "select", void 0);
|
|
2058
|
-
__decorate([
|
|
2059
|
-
Input(),
|
|
2060
|
-
__metadata("design:type", String)
|
|
2061
|
-
], Messages.prototype, "uploadSelectedFiles", void 0);
|
|
2062
|
-
|
|
2063
|
-
var CustomMessagesComponent_1;
|
|
2064
|
-
/**
|
|
2065
|
-
* Custom component messages override default component messages ([more information and example]({% slug globalization_upload %})).
|
|
2066
|
-
*
|
|
2067
|
-
* @example
|
|
2068
|
-
* ```html-no-run
|
|
2069
|
-
* <kendo-fileselect>
|
|
2070
|
-
* <kendo-fileselect-messages
|
|
2071
|
-
* dropFilesHere="Drop your file here"
|
|
2072
|
-
* select="Upload file">
|
|
2073
|
-
* </kendo-fileselect-messages>
|
|
2074
|
-
* </kendo-fileselect>
|
|
2075
|
-
* ```
|
|
2076
|
-
*/
|
|
2077
|
-
let CustomMessagesComponent = CustomMessagesComponent_1 = class CustomMessagesComponent extends Messages {
|
|
2078
|
-
constructor(service) {
|
|
2079
|
-
super();
|
|
2080
|
-
this.service = service;
|
|
1867
|
+
class TemplateContextDirective {
|
|
1868
|
+
constructor(viewContainerRef) {
|
|
1869
|
+
this.viewContainerRef = viewContainerRef;
|
|
2081
1870
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
1871
|
+
set templateContext(context) {
|
|
1872
|
+
if (this.insertedViewRef) {
|
|
1873
|
+
this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
|
|
1874
|
+
this.insertedViewRef = undefined;
|
|
1875
|
+
}
|
|
1876
|
+
if (context.templateRef) {
|
|
1877
|
+
this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
|
|
1878
|
+
}
|
|
2084
1879
|
}
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
],
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
}),
|
|
2097
|
-
__metadata("design:paramtypes", [LocalizationService])
|
|
2098
|
-
], CustomMessagesComponent);
|
|
1880
|
+
}
|
|
1881
|
+
TemplateContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplateContextDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1882
|
+
TemplateContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TemplateContextDirective, selector: "[templateContext]", inputs: { templateContext: "templateContext" }, ngImport: i0 });
|
|
1883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TemplateContextDirective, decorators: [{
|
|
1884
|
+
type: Directive,
|
|
1885
|
+
args: [{
|
|
1886
|
+
selector: '[templateContext]' // eslint-disable-line directive-selector
|
|
1887
|
+
}]
|
|
1888
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { templateContext: [{
|
|
1889
|
+
type: Input
|
|
1890
|
+
}] } });
|
|
2099
1891
|
|
|
2100
1892
|
/**
|
|
2101
1893
|
* @hidden
|
|
2102
1894
|
*/
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
*/
|
|
2111
|
-
const INVALIDFILEEXTENSION = "invalidFileExtension";
|
|
2112
|
-
const validateFileExtension = (file, allowedExtensions) => {
|
|
2113
|
-
if (allowedExtensions.length > 0) {
|
|
2114
|
-
if (allowedExtensions.indexOf(file.extension.toLowerCase()) < 0) {
|
|
2115
|
-
file.validationErrors = file.validationErrors || [];
|
|
2116
|
-
if (file.validationErrors.indexOf(INVALIDFILEEXTENSION) < 0) {
|
|
2117
|
-
file.validationErrors.push(INVALIDFILEEXTENSION);
|
|
1895
|
+
class FileListSingleItemComponent extends FileListItemBase {
|
|
1896
|
+
constructor(localization, uploadService) {
|
|
1897
|
+
super(uploadService);
|
|
1898
|
+
this.localization = localization;
|
|
1899
|
+
this.subscribeUploadProgress((args) => {
|
|
1900
|
+
if (args.files[0].uid === this.file.uid) {
|
|
1901
|
+
this.progressComplete = args.percentComplete;
|
|
2118
1902
|
}
|
|
2119
|
-
}
|
|
1903
|
+
});
|
|
2120
1904
|
}
|
|
2121
|
-
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
if (file.validationErrors.indexOf(INVALIDMINFILESIZE) < 0) {
|
|
2126
|
-
file.validationErrors.push(INVALIDMINFILESIZE);
|
|
1905
|
+
get fileStatusText() {
|
|
1906
|
+
const errors = this.file.validationErrors;
|
|
1907
|
+
if (this.file.state === FileState.Uploaded) {
|
|
1908
|
+
return `${this.textFor('fileStatusUploaded')}`;
|
|
2127
1909
|
}
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
file.validationErrors = file.validationErrors || [];
|
|
2131
|
-
if (file.validationErrors.indexOf(INVALIDMAXFILESIZE) < 0) {
|
|
2132
|
-
file.validationErrors.push(INVALIDMAXFILESIZE);
|
|
1910
|
+
if (this.file.state === FileState.Failed) {
|
|
1911
|
+
return `${this.textFor('fileStatusFailed')}`;
|
|
2133
1912
|
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
const parseAllowedExtensions = (extensions) => {
|
|
2137
|
-
const allowedExtensions = extensions.map((ext) => {
|
|
2138
|
-
var parsedExt = (ext.substring(0, 1) === ".") ? ext : ("." + ext);
|
|
2139
|
-
return parsedExt.toLowerCase();
|
|
2140
|
-
});
|
|
2141
|
-
return allowedExtensions;
|
|
2142
|
-
};
|
|
2143
|
-
/**
|
|
2144
|
-
* @hidden
|
|
2145
|
-
*/
|
|
2146
|
-
const validateFiles = (files, restrictionInfo) => {
|
|
2147
|
-
const allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions);
|
|
2148
|
-
const maxFileSize = restrictionInfo.maxFileSize;
|
|
2149
|
-
const minFileSize = restrictionInfo.minFileSize;
|
|
2150
|
-
let i;
|
|
2151
|
-
for (i = 0; i < files.length; i++) {
|
|
2152
|
-
validateFileExtension(files[i], allowedExtensions);
|
|
2153
|
-
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
2154
|
-
}
|
|
2155
|
-
};
|
|
2156
|
-
|
|
2157
|
-
/**
|
|
2158
|
-
* @hidden
|
|
2159
|
-
*/
|
|
2160
|
-
class DropZoneBase {
|
|
2161
|
-
constructor(element, renderer, hoverClass) {
|
|
2162
|
-
this.element = element;
|
|
2163
|
-
this.renderer = renderer;
|
|
2164
|
-
this.hideIntervalElement = null;
|
|
2165
|
-
this.hoverClass = hoverClass;
|
|
2166
|
-
}
|
|
2167
|
-
/**
|
|
2168
|
-
* @hidden
|
|
2169
|
-
*/
|
|
2170
|
-
onElementDragEnterListener() {
|
|
2171
|
-
this.addClass(this.hoverClass);
|
|
2172
|
-
this.lastDragElement = new Date();
|
|
2173
|
-
if (!this.hideIntervalElement) {
|
|
2174
|
-
this.hideIntervalElement = setInterval(() => {
|
|
2175
|
-
if (this.calculateTimeDiff(this.lastDragElement) < 100) {
|
|
2176
|
-
return;
|
|
2177
|
-
}
|
|
2178
|
-
this.removeClass(this.hoverClass);
|
|
2179
|
-
clearInterval(this.hideIntervalElement);
|
|
2180
|
-
this.hideIntervalElement = null;
|
|
2181
|
-
}, 100);
|
|
1913
|
+
if (!isPresent(errors)) {
|
|
1914
|
+
return this.getTotalFilesSizeMessage([this.file]);
|
|
2182
1915
|
}
|
|
2183
|
-
return
|
|
2184
|
-
}
|
|
2185
|
-
/**
|
|
2186
|
-
* @hidden
|
|
2187
|
-
*/
|
|
2188
|
-
onElementDragOverListener() {
|
|
2189
|
-
this.lastDragElement = new Date();
|
|
2190
|
-
return false;
|
|
2191
|
-
}
|
|
2192
|
-
calculateTimeDiff(prevEvent) {
|
|
2193
|
-
return new Date().getTime() - prevEvent.getTime();
|
|
2194
|
-
}
|
|
2195
|
-
addClass(className) {
|
|
2196
|
-
this.renderer.addClass(this.element.nativeElement, className);
|
|
1916
|
+
return this.getFileValidationMessage(this.file);
|
|
2197
1917
|
}
|
|
2198
|
-
|
|
2199
|
-
this.
|
|
1918
|
+
get showProgress() {
|
|
1919
|
+
const showProgress = this.file.state === FileState.Uploading || this.file.state === FileState.Paused;
|
|
1920
|
+
return showProgress ? 'active' : 'inactive';
|
|
2200
1921
|
}
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
HostListener('dragenter'),
|
|
2204
|
-
__metadata("design:type", Function),
|
|
2205
|
-
__metadata("design:paramtypes", []),
|
|
2206
|
-
__metadata("design:returntype", Boolean)
|
|
2207
|
-
], DropZoneBase.prototype, "onElementDragEnterListener", null);
|
|
2208
|
-
__decorate([
|
|
2209
|
-
HostListener('dragover'),
|
|
2210
|
-
__metadata("design:type", Function),
|
|
2211
|
-
__metadata("design:paramtypes", []),
|
|
2212
|
-
__metadata("design:returntype", Boolean)
|
|
2213
|
-
], DropZoneBase.prototype, "onElementDragOverListener", null);
|
|
2214
|
-
|
|
2215
|
-
/**
|
|
2216
|
-
* @hidden
|
|
2217
|
-
*/
|
|
2218
|
-
let DropZoneInternalDirective = class DropZoneInternalDirective extends DropZoneBase {
|
|
2219
|
-
constructor(element, renderer, ngZone, uploadService) {
|
|
2220
|
-
super(element, renderer, 'k-dropzone-hover');
|
|
2221
|
-
this.ngZone = ngZone;
|
|
2222
|
-
this.uploadService = uploadService;
|
|
2223
|
-
this.initialClassName = true;
|
|
2224
|
-
this.hideIntervalDocument = null;
|
|
2225
|
-
this.activeClass = 'k-dropzone-active';
|
|
2226
|
-
this.ngZone.runOutsideAngular(() => {
|
|
2227
|
-
this.unsubscribeDocumentDragEnter = this.renderer.listen('document', 'dragenter', () => this.onDocumentDragEnter());
|
|
2228
|
-
this.unsubscribeDocumentDragOver = this.renderer.listen('document', 'dragover', () => this.onDocumentDragOver());
|
|
2229
|
-
});
|
|
1922
|
+
get fileGroupClass() {
|
|
1923
|
+
return getFileGroupCssClass(this.file.extension ? this.file.extension : '');
|
|
2230
1924
|
}
|
|
2231
|
-
|
|
2232
|
-
this.
|
|
2233
|
-
if (this.unsubscribeDocumentDragEnter) {
|
|
2234
|
-
this.unsubscribeDocumentDragEnter();
|
|
2235
|
-
}
|
|
2236
|
-
if (this.unsubscribeDocumentDragOver) {
|
|
2237
|
-
this.unsubscribeDocumentDragOver();
|
|
2238
|
-
}
|
|
2239
|
-
});
|
|
1925
|
+
get isUploadSuccessful() {
|
|
1926
|
+
return this.file.state === FileState.Uploaded;
|
|
2240
1927
|
}
|
|
2241
|
-
|
|
2242
|
-
this.
|
|
2243
|
-
this.lastDragDocument = new Date();
|
|
2244
|
-
if (!this.hideIntervalDocument) {
|
|
2245
|
-
this.hideIntervalDocument = setInterval(() => {
|
|
2246
|
-
if (this.calculateTimeDiff(this.lastDragDocument) < 100) {
|
|
2247
|
-
return;
|
|
2248
|
-
}
|
|
2249
|
-
this.removeClass(this.activeClass);
|
|
2250
|
-
clearInterval(this.hideIntervalDocument);
|
|
2251
|
-
this.hideIntervalDocument = null;
|
|
2252
|
-
}, 100);
|
|
2253
|
-
}
|
|
2254
|
-
return false;
|
|
1928
|
+
get isUploadFailed() {
|
|
1929
|
+
return this.file.state === FileState.Failed;
|
|
2255
1930
|
}
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
*/
|
|
2259
|
-
onDocumentDragOver() {
|
|
2260
|
-
this.lastDragDocument = new Date();
|
|
2261
|
-
return false;
|
|
1931
|
+
get isNotYetUploaded() {
|
|
1932
|
+
return !this.isUploadFailed && !this.isUploadSuccessful;
|
|
2262
1933
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
]
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
]
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
1934
|
+
}
|
|
1935
|
+
FileListSingleItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListSingleItemComponent, deps: [{ token: i1$1.LocalizationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1936
|
+
FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListSingleItemComponent, selector: "kendo-upload-file-list-single-item", inputs: { disabled: "disabled", file: "file", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
1937
|
+
<div class="k-progressbar" [@progressState]="showProgress">
|
|
1938
|
+
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
1939
|
+
</div>
|
|
1940
|
+
<span class="k-file-group-wrapper">
|
|
1941
|
+
<span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
|
|
1942
|
+
</span>
|
|
1943
|
+
<span class="k-file-name-size-wrapper">
|
|
1944
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
1945
|
+
<span class="k-file-name" [title]="file.name">{{ file.name }}</span>
|
|
1946
|
+
<span [ngClass]="{
|
|
1947
|
+
'k-file-validation-message': file.validationErrors,
|
|
1948
|
+
'k-file-size': !file.validationErrors && isNotYetUploaded,
|
|
1949
|
+
'k-text-success': isUploadSuccessful,
|
|
1950
|
+
'k-text-error': file.validationErrors || isUploadFailed,
|
|
1951
|
+
'k-file-information': isUploadSuccessful || isUploadFailed
|
|
1952
|
+
}"
|
|
1953
|
+
>{{fileStatusText}}</span>
|
|
1954
|
+
</ng-container>
|
|
1955
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
1956
|
+
[templateContext]="{
|
|
1957
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
1958
|
+
state: file.state,
|
|
1959
|
+
$implicit: [file]
|
|
1960
|
+
}">
|
|
1961
|
+
</ng-template>
|
|
1962
|
+
</span>
|
|
1963
|
+
<kendo-upload-file-list-item-action-button
|
|
1964
|
+
[file]='file'
|
|
1965
|
+
[disabled]='disabled'
|
|
1966
|
+
[progress]='progressComplete'>
|
|
1967
|
+
</kendo-upload-file-list-item-action-button>
|
|
1968
|
+
`, isInline: true, components: [{ type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
|
|
1969
|
+
trigger('progressState', [
|
|
1970
|
+
state('active', style({ opacity: 1 })),
|
|
1971
|
+
state('inactive', style({ opacity: 0 })),
|
|
1972
|
+
transition('void => active', style({ opacity: 0 })),
|
|
1973
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
1974
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
1975
|
+
])
|
|
1976
|
+
] });
|
|
1977
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListSingleItemComponent, decorators: [{
|
|
1978
|
+
type: Component,
|
|
1979
|
+
args: [{
|
|
1980
|
+
animations: [
|
|
1981
|
+
trigger('progressState', [
|
|
1982
|
+
state('active', style({ opacity: 1 })),
|
|
1983
|
+
state('inactive', style({ opacity: 0 })),
|
|
1984
|
+
transition('void => active', style({ opacity: 0 })),
|
|
1985
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
1986
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
1987
|
+
])
|
|
1988
|
+
],
|
|
1989
|
+
selector: 'kendo-upload-file-list-single-item',
|
|
1990
|
+
template: `
|
|
1991
|
+
<div class="k-progressbar" [@progressState]="showProgress">
|
|
1992
|
+
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
1993
|
+
</div>
|
|
1994
|
+
<span class="k-file-group-wrapper">
|
|
1995
|
+
<span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
|
|
1996
|
+
</span>
|
|
1997
|
+
<span class="k-file-name-size-wrapper">
|
|
1998
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
1999
|
+
<span class="k-file-name" [title]="file.name">{{ file.name }}</span>
|
|
2000
|
+
<span [ngClass]="{
|
|
2001
|
+
'k-file-validation-message': file.validationErrors,
|
|
2002
|
+
'k-file-size': !file.validationErrors && isNotYetUploaded,
|
|
2003
|
+
'k-text-success': isUploadSuccessful,
|
|
2004
|
+
'k-text-error': file.validationErrors || isUploadFailed,
|
|
2005
|
+
'k-file-information': isUploadSuccessful || isUploadFailed
|
|
2006
|
+
}"
|
|
2007
|
+
>{{fileStatusText}}</span>
|
|
2008
|
+
</ng-container>
|
|
2009
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
2010
|
+
[templateContext]="{
|
|
2011
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
2012
|
+
state: file.state,
|
|
2013
|
+
$implicit: [file]
|
|
2014
|
+
}">
|
|
2015
|
+
</ng-template>
|
|
2016
|
+
</span>
|
|
2017
|
+
<kendo-upload-file-list-item-action-button
|
|
2018
|
+
[file]='file'
|
|
2019
|
+
[disabled]='disabled'
|
|
2020
|
+
[progress]='progressComplete'>
|
|
2021
|
+
</kendo-upload-file-list-item-action-button>
|
|
2305
2022
|
`
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
],
|
|
2023
|
+
}]
|
|
2024
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
2025
|
+
type: Input
|
|
2026
|
+
}], file: [{
|
|
2027
|
+
type: Input
|
|
2028
|
+
}], fileInfoTemplate: [{
|
|
2029
|
+
type: Input
|
|
2030
|
+
}] } });
|
|
2312
2031
|
|
|
2313
2032
|
/**
|
|
2314
2033
|
* @hidden
|
|
2315
2034
|
*/
|
|
2316
|
-
|
|
2317
|
-
constructor(
|
|
2318
|
-
|
|
2319
|
-
this.
|
|
2320
|
-
this.
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
this.element.nativeElement.focus();
|
|
2326
|
-
}
|
|
2327
|
-
get uidAttribute() {
|
|
2328
|
-
return this.files[0].uid;
|
|
2329
|
-
}
|
|
2330
|
-
get tabIndex() {
|
|
2331
|
-
return "-1";
|
|
2332
|
-
}
|
|
2333
|
-
get kFileError() {
|
|
2334
|
-
return this.files[0].state === FileState.Failed;
|
|
2035
|
+
class FileListMultipleItemsComponent extends FileListItemBase {
|
|
2036
|
+
constructor(localization, uploadService) {
|
|
2037
|
+
super(uploadService);
|
|
2038
|
+
this.localization = localization;
|
|
2039
|
+
this.subscribeUploadProgress((args) => {
|
|
2040
|
+
if (args.files[0].uid === this.files[0].uid) {
|
|
2041
|
+
this.progressComplete = args.percentComplete;
|
|
2042
|
+
}
|
|
2043
|
+
});
|
|
2335
2044
|
}
|
|
2336
|
-
get
|
|
2337
|
-
|
|
2045
|
+
get showProgress() {
|
|
2046
|
+
const showProgress = this.files[0].state === FileState.Uploading || this.files[0].state === FileState.Paused;
|
|
2047
|
+
return showProgress ? 'active' : 'inactive';
|
|
2338
2048
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
this.files[0].state === FileState.Paused;
|
|
2049
|
+
ngOnInit() {
|
|
2050
|
+
this.filesHaveErrors = super.filesHaveValidationErrors(this.files);
|
|
2342
2051
|
}
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2052
|
+
fileStatusText(file) {
|
|
2053
|
+
const errors = file.validationErrors;
|
|
2054
|
+
if (!isPresent(errors)) {
|
|
2055
|
+
return this.getTotalFilesSizeMessage([file]);
|
|
2347
2056
|
}
|
|
2348
|
-
return
|
|
2349
|
-
}
|
|
2350
|
-
get kStateFocused() {
|
|
2351
|
-
return this.focused;
|
|
2057
|
+
return this.getFileValidationMessage(file);
|
|
2352
2058
|
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2059
|
+
get batchStatusText() {
|
|
2060
|
+
const state = this.files[0].state;
|
|
2061
|
+
const fileCount = this.files.length;
|
|
2062
|
+
if (state === FileState.Uploaded) {
|
|
2063
|
+
return `${fileCount} ${this.textFor('filesBatchStatusUploaded')}`;
|
|
2064
|
+
}
|
|
2065
|
+
if (state === FileState.Failed) {
|
|
2066
|
+
return `${fileCount} ${this.textFor('filesBatchStatusFailed')}`;
|
|
2067
|
+
}
|
|
2068
|
+
return `${fileCount} ${this.textFor('filesBatchStatus')}`;
|
|
2355
2069
|
}
|
|
2356
|
-
|
|
2357
|
-
this.
|
|
2070
|
+
get isUploadSuccessful() {
|
|
2071
|
+
return this.files[0].state === FileState.Uploaded;
|
|
2358
2072
|
}
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
this.navigationService.focusedIndex = this.index;
|
|
2362
|
-
}
|
|
2073
|
+
get isUploadFailed() {
|
|
2074
|
+
return this.files[0].state === FileState.Failed;
|
|
2363
2075
|
}
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
]
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
]
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
],
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2076
|
+
}
|
|
2077
|
+
FileListMultipleItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListMultipleItemsComponent, deps: [{ token: i1$1.LocalizationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2078
|
+
FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: { disabled: "disabled", files: "files", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
2079
|
+
<div class="k-progressbar" [@progressState]="showProgress">
|
|
2080
|
+
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
2081
|
+
</div>
|
|
2082
|
+
<span class="k-multiple-files-group-wrapper">
|
|
2083
|
+
<span class="k-file-group k-icon k-i-copy"></span>
|
|
2084
|
+
</span>
|
|
2085
|
+
<span class="k-multiple-files-wrapper">
|
|
2086
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
2087
|
+
<span *ngFor="let file of files" class="k-file-name-size-wrapper">
|
|
2088
|
+
<span [title]="file.name" class="k-file-name">
|
|
2089
|
+
{{file.name}}
|
|
2090
|
+
</span>
|
|
2091
|
+
<span [ngClass]="{
|
|
2092
|
+
'k-text-error': file.validationErrors,
|
|
2093
|
+
'k-file-validation-message': file.validationErrors,
|
|
2094
|
+
'k-file-size': !file.validationErrors
|
|
2095
|
+
}"
|
|
2096
|
+
>{{fileStatusText(file)}}</span>
|
|
2097
|
+
</span>
|
|
2098
|
+
<span class="k-file-information"
|
|
2099
|
+
[ngClass]="{
|
|
2100
|
+
'k-text-success': isUploadSuccessful,
|
|
2101
|
+
'k-text-error': isUploadFailed
|
|
2102
|
+
}"
|
|
2103
|
+
>{{batchStatusText}}</span>
|
|
2104
|
+
</ng-container>
|
|
2105
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
2106
|
+
[templateContext]="{
|
|
2107
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
2108
|
+
state: files[0].state,
|
|
2109
|
+
$implicit: files
|
|
2110
|
+
}">
|
|
2111
|
+
</ng-template>
|
|
2112
|
+
</span>
|
|
2113
|
+
<kendo-upload-file-list-item-action-button
|
|
2114
|
+
[file]='files[0]'
|
|
2115
|
+
[disabled]='disabled'
|
|
2116
|
+
[progress]='progressComplete'>
|
|
2117
|
+
</kendo-upload-file-list-item-action-button>
|
|
2118
|
+
`, isInline: true, components: [{ type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }], animations: [
|
|
2119
|
+
trigger('progressState', [
|
|
2120
|
+
state('active', style({ opacity: 1 })),
|
|
2121
|
+
state('inactive', style({ opacity: 0 })),
|
|
2122
|
+
transition('void => active', style({ opacity: 0 })),
|
|
2123
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
2124
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
2125
|
+
])
|
|
2126
|
+
] });
|
|
2127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListMultipleItemsComponent, decorators: [{
|
|
2128
|
+
type: Component,
|
|
2129
|
+
args: [{
|
|
2130
|
+
animations: [
|
|
2131
|
+
trigger('progressState', [
|
|
2132
|
+
state('active', style({ opacity: 1 })),
|
|
2133
|
+
state('inactive', style({ opacity: 0 })),
|
|
2134
|
+
transition('void => active', style({ opacity: 0 })),
|
|
2135
|
+
transition('inactive => active', style({ opacity: 1 })),
|
|
2136
|
+
transition('active => inactive', animate('1s 2s ease-out'))
|
|
2137
|
+
])
|
|
2138
|
+
],
|
|
2139
|
+
selector: 'kendo-upload-file-list-multiple-items',
|
|
2140
|
+
template: `
|
|
2141
|
+
<div class="k-progressbar" [@progressState]="showProgress">
|
|
2142
|
+
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
2143
|
+
</div>
|
|
2144
|
+
<span class="k-multiple-files-group-wrapper">
|
|
2145
|
+
<span class="k-file-group k-icon k-i-copy"></span>
|
|
2146
|
+
</span>
|
|
2147
|
+
<span class="k-multiple-files-wrapper">
|
|
2148
|
+
<ng-container *ngIf="!fileInfoTemplate">
|
|
2149
|
+
<span *ngFor="let file of files" class="k-file-name-size-wrapper">
|
|
2150
|
+
<span [title]="file.name" class="k-file-name">
|
|
2151
|
+
{{file.name}}
|
|
2152
|
+
</span>
|
|
2153
|
+
<span [ngClass]="{
|
|
2154
|
+
'k-text-error': file.validationErrors,
|
|
2155
|
+
'k-file-validation-message': file.validationErrors,
|
|
2156
|
+
'k-file-size': !file.validationErrors
|
|
2157
|
+
}"
|
|
2158
|
+
>{{fileStatusText(file)}}</span>
|
|
2159
|
+
</span>
|
|
2160
|
+
<span class="k-file-information"
|
|
2161
|
+
[ngClass]="{
|
|
2162
|
+
'k-text-success': isUploadSuccessful,
|
|
2163
|
+
'k-text-error': isUploadFailed
|
|
2164
|
+
}"
|
|
2165
|
+
>{{batchStatusText}}</span>
|
|
2166
|
+
</ng-container>
|
|
2167
|
+
<ng-template *ngIf="fileInfoTemplate"
|
|
2168
|
+
[templateContext]="{
|
|
2169
|
+
templateRef: fileInfoTemplate.templateRef,
|
|
2170
|
+
state: files[0].state,
|
|
2171
|
+
$implicit: files
|
|
2172
|
+
}">
|
|
2173
|
+
</ng-template>
|
|
2174
|
+
</span>
|
|
2175
|
+
<kendo-upload-file-list-item-action-button
|
|
2176
|
+
[file]='files[0]'
|
|
2177
|
+
[disabled]='disabled'
|
|
2178
|
+
[progress]='progressComplete'>
|
|
2179
|
+
</kendo-upload-file-list-item-action-button>
|
|
2180
|
+
`
|
|
2181
|
+
}]
|
|
2182
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
2183
|
+
type: Input
|
|
2184
|
+
}], files: [{
|
|
2185
|
+
type: Input
|
|
2186
|
+
}], fileInfoTemplate: [{
|
|
2187
|
+
type: Input
|
|
2188
|
+
}] } });
|
|
2438
2189
|
|
|
2190
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
2439
2191
|
/**
|
|
2440
2192
|
* @hidden
|
|
2441
2193
|
*/
|
|
2442
|
-
|
|
2194
|
+
class FileListComponent {
|
|
2443
2195
|
constructor(uploadService, navigation) {
|
|
2444
2196
|
this.uploadService = uploadService;
|
|
2445
2197
|
this.navigation = navigation;
|
|
@@ -2487,31 +2239,9 @@ let FileListComponent = class FileListComponent {
|
|
|
2487
2239
|
this.focusSubscription.unsubscribe();
|
|
2488
2240
|
this.actionSubscription.unsubscribe();
|
|
2489
2241
|
}
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
__metadata("design:type", Boolean)
|
|
2494
|
-
], FileListComponent.prototype, "disabled", void 0);
|
|
2495
|
-
__decorate([
|
|
2496
|
-
Input(),
|
|
2497
|
-
__metadata("design:type", Array)
|
|
2498
|
-
], FileListComponent.prototype, "fileList", void 0);
|
|
2499
|
-
__decorate([
|
|
2500
|
-
Input(),
|
|
2501
|
-
__metadata("design:type", FileTemplateDirective)
|
|
2502
|
-
], FileListComponent.prototype, "fileTemplate", void 0);
|
|
2503
|
-
__decorate([
|
|
2504
|
-
Input(),
|
|
2505
|
-
__metadata("design:type", FileInfoTemplateDirective)
|
|
2506
|
-
], FileListComponent.prototype, "fileInfoTemplate", void 0);
|
|
2507
|
-
__decorate([
|
|
2508
|
-
ViewChildren(FileListItemDirective),
|
|
2509
|
-
__metadata("design:type", QueryList)
|
|
2510
|
-
], FileListComponent.prototype, "fileListItems", void 0);
|
|
2511
|
-
FileListComponent = __decorate([
|
|
2512
|
-
Component({
|
|
2513
|
-
selector: '[kendo-upload-file-list]',
|
|
2514
|
-
template: `
|
|
2242
|
+
}
|
|
2243
|
+
FileListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListComponent, deps: [{ token: UploadService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2244
|
+
FileListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: { disabled: "disabled", fileList: "fileList", fileTemplate: "fileTemplate", fileInfoTemplate: "fileInfoTemplate" }, viewQueries: [{ propertyName: "fileListItems", predicate: FileListItemDirective, descendants: true }], ngImport: i0, template: `
|
|
2515
2245
|
<ng-template ngFor
|
|
2516
2246
|
[ngForOf]="fileList"
|
|
2517
2247
|
let-files
|
|
@@ -2539,623 +2269,1177 @@ FileListComponent = __decorate([
|
|
|
2539
2269
|
}"></ng-template>
|
|
2540
2270
|
</li>
|
|
2541
2271
|
</ng-template>
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
],
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
let
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2272
|
+
`, isInline: true, components: [{ type: FileListSingleItemComponent, selector: "kendo-upload-file-list-single-item", inputs: ["disabled", "file", "fileInfoTemplate"] }, { type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: ["disabled", "files", "fileInfoTemplate"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: FileListItemDirective, selector: "[kendoUploadFileListItem]", inputs: ["files", "index"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
|
|
2273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileListComponent, decorators: [{
|
|
2274
|
+
type: Component,
|
|
2275
|
+
args: [{
|
|
2276
|
+
selector: '[kendo-upload-file-list]',
|
|
2277
|
+
template: `
|
|
2278
|
+
<ng-template ngFor
|
|
2279
|
+
[ngForOf]="fileList"
|
|
2280
|
+
let-files
|
|
2281
|
+
let-index="index">
|
|
2282
|
+
<li kendoUploadFileListItem [files]='files' [index]='index'>
|
|
2283
|
+
<kendo-upload-file-list-single-item
|
|
2284
|
+
class='k-file-single'
|
|
2285
|
+
*ngIf='files.length === 1 && !fileTemplate'
|
|
2286
|
+
[disabled]='disabled'
|
|
2287
|
+
[file]='files[0]'
|
|
2288
|
+
[fileInfoTemplate]="fileInfoTemplate">
|
|
2289
|
+
</kendo-upload-file-list-single-item>
|
|
2290
|
+
<kendo-upload-file-list-multiple-items
|
|
2291
|
+
class='k-file-multiple'
|
|
2292
|
+
*ngIf='files.length > 1 && !fileTemplate'
|
|
2293
|
+
[disabled]='disabled'
|
|
2294
|
+
[files]='files'
|
|
2295
|
+
[fileInfoTemplate]="fileInfoTemplate">
|
|
2296
|
+
</kendo-upload-file-list-multiple-items>
|
|
2297
|
+
<ng-template *ngIf="fileTemplate"
|
|
2298
|
+
[templateContext]="{
|
|
2299
|
+
templateRef: fileTemplate.templateRef,
|
|
2300
|
+
state: files[0].state,
|
|
2301
|
+
$implicit: files
|
|
2302
|
+
}"></ng-template>
|
|
2303
|
+
</li>
|
|
2304
|
+
</ng-template>
|
|
2305
|
+
`
|
|
2306
|
+
}]
|
|
2307
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: NavigationService }]; }, propDecorators: { disabled: [{
|
|
2308
|
+
type: Input
|
|
2309
|
+
}], fileList: [{
|
|
2310
|
+
type: Input
|
|
2311
|
+
}], fileTemplate: [{
|
|
2312
|
+
type: Input
|
|
2313
|
+
}], fileInfoTemplate: [{
|
|
2314
|
+
type: Input
|
|
2315
|
+
}], fileListItems: [{
|
|
2316
|
+
type: ViewChildren,
|
|
2317
|
+
args: [FileListItemDirective]
|
|
2318
|
+
}] } });
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* @hidden
|
|
2322
|
+
*/
|
|
2323
|
+
class Messages extends ComponentMessages {
|
|
2324
|
+
}
|
|
2325
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2326
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, inputs: { cancel: "cancel", clearSelectedFiles: "clearSelectedFiles", dropFilesHere: "dropFilesHere", externalDropFilesHere: "externalDropFilesHere", filesBatchStatus: "filesBatchStatus", filesBatchStatusFailed: "filesBatchStatusFailed", filesBatchStatusUploaded: "filesBatchStatusUploaded", fileStatusFailed: "fileStatusFailed", fileStatusUploaded: "fileStatusUploaded", headerStatusPaused: "headerStatusPaused", headerStatusUploaded: "headerStatusUploaded", headerStatusUploading: "headerStatusUploading", invalidFileExtension: "invalidFileExtension", invalidMaxFileSize: "invalidMaxFileSize", invalidMinFileSize: "invalidMinFileSize", pause: "pause", remove: "remove", resume: "resume", retry: "retry", select: "select", uploadSelectedFiles: "uploadSelectedFiles" }, usesInheritance: true, ngImport: i0 });
|
|
2327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
|
|
2328
|
+
type: Directive
|
|
2329
|
+
}], propDecorators: { cancel: [{
|
|
2330
|
+
type: Input
|
|
2331
|
+
}], clearSelectedFiles: [{
|
|
2332
|
+
type: Input
|
|
2333
|
+
}], dropFilesHere: [{
|
|
2334
|
+
type: Input
|
|
2335
|
+
}], externalDropFilesHere: [{
|
|
2336
|
+
type: Input
|
|
2337
|
+
}], filesBatchStatus: [{
|
|
2338
|
+
type: Input
|
|
2339
|
+
}], filesBatchStatusFailed: [{
|
|
2340
|
+
type: Input
|
|
2341
|
+
}], filesBatchStatusUploaded: [{
|
|
2342
|
+
type: Input
|
|
2343
|
+
}], fileStatusFailed: [{
|
|
2344
|
+
type: Input
|
|
2345
|
+
}], fileStatusUploaded: [{
|
|
2346
|
+
type: Input
|
|
2347
|
+
}], headerStatusPaused: [{
|
|
2348
|
+
type: Input
|
|
2349
|
+
}], headerStatusUploaded: [{
|
|
2350
|
+
type: Input
|
|
2351
|
+
}], headerStatusUploading: [{
|
|
2352
|
+
type: Input
|
|
2353
|
+
}], invalidFileExtension: [{
|
|
2354
|
+
type: Input
|
|
2355
|
+
}], invalidMaxFileSize: [{
|
|
2356
|
+
type: Input
|
|
2357
|
+
}], invalidMinFileSize: [{
|
|
2358
|
+
type: Input
|
|
2359
|
+
}], pause: [{
|
|
2360
|
+
type: Input
|
|
2361
|
+
}], remove: [{
|
|
2362
|
+
type: Input
|
|
2363
|
+
}], resume: [{
|
|
2364
|
+
type: Input
|
|
2365
|
+
}], retry: [{
|
|
2366
|
+
type: Input
|
|
2367
|
+
}], select: [{
|
|
2368
|
+
type: Input
|
|
2369
|
+
}], uploadSelectedFiles: [{
|
|
2370
|
+
type: Input
|
|
2371
|
+
}] } });
|
|
2372
|
+
|
|
2373
|
+
/**
|
|
2374
|
+
* @hidden
|
|
2375
|
+
*/
|
|
2376
|
+
class LocalizedMessagesDirective extends Messages {
|
|
2377
|
+
constructor(service) {
|
|
2378
|
+
super();
|
|
2379
|
+
this.service = service;
|
|
2581
2380
|
}
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2381
|
+
}
|
|
2382
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2383
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n ", providers: [
|
|
2384
|
+
{
|
|
2385
|
+
provide: Messages,
|
|
2386
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective) // eslint-disable-line no-forward-ref
|
|
2387
|
+
}
|
|
2388
|
+
], usesInheritance: true, ngImport: i0 });
|
|
2389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
2390
|
+
type: Directive,
|
|
2391
|
+
args: [{
|
|
2392
|
+
providers: [
|
|
2393
|
+
{
|
|
2394
|
+
provide: Messages,
|
|
2395
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective) // eslint-disable-line no-forward-ref
|
|
2396
|
+
}
|
|
2397
|
+
],
|
|
2398
|
+
selector: `
|
|
2399
|
+
[kendoUploadLocalizedMessages],
|
|
2400
|
+
[kendoFileSelectLocalizedMessages],
|
|
2401
|
+
[kendoUploadDropZoneLocalizedMessages]
|
|
2402
|
+
`
|
|
2403
|
+
}]
|
|
2404
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
2405
|
+
|
|
2406
|
+
/**
|
|
2407
|
+
* @hidden
|
|
2408
|
+
*/
|
|
2409
|
+
const INVALIDMAXFILESIZE = "invalidMaxFileSize";
|
|
2410
|
+
/**
|
|
2411
|
+
* @hidden
|
|
2412
|
+
*/
|
|
2413
|
+
const INVALIDMINFILESIZE = "invalidMinFileSize";
|
|
2414
|
+
/**
|
|
2415
|
+
* @hidden
|
|
2416
|
+
*/
|
|
2417
|
+
const INVALIDFILEEXTENSION = "invalidFileExtension";
|
|
2418
|
+
const validateFileExtension = (file, allowedExtensions) => {
|
|
2419
|
+
if (allowedExtensions.length > 0) {
|
|
2420
|
+
if (allowedExtensions.indexOf(file.extension.toLowerCase()) < 0) {
|
|
2421
|
+
file.validationErrors = file.validationErrors || [];
|
|
2422
|
+
if (file.validationErrors.indexOf(INVALIDFILEEXTENSION) < 0) {
|
|
2423
|
+
file.validationErrors.push(INVALIDFILEEXTENSION);
|
|
2424
|
+
}
|
|
2585
2425
|
}
|
|
2586
|
-
this.uploadService.retryFiles(this.file.uid);
|
|
2587
2426
|
}
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
if (this.file.state === FileState.Uploading) {
|
|
2595
|
-
this.uploadService.cancelFiles(uid);
|
|
2596
|
-
}
|
|
2597
|
-
else {
|
|
2598
|
-
this.uploadService.removeFiles(uid);
|
|
2427
|
+
};
|
|
2428
|
+
const validateFileSize = (file, minFileSize, maxFileSize) => {
|
|
2429
|
+
if (minFileSize !== 0 && file.size < minFileSize) {
|
|
2430
|
+
file.validationErrors = file.validationErrors || [];
|
|
2431
|
+
if (file.validationErrors.indexOf(INVALIDMINFILESIZE) < 0) {
|
|
2432
|
+
file.validationErrors.push(INVALIDMINFILESIZE);
|
|
2599
2433
|
}
|
|
2600
|
-
this.navigation.focusSelectButton();
|
|
2601
2434
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
const uid = this.file.uid;
|
|
2607
|
-
if (this.file.state === FileState.Paused) {
|
|
2608
|
-
this.uploadService.resumeFile(uid);
|
|
2609
|
-
}
|
|
2610
|
-
else {
|
|
2611
|
-
this.uploadService.pauseFile(uid);
|
|
2435
|
+
if (maxFileSize !== 0 && file.size > maxFileSize) {
|
|
2436
|
+
file.validationErrors = file.validationErrors || [];
|
|
2437
|
+
if (file.validationErrors.indexOf(INVALIDMAXFILESIZE) < 0) {
|
|
2438
|
+
file.validationErrors.push(INVALIDMAXFILESIZE);
|
|
2612
2439
|
}
|
|
2613
2440
|
}
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
return
|
|
2441
|
+
};
|
|
2442
|
+
const parseAllowedExtensions = (extensions) => {
|
|
2443
|
+
const allowedExtensions = extensions.map((ext) => {
|
|
2444
|
+
var parsedExt = (ext.substring(0, 1) === ".") ? ext : ("." + ext);
|
|
2445
|
+
return parsedExt.toLowerCase();
|
|
2446
|
+
});
|
|
2447
|
+
return allowedExtensions;
|
|
2448
|
+
};
|
|
2449
|
+
/**
|
|
2450
|
+
* @hidden
|
|
2451
|
+
*/
|
|
2452
|
+
const validateFiles = (files, restrictionInfo) => {
|
|
2453
|
+
const allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions);
|
|
2454
|
+
const maxFileSize = restrictionInfo.maxFileSize;
|
|
2455
|
+
const minFileSize = restrictionInfo.minFileSize;
|
|
2456
|
+
let i;
|
|
2457
|
+
for (i = 0; i < files.length; i++) {
|
|
2458
|
+
validateFileExtension(files[i], allowedExtensions);
|
|
2459
|
+
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
2619
2460
|
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2461
|
+
};
|
|
2462
|
+
|
|
2463
|
+
/**
|
|
2464
|
+
* @hidden
|
|
2465
|
+
*/
|
|
2466
|
+
class DropZoneBase {
|
|
2467
|
+
constructor(element, renderer, cssClass) {
|
|
2468
|
+
this.element = element;
|
|
2469
|
+
this.renderer = renderer;
|
|
2470
|
+
this.hideIntervalElement = null;
|
|
2471
|
+
this.hoverClass = cssClass;
|
|
2622
2472
|
}
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2473
|
+
/**
|
|
2474
|
+
* @hidden
|
|
2475
|
+
*/
|
|
2476
|
+
onElementDragEnterListener() {
|
|
2477
|
+
this.addClass(this.hoverClass);
|
|
2478
|
+
this.lastDragElement = new Date();
|
|
2479
|
+
if (!this.hideIntervalElement) {
|
|
2480
|
+
this.hideIntervalElement = setInterval(() => {
|
|
2481
|
+
if (this.calculateTimeDiff(this.lastDragElement) < 100) {
|
|
2482
|
+
return;
|
|
2483
|
+
}
|
|
2484
|
+
this.removeClass(this.hoverClass);
|
|
2485
|
+
clearInterval(this.hideIntervalElement);
|
|
2486
|
+
this.hideIntervalElement = null;
|
|
2487
|
+
}, 100);
|
|
2626
2488
|
}
|
|
2627
|
-
return
|
|
2628
|
-
}
|
|
2629
|
-
get isUploading() {
|
|
2630
|
-
return this.file.state === FileState.Uploading;
|
|
2489
|
+
return false;
|
|
2631
2490
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2491
|
+
/**
|
|
2492
|
+
* @hidden
|
|
2493
|
+
*/
|
|
2494
|
+
onElementDragOverListener() {
|
|
2495
|
+
this.lastDragElement = new Date();
|
|
2496
|
+
return false;
|
|
2634
2497
|
}
|
|
2635
|
-
|
|
2636
|
-
return
|
|
2498
|
+
calculateTimeDiff(prevEvent) {
|
|
2499
|
+
return new Date().getTime() - prevEvent.getTime();
|
|
2637
2500
|
}
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
const isResumable = service.async.chunk && service.chunk.resumable;
|
|
2641
|
-
const isUploading = (this.file.state === FileState.Paused) || (this.file.state === FileState.Uploading);
|
|
2642
|
-
return isResumable && isUploading;
|
|
2501
|
+
addClass(className) {
|
|
2502
|
+
this.renderer.addClass(this.element.nativeElement, className);
|
|
2643
2503
|
}
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
!this.uploadService.async.removeUrl && this.uploadService.component === 'Upload') {
|
|
2647
|
-
return false;
|
|
2648
|
-
}
|
|
2649
|
-
return true;
|
|
2504
|
+
removeClass(className) {
|
|
2505
|
+
this.renderer.removeClass(this.element.nativeElement, className);
|
|
2650
2506
|
}
|
|
2651
|
-
}
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
]
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
selector: 'kendo-upload-file-list-item-action-button',
|
|
2667
|
-
template: `
|
|
2668
|
-
<strong class="k-upload-status">
|
|
2669
|
-
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
2670
|
-
|
|
2671
|
-
<button type="button" *ngIf="isFailed" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
2672
|
-
[ngClass]="{ 'k-focus': this.retryFocused }"
|
|
2673
|
-
[attr.tabIndex]="-1"
|
|
2674
|
-
(focus)="onFocus('retry')"
|
|
2675
|
-
(blur)="onBlur('retry')"
|
|
2676
|
-
(click)="onRetryClick()">
|
|
2677
|
-
<span class="k-icon k-button-icon k-retry k-i-refresh-sm"
|
|
2678
|
-
[attr.aria-label]="retryButtonTitle"
|
|
2679
|
-
[attr.title]="retryButtonTitle">
|
|
2680
|
-
</span>
|
|
2681
|
-
</button>
|
|
2682
|
-
|
|
2683
|
-
<button *ngIf="isResumable" type="button" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
2684
|
-
[ngClass]="{ 'k-focus': this.pauseResumeFocused }"
|
|
2685
|
-
[attr.tabIndex]="-1"
|
|
2686
|
-
(focus)="onFocus('pauseResume')"
|
|
2687
|
-
(blur)="onBlur('pauseResume')"
|
|
2688
|
-
(click)="onPauseResumeClick()">
|
|
2689
|
-
<span class="k-icon k-button-icon"
|
|
2690
|
-
[ngClass]="{
|
|
2691
|
-
'k-i-play-sm': isPaused,
|
|
2692
|
-
'k-i-pause-sm': !isPaused
|
|
2693
|
-
}"
|
|
2694
|
-
[attr.aria-label]='pauseResumeButtonTitle'
|
|
2695
|
-
[attr.title]='pauseResumeButtonTitle'>
|
|
2696
|
-
</span>
|
|
2697
|
-
</button>
|
|
2698
|
-
|
|
2699
|
-
<button type="button" *ngIf="isActionButtonVisible" class="k-button k-icon-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-upload-action"
|
|
2700
|
-
[ngClass]="{ 'k-focus': this.actionFocused }"
|
|
2701
|
-
[attr.tabIndex]="-1"
|
|
2702
|
-
(focus)="onFocus('action')"
|
|
2703
|
-
(blur)="onBlur('action')"
|
|
2704
|
-
(click)="onRemoveCancelClick($event)">
|
|
2705
|
-
<span class="k-icon k-button-icon"
|
|
2706
|
-
[ngClass]="{
|
|
2707
|
-
'k-i-cancel': isUploading,
|
|
2708
|
-
'k-delete k-i-x': !isUploading
|
|
2709
|
-
}"
|
|
2710
|
-
[attr.aria-label]='actionButtonTitle'
|
|
2711
|
-
[attr.title]='actionButtonTitle'>
|
|
2712
|
-
</span>
|
|
2713
|
-
</button>
|
|
2714
|
-
</strong>
|
|
2715
|
-
`
|
|
2716
|
-
}),
|
|
2717
|
-
__metadata("design:paramtypes", [UploadService,
|
|
2718
|
-
LocalizationService,
|
|
2719
|
-
NavigationService])
|
|
2720
|
-
], FileListItemActionButtonComponent);
|
|
2507
|
+
}
|
|
2508
|
+
DropZoneBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneBase, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: 'hoverClass' }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2509
|
+
DropZoneBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DropZoneBase, host: { listeners: { "dragenter": "onElementDragEnterListener()", "dragover": "onElementDragOverListener()" } }, ngImport: i0 });
|
|
2510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneBase, decorators: [{
|
|
2511
|
+
type: Directive
|
|
2512
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
2513
|
+
type: Inject,
|
|
2514
|
+
args: ['hoverClass']
|
|
2515
|
+
}] }]; }, propDecorators: { onElementDragEnterListener: [{
|
|
2516
|
+
type: HostListener,
|
|
2517
|
+
args: ['dragenter']
|
|
2518
|
+
}], onElementDragOverListener: [{
|
|
2519
|
+
type: HostListener,
|
|
2520
|
+
args: ['dragover']
|
|
2521
|
+
}] } });
|
|
2721
2522
|
|
|
2722
2523
|
/**
|
|
2723
2524
|
* @hidden
|
|
2724
2525
|
*/
|
|
2725
|
-
class
|
|
2726
|
-
constructor(uploadService) {
|
|
2526
|
+
class DropZoneInternalDirective extends DropZoneBase {
|
|
2527
|
+
constructor(element, renderer, ngZone, uploadService) {
|
|
2528
|
+
super(element, renderer, 'k-dropzone-hover');
|
|
2529
|
+
this.ngZone = ngZone;
|
|
2727
2530
|
this.uploadService = uploadService;
|
|
2728
|
-
this.
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
this.
|
|
2531
|
+
this.initialClassName = true;
|
|
2532
|
+
this.hideIntervalDocument = null;
|
|
2533
|
+
this.activeClass = 'k-dropzone-active';
|
|
2534
|
+
this.ngZone.runOutsideAngular(() => {
|
|
2535
|
+
this.unsubscribeDocumentDragEnter = this.renderer.listen('document', 'dragenter', () => this.onDocumentDragEnter());
|
|
2536
|
+
this.unsubscribeDocumentDragOver = this.renderer.listen('document', 'dragover', () => this.onDocumentDragOver());
|
|
2537
|
+
});
|
|
2732
2538
|
}
|
|
2733
|
-
|
|
2734
|
-
|
|
2539
|
+
ngOnDestroy() {
|
|
2540
|
+
this.ngZone.runOutsideAngular(() => {
|
|
2541
|
+
if (this.unsubscribeDocumentDragEnter) {
|
|
2542
|
+
this.unsubscribeDocumentDragEnter();
|
|
2543
|
+
}
|
|
2544
|
+
if (this.unsubscribeDocumentDragOver) {
|
|
2545
|
+
this.unsubscribeDocumentDragOver();
|
|
2546
|
+
}
|
|
2547
|
+
});
|
|
2735
2548
|
}
|
|
2736
|
-
|
|
2737
|
-
|
|
2549
|
+
onDocumentDragEnter() {
|
|
2550
|
+
this.addClass(this.activeClass);
|
|
2551
|
+
this.lastDragDocument = new Date();
|
|
2552
|
+
if (!this.hideIntervalDocument) {
|
|
2553
|
+
this.hideIntervalDocument = setInterval(() => {
|
|
2554
|
+
if (this.calculateTimeDiff(this.lastDragDocument) < 100) {
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
this.removeClass(this.activeClass);
|
|
2558
|
+
clearInterval(this.hideIntervalDocument);
|
|
2559
|
+
this.hideIntervalDocument = null;
|
|
2560
|
+
}, 100);
|
|
2561
|
+
}
|
|
2562
|
+
return false;
|
|
2738
2563
|
}
|
|
2739
|
-
|
|
2740
|
-
|
|
2564
|
+
/**
|
|
2565
|
+
* @hidden
|
|
2566
|
+
*/
|
|
2567
|
+
onDocumentDragOver() {
|
|
2568
|
+
this.lastDragDocument = new Date();
|
|
2569
|
+
return false;
|
|
2741
2570
|
}
|
|
2742
|
-
|
|
2743
|
-
let
|
|
2744
|
-
if (
|
|
2745
|
-
|
|
2571
|
+
onDropListener(event) {
|
|
2572
|
+
let droppedFiles = event.dataTransfer.files;
|
|
2573
|
+
if (droppedFiles.length > 0 && !this.disabled) {
|
|
2574
|
+
let files = getAllFileInfo(droppedFiles);
|
|
2575
|
+
files = assignGuidToFiles(files, !this.uploadService.async.batch);
|
|
2576
|
+
if (!this.multiple) {
|
|
2577
|
+
files.splice(1, files.length - 1);
|
|
2578
|
+
this.uploadService.clearFiles();
|
|
2579
|
+
}
|
|
2580
|
+
validateFiles(files, this.restrictions);
|
|
2581
|
+
this.uploadService.addFiles(files);
|
|
2746
2582
|
}
|
|
2747
|
-
return
|
|
2583
|
+
return false;
|
|
2748
2584
|
}
|
|
2749
|
-
|
|
2750
|
-
|
|
2585
|
+
}
|
|
2586
|
+
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: UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2587
|
+
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 });
|
|
2588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropZoneInternalDirective, decorators: [{
|
|
2589
|
+
type: Directive,
|
|
2590
|
+
args: [{
|
|
2591
|
+
selector: `
|
|
2592
|
+
[kendoUploadInternalDropZone],
|
|
2593
|
+
[kendoFileSelectInternalDropZone]
|
|
2594
|
+
`
|
|
2595
|
+
}]
|
|
2596
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
2597
|
+
type: Input
|
|
2598
|
+
}], multiple: [{
|
|
2599
|
+
type: Input
|
|
2600
|
+
}], restrictions: [{
|
|
2601
|
+
type: Input
|
|
2602
|
+
}], initialClassName: [{
|
|
2603
|
+
type: HostBinding,
|
|
2604
|
+
args: ['class.k-dropzone']
|
|
2605
|
+
}], onDropListener: [{
|
|
2606
|
+
type: HostListener,
|
|
2607
|
+
args: ['drop', ['$event']]
|
|
2608
|
+
}] } });
|
|
2609
|
+
|
|
2610
|
+
/**
|
|
2611
|
+
* @hidden
|
|
2612
|
+
*/
|
|
2613
|
+
class FileSelectDirective {
|
|
2614
|
+
constructor(uploadService, navigation, el) {
|
|
2615
|
+
this.uploadService = uploadService;
|
|
2616
|
+
this.navigation = navigation;
|
|
2617
|
+
this.type = "file";
|
|
2618
|
+
this.autocomplete = "off";
|
|
2619
|
+
this.tabIndex = -1;
|
|
2620
|
+
this.element = el;
|
|
2751
2621
|
}
|
|
2752
|
-
|
|
2753
|
-
return this.
|
|
2622
|
+
get nameAttribute() {
|
|
2623
|
+
return this.uploadService.async.saveField;
|
|
2624
|
+
}
|
|
2625
|
+
get multipleAttribute() {
|
|
2626
|
+
return this.multiple ? "multiple" : null;
|
|
2627
|
+
}
|
|
2628
|
+
get dirAttribute() {
|
|
2629
|
+
return this.dir;
|
|
2630
|
+
}
|
|
2631
|
+
get disabledAttribute() {
|
|
2632
|
+
return this.disabled ? "true" : null;
|
|
2633
|
+
}
|
|
2634
|
+
onInputChange(event) {
|
|
2635
|
+
const ua = navigator.userAgent;
|
|
2636
|
+
const webkit = /(webkit)[ \/]([\w.]+)/i;
|
|
2637
|
+
const ie = /(windows)[ \/]([\w.]+)/i;
|
|
2638
|
+
let selectedFiles = inputFiles(event.target);
|
|
2639
|
+
selectedFiles = assignGuidToFiles(selectedFiles, !this.uploadService.async.batch);
|
|
2640
|
+
validateFiles(selectedFiles, this.restrictions);
|
|
2641
|
+
if (!this.multiple) {
|
|
2642
|
+
this.uploadService.clearFiles();
|
|
2643
|
+
}
|
|
2644
|
+
this.uploadService.addFiles(selectedFiles);
|
|
2645
|
+
/*
|
|
2646
|
+
Chrome, IE, Edge and Safari do not trigger a `change` event
|
|
2647
|
+
when a file with the same name is selected a number of consecutive times.
|
|
2648
|
+
As a workaround, clear the input value after handling the file.
|
|
2649
|
+
*/
|
|
2650
|
+
const native = this.element.nativeElement;
|
|
2651
|
+
if (ua.match(webkit) || ua.match(ie)) {
|
|
2652
|
+
native.type = "";
|
|
2653
|
+
native.type = "file";
|
|
2654
|
+
}
|
|
2655
|
+
setTimeout(() => {
|
|
2656
|
+
this.navigation.focusedIndex = -1;
|
|
2657
|
+
});
|
|
2754
2658
|
}
|
|
2755
2659
|
}
|
|
2660
|
+
FileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectDirective, deps: [{ token: UploadService }, { token: NavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2661
|
+
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 });
|
|
2662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
2663
|
+
type: Directive,
|
|
2664
|
+
args: [{
|
|
2665
|
+
selector: '[kendoFileSelect]'
|
|
2666
|
+
}]
|
|
2667
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: NavigationService }, { type: i0.ElementRef }]; }, propDecorators: { dir: [{
|
|
2668
|
+
type: Input
|
|
2669
|
+
}], disabled: [{
|
|
2670
|
+
type: Input
|
|
2671
|
+
}], multiple: [{
|
|
2672
|
+
type: Input
|
|
2673
|
+
}], restrictions: [{
|
|
2674
|
+
type: Input
|
|
2675
|
+
}], type: [{
|
|
2676
|
+
type: HostBinding,
|
|
2677
|
+
args: ["attr.type"]
|
|
2678
|
+
}], autocomplete: [{
|
|
2679
|
+
type: HostBinding,
|
|
2680
|
+
args: ["attr.autocomplete"]
|
|
2681
|
+
}], tabIndex: [{
|
|
2682
|
+
type: HostBinding,
|
|
2683
|
+
args: ["attr.tabindex"]
|
|
2684
|
+
}], nameAttribute: [{
|
|
2685
|
+
type: HostBinding,
|
|
2686
|
+
args: ["attr.name"]
|
|
2687
|
+
}], multipleAttribute: [{
|
|
2688
|
+
type: HostBinding,
|
|
2689
|
+
args: ["attr.multiple"]
|
|
2690
|
+
}], dirAttribute: [{
|
|
2691
|
+
type: HostBinding,
|
|
2692
|
+
args: ["attr.dir"]
|
|
2693
|
+
}], disabledAttribute: [{
|
|
2694
|
+
type: HostBinding,
|
|
2695
|
+
args: ["attr.disabled"]
|
|
2696
|
+
}], onInputChange: [{
|
|
2697
|
+
type: HostListener,
|
|
2698
|
+
args: ["change", ["$event"]]
|
|
2699
|
+
}] } });
|
|
2756
2700
|
|
|
2757
2701
|
/**
|
|
2758
2702
|
* @hidden
|
|
2759
2703
|
*/
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2704
|
+
const FILESELECT_VALUE_ACCESSOR = {
|
|
2705
|
+
multi: true,
|
|
2706
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2707
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
2708
|
+
};
|
|
2709
|
+
class FileSelectComponent {
|
|
2710
|
+
constructor(uploadService, localization, navigation, dropZoneService, ngZone, renderer, cdr, wrapper) {
|
|
2711
|
+
this.uploadService = uploadService;
|
|
2763
2712
|
this.localization = localization;
|
|
2764
|
-
this.
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2713
|
+
this.navigation = navigation;
|
|
2714
|
+
this.dropZoneService = dropZoneService;
|
|
2715
|
+
this.ngZone = ngZone;
|
|
2716
|
+
this.renderer = renderer;
|
|
2717
|
+
this.cdr = cdr;
|
|
2718
|
+
/**
|
|
2719
|
+
* Disables the FileSelect.
|
|
2720
|
+
* The default value is `false`.
|
|
2721
|
+
*/
|
|
2722
|
+
this.disabled = false;
|
|
2723
|
+
/**
|
|
2724
|
+
* Enables the selection of multiple files
|
|
2725
|
+
* ([see example]({% slug fileprocessing_upload %}#toc-upload-of-sinlge-or-multiple-files)).
|
|
2726
|
+
* If set to `false`, only one file can be selected at a time.
|
|
2727
|
+
*/
|
|
2728
|
+
this.multiple = true;
|
|
2729
|
+
/**
|
|
2730
|
+
* Toggles the visibility of the file list.
|
|
2731
|
+
*/
|
|
2732
|
+
this.showFileList = true;
|
|
2733
|
+
/**
|
|
2734
|
+
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the FileSelect.
|
|
2735
|
+
*/
|
|
2736
|
+
this.tabindex = 0;
|
|
2737
|
+
/**
|
|
2738
|
+
* @hidden
|
|
2739
|
+
*/
|
|
2740
|
+
this.focusableId = `k-${guid()}`;
|
|
2741
|
+
/**
|
|
2742
|
+
* Fires when the user navigates outside the component.
|
|
2743
|
+
*/
|
|
2744
|
+
this.onBlur = new EventEmitter();
|
|
2745
|
+
/**
|
|
2746
|
+
* Fires when the component is focused.
|
|
2747
|
+
*/
|
|
2748
|
+
this.onFocus = new EventEmitter();
|
|
2749
|
+
/**
|
|
2750
|
+
* Fires when files are selected. If prevented, the selected files will not be added to the list.
|
|
2751
|
+
*/
|
|
2752
|
+
this.select = new EventEmitter();
|
|
2753
|
+
/**
|
|
2754
|
+
* Fires when a file is about to be removed. If prevented, the file will remain in the list.
|
|
2755
|
+
*/
|
|
2756
|
+
this.remove = new EventEmitter();
|
|
2757
|
+
/**
|
|
2758
|
+
* Fires when the value of the component has changed as a result of a successful `select` or `remove` operation.
|
|
2759
|
+
*/
|
|
2760
|
+
this.valueChange = new EventEmitter();
|
|
2761
|
+
this.hostDefaultClasses = true;
|
|
2762
|
+
/**
|
|
2763
|
+
* @hidden
|
|
2764
|
+
*/
|
|
2765
|
+
this._restrictions = {
|
|
2766
|
+
allowedExtensions: [],
|
|
2767
|
+
maxFileSize: 0,
|
|
2768
|
+
minFileSize: 0
|
|
2769
|
+
};
|
|
2770
|
+
this.onTouchedCallback = (_) => { };
|
|
2771
|
+
this.onChangeCallback = (_) => { };
|
|
2772
|
+
validatePackage(packageMetadata);
|
|
2773
|
+
this.wrapper = wrapper.nativeElement;
|
|
2774
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
2775
|
+
this.navigation.computeKeys(this.direction);
|
|
2776
|
+
this.fileList = this.uploadService.files;
|
|
2777
|
+
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
2778
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
2779
|
+
this.navigation.computeKeys(this.direction);
|
|
2768
2780
|
});
|
|
2781
|
+
this.subscribeBlur();
|
|
2782
|
+
this.subscribeFocus();
|
|
2783
|
+
this.attachEventHandlers();
|
|
2784
|
+
this.setDefaultSettings();
|
|
2769
2785
|
}
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2786
|
+
/**
|
|
2787
|
+
* Sets the `name` attribute of the `input` element of the FileSelect.
|
|
2788
|
+
*/
|
|
2789
|
+
set name(name) {
|
|
2790
|
+
this.uploadService.async.saveField = name;
|
|
2773
2791
|
}
|
|
2774
|
-
|
|
2775
|
-
this.
|
|
2792
|
+
get name() {
|
|
2793
|
+
return this.uploadService.async.saveField;
|
|
2776
2794
|
}
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
}
|
|
2782
|
-
|
|
2795
|
+
/**
|
|
2796
|
+
* Sets the restrictions for selected files.
|
|
2797
|
+
*/
|
|
2798
|
+
set restrictions(restrictions) {
|
|
2799
|
+
let parsedRestrictions = Object.assign({}, this._restrictions, restrictions);
|
|
2800
|
+
this._restrictions = parsedRestrictions;
|
|
2783
2801
|
}
|
|
2784
|
-
get
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2802
|
+
get restrictions() {
|
|
2803
|
+
return this._restrictions;
|
|
2804
|
+
}
|
|
2805
|
+
get hostDisabledClass() {
|
|
2806
|
+
return this.disabled;
|
|
2807
|
+
}
|
|
2808
|
+
get dir() {
|
|
2809
|
+
return this.direction;
|
|
2810
|
+
}
|
|
2811
|
+
ngOnInit() {
|
|
2812
|
+
this.renderer.removeAttribute(this.wrapper, "tabindex");
|
|
2813
|
+
if (this.zoneId) {
|
|
2814
|
+
this.dropZoneService.addComponent(this, this.zoneId);
|
|
2792
2815
|
}
|
|
2793
|
-
return `${fileCount} ${this.textFor('filesBatchStatus')}`;
|
|
2794
2816
|
}
|
|
2795
|
-
|
|
2796
|
-
|
|
2817
|
+
/**
|
|
2818
|
+
* @hidden
|
|
2819
|
+
*/
|
|
2820
|
+
textFor(key) {
|
|
2821
|
+
return this.localization.get(key);
|
|
2797
2822
|
}
|
|
2798
|
-
|
|
2799
|
-
|
|
2823
|
+
/**
|
|
2824
|
+
* Focuses the underlying input element.
|
|
2825
|
+
*/
|
|
2826
|
+
focus() {
|
|
2827
|
+
setTimeout(() => {
|
|
2828
|
+
this.fileSelectButton.nativeElement.focus();
|
|
2829
|
+
});
|
|
2800
2830
|
}
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2831
|
+
ngOnDestroy() {
|
|
2832
|
+
this.fileList.clear();
|
|
2833
|
+
if (this.blurSubscription) {
|
|
2834
|
+
this.blurSubscription.unsubscribe();
|
|
2835
|
+
}
|
|
2836
|
+
if (this.wrapperFocusSubscription) {
|
|
2837
|
+
this.wrapperFocusSubscription.unsubscribe();
|
|
2838
|
+
}
|
|
2839
|
+
if (this.selectButtonFocusSubscription) {
|
|
2840
|
+
this.selectButtonFocusSubscription.unsubscribe();
|
|
2841
|
+
}
|
|
2842
|
+
if (this.localizationChangeSubscription) {
|
|
2843
|
+
this.localizationChangeSubscription.unsubscribe();
|
|
2844
|
+
}
|
|
2845
|
+
if (this.subs) {
|
|
2846
|
+
this.subs.unsubscribe();
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
/**
|
|
2850
|
+
* @hidden
|
|
2851
|
+
*/
|
|
2852
|
+
handleKeydown(event) {
|
|
2853
|
+
if (this.disabled) {
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2856
|
+
if ((event.keyCode === Keys.Enter || event.keyCode === Keys.Space) &&
|
|
2857
|
+
event.target === this.fileSelectButton.nativeElement) {
|
|
2858
|
+
event.preventDefault();
|
|
2859
|
+
this.fileSelect.nativeElement.click();
|
|
2860
|
+
return;
|
|
2861
|
+
}
|
|
2862
|
+
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
2863
|
+
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
2864
|
+
this.navigation.process(event);
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
/**
|
|
2868
|
+
* @hidden
|
|
2869
|
+
*/
|
|
2870
|
+
writeValue(newValue) {
|
|
2871
|
+
let isValid = true;
|
|
2872
|
+
if (newValue instanceof Array) {
|
|
2873
|
+
newValue.forEach((file) => {
|
|
2874
|
+
if (!validateInitialFileSelectFile(file)) {
|
|
2875
|
+
isValid = false;
|
|
2876
|
+
}
|
|
2877
|
+
});
|
|
2878
|
+
if (isValid) {
|
|
2879
|
+
this.uploadService.addInitialFileSelectFiles(newValue);
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
if (newValue === null) {
|
|
2883
|
+
this.fileList.clear();
|
|
2884
|
+
}
|
|
2885
|
+
this.cdr.markForCheck();
|
|
2886
|
+
}
|
|
2887
|
+
/**
|
|
2888
|
+
* @hidden
|
|
2889
|
+
*/
|
|
2890
|
+
registerOnChange(fn) {
|
|
2891
|
+
this.onChangeCallback = fn;
|
|
2892
|
+
}
|
|
2893
|
+
/**
|
|
2894
|
+
* @hidden
|
|
2895
|
+
*/
|
|
2896
|
+
registerOnTouched(fn) {
|
|
2897
|
+
this.onTouchedCallback = fn;
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* @hidden
|
|
2901
|
+
*/
|
|
2902
|
+
setDisabledState(isDisabled) {
|
|
2903
|
+
this.disabled = isDisabled;
|
|
2904
|
+
}
|
|
2905
|
+
/**
|
|
2906
|
+
* Removes specific file from the file list.
|
|
2907
|
+
*/
|
|
2908
|
+
removeFileByUid(uid) {
|
|
2909
|
+
this.uploadService.removeFiles(uid);
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Visually clears all files from the UI.
|
|
2913
|
+
*/
|
|
2914
|
+
clearFiles() {
|
|
2915
|
+
this.uploadService.clearFiles();
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* @hidden
|
|
2919
|
+
* Used to determine if the component is empty.
|
|
2920
|
+
*/
|
|
2921
|
+
isEmpty() {
|
|
2922
|
+
return false;
|
|
2923
|
+
}
|
|
2924
|
+
/**
|
|
2925
|
+
* @hidden
|
|
2926
|
+
* Used by the external dropzone to add files to the FileSelect
|
|
2927
|
+
*/
|
|
2928
|
+
addFiles(files) {
|
|
2929
|
+
this.uploadService.addFiles(files);
|
|
2930
|
+
}
|
|
2931
|
+
/**
|
|
2932
|
+
* @hidden
|
|
2933
|
+
*/
|
|
2934
|
+
get selectButtonTabIndex() {
|
|
2935
|
+
return this.disabled ? undefined : this.tabindex;
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* @hidden
|
|
2939
|
+
*/
|
|
2940
|
+
onFileSelectButtonFocus(_event) {
|
|
2941
|
+
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
2942
|
+
if (!this.navigation.focused) {
|
|
2943
|
+
this.navigation.focusedIndex = -1;
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
/**
|
|
2947
|
+
* @hidden
|
|
2948
|
+
*/
|
|
2949
|
+
onFileSelectButtonBlur(_event) {
|
|
2950
|
+
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-focus');
|
|
2951
|
+
}
|
|
2952
|
+
subscribeBlur() {
|
|
2953
|
+
if (!isDocumentAvailable()) {
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
this.ngZone.runOutsideAngular(() => {
|
|
2957
|
+
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
2958
|
+
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
2959
|
+
}));
|
|
2960
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTab).subscribe(() => {
|
|
2961
|
+
if (this.navigation.focused) {
|
|
2962
|
+
this.ngZone.run(() => {
|
|
2963
|
+
this.navigation.focused = false;
|
|
2964
|
+
this.onTouchedCallback();
|
|
2965
|
+
this.onBlur.emit();
|
|
2966
|
+
});
|
|
2967
|
+
}
|
|
2968
|
+
});
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
subscribeFocus() {
|
|
2972
|
+
this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(() => {
|
|
2973
|
+
this.onFocus.emit();
|
|
2974
|
+
});
|
|
2975
|
+
this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(() => {
|
|
2976
|
+
this.fileSelectButton.nativeElement.focus();
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2979
|
+
attachEventHandlers() {
|
|
2980
|
+
this.subs = this.uploadService.changeEvent.subscribe((files) => {
|
|
2981
|
+
let model = [];
|
|
2982
|
+
if (files !== null) {
|
|
2983
|
+
files.forEach((file) => {
|
|
2984
|
+
if (file.state === FileState.Initial) {
|
|
2985
|
+
model.push(file);
|
|
2986
|
+
}
|
|
2987
|
+
if (file.state === FileState.Selected && file.rawFile && !file.validationErrors) {
|
|
2988
|
+
model.push(file.rawFile);
|
|
2989
|
+
}
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
if (model.length === 0) {
|
|
2993
|
+
model = null;
|
|
2994
|
+
}
|
|
2995
|
+
this.onChangeCallback(model);
|
|
2996
|
+
this.valueChange.emit(model);
|
|
2997
|
+
});
|
|
2998
|
+
this.subs.add(this.uploadService.removeEvent.subscribe((args) => {
|
|
2999
|
+
this.remove.emit(args);
|
|
3000
|
+
}));
|
|
3001
|
+
this.subs.add(this.uploadService.selectEvent.subscribe((args) => {
|
|
3002
|
+
this.select.emit(args);
|
|
3003
|
+
}));
|
|
3004
|
+
}
|
|
3005
|
+
setDefaultSettings() {
|
|
3006
|
+
this.uploadService.async.autoUpload = false;
|
|
3007
|
+
this.uploadService.component = 'FileSelect';
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
FileSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }, { token: DropZoneService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3011
|
+
FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FileSelectComponent, selector: "kendo-fileselect", inputs: { accept: "accept", disabled: "disabled", multiple: "multiple", name: "name", showFileList: "showFileList", tabindex: "tabindex", restrictions: "restrictions", zoneId: "zoneId", focusableId: "focusableId" }, outputs: { onBlur: "blur", onFocus: "focus", select: "select", remove: "remove", valueChange: "valueChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class.k-widget": "this.hostDefaultClasses", "class.k-upload": "this.hostDefaultClasses", "class.k-disabled": "this.hostDisabledClass", "attr.dir": "this.dir" } }, providers: [
|
|
3012
|
+
LocalizationService,
|
|
3013
|
+
NavigationService,
|
|
3014
|
+
UploadService,
|
|
3015
|
+
DropZoneService,
|
|
3016
|
+
FILESELECT_VALUE_ACCESSOR,
|
|
3017
|
+
{
|
|
3018
|
+
provide: L10N_PREFIX,
|
|
3019
|
+
useValue: 'kendo.fileselect'
|
|
3020
|
+
},
|
|
3021
|
+
{
|
|
3022
|
+
provide: KendoInput,
|
|
3023
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
3024
|
+
}
|
|
3025
|
+
], queries: [{ propertyName: "fileTemplate", first: true, predicate: FileTemplateDirective, descendants: true }, { propertyName: "fileInfoTemplate", first: true, predicate: FileInfoTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "fileSelect", first: true, predicate: ["fileSelect"], descendants: true, static: true }, { propertyName: "fileSelectButton", first: true, predicate: ["fileSelectButton"], descendants: true, static: true }], exportAs: ["kendoFileSelect"], ngImport: i0, template: `
|
|
3026
|
+
<ng-container kendoFileSelectLocalizedMessages
|
|
3027
|
+
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
3028
|
+
dropFilesHere="Drop files here to select"
|
|
3029
|
+
|
|
3030
|
+
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
3031
|
+
invalidFileExtension="File type not allowed."
|
|
3032
|
+
|
|
3033
|
+
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
3034
|
+
invalidMaxFileSize="File size too large."
|
|
3035
|
+
|
|
3036
|
+
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
3037
|
+
invalidMinFileSize="File size too small."
|
|
3038
|
+
|
|
3039
|
+
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
3040
|
+
remove="Remove"
|
|
3041
|
+
|
|
3042
|
+
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
3043
|
+
select="Select files..."
|
|
3044
|
+
>
|
|
2852
3045
|
</ng-container>
|
|
2853
|
-
<
|
|
2854
|
-
[
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
3046
|
+
<div kendoFileSelectInternalDropZone
|
|
3047
|
+
[restrictions]="restrictions"
|
|
3048
|
+
[multiple]="multiple"
|
|
3049
|
+
[disabled]="disabled">
|
|
3050
|
+
<div role="button" #fileSelectButton
|
|
3051
|
+
[id]="focusableId"
|
|
3052
|
+
[attr.aria-label]="textFor('select')"
|
|
3053
|
+
[attr.tabindex]="selectButtonTabIndex"
|
|
3054
|
+
(focus)="onFileSelectButtonFocus($event)"
|
|
3055
|
+
(blur)="onFileSelectButtonBlur($event)"
|
|
3056
|
+
class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button">
|
|
3057
|
+
<input #fileSelect kendoFileSelect
|
|
3058
|
+
[attr.accept]="accept ? accept : null"
|
|
3059
|
+
[dir]="direction"
|
|
3060
|
+
[restrictions]="restrictions"
|
|
3061
|
+
[multiple]="multiple"
|
|
3062
|
+
[disabled]="disabled" />
|
|
3063
|
+
<span>{{textFor('select')}}</span>
|
|
3064
|
+
</div>
|
|
3065
|
+
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
3066
|
+
</div>
|
|
3067
|
+
<ul kendo-upload-file-list
|
|
3068
|
+
class="k-upload-files k-reset"
|
|
3069
|
+
*ngIf="showFileList && fileList.count > 0"
|
|
3070
|
+
[disabled]="disabled"
|
|
3071
|
+
[fileList]="fileList.files"
|
|
3072
|
+
[fileTemplate]="fileTemplate"
|
|
3073
|
+
[fileInfoTemplate]="fileInfoTemplate">
|
|
3074
|
+
</ul>
|
|
3075
|
+
`, isInline: true, components: [{ type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
3077
|
+
type: Component,
|
|
3078
|
+
args: [{
|
|
3079
|
+
exportAs: 'kendoFileSelect',
|
|
3080
|
+
providers: [
|
|
3081
|
+
LocalizationService,
|
|
3082
|
+
NavigationService,
|
|
3083
|
+
UploadService,
|
|
3084
|
+
DropZoneService,
|
|
3085
|
+
FILESELECT_VALUE_ACCESSOR,
|
|
3086
|
+
{
|
|
3087
|
+
provide: L10N_PREFIX,
|
|
3088
|
+
useValue: 'kendo.fileselect'
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
provide: KendoInput,
|
|
3092
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
3093
|
+
}
|
|
3094
|
+
],
|
|
3095
|
+
selector: 'kendo-fileselect',
|
|
3096
|
+
template: `
|
|
3097
|
+
<ng-container kendoFileSelectLocalizedMessages
|
|
3098
|
+
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
3099
|
+
dropFilesHere="Drop files here to select"
|
|
3100
|
+
|
|
3101
|
+
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
3102
|
+
invalidFileExtension="File type not allowed."
|
|
3103
|
+
|
|
3104
|
+
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
3105
|
+
invalidMaxFileSize="File size too large."
|
|
3106
|
+
|
|
3107
|
+
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
3108
|
+
invalidMinFileSize="File size too small."
|
|
3109
|
+
|
|
3110
|
+
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
3111
|
+
remove="Remove"
|
|
3112
|
+
|
|
3113
|
+
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
3114
|
+
select="Select files..."
|
|
3115
|
+
>
|
|
3116
|
+
</ng-container>
|
|
3117
|
+
<div kendoFileSelectInternalDropZone
|
|
3118
|
+
[restrictions]="restrictions"
|
|
3119
|
+
[multiple]="multiple"
|
|
3120
|
+
[disabled]="disabled">
|
|
3121
|
+
<div role="button" #fileSelectButton
|
|
3122
|
+
[id]="focusableId"
|
|
3123
|
+
[attr.aria-label]="textFor('select')"
|
|
3124
|
+
[attr.tabindex]="selectButtonTabIndex"
|
|
3125
|
+
(focus)="onFileSelectButtonFocus($event)"
|
|
3126
|
+
(blur)="onFileSelectButtonBlur($event)"
|
|
3127
|
+
class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button">
|
|
3128
|
+
<input #fileSelect kendoFileSelect
|
|
3129
|
+
[attr.accept]="accept ? accept : null"
|
|
3130
|
+
[dir]="direction"
|
|
3131
|
+
[restrictions]="restrictions"
|
|
3132
|
+
[multiple]="multiple"
|
|
3133
|
+
[disabled]="disabled" />
|
|
3134
|
+
<span>{{textFor('select')}}</span>
|
|
3135
|
+
</div>
|
|
3136
|
+
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
3137
|
+
</div>
|
|
3138
|
+
<ul kendo-upload-file-list
|
|
3139
|
+
class="k-upload-files k-reset"
|
|
3140
|
+
*ngIf="showFileList && fileList.count > 0"
|
|
3141
|
+
[disabled]="disabled"
|
|
3142
|
+
[fileList]="fileList.files"
|
|
3143
|
+
[fileTemplate]="fileTemplate"
|
|
3144
|
+
[fileInfoTemplate]="fileInfoTemplate">
|
|
3145
|
+
</ul>
|
|
2866
3146
|
`
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
],
|
|
3147
|
+
}]
|
|
3148
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }, { type: DropZoneService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { accept: [{
|
|
3149
|
+
type: Input
|
|
3150
|
+
}], disabled: [{
|
|
3151
|
+
type: Input
|
|
3152
|
+
}], multiple: [{
|
|
3153
|
+
type: Input
|
|
3154
|
+
}], name: [{
|
|
3155
|
+
type: Input
|
|
3156
|
+
}], showFileList: [{
|
|
3157
|
+
type: Input
|
|
3158
|
+
}], tabindex: [{
|
|
3159
|
+
type: Input
|
|
3160
|
+
}], restrictions: [{
|
|
3161
|
+
type: Input
|
|
3162
|
+
}], zoneId: [{
|
|
3163
|
+
type: Input
|
|
3164
|
+
}], focusableId: [{
|
|
3165
|
+
type: Input
|
|
3166
|
+
}], fileTemplate: [{
|
|
3167
|
+
type: ContentChild,
|
|
3168
|
+
args: [FileTemplateDirective, { static: false }]
|
|
3169
|
+
}], fileInfoTemplate: [{
|
|
3170
|
+
type: ContentChild,
|
|
3171
|
+
args: [FileInfoTemplateDirective, { static: false }]
|
|
3172
|
+
}], fileSelect: [{
|
|
3173
|
+
type: ViewChild,
|
|
3174
|
+
args: ['fileSelect', { static: true }]
|
|
3175
|
+
}], fileSelectButton: [{
|
|
3176
|
+
type: ViewChild,
|
|
3177
|
+
args: ['fileSelectButton', { static: true }]
|
|
3178
|
+
}], onBlur: [{
|
|
3179
|
+
type: Output,
|
|
3180
|
+
args: ['blur']
|
|
3181
|
+
}], onFocus: [{
|
|
3182
|
+
type: Output,
|
|
3183
|
+
args: ['focus']
|
|
3184
|
+
}], select: [{
|
|
3185
|
+
type: Output
|
|
3186
|
+
}], remove: [{
|
|
3187
|
+
type: Output
|
|
3188
|
+
}], valueChange: [{
|
|
3189
|
+
type: Output
|
|
3190
|
+
}], hostDefaultClasses: [{
|
|
3191
|
+
type: HostBinding,
|
|
3192
|
+
args: ['class.k-widget']
|
|
3193
|
+
}, {
|
|
3194
|
+
type: HostBinding,
|
|
3195
|
+
args: ['class.k-upload']
|
|
3196
|
+
}], hostDisabledClass: [{
|
|
3197
|
+
type: HostBinding,
|
|
3198
|
+
args: ['class.k-disabled']
|
|
3199
|
+
}], dir: [{
|
|
3200
|
+
type: HostBinding,
|
|
3201
|
+
args: ['attr.dir']
|
|
3202
|
+
}], handleKeydown: [{
|
|
3203
|
+
type: HostListener,
|
|
3204
|
+
args: ['keydown', ['$event']]
|
|
3205
|
+
}] } });
|
|
3206
|
+
|
|
3207
|
+
/**
|
|
3208
|
+
* Custom component messages override default component messages ([more information and example]({% slug globalization_upload %})).
|
|
3209
|
+
*
|
|
3210
|
+
* @example
|
|
3211
|
+
* ```html-no-run
|
|
3212
|
+
* <kendo-fileselect>
|
|
3213
|
+
* <kendo-fileselect-messages
|
|
3214
|
+
* dropFilesHere="Drop your file here"
|
|
3215
|
+
* select="Upload file">
|
|
3216
|
+
* </kendo-fileselect-messages>
|
|
3217
|
+
* </kendo-fileselect>
|
|
3218
|
+
* ```
|
|
3219
|
+
*/
|
|
3220
|
+
class CustomMessagesComponent extends Messages {
|
|
3221
|
+
constructor(service) {
|
|
3222
|
+
super();
|
|
3223
|
+
this.service = service;
|
|
3224
|
+
}
|
|
3225
|
+
get override() {
|
|
3226
|
+
return true;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3230
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CustomMessagesComponent, selector: "kendo-upload-messages, kendo-fileselect-messages, kendo-uploaddropzone-messages", providers: [
|
|
3231
|
+
{
|
|
3232
|
+
provide: Messages,
|
|
3233
|
+
useExisting: forwardRef(() => CustomMessagesComponent) // eslint-disable-line no-forward-ref
|
|
3234
|
+
}
|
|
3235
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
3236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
3237
|
+
type: Component,
|
|
3238
|
+
args: [{
|
|
3239
|
+
providers: [
|
|
3240
|
+
{
|
|
3241
|
+
provide: Messages,
|
|
3242
|
+
useExisting: forwardRef(() => CustomMessagesComponent) // eslint-disable-line no-forward-ref
|
|
3243
|
+
}
|
|
3244
|
+
],
|
|
3245
|
+
selector: 'kendo-upload-messages, kendo-fileselect-messages, kendo-uploaddropzone-messages',
|
|
3246
|
+
template: ``
|
|
3247
|
+
}]
|
|
3248
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
2871
3249
|
|
|
2872
3250
|
/**
|
|
2873
3251
|
* @hidden
|
|
2874
3252
|
*/
|
|
2875
|
-
|
|
2876
|
-
constructor(localization
|
|
2877
|
-
super(uploadService);
|
|
3253
|
+
class UploadStatusTotalComponent {
|
|
3254
|
+
constructor(localization) {
|
|
2878
3255
|
this.localization = localization;
|
|
2879
|
-
this.subscribeUploadProgress((args) => {
|
|
2880
|
-
if (args.files[0].uid === this.file.uid) {
|
|
2881
|
-
this.progressComplete = args.percentComplete;
|
|
2882
|
-
}
|
|
2883
|
-
});
|
|
2884
3256
|
}
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
return `${this.textFor('fileStatusFailed')}`;
|
|
3257
|
+
ngDoCheck() {
|
|
3258
|
+
this.isPaused = this.fileList.hasFileWithState([FileState.Paused]);
|
|
3259
|
+
this.isFailed = this.fileList.hasFileWithState([FileState.Failed]);
|
|
3260
|
+
this.isUploading = this.fileList.hasFileWithState([FileState.Uploading]);
|
|
3261
|
+
if (this.isPaused && !this.isUploading) {
|
|
3262
|
+
this.statusText = this.localization.get('headerStatusPaused');
|
|
2892
3263
|
}
|
|
2893
|
-
|
|
2894
|
-
|
|
3264
|
+
else {
|
|
3265
|
+
this.statusText = this.isUploading ? this.localization.get('headerStatusUploading')
|
|
3266
|
+
: this.localization.get('headerStatusUploaded');
|
|
2895
3267
|
}
|
|
2896
|
-
return this.getFileValidationMessage(this.file);
|
|
2897
|
-
}
|
|
2898
|
-
get showProgress() {
|
|
2899
|
-
const showProgress = this.file.state === FileState.Uploading || this.file.state === FileState.Paused;
|
|
2900
|
-
return showProgress ? 'active' : 'inactive';
|
|
2901
|
-
}
|
|
2902
|
-
get fileGroupClass() {
|
|
2903
|
-
return getFileGroupCssClass(this.file.extension ? this.file.extension : '');
|
|
2904
|
-
}
|
|
2905
|
-
get isUploadSuccessful() {
|
|
2906
|
-
return this.file.state === FileState.Uploaded;
|
|
2907
|
-
}
|
|
2908
|
-
get isUploadFailed() {
|
|
2909
|
-
return this.file.state === FileState.Failed;
|
|
2910
3268
|
}
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
Input(),
|
|
2921
|
-
__metadata("design:type", Object)
|
|
2922
|
-
], FileListSingleItemComponent.prototype, "file", void 0);
|
|
2923
|
-
__decorate([
|
|
2924
|
-
Input(),
|
|
2925
|
-
__metadata("design:type", FileInfoTemplateDirective)
|
|
2926
|
-
], FileListSingleItemComponent.prototype, "fileInfoTemplate", void 0);
|
|
2927
|
-
FileListSingleItemComponent = __decorate([
|
|
2928
|
-
Component({
|
|
2929
|
-
animations: [
|
|
2930
|
-
trigger('progressState', [
|
|
2931
|
-
state('active', style({ opacity: 1 })),
|
|
2932
|
-
state('inactive', style({ opacity: 0 })),
|
|
2933
|
-
transition('void => active', style({ opacity: 0 })),
|
|
2934
|
-
transition('inactive => active', style({ opacity: 1 })),
|
|
2935
|
-
transition('active => inactive', animate('1s 2s ease-out'))
|
|
2936
|
-
])
|
|
2937
|
-
],
|
|
2938
|
-
selector: 'kendo-upload-file-list-single-item',
|
|
2939
|
-
template: `
|
|
2940
|
-
<div class="k-progressbar" [@progressState]="showProgress">
|
|
2941
|
-
<span class="k-progress" [style.width]="progressComplete + '%'"></span>
|
|
2942
|
-
</div>
|
|
2943
|
-
<span class="k-file-group-wrapper">
|
|
2944
|
-
<span class="k-file-group k-icon" [ngClass]="fileGroupClass"></span>
|
|
2945
|
-
</span>
|
|
2946
|
-
<span class="k-file-name-size-wrapper">
|
|
2947
|
-
<ng-container *ngIf="!fileInfoTemplate">
|
|
2948
|
-
<span class="k-file-name" [title]="file.name">{{ file.name }}</span>
|
|
2949
|
-
<span [ngClass]="{
|
|
2950
|
-
'k-file-validation-message': file.validationErrors,
|
|
2951
|
-
'k-file-size': !file.validationErrors && isNotYetUploaded,
|
|
2952
|
-
'k-text-success': isUploadSuccessful,
|
|
2953
|
-
'k-text-error': file.validationErrors || isUploadFailed,
|
|
2954
|
-
'k-file-information': isUploadSuccessful || isUploadFailed
|
|
2955
|
-
}"
|
|
2956
|
-
>{{fileStatusText}}</span>
|
|
2957
|
-
</ng-container>
|
|
2958
|
-
<ng-template *ngIf="fileInfoTemplate"
|
|
2959
|
-
[templateContext]="{
|
|
2960
|
-
templateRef: fileInfoTemplate.templateRef,
|
|
2961
|
-
state: file.state,
|
|
2962
|
-
$implicit: [file]
|
|
3269
|
+
}
|
|
3270
|
+
UploadStatusTotalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadStatusTotalComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3271
|
+
UploadStatusTotalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: { fileList: "fileList" }, ngImport: i0, template: `
|
|
3272
|
+
<span class="k-icon"
|
|
3273
|
+
[ngClass]="{
|
|
3274
|
+
'k-i-checkmark': !this.isUploading && !this.isFailed,
|
|
3275
|
+
'k-i-exception': !this.isUploading && this.isFailed,
|
|
3276
|
+
'k-i-upload': this.isUploading,
|
|
3277
|
+
'k-i-pause-sm': this.isPaused
|
|
2963
3278
|
}">
|
|
2964
|
-
</
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
3279
|
+
</span>
|
|
3280
|
+
{{statusText}}
|
|
3281
|
+
`, isInline: true, directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
3282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadStatusTotalComponent, decorators: [{
|
|
3283
|
+
type: Component,
|
|
3284
|
+
args: [{
|
|
3285
|
+
selector: 'kendo-upload-status-total',
|
|
3286
|
+
template: `
|
|
3287
|
+
<span class="k-icon"
|
|
3288
|
+
[ngClass]="{
|
|
3289
|
+
'k-i-checkmark': !this.isUploading && !this.isFailed,
|
|
3290
|
+
'k-i-exception': !this.isUploading && this.isFailed,
|
|
3291
|
+
'k-i-upload': this.isUploading,
|
|
3292
|
+
'k-i-pause-sm': this.isPaused
|
|
3293
|
+
}">
|
|
3294
|
+
</span>
|
|
3295
|
+
{{statusText}}
|
|
2971
3296
|
`
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3297
|
+
}]
|
|
3298
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; }, propDecorators: { fileList: [{
|
|
3299
|
+
type: Input
|
|
3300
|
+
}] } });
|
|
2975
3301
|
|
|
2976
3302
|
/**
|
|
2977
3303
|
* @hidden
|
|
2978
3304
|
*/
|
|
2979
|
-
|
|
2980
|
-
constructor(uploadService,
|
|
3305
|
+
class UploadActionButtonsComponent {
|
|
3306
|
+
constructor(uploadService, localization, navigation) {
|
|
2981
3307
|
this.uploadService = uploadService;
|
|
3308
|
+
this.localization = localization;
|
|
2982
3309
|
this.navigation = navigation;
|
|
2983
|
-
this.
|
|
2984
|
-
this.
|
|
2985
|
-
this.
|
|
2986
|
-
this.element = el;
|
|
3310
|
+
this.hostDefaultClass = true;
|
|
3311
|
+
this.onAction();
|
|
3312
|
+
this.onFocus();
|
|
2987
3313
|
}
|
|
2988
|
-
get
|
|
2989
|
-
return this.
|
|
3314
|
+
get actionButtonsEndClassName() {
|
|
3315
|
+
return this.actionsLayout === 'end';
|
|
2990
3316
|
}
|
|
2991
|
-
get
|
|
2992
|
-
return this.
|
|
3317
|
+
get actionButtonsStretchedClassName() {
|
|
3318
|
+
return this.actionsLayout === 'stretched';
|
|
2993
3319
|
}
|
|
2994
|
-
get
|
|
2995
|
-
return this.
|
|
3320
|
+
get actionButtonsStartClassName() {
|
|
3321
|
+
return this.actionsLayout === 'start';
|
|
2996
3322
|
}
|
|
2997
|
-
get
|
|
2998
|
-
return this.
|
|
3323
|
+
get actionButtonsCenterClassName() {
|
|
3324
|
+
return this.actionsLayout === 'center';
|
|
2999
3325
|
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
this.uploadService.clearFiles();
|
|
3009
|
-
}
|
|
3010
|
-
this.uploadService.addFiles(selectedFiles);
|
|
3011
|
-
/*
|
|
3012
|
-
Chrome, IE, Edge and Safari do not trigger a `change` event
|
|
3013
|
-
when a file with the same name is selected a number of consecutive times.
|
|
3014
|
-
As a workaround, clear the input value after handling the file.
|
|
3015
|
-
*/
|
|
3016
|
-
const native = this.element.nativeElement;
|
|
3017
|
-
if (ua.match(webkit) || ua.match(ie)) {
|
|
3018
|
-
native.type = "";
|
|
3019
|
-
native.type = "file";
|
|
3020
|
-
}
|
|
3021
|
-
setTimeout(() => {
|
|
3022
|
-
this.navigation.focusedIndex = -1;
|
|
3326
|
+
onAction() {
|
|
3327
|
+
this.actionSubscription = this.navigation.onActionButtonAction.subscribe((button) => {
|
|
3328
|
+
if (button === "clear") {
|
|
3329
|
+
this.clearFiles();
|
|
3330
|
+
}
|
|
3331
|
+
else {
|
|
3332
|
+
this.performUpload();
|
|
3333
|
+
}
|
|
3023
3334
|
});
|
|
3024
3335
|
}
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
], FileSelectDirective.prototype, "dir", void 0);
|
|
3030
|
-
__decorate([
|
|
3031
|
-
Input(),
|
|
3032
|
-
__metadata("design:type", Boolean)
|
|
3033
|
-
], FileSelectDirective.prototype, "disabled", void 0);
|
|
3034
|
-
__decorate([
|
|
3035
|
-
Input(),
|
|
3036
|
-
__metadata("design:type", Boolean)
|
|
3037
|
-
], FileSelectDirective.prototype, "multiple", void 0);
|
|
3038
|
-
__decorate([
|
|
3039
|
-
Input(),
|
|
3040
|
-
__metadata("design:type", Object)
|
|
3041
|
-
], FileSelectDirective.prototype, "restrictions", void 0);
|
|
3042
|
-
__decorate([
|
|
3043
|
-
HostBinding("attr.type"),
|
|
3044
|
-
__metadata("design:type", String)
|
|
3045
|
-
], FileSelectDirective.prototype, "type", void 0);
|
|
3046
|
-
__decorate([
|
|
3047
|
-
HostBinding("attr.autocomplete"),
|
|
3048
|
-
__metadata("design:type", String)
|
|
3049
|
-
], FileSelectDirective.prototype, "autocomplete", void 0);
|
|
3050
|
-
__decorate([
|
|
3051
|
-
HostBinding("attr.tabindex"),
|
|
3052
|
-
__metadata("design:type", Number)
|
|
3053
|
-
], FileSelectDirective.prototype, "tabIndex", void 0);
|
|
3054
|
-
__decorate([
|
|
3055
|
-
HostBinding("attr.name"),
|
|
3056
|
-
__metadata("design:type", String),
|
|
3057
|
-
__metadata("design:paramtypes", [])
|
|
3058
|
-
], FileSelectDirective.prototype, "nameAttribute", null);
|
|
3059
|
-
__decorate([
|
|
3060
|
-
HostBinding("attr.multiple"),
|
|
3061
|
-
__metadata("design:type", String),
|
|
3062
|
-
__metadata("design:paramtypes", [])
|
|
3063
|
-
], FileSelectDirective.prototype, "multipleAttribute", null);
|
|
3064
|
-
__decorate([
|
|
3065
|
-
HostBinding("attr.dir"),
|
|
3066
|
-
__metadata("design:type", String),
|
|
3067
|
-
__metadata("design:paramtypes", [])
|
|
3068
|
-
], FileSelectDirective.prototype, "dirAttribute", null);
|
|
3069
|
-
__decorate([
|
|
3070
|
-
HostBinding("attr.disabled"),
|
|
3071
|
-
__metadata("design:type", String),
|
|
3072
|
-
__metadata("design:paramtypes", [])
|
|
3073
|
-
], FileSelectDirective.prototype, "disabledAttribute", null);
|
|
3074
|
-
__decorate([
|
|
3075
|
-
HostListener("change", ["$event"]),
|
|
3076
|
-
__metadata("design:type", Function),
|
|
3077
|
-
__metadata("design:paramtypes", [Object]),
|
|
3078
|
-
__metadata("design:returntype", void 0)
|
|
3079
|
-
], FileSelectDirective.prototype, "onInputChange", null);
|
|
3080
|
-
FileSelectDirective = __decorate([
|
|
3081
|
-
Directive({
|
|
3082
|
-
selector: '[kendoFileSelect]'
|
|
3083
|
-
}),
|
|
3084
|
-
__metadata("design:paramtypes", [UploadService,
|
|
3085
|
-
NavigationService,
|
|
3086
|
-
ElementRef])
|
|
3087
|
-
], FileSelectDirective);
|
|
3088
|
-
|
|
3089
|
-
var LocalizedMessagesDirective_1;
|
|
3090
|
-
/**
|
|
3091
|
-
* @hidden
|
|
3092
|
-
*/
|
|
3093
|
-
let LocalizedMessagesDirective = LocalizedMessagesDirective_1 = class LocalizedMessagesDirective extends Messages {
|
|
3094
|
-
constructor(service) {
|
|
3095
|
-
super();
|
|
3096
|
-
this.service = service;
|
|
3336
|
+
onFocus() {
|
|
3337
|
+
this.focusSubscription = this.navigation.onActionButtonFocus.subscribe((button) => {
|
|
3338
|
+
this.focusButton(button);
|
|
3339
|
+
});
|
|
3097
3340
|
}
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
providers: [
|
|
3102
|
-
{
|
|
3103
|
-
provide: Messages,
|
|
3104
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective_1) // tslint:disable-line:no-forward-ref
|
|
3105
|
-
}
|
|
3106
|
-
],
|
|
3107
|
-
selector: `
|
|
3108
|
-
[kendoUploadLocalizedMessages],
|
|
3109
|
-
[kendoFileSelectLocalizedMessages],
|
|
3110
|
-
[kendoUploadDropZoneLocalizedMessages]
|
|
3111
|
-
`
|
|
3112
|
-
}),
|
|
3113
|
-
__metadata("design:paramtypes", [LocalizationService])
|
|
3114
|
-
], LocalizedMessagesDirective);
|
|
3115
|
-
|
|
3116
|
-
/**
|
|
3117
|
-
* @hidden
|
|
3118
|
-
*/
|
|
3119
|
-
let TemplateContextDirective = class TemplateContextDirective {
|
|
3120
|
-
constructor(viewContainerRef) {
|
|
3121
|
-
this.viewContainerRef = viewContainerRef;
|
|
3341
|
+
focusButton(button) {
|
|
3342
|
+
const el = (button === "clear") ? this.clearButton : this.uploadButton;
|
|
3343
|
+
el.nativeElement.focus();
|
|
3122
3344
|
}
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3345
|
+
ngOnDestroy() {
|
|
3346
|
+
this.actionSubscription.unsubscribe();
|
|
3347
|
+
this.focusSubscription.unsubscribe();
|
|
3348
|
+
}
|
|
3349
|
+
onUploadButtonClick(event) {
|
|
3350
|
+
event.stopImmediatePropagation();
|
|
3351
|
+
this.performUpload();
|
|
3352
|
+
}
|
|
3353
|
+
performUpload() {
|
|
3354
|
+
if (!this.disabled) {
|
|
3355
|
+
this.uploadService.uploadFiles();
|
|
3356
|
+
this.navigation.focusSelectButton();
|
|
3127
3357
|
}
|
|
3128
|
-
|
|
3129
|
-
|
|
3358
|
+
}
|
|
3359
|
+
onClearButtonClick(event) {
|
|
3360
|
+
event.stopImmediatePropagation();
|
|
3361
|
+
this.clearFiles();
|
|
3362
|
+
}
|
|
3363
|
+
clearFiles() {
|
|
3364
|
+
if (!this.disabled) {
|
|
3365
|
+
this.uploadService.clearFiles();
|
|
3366
|
+
this.navigation.focusSelectButton();
|
|
3130
3367
|
}
|
|
3131
3368
|
}
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3369
|
+
textFor(key) {
|
|
3370
|
+
return this.localization.get(key);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
UploadActionButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadActionButtonsComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3374
|
+
UploadActionButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: { disabled: "disabled", actionsLayout: "actionsLayout" }, host: { properties: { "class.k-actions": "this.hostDefaultClass", "class.k-actions-end": "this.actionButtonsEndClassName", "class.k-actions-stretched": "this.actionButtonsStretchedClassName", "class.k-actions-start": "this.actionButtonsStartClassName", "class.k-actions-center": "this.actionButtonsCenterClassName" } }, viewQueries: [{ propertyName: "clearButton", first: true, predicate: ["clearButton"], descendants: true, static: true }, { propertyName: "uploadButton", first: true, predicate: ["uploadButton"], descendants: true, static: true }], ngImport: i0, template: `
|
|
3375
|
+
<button #clearButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-clear-selected"
|
|
3376
|
+
[attr.tabIndex]="-1"
|
|
3377
|
+
(click)="onClearButtonClick($event)">
|
|
3378
|
+
{{textFor('clearSelectedFiles')}}
|
|
3379
|
+
</button>
|
|
3380
|
+
<button #uploadButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3381
|
+
[attr.tabIndex]="-1"
|
|
3382
|
+
(click)="onUploadButtonClick($event)">
|
|
3383
|
+
{{textFor('uploadSelectedFiles')}}
|
|
3384
|
+
</button>
|
|
3385
|
+
`, isInline: true });
|
|
3386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadActionButtonsComponent, decorators: [{
|
|
3387
|
+
type: Component,
|
|
3388
|
+
args: [{
|
|
3389
|
+
selector: 'kendo-upload-action-buttons',
|
|
3390
|
+
template: `
|
|
3391
|
+
<button #clearButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-clear-selected"
|
|
3392
|
+
[attr.tabIndex]="-1"
|
|
3393
|
+
(click)="onClearButtonClick($event)">
|
|
3394
|
+
{{textFor('clearSelectedFiles')}}
|
|
3395
|
+
</button>
|
|
3396
|
+
<button #uploadButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3397
|
+
[attr.tabIndex]="-1"
|
|
3398
|
+
(click)="onUploadButtonClick($event)">
|
|
3399
|
+
{{textFor('uploadSelectedFiles')}}
|
|
3400
|
+
</button>
|
|
3401
|
+
`
|
|
3402
|
+
}]
|
|
3403
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }]; }, propDecorators: { disabled: [{
|
|
3404
|
+
type: Input
|
|
3405
|
+
}], actionsLayout: [{
|
|
3406
|
+
type: Input
|
|
3407
|
+
}], clearButton: [{
|
|
3408
|
+
type: ViewChild,
|
|
3409
|
+
args: ['clearButton', { static: true }]
|
|
3410
|
+
}], uploadButton: [{
|
|
3411
|
+
type: ViewChild,
|
|
3412
|
+
args: ['uploadButton', { static: true }]
|
|
3413
|
+
}], hostDefaultClass: [{
|
|
3414
|
+
type: HostBinding,
|
|
3415
|
+
args: ['class.k-actions']
|
|
3416
|
+
}], actionButtonsEndClassName: [{
|
|
3417
|
+
type: HostBinding,
|
|
3418
|
+
args: ['class.k-actions-end']
|
|
3419
|
+
}], actionButtonsStretchedClassName: [{
|
|
3420
|
+
type: HostBinding,
|
|
3421
|
+
args: ['class.k-actions-stretched']
|
|
3422
|
+
}], actionButtonsStartClassName: [{
|
|
3423
|
+
type: HostBinding,
|
|
3424
|
+
args: ['class.k-actions-start']
|
|
3425
|
+
}], actionButtonsCenterClassName: [{
|
|
3426
|
+
type: HostBinding,
|
|
3427
|
+
args: ['class.k-actions-center']
|
|
3428
|
+
}] } });
|
|
3144
3429
|
|
|
3145
|
-
|
|
3146
|
-
/* tslint:disable: no-use-before-declare */
|
|
3430
|
+
/* eslint-disable no-use-before-declare */
|
|
3147
3431
|
/**
|
|
3148
3432
|
* @hidden
|
|
3149
3433
|
*/
|
|
3150
3434
|
const UPLOAD_VALUE_ACCESSOR = {
|
|
3151
3435
|
multi: true,
|
|
3152
3436
|
provide: NG_VALUE_ACCESSOR,
|
|
3153
|
-
useExisting: forwardRef(() => UploadComponent) //
|
|
3437
|
+
useExisting: forwardRef(() => UploadComponent) // eslint-disable-line no-forward-ref
|
|
3154
3438
|
};
|
|
3155
3439
|
/**
|
|
3156
3440
|
* Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
|
|
3157
3441
|
*/
|
|
3158
|
-
|
|
3442
|
+
class UploadComponent {
|
|
3159
3443
|
constructor(uploadService, localization, navigation, dropZoneService, _ngZone, renderer, cdr, wrapper) {
|
|
3160
3444
|
this.uploadService = uploadService;
|
|
3161
3445
|
this.localization = localization;
|
|
@@ -3764,231 +4048,145 @@ let UploadComponent = UploadComponent_1 = class UploadComponent {
|
|
|
3764
4048
|
this.uploadProgress.emit(args);
|
|
3765
4049
|
}));
|
|
3766
4050
|
}
|
|
3767
|
-
}
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
]
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
]
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
]
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
]
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
]
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
], UploadComponent.prototype, "clear", void 0);
|
|
3907
|
-
__decorate([
|
|
3908
|
-
Output(),
|
|
3909
|
-
__metadata("design:type", EventEmitter)
|
|
3910
|
-
], UploadComponent.prototype, "complete", void 0);
|
|
3911
|
-
__decorate([
|
|
3912
|
-
Output(),
|
|
3913
|
-
__metadata("design:type", EventEmitter)
|
|
3914
|
-
], UploadComponent.prototype, "error", void 0);
|
|
3915
|
-
__decorate([
|
|
3916
|
-
Output('focus'),
|
|
3917
|
-
__metadata("design:type", EventEmitter)
|
|
3918
|
-
], UploadComponent.prototype, "onFocus", void 0);
|
|
3919
|
-
__decorate([
|
|
3920
|
-
Output(),
|
|
3921
|
-
__metadata("design:type", EventEmitter)
|
|
3922
|
-
], UploadComponent.prototype, "pause", void 0);
|
|
3923
|
-
__decorate([
|
|
3924
|
-
Output(),
|
|
3925
|
-
__metadata("design:type", EventEmitter)
|
|
3926
|
-
], UploadComponent.prototype, "remove", void 0);
|
|
3927
|
-
__decorate([
|
|
3928
|
-
Output(),
|
|
3929
|
-
__metadata("design:type", EventEmitter)
|
|
3930
|
-
], UploadComponent.prototype, "resume", void 0);
|
|
3931
|
-
__decorate([
|
|
3932
|
-
Output(),
|
|
3933
|
-
__metadata("design:type", EventEmitter)
|
|
3934
|
-
], UploadComponent.prototype, "select", void 0);
|
|
3935
|
-
__decorate([
|
|
3936
|
-
Output(),
|
|
3937
|
-
__metadata("design:type", EventEmitter)
|
|
3938
|
-
], UploadComponent.prototype, "success", void 0);
|
|
3939
|
-
__decorate([
|
|
3940
|
-
Output(),
|
|
3941
|
-
__metadata("design:type", EventEmitter)
|
|
3942
|
-
], UploadComponent.prototype, "upload", void 0);
|
|
3943
|
-
__decorate([
|
|
3944
|
-
Output(),
|
|
3945
|
-
__metadata("design:type", EventEmitter)
|
|
3946
|
-
], UploadComponent.prototype, "uploadProgress", void 0);
|
|
3947
|
-
__decorate([
|
|
3948
|
-
Output(),
|
|
3949
|
-
__metadata("design:type", EventEmitter)
|
|
3950
|
-
], UploadComponent.prototype, "valueChange", void 0);
|
|
3951
|
-
__decorate([
|
|
3952
|
-
HostBinding('class.k-widget'),
|
|
3953
|
-
HostBinding('class.k-upload'),
|
|
3954
|
-
__metadata("design:type", Boolean)
|
|
3955
|
-
], UploadComponent.prototype, "hostDefaultClasses", void 0);
|
|
3956
|
-
__decorate([
|
|
3957
|
-
HostBinding('class.k-disabled'),
|
|
3958
|
-
__metadata("design:type", Boolean),
|
|
3959
|
-
__metadata("design:paramtypes", [])
|
|
3960
|
-
], UploadComponent.prototype, "hostDisabledClass", null);
|
|
3961
|
-
__decorate([
|
|
3962
|
-
HostBinding('attr.dir'),
|
|
3963
|
-
__metadata("design:type", String),
|
|
3964
|
-
__metadata("design:paramtypes", [])
|
|
3965
|
-
], UploadComponent.prototype, "dir", null);
|
|
3966
|
-
__decorate([
|
|
3967
|
-
HostListener('keydown', ['$event']),
|
|
3968
|
-
__metadata("design:type", Function),
|
|
3969
|
-
__metadata("design:paramtypes", [Object]),
|
|
3970
|
-
__metadata("design:returntype", void 0)
|
|
3971
|
-
], UploadComponent.prototype, "handleKeydown", null);
|
|
3972
|
-
UploadComponent = UploadComponent_1 = __decorate([
|
|
3973
|
-
Component({
|
|
3974
|
-
exportAs: 'kendoUpload',
|
|
3975
|
-
providers: [
|
|
3976
|
-
LocalizationService,
|
|
3977
|
-
NavigationService,
|
|
3978
|
-
UploadService,
|
|
3979
|
-
DropZoneService,
|
|
3980
|
-
UPLOAD_VALUE_ACCESSOR,
|
|
3981
|
-
{
|
|
3982
|
-
provide: L10N_PREFIX,
|
|
3983
|
-
useValue: 'kendo.upload'
|
|
3984
|
-
},
|
|
3985
|
-
{
|
|
3986
|
-
provide: KendoInput,
|
|
3987
|
-
useExisting: forwardRef(() => UploadComponent_1)
|
|
3988
|
-
}
|
|
3989
|
-
],
|
|
3990
|
-
selector: 'kendo-upload',
|
|
3991
|
-
template: `
|
|
4051
|
+
}
|
|
4052
|
+
UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }, { token: DropZoneService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4053
|
+
UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: UploadComponent, selector: "kendo-upload", inputs: { autoUpload: "autoUpload", batch: "batch", withCredentials: "withCredentials", saveField: "saveField", saveHeaders: "saveHeaders", saveMethod: "saveMethod", saveUrl: "saveUrl", responseType: "responseType", removeField: "removeField", removeHeaders: "removeHeaders", removeMethod: "removeMethod", removeUrl: "removeUrl", chunkable: "chunkable", concurrent: "concurrent", multiple: "multiple", disabled: "disabled", showFileList: "showFileList", tabindex: "tabindex", zoneId: "zoneId", tabIndex: "tabIndex", accept: "accept", restrictions: "restrictions", focusableId: "focusableId", actionsLayout: "actionsLayout" }, outputs: { onBlur: "blur", cancel: "cancel", clear: "clear", complete: "complete", error: "error", onFocus: "focus", pause: "pause", remove: "remove", resume: "resume", select: "select", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "class.k-widget": "this.hostDefaultClasses", "class.k-upload": "this.hostDefaultClasses", "class.k-disabled": "this.hostDisabledClass", "attr.dir": "this.dir" } }, providers: [
|
|
4054
|
+
LocalizationService,
|
|
4055
|
+
NavigationService,
|
|
4056
|
+
UploadService,
|
|
4057
|
+
DropZoneService,
|
|
4058
|
+
UPLOAD_VALUE_ACCESSOR,
|
|
4059
|
+
{
|
|
4060
|
+
provide: L10N_PREFIX,
|
|
4061
|
+
useValue: 'kendo.upload'
|
|
4062
|
+
},
|
|
4063
|
+
{
|
|
4064
|
+
provide: KendoInput,
|
|
4065
|
+
useExisting: forwardRef(() => UploadComponent)
|
|
4066
|
+
}
|
|
4067
|
+
], queries: [{ propertyName: "fileTemplate", first: true, predicate: FileTemplateDirective, descendants: true }, { propertyName: "fileInfoTemplate", first: true, predicate: FileInfoTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "fileSelect", first: true, predicate: ["fileSelect"], descendants: true, static: true }, { propertyName: "fileSelectButton", first: true, predicate: ["fileSelectButton"], descendants: true, static: true }], exportAs: ["kendoUpload"], usesOnChanges: true, ngImport: i0, template: `
|
|
4068
|
+
<ng-container kendoUploadLocalizedMessages
|
|
4069
|
+
i18n-cancel="kendo.upload.cancel|The text for the Cancel button"
|
|
4070
|
+
cancel="Cancel"
|
|
4071
|
+
|
|
4072
|
+
i18n-clearSelectedFiles="kendo.upload.clearSelectedFiles|The text for the Clear button"
|
|
4073
|
+
clearSelectedFiles="Clear"
|
|
4074
|
+
|
|
4075
|
+
i18n-dropFilesHere="kendo.upload.dropFilesHere|The drop zone hint"
|
|
4076
|
+
dropFilesHere="Drop files here to upload"
|
|
4077
|
+
|
|
4078
|
+
i18n-filesBatchStatus="kendo.upload.filesBatchStatus|The status message for a batch of files"
|
|
4079
|
+
filesBatchStatus="files"
|
|
4080
|
+
|
|
4081
|
+
i18n-filesBatchStatusFailed="kendo.upload.filesBatchStatusFailed|The status message for a batch of files after failed upload"
|
|
4082
|
+
filesBatchStatusFailed="files failed to upload."
|
|
4083
|
+
|
|
4084
|
+
i18n-filesBatchStatusUploaded="kendo.upload.filesBatchStatusUploaded|The status message for a batch of files after successful upload"
|
|
4085
|
+
filesBatchStatusUploaded="files successfully uploaded."
|
|
4086
|
+
|
|
4087
|
+
i18n-fileStatusFailed="kendo.upload.fileStatusFailed|The file status message after failed upload"
|
|
4088
|
+
fileStatusFailed="File failed to upload."
|
|
4089
|
+
|
|
4090
|
+
i18n-fileStatusUploaded="kendo.upload.fileStatusUploaded|The file status message after successful upload"
|
|
4091
|
+
fileStatusUploaded="File successfully uploaded."
|
|
4092
|
+
|
|
4093
|
+
i18n-headerStatusPaused="kendo.upload.headerStatusPaused|The header status message when the file upload is paused"
|
|
4094
|
+
headerStatusPaused="Paused"
|
|
4095
|
+
|
|
4096
|
+
i18n-headerStatusUploaded="kendo.upload.headerStatusUploaded|The header status message after file upload completion"
|
|
4097
|
+
headerStatusUploaded="Done"
|
|
4098
|
+
|
|
4099
|
+
i18n-headerStatusUploading="kendo.upload.headerStatusUploading|The header status message during file upload"
|
|
4100
|
+
headerStatusUploading="Uploading..."
|
|
4101
|
+
|
|
4102
|
+
i18n-invalidFileExtension="kendo.upload.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
4103
|
+
invalidFileExtension="File type not allowed."
|
|
4104
|
+
|
|
4105
|
+
i18n-invalidMaxFileSize="kendo.upload.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
4106
|
+
invalidMaxFileSize="File size too large."
|
|
4107
|
+
|
|
4108
|
+
i18n-invalidMinFileSize="kendo.upload.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
4109
|
+
invalidMinFileSize="File size too small."
|
|
4110
|
+
|
|
4111
|
+
i18n-pause="kendo.upload.pause|The text for the Pause button"
|
|
4112
|
+
pause="Pause"
|
|
4113
|
+
|
|
4114
|
+
i18n-remove="kendo.upload.remove|The text for the Remove button"
|
|
4115
|
+
remove="Remove"
|
|
4116
|
+
|
|
4117
|
+
i18n-resume="kendo.upload.resume|The text for the Resume button"
|
|
4118
|
+
resume="Resume"
|
|
4119
|
+
|
|
4120
|
+
i18n-retry="kendo.upload.retry|The text for the Retry button"
|
|
4121
|
+
retry="Retry"
|
|
4122
|
+
|
|
4123
|
+
i18n-select="kendo.upload.select|The text for the Select button"
|
|
4124
|
+
select="Select files..."
|
|
4125
|
+
|
|
4126
|
+
i18n-uploadSelectedFiles="kendo.upload.uploadSelectedFiles|The text for the Upload files button"
|
|
4127
|
+
uploadSelectedFiles="Upload"
|
|
4128
|
+
>
|
|
4129
|
+
</ng-container>
|
|
4130
|
+
<div kendoUploadInternalDropZone
|
|
4131
|
+
[restrictions]="restrictions"
|
|
4132
|
+
[multiple]="multiple"
|
|
4133
|
+
[disabled]="disabled">
|
|
4134
|
+
<div role="button" #fileSelectButton
|
|
4135
|
+
[id]="focusableId"
|
|
4136
|
+
[attr.aria-label]="textFor('select')"
|
|
4137
|
+
[attr.tabindex]="selectButtonTabIndex"
|
|
4138
|
+
(focus)="onFileSelectButtonFocus($event)"
|
|
4139
|
+
(blur)="onFileSelectButtonBlur($event)"
|
|
4140
|
+
class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-upload-button">
|
|
4141
|
+
<input #fileSelect kendoFileSelect
|
|
4142
|
+
[attr.accept]="accept ? accept : null"
|
|
4143
|
+
[attr.aria-hidden]="true"
|
|
4144
|
+
[dir]="direction"
|
|
4145
|
+
[restrictions]="restrictions"
|
|
4146
|
+
[multiple]="multiple"
|
|
4147
|
+
[disabled]="disabled" />
|
|
4148
|
+
<span>{{textFor('select')}}</span>
|
|
4149
|
+
</div>
|
|
4150
|
+
<kendo-upload-status-total *ngIf="showTotalStatus"
|
|
4151
|
+
class="k-upload-status k-upload-status-total"
|
|
4152
|
+
[fileList]="fileList">
|
|
4153
|
+
</kendo-upload-status-total>
|
|
4154
|
+
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
4155
|
+
</div>
|
|
4156
|
+
<ul kendo-upload-file-list *ngIf="showFileList && fileList.count > 0"
|
|
4157
|
+
class="k-upload-files k-reset"
|
|
4158
|
+
[disabled]="disabled"
|
|
4159
|
+
[fileList]="fileList.files"
|
|
4160
|
+
[fileTemplate]="fileTemplate"
|
|
4161
|
+
[fileInfoTemplate]="fileInfoTemplate">
|
|
4162
|
+
</ul>
|
|
4163
|
+
<kendo-upload-action-buttons
|
|
4164
|
+
*ngIf="showActionButtons"
|
|
4165
|
+
[disabled]="disabled"
|
|
4166
|
+
[actionsLayout]="actionsLayout">
|
|
4167
|
+
</kendo-upload-action-buttons>
|
|
4168
|
+
`, isInline: true, components: [{ type: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }], directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
4169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadComponent, decorators: [{
|
|
4170
|
+
type: Component,
|
|
4171
|
+
args: [{
|
|
4172
|
+
exportAs: 'kendoUpload',
|
|
4173
|
+
providers: [
|
|
4174
|
+
LocalizationService,
|
|
4175
|
+
NavigationService,
|
|
4176
|
+
UploadService,
|
|
4177
|
+
DropZoneService,
|
|
4178
|
+
UPLOAD_VALUE_ACCESSOR,
|
|
4179
|
+
{
|
|
4180
|
+
provide: L10N_PREFIX,
|
|
4181
|
+
useValue: 'kendo.upload'
|
|
4182
|
+
},
|
|
4183
|
+
{
|
|
4184
|
+
provide: KendoInput,
|
|
4185
|
+
useExisting: forwardRef(() => UploadComponent)
|
|
4186
|
+
}
|
|
4187
|
+
],
|
|
4188
|
+
selector: 'kendo-upload',
|
|
4189
|
+
template: `
|
|
3992
4190
|
<ng-container kendoUploadLocalizedMessages
|
|
3993
4191
|
i18n-cancel="kendo.upload.cancel|The text for the Cancel button"
|
|
3994
4192
|
cancel="Cancel"
|
|
@@ -4090,18 +4288,116 @@ UploadComponent = UploadComponent_1 = __decorate([
|
|
|
4090
4288
|
[actionsLayout]="actionsLayout">
|
|
4091
4289
|
</kendo-upload-action-buttons>
|
|
4092
4290
|
`
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
],
|
|
4291
|
+
}]
|
|
4292
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }, { type: DropZoneService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { autoUpload: [{
|
|
4293
|
+
type: Input
|
|
4294
|
+
}], batch: [{
|
|
4295
|
+
type: Input
|
|
4296
|
+
}], withCredentials: [{
|
|
4297
|
+
type: Input
|
|
4298
|
+
}], saveField: [{
|
|
4299
|
+
type: Input
|
|
4300
|
+
}], saveHeaders: [{
|
|
4301
|
+
type: Input
|
|
4302
|
+
}], saveMethod: [{
|
|
4303
|
+
type: Input
|
|
4304
|
+
}], saveUrl: [{
|
|
4305
|
+
type: Input
|
|
4306
|
+
}], responseType: [{
|
|
4307
|
+
type: Input
|
|
4308
|
+
}], removeField: [{
|
|
4309
|
+
type: Input
|
|
4310
|
+
}], removeHeaders: [{
|
|
4311
|
+
type: Input
|
|
4312
|
+
}], removeMethod: [{
|
|
4313
|
+
type: Input
|
|
4314
|
+
}], removeUrl: [{
|
|
4315
|
+
type: Input
|
|
4316
|
+
}], chunkable: [{
|
|
4317
|
+
type: Input
|
|
4318
|
+
}], concurrent: [{
|
|
4319
|
+
type: Input
|
|
4320
|
+
}], multiple: [{
|
|
4321
|
+
type: Input
|
|
4322
|
+
}], disabled: [{
|
|
4323
|
+
type: Input
|
|
4324
|
+
}], showFileList: [{
|
|
4325
|
+
type: Input
|
|
4326
|
+
}], tabindex: [{
|
|
4327
|
+
type: Input
|
|
4328
|
+
}], zoneId: [{
|
|
4329
|
+
type: Input
|
|
4330
|
+
}], tabIndex: [{
|
|
4331
|
+
type: Input,
|
|
4332
|
+
args: ['tabIndex']
|
|
4333
|
+
}], accept: [{
|
|
4334
|
+
type: Input
|
|
4335
|
+
}], restrictions: [{
|
|
4336
|
+
type: Input
|
|
4337
|
+
}], focusableId: [{
|
|
4338
|
+
type: Input
|
|
4339
|
+
}], actionsLayout: [{
|
|
4340
|
+
type: Input
|
|
4341
|
+
}], fileTemplate: [{
|
|
4342
|
+
type: ContentChild,
|
|
4343
|
+
args: [FileTemplateDirective, { static: false }]
|
|
4344
|
+
}], fileInfoTemplate: [{
|
|
4345
|
+
type: ContentChild,
|
|
4346
|
+
args: [FileInfoTemplateDirective, { static: false }]
|
|
4347
|
+
}], fileSelect: [{
|
|
4348
|
+
type: ViewChild,
|
|
4349
|
+
args: ['fileSelect', { static: true }]
|
|
4350
|
+
}], fileSelectButton: [{
|
|
4351
|
+
type: ViewChild,
|
|
4352
|
+
args: ['fileSelectButton', { static: true }]
|
|
4353
|
+
}], onBlur: [{
|
|
4354
|
+
type: Output,
|
|
4355
|
+
args: ['blur']
|
|
4356
|
+
}], cancel: [{
|
|
4357
|
+
type: Output
|
|
4358
|
+
}], clear: [{
|
|
4359
|
+
type: Output
|
|
4360
|
+
}], complete: [{
|
|
4361
|
+
type: Output
|
|
4362
|
+
}], error: [{
|
|
4363
|
+
type: Output
|
|
4364
|
+
}], onFocus: [{
|
|
4365
|
+
type: Output,
|
|
4366
|
+
args: ['focus']
|
|
4367
|
+
}], pause: [{
|
|
4368
|
+
type: Output
|
|
4369
|
+
}], remove: [{
|
|
4370
|
+
type: Output
|
|
4371
|
+
}], resume: [{
|
|
4372
|
+
type: Output
|
|
4373
|
+
}], select: [{
|
|
4374
|
+
type: Output
|
|
4375
|
+
}], success: [{
|
|
4376
|
+
type: Output
|
|
4377
|
+
}], upload: [{
|
|
4378
|
+
type: Output
|
|
4379
|
+
}], uploadProgress: [{
|
|
4380
|
+
type: Output
|
|
4381
|
+
}], valueChange: [{
|
|
4382
|
+
type: Output
|
|
4383
|
+
}], hostDefaultClasses: [{
|
|
4384
|
+
type: HostBinding,
|
|
4385
|
+
args: ['class.k-widget']
|
|
4386
|
+
}, {
|
|
4387
|
+
type: HostBinding,
|
|
4388
|
+
args: ['class.k-upload']
|
|
4389
|
+
}], hostDisabledClass: [{
|
|
4390
|
+
type: HostBinding,
|
|
4391
|
+
args: ['class.k-disabled']
|
|
4392
|
+
}], dir: [{
|
|
4393
|
+
type: HostBinding,
|
|
4394
|
+
args: ['attr.dir']
|
|
4395
|
+
}], handleKeydown: [{
|
|
4396
|
+
type: HostListener,
|
|
4397
|
+
args: ['keydown', ['$event']]
|
|
4398
|
+
}] } });
|
|
4103
4399
|
|
|
4104
|
-
|
|
4400
|
+
class UploadDropZoneDirective {
|
|
4105
4401
|
constructor(dropZoneService) {
|
|
4106
4402
|
this.dropZoneService = dropZoneService;
|
|
4107
4403
|
}
|
|
@@ -4151,44 +4447,38 @@ let UploadDropZoneDirective = class UploadDropZoneDirective {
|
|
|
4151
4447
|
get componentInstance() {
|
|
4152
4448
|
return this.dropZoneService.getComponents(this.zoneId);
|
|
4153
4449
|
}
|
|
4154
|
-
}
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
],
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
],
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
],
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
],
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
DropZoneService
|
|
4181
|
-
],
|
|
4182
|
-
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
4183
|
-
}),
|
|
4184
|
-
__metadata("design:paramtypes", [DropZoneService])
|
|
4185
|
-
], UploadDropZoneDirective);
|
|
4450
|
+
}
|
|
4451
|
+
UploadDropZoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneDirective, deps: [{ token: DropZoneService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4452
|
+
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: [
|
|
4453
|
+
DropZoneService
|
|
4454
|
+
], ngImport: i0 });
|
|
4455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneDirective, decorators: [{
|
|
4456
|
+
type: Directive,
|
|
4457
|
+
args: [{
|
|
4458
|
+
providers: [
|
|
4459
|
+
DropZoneService
|
|
4460
|
+
],
|
|
4461
|
+
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
4462
|
+
}]
|
|
4463
|
+
}], ctorParameters: function () { return [{ type: DropZoneService }]; }, propDecorators: { zoneId: [{
|
|
4464
|
+
type: Input,
|
|
4465
|
+
args: ['kendoUploadDropZone']
|
|
4466
|
+
}], onElementDragEnter: [{
|
|
4467
|
+
type: HostListener,
|
|
4468
|
+
args: ['dragenter']
|
|
4469
|
+
}], onElementDragOver: [{
|
|
4470
|
+
type: HostListener,
|
|
4471
|
+
args: ['dragover']
|
|
4472
|
+
}], onDropListener: [{
|
|
4473
|
+
type: HostListener,
|
|
4474
|
+
args: ['drop', ['$event']]
|
|
4475
|
+
}] } });
|
|
4186
4476
|
|
|
4187
|
-
/*
|
|
4477
|
+
/* eslint-disable no-use-before-declare */
|
|
4188
4478
|
/**
|
|
4189
4479
|
* Represents the [Kendo UI UploadDropZone component for Angular]({% slug overview_upload %}).
|
|
4190
4480
|
*/
|
|
4191
|
-
|
|
4481
|
+
class UploadDropZoneComponent extends DropZoneBase {
|
|
4192
4482
|
constructor(element, renderer, localization) {
|
|
4193
4483
|
super(element, renderer, 'k-external-dropzone-hover');
|
|
4194
4484
|
this.localization = localization;
|
|
@@ -4223,40 +4513,41 @@ let UploadDropZoneComponent = class UploadDropZoneComponent extends DropZoneBase
|
|
|
4223
4513
|
this.localizationChangeSubscription.unsubscribe();
|
|
4224
4514
|
}
|
|
4225
4515
|
}
|
|
4226
|
-
}
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
],
|
|
4248
|
-
UploadDropZoneComponent
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4516
|
+
}
|
|
4517
|
+
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$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4518
|
+
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: [
|
|
4519
|
+
LocalizationService,
|
|
4520
|
+
{
|
|
4521
|
+
provide: L10N_PREFIX,
|
|
4522
|
+
useValue: 'kendo.uploaddropzone'
|
|
4523
|
+
}
|
|
4524
|
+
], exportAs: ["kendoUploadDropZone"], usesInheritance: true, ngImport: i0, template: `
|
|
4525
|
+
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
4526
|
+
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
4527
|
+
externalDropFilesHere='Drag and drop files here to upload'
|
|
4528
|
+
>
|
|
4529
|
+
</ng-container>
|
|
4530
|
+
<div class='k-dropzone-inner' [kendoUploadDropZone]="zoneId">
|
|
4531
|
+
<span [ngClass]="iconClasses"></span>
|
|
4532
|
+
<span class="k-dropzone-hint">{{ textFor('externalDropFilesHere') }}</span>
|
|
4533
|
+
<span class="k-dropzone-note">
|
|
4534
|
+
<ng-content></ng-content>
|
|
4535
|
+
</span>
|
|
4536
|
+
</div>
|
|
4537
|
+
`, isInline: true, directives: [{ type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { type: UploadDropZoneDirective, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: ["kendoUploadDropZone"] }, { type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
4538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadDropZoneComponent, decorators: [{
|
|
4539
|
+
type: Component,
|
|
4540
|
+
args: [{
|
|
4541
|
+
exportAs: 'kendoUploadDropZone',
|
|
4542
|
+
providers: [
|
|
4543
|
+
LocalizationService,
|
|
4544
|
+
{
|
|
4545
|
+
provide: L10N_PREFIX,
|
|
4546
|
+
useValue: 'kendo.uploaddropzone'
|
|
4547
|
+
}
|
|
4548
|
+
],
|
|
4549
|
+
selector: 'kendo-uploaddropzone',
|
|
4550
|
+
template: `
|
|
4260
4551
|
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
4261
4552
|
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
4262
4553
|
externalDropFilesHere='Drag and drop files here to upload'
|
|
@@ -4270,11 +4561,20 @@ UploadDropZoneComponent = __decorate([
|
|
|
4270
4561
|
</span>
|
|
4271
4562
|
</div>
|
|
4272
4563
|
`
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
],
|
|
4564
|
+
}]
|
|
4565
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.LocalizationService }]; }, propDecorators: { hostClass: [{
|
|
4566
|
+
type: HostBinding,
|
|
4567
|
+
args: ['class.k-external-dropzone']
|
|
4568
|
+
}], dirAttribute: [{
|
|
4569
|
+
type: HostBinding,
|
|
4570
|
+
args: ['attr.dir']
|
|
4571
|
+
}], zoneId: [{
|
|
4572
|
+
type: Input
|
|
4573
|
+
}], icon: [{
|
|
4574
|
+
type: Input
|
|
4575
|
+
}], iconClass: [{
|
|
4576
|
+
type: Input
|
|
4577
|
+
}] } });
|
|
4278
4578
|
|
|
4279
4579
|
/**
|
|
4280
4580
|
* @hidden
|
|
@@ -4303,22 +4603,50 @@ const PUBLIC_DIRECTIVES = [
|
|
|
4303
4603
|
/**
|
|
4304
4604
|
* @hidden
|
|
4305
4605
|
*/
|
|
4306
|
-
|
|
4307
|
-
}
|
|
4308
|
-
SharedModule =
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
],
|
|
4606
|
+
class SharedModule {
|
|
4607
|
+
}
|
|
4608
|
+
SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4609
|
+
SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SharedModule, declarations: [FileTemplateDirective,
|
|
4610
|
+
FileInfoTemplateDirective,
|
|
4611
|
+
CustomMessagesComponent,
|
|
4612
|
+
UploadDropZoneDirective,
|
|
4613
|
+
UploadDropZoneComponent, DropZoneInternalDirective,
|
|
4614
|
+
FileListComponent,
|
|
4615
|
+
FileListItemDirective,
|
|
4616
|
+
FileListItemActionButtonComponent,
|
|
4617
|
+
FileListMultipleItemsComponent,
|
|
4618
|
+
FileListSingleItemComponent,
|
|
4619
|
+
FileSelectDirective,
|
|
4620
|
+
LocalizedMessagesDirective,
|
|
4621
|
+
TemplateContextDirective], imports: [CommonModule], exports: [FileTemplateDirective,
|
|
4622
|
+
FileInfoTemplateDirective,
|
|
4623
|
+
CustomMessagesComponent,
|
|
4624
|
+
UploadDropZoneDirective,
|
|
4625
|
+
UploadDropZoneComponent, DropZoneInternalDirective,
|
|
4626
|
+
FileListComponent,
|
|
4627
|
+
FileListItemDirective,
|
|
4628
|
+
FileListItemActionButtonComponent,
|
|
4629
|
+
FileListMultipleItemsComponent,
|
|
4630
|
+
FileListSingleItemComponent,
|
|
4631
|
+
FileSelectDirective,
|
|
4632
|
+
LocalizedMessagesDirective,
|
|
4633
|
+
TemplateContextDirective, CommonModule] });
|
|
4634
|
+
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SharedModule, imports: [[CommonModule], CommonModule] });
|
|
4635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SharedModule, decorators: [{
|
|
4636
|
+
type: NgModule,
|
|
4637
|
+
args: [{
|
|
4638
|
+
declarations: [
|
|
4639
|
+
PUBLIC_DIRECTIVES,
|
|
4640
|
+
SHARED_DECLARATIONS
|
|
4641
|
+
],
|
|
4642
|
+
exports: [
|
|
4643
|
+
PUBLIC_DIRECTIVES,
|
|
4644
|
+
SHARED_DECLARATIONS,
|
|
4645
|
+
CommonModule
|
|
4646
|
+
],
|
|
4647
|
+
imports: [CommonModule]
|
|
4648
|
+
}]
|
|
4649
|
+
}] });
|
|
4322
4650
|
|
|
4323
4651
|
const FILESELECT_DECLARATIONS = [
|
|
4324
4652
|
FileSelectComponent
|
|
@@ -4326,192 +4654,22 @@ const FILESELECT_DECLARATIONS = [
|
|
|
4326
4654
|
/**
|
|
4327
4655
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the FileSelect component.
|
|
4328
4656
|
*/
|
|
4329
|
-
|
|
4330
|
-
}
|
|
4331
|
-
FileSelectModule =
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
let UploadActionButtonsComponent = class UploadActionButtonsComponent {
|
|
4346
|
-
constructor(uploadService, localization, navigation) {
|
|
4347
|
-
this.uploadService = uploadService;
|
|
4348
|
-
this.localization = localization;
|
|
4349
|
-
this.navigation = navigation;
|
|
4350
|
-
this.hostDefaultClass = true;
|
|
4351
|
-
this.onAction();
|
|
4352
|
-
this.onFocus();
|
|
4353
|
-
}
|
|
4354
|
-
get actionButtonsEndClassName() {
|
|
4355
|
-
return this.actionsLayout === 'end';
|
|
4356
|
-
}
|
|
4357
|
-
get actionButtonsStretchedClassName() {
|
|
4358
|
-
return this.actionsLayout === 'stretched';
|
|
4359
|
-
}
|
|
4360
|
-
get actionButtonsStartClassName() {
|
|
4361
|
-
return this.actionsLayout === 'start';
|
|
4362
|
-
}
|
|
4363
|
-
get actionButtonsCenterClassName() {
|
|
4364
|
-
return this.actionsLayout === 'center';
|
|
4365
|
-
}
|
|
4366
|
-
onAction() {
|
|
4367
|
-
this.actionSubscription = this.navigation.onActionButtonAction.subscribe((button) => {
|
|
4368
|
-
if (button === "clear") {
|
|
4369
|
-
this.clearFiles();
|
|
4370
|
-
}
|
|
4371
|
-
else {
|
|
4372
|
-
this.performUpload();
|
|
4373
|
-
}
|
|
4374
|
-
});
|
|
4375
|
-
}
|
|
4376
|
-
onFocus() {
|
|
4377
|
-
this.focusSubscription = this.navigation.onActionButtonFocus.subscribe((button) => {
|
|
4378
|
-
this.focusButton(button);
|
|
4379
|
-
});
|
|
4380
|
-
}
|
|
4381
|
-
focusButton(button) {
|
|
4382
|
-
const el = (button === "clear") ? this.clearButton : this.uploadButton;
|
|
4383
|
-
el.nativeElement.focus();
|
|
4384
|
-
}
|
|
4385
|
-
ngOnDestroy() {
|
|
4386
|
-
this.actionSubscription.unsubscribe();
|
|
4387
|
-
this.focusSubscription.unsubscribe();
|
|
4388
|
-
}
|
|
4389
|
-
onUploadButtonClick(event) {
|
|
4390
|
-
event.stopImmediatePropagation();
|
|
4391
|
-
this.performUpload();
|
|
4392
|
-
}
|
|
4393
|
-
performUpload() {
|
|
4394
|
-
if (!this.disabled) {
|
|
4395
|
-
this.uploadService.uploadFiles();
|
|
4396
|
-
this.navigation.focusSelectButton();
|
|
4397
|
-
}
|
|
4398
|
-
}
|
|
4399
|
-
onClearButtonClick(event) {
|
|
4400
|
-
event.stopImmediatePropagation();
|
|
4401
|
-
this.clearFiles();
|
|
4402
|
-
}
|
|
4403
|
-
clearFiles() {
|
|
4404
|
-
if (!this.disabled) {
|
|
4405
|
-
this.uploadService.clearFiles();
|
|
4406
|
-
this.navigation.focusSelectButton();
|
|
4407
|
-
}
|
|
4408
|
-
}
|
|
4409
|
-
textFor(key) {
|
|
4410
|
-
return this.localization.get(key);
|
|
4411
|
-
}
|
|
4412
|
-
};
|
|
4413
|
-
__decorate([
|
|
4414
|
-
Input(),
|
|
4415
|
-
__metadata("design:type", Boolean)
|
|
4416
|
-
], UploadActionButtonsComponent.prototype, "disabled", void 0);
|
|
4417
|
-
__decorate([
|
|
4418
|
-
Input(),
|
|
4419
|
-
__metadata("design:type", String)
|
|
4420
|
-
], UploadActionButtonsComponent.prototype, "actionsLayout", void 0);
|
|
4421
|
-
__decorate([
|
|
4422
|
-
ViewChild('clearButton', { static: true }),
|
|
4423
|
-
__metadata("design:type", ElementRef)
|
|
4424
|
-
], UploadActionButtonsComponent.prototype, "clearButton", void 0);
|
|
4425
|
-
__decorate([
|
|
4426
|
-
ViewChild('uploadButton', { static: true }),
|
|
4427
|
-
__metadata("design:type", ElementRef)
|
|
4428
|
-
], UploadActionButtonsComponent.prototype, "uploadButton", void 0);
|
|
4429
|
-
__decorate([
|
|
4430
|
-
HostBinding('class.k-actions'),
|
|
4431
|
-
__metadata("design:type", Boolean)
|
|
4432
|
-
], UploadActionButtonsComponent.prototype, "hostDefaultClass", void 0);
|
|
4433
|
-
__decorate([
|
|
4434
|
-
HostBinding('class.k-actions-end'),
|
|
4435
|
-
__metadata("design:type", Boolean),
|
|
4436
|
-
__metadata("design:paramtypes", [])
|
|
4437
|
-
], UploadActionButtonsComponent.prototype, "actionButtonsEndClassName", null);
|
|
4438
|
-
__decorate([
|
|
4439
|
-
HostBinding('class.k-actions-stretched'),
|
|
4440
|
-
__metadata("design:type", Boolean),
|
|
4441
|
-
__metadata("design:paramtypes", [])
|
|
4442
|
-
], UploadActionButtonsComponent.prototype, "actionButtonsStretchedClassName", null);
|
|
4443
|
-
__decorate([
|
|
4444
|
-
HostBinding('class.k-actions-start'),
|
|
4445
|
-
__metadata("design:type", Boolean),
|
|
4446
|
-
__metadata("design:paramtypes", [])
|
|
4447
|
-
], UploadActionButtonsComponent.prototype, "actionButtonsStartClassName", null);
|
|
4448
|
-
__decorate([
|
|
4449
|
-
HostBinding('class.k-actions-center'),
|
|
4450
|
-
__metadata("design:type", Boolean),
|
|
4451
|
-
__metadata("design:paramtypes", [])
|
|
4452
|
-
], UploadActionButtonsComponent.prototype, "actionButtonsCenterClassName", null);
|
|
4453
|
-
UploadActionButtonsComponent = __decorate([
|
|
4454
|
-
Component({
|
|
4455
|
-
selector: 'kendo-upload-action-buttons',
|
|
4456
|
-
template: `
|
|
4457
|
-
<button #clearButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-clear-selected"
|
|
4458
|
-
[attr.tabIndex]="-1"
|
|
4459
|
-
(click)="onClearButtonClick($event)">
|
|
4460
|
-
{{textFor('clearSelectedFiles')}}
|
|
4461
|
-
</button>
|
|
4462
|
-
<button #uploadButton type="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
4463
|
-
[attr.tabIndex]="-1"
|
|
4464
|
-
(click)="onUploadButtonClick($event)">
|
|
4465
|
-
{{textFor('uploadSelectedFiles')}}
|
|
4466
|
-
</button>
|
|
4467
|
-
`
|
|
4468
|
-
}),
|
|
4469
|
-
__metadata("design:paramtypes", [UploadService,
|
|
4470
|
-
LocalizationService,
|
|
4471
|
-
NavigationService])
|
|
4472
|
-
], UploadActionButtonsComponent);
|
|
4473
|
-
|
|
4474
|
-
/**
|
|
4475
|
-
* @hidden
|
|
4476
|
-
*/
|
|
4477
|
-
let UploadStatusTotalComponent = class UploadStatusTotalComponent {
|
|
4478
|
-
constructor(localization) {
|
|
4479
|
-
this.localization = localization;
|
|
4480
|
-
}
|
|
4481
|
-
ngDoCheck() {
|
|
4482
|
-
this.isPaused = this.fileList.hasFileWithState([FileState.Paused]);
|
|
4483
|
-
this.isFailed = this.fileList.hasFileWithState([FileState.Failed]);
|
|
4484
|
-
this.isUploading = this.fileList.hasFileWithState([FileState.Uploading]);
|
|
4485
|
-
if (this.isPaused && !this.isUploading) {
|
|
4486
|
-
this.statusText = this.localization.get('headerStatusPaused');
|
|
4487
|
-
}
|
|
4488
|
-
else {
|
|
4489
|
-
this.statusText = this.isUploading ? this.localization.get('headerStatusUploading')
|
|
4490
|
-
: this.localization.get('headerStatusUploaded');
|
|
4491
|
-
}
|
|
4492
|
-
}
|
|
4493
|
-
};
|
|
4494
|
-
__decorate([
|
|
4495
|
-
Input(),
|
|
4496
|
-
__metadata("design:type", FileMap)
|
|
4497
|
-
], UploadStatusTotalComponent.prototype, "fileList", void 0);
|
|
4498
|
-
UploadStatusTotalComponent = __decorate([
|
|
4499
|
-
Component({
|
|
4500
|
-
selector: 'kendo-upload-status-total',
|
|
4501
|
-
template: `
|
|
4502
|
-
<span class="k-icon"
|
|
4503
|
-
[ngClass]="{
|
|
4504
|
-
'k-i-checkmark': !this.isUploading && !this.isFailed,
|
|
4505
|
-
'k-i-exception': !this.isUploading && this.isFailed,
|
|
4506
|
-
'k-i-upload': this.isUploading,
|
|
4507
|
-
'k-i-pause-sm': this.isPaused
|
|
4508
|
-
}">
|
|
4509
|
-
</span>
|
|
4510
|
-
{{statusText}}
|
|
4511
|
-
`
|
|
4512
|
-
}),
|
|
4513
|
-
__metadata("design:paramtypes", [LocalizationService])
|
|
4514
|
-
], UploadStatusTotalComponent);
|
|
4657
|
+
class FileSelectModule {
|
|
4658
|
+
}
|
|
4659
|
+
FileSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4660
|
+
FileSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectModule, declarations: [FileSelectComponent], imports: [SharedModule], exports: [FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent, FileSelectComponent] });
|
|
4661
|
+
FileSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectModule, imports: [[SharedModule]] });
|
|
4662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FileSelectModule, decorators: [{
|
|
4663
|
+
type: NgModule,
|
|
4664
|
+
args: [{
|
|
4665
|
+
declarations: [FILESELECT_DECLARATIONS],
|
|
4666
|
+
exports: [
|
|
4667
|
+
PUBLIC_DIRECTIVES,
|
|
4668
|
+
FILESELECT_DECLARATIONS
|
|
4669
|
+
],
|
|
4670
|
+
imports: [SharedModule]
|
|
4671
|
+
}]
|
|
4672
|
+
}] });
|
|
4515
4673
|
|
|
4516
4674
|
const UPLOAD_DECLARATIONS = [
|
|
4517
4675
|
UploadComponent,
|
|
@@ -4521,18 +4679,26 @@ const UPLOAD_DECLARATIONS = [
|
|
|
4521
4679
|
/**
|
|
4522
4680
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the Upload component.
|
|
4523
4681
|
*/
|
|
4524
|
-
|
|
4525
|
-
}
|
|
4526
|
-
UploadModule =
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
exports: [
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4682
|
+
class UploadModule {
|
|
4683
|
+
}
|
|
4684
|
+
UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4685
|
+
UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
|
|
4686
|
+
UploadActionButtonsComponent,
|
|
4687
|
+
UploadStatusTotalComponent], imports: [SharedModule], exports: [FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent, UploadComponent,
|
|
4688
|
+
UploadActionButtonsComponent,
|
|
4689
|
+
UploadStatusTotalComponent] });
|
|
4690
|
+
UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, imports: [[SharedModule]] });
|
|
4691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadModule, decorators: [{
|
|
4692
|
+
type: NgModule,
|
|
4693
|
+
args: [{
|
|
4694
|
+
declarations: [UPLOAD_DECLARATIONS],
|
|
4695
|
+
exports: [
|
|
4696
|
+
PUBLIC_DIRECTIVES,
|
|
4697
|
+
UPLOAD_DECLARATIONS
|
|
4698
|
+
],
|
|
4699
|
+
imports: [SharedModule]
|
|
4700
|
+
}]
|
|
4701
|
+
}] });
|
|
4536
4702
|
|
|
4537
4703
|
/**
|
|
4538
4704
|
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
@@ -4559,19 +4725,26 @@ UploadModule = __decorate([
|
|
|
4559
4725
|
*
|
|
4560
4726
|
* ```
|
|
4561
4727
|
*/
|
|
4562
|
-
|
|
4563
|
-
}
|
|
4564
|
-
UploadsModule =
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4728
|
+
class UploadsModule {
|
|
4729
|
+
}
|
|
4730
|
+
UploadsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4731
|
+
UploadsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadsModule, exports: [FileSelectModule,
|
|
4732
|
+
UploadModule] });
|
|
4733
|
+
UploadsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadsModule, imports: [FileSelectModule,
|
|
4734
|
+
UploadModule] });
|
|
4735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: UploadsModule, decorators: [{
|
|
4736
|
+
type: NgModule,
|
|
4737
|
+
args: [{
|
|
4738
|
+
exports: [
|
|
4739
|
+
FileSelectModule,
|
|
4740
|
+
UploadModule
|
|
4741
|
+
]
|
|
4742
|
+
}]
|
|
4743
|
+
}] });
|
|
4572
4744
|
|
|
4573
4745
|
/**
|
|
4574
4746
|
* Generated bundle index. Do not edit.
|
|
4575
4747
|
*/
|
|
4576
4748
|
|
|
4577
|
-
export {
|
|
4749
|
+
export { CancelEvent, ClearEvent, CustomMessagesComponent, ErrorEvent, FileInfoTemplateDirective, FileListComponent, FileListItemActionButtonComponent, FileListMultipleItemsComponent, FileListSingleItemComponent, FileSelectComponent, FileSelectDirective, FileSelectModule, FileState, FileTemplateDirective, PauseEvent, RemoveEvent, ResumeEvent, SelectEvent, SuccessEvent, TemplateContextDirective, UploadActionButtonsComponent, UploadComponent, UploadDropZoneComponent, UploadDropZoneDirective, UploadEvent, UploadModule, UploadProgressEvent, UploadStatusTotalComponent, UploadsModule };
|
|
4750
|
+
|