@progress/kendo-angular-upload 16.5.0 → 16.6.0-develop.2
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/directives.d.ts +25 -0
- package/dropzone-external.directive.d.ts +1 -1
- package/dropzone-internal.directive.d.ts +1 -1
- package/dropzone.component.d.ts +1 -1
- package/esm2020/directives.mjs +44 -0
- package/esm2020/dropzone-external.directive.mjs +3 -2
- package/esm2020/dropzone-internal.directive.mjs +3 -2
- package/esm2020/dropzone.component.mjs +8 -6
- package/esm2020/file-select.directive.mjs +3 -2
- package/esm2020/fileselect.component.mjs +11 -9
- package/esm2020/fileselect.module.mjs +24 -19
- package/esm2020/index.mjs +1 -0
- package/esm2020/localization/custom-messages.component.mjs +3 -2
- package/esm2020/localization/localized-messages.directive.mjs +3 -2
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/rendering/file-list-item-action-button.component.mjs +7 -5
- package/esm2020/rendering/file-list-item.mjs +3 -2
- package/esm2020/rendering/file-list-multiple-items.component.mjs +9 -7
- package/esm2020/rendering/file-list-single-item.component.mjs +9 -7
- package/esm2020/rendering/file-list.component.mjs +8 -7
- package/esm2020/rendering/upload-action-buttons.component.mjs +3 -2
- package/esm2020/rendering/upload-status-total.component.mjs +6 -4
- package/esm2020/templates/file-info-template.directive.mjs +3 -2
- package/esm2020/templates/file-template.directive.mjs +3 -2
- package/esm2020/upload.component.mjs +13 -11
- package/esm2020/upload.module.mjs +26 -27
- package/esm2020/uploads.module.mjs +26 -9
- package/fesm2015/progress-kendo-angular-upload.mjs +1124 -1136
- package/fesm2020/progress-kendo-angular-upload.mjs +1122 -1134
- package/file-select.directive.d.ts +1 -1
- package/fileselect.component.d.ts +1 -1
- package/fileselect.module.d.ts +6 -8
- package/index.d.ts +1 -0
- package/localization/custom-messages.component.d.ts +1 -1
- package/localization/localized-messages.directive.d.ts +1 -1
- package/package.json +7 -7
- package/rendering/file-list-item-action-button.component.d.ts +1 -1
- package/rendering/file-list-item.d.ts +1 -1
- package/rendering/file-list-multiple-items.component.d.ts +1 -1
- package/rendering/file-list-single-item.component.d.ts +1 -1
- package/rendering/file-list.component.d.ts +1 -1
- package/rendering/upload-action-buttons.component.d.ts +1 -1
- package/rendering/upload-status-total.component.d.ts +1 -1
- package/schematics/ngAdd/index.js +3 -3
- package/templates/file-info-template.directive.d.ts +1 -1
- package/templates/file-template.directive.d.ts +1 -1
- package/upload.component.d.ts +1 -1
- package/upload.module.d.ts +6 -8
- package/uploads.module.d.ts +10 -3
- package/esm2020/shared.module.mjs +0 -94
- package/shared.module.d.ts +0 -38
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpHeaders, HttpRequest, HttpEventType, HttpResponse } from '@angular/common/http';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { EventEmitter, Injectable, Directive, ElementRef, ContentChild, ViewChild, Input, HostBinding, Output,
|
|
9
|
-
import { guid, Keys, isControlRequired, isDocumentAvailable, KendoInput,
|
|
8
|
+
import { EventEmitter, Injectable, Directive, ElementRef, ContentChild, ViewChild, Input, HostBinding, Output, Component, HostListener, ViewChildren, Inject, forwardRef, isDevMode, NgModule } from '@angular/core';
|
|
9
|
+
import { guid, Keys, isControlRequired, isChanged, isDocumentAvailable, KendoInput, ResizeBatchService } from '@progress/kendo-angular-common';
|
|
10
10
|
import { fileAudioIcon, fileVideoIcon, fileImageIcon, fileTxtIcon, filePresentationIcon, fileDataIcon, fileProgrammingIcon, filePdfIcon, fileConfigIcon, fileZipIcon, fileDiscImageIcon, arrowRotateCwSmallIcon, playSmIcon, pauseSmIcon, cancelIcon, xIcon, copyIcon, fileIcon, checkIcon, exclamationCircleIcon, uploadIcon } from '@progress/kendo-svg-icons';
|
|
11
11
|
import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
12
12
|
import * as i1$1 from '@progress/kendo-angular-l10n';
|
|
@@ -14,15 +14,12 @@ import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/k
|
|
|
14
14
|
import { fromEvent, merge } from 'rxjs';
|
|
15
15
|
import { filter } from 'rxjs/operators';
|
|
16
16
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
17
|
-
import * as i3 from '@angular/common';
|
|
18
|
-
import { CommonModule } from '@angular/common';
|
|
19
17
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
18
|
+
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
19
|
+
import { NgIf, NgFor, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
20
|
+
import { IconWrapperComponent, IconsService } from '@progress/kendo-angular-icons';
|
|
21
|
+
import { ProgressBarComponent } from '@progress/kendo-angular-progressbar';
|
|
22
|
+
import { PopupService } from '@progress/kendo-angular-popup';
|
|
26
23
|
|
|
27
24
|
/**
|
|
28
25
|
* Lists the possible states of a file.
|
|
@@ -1491,6 +1488,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1491
1488
|
type: Injectable
|
|
1492
1489
|
}] });
|
|
1493
1490
|
|
|
1491
|
+
/**
|
|
1492
|
+
* @hidden
|
|
1493
|
+
*/
|
|
1494
|
+
const INVALIDMAXFILESIZE = "invalidMaxFileSize";
|
|
1495
|
+
/**
|
|
1496
|
+
* @hidden
|
|
1497
|
+
*/
|
|
1498
|
+
const INVALIDMINFILESIZE = "invalidMinFileSize";
|
|
1499
|
+
/**
|
|
1500
|
+
* @hidden
|
|
1501
|
+
*/
|
|
1502
|
+
const INVALIDFILEEXTENSION = "invalidFileExtension";
|
|
1503
|
+
const validateFileExtension = (file, allowedExtensions) => {
|
|
1504
|
+
if (allowedExtensions.length > 0) {
|
|
1505
|
+
if (allowedExtensions.indexOf(file.extension.toLowerCase()) < 0) {
|
|
1506
|
+
file.validationErrors = file.validationErrors || [];
|
|
1507
|
+
if (file.validationErrors.indexOf(INVALIDFILEEXTENSION) < 0) {
|
|
1508
|
+
file.validationErrors.push(INVALIDFILEEXTENSION);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
const validateFileSize = (file, minFileSize, maxFileSize) => {
|
|
1514
|
+
if (minFileSize !== 0 && file.size < minFileSize) {
|
|
1515
|
+
file.validationErrors = file.validationErrors || [];
|
|
1516
|
+
if (file.validationErrors.indexOf(INVALIDMINFILESIZE) < 0) {
|
|
1517
|
+
file.validationErrors.push(INVALIDMINFILESIZE);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
if (maxFileSize !== 0 && file.size > maxFileSize) {
|
|
1521
|
+
file.validationErrors = file.validationErrors || [];
|
|
1522
|
+
if (file.validationErrors.indexOf(INVALIDMAXFILESIZE) < 0) {
|
|
1523
|
+
file.validationErrors.push(INVALIDMAXFILESIZE);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
const parseAllowedExtensions = (extensions) => {
|
|
1528
|
+
const allowedExtensions = extensions.map((ext) => {
|
|
1529
|
+
const parsedExt = (ext.substring(0, 1) === ".") ? ext : ("." + ext);
|
|
1530
|
+
return parsedExt.toLowerCase();
|
|
1531
|
+
});
|
|
1532
|
+
return allowedExtensions;
|
|
1533
|
+
};
|
|
1534
|
+
/**
|
|
1535
|
+
* @hidden
|
|
1536
|
+
*/
|
|
1537
|
+
const validateFiles = (files, restrictionInfo) => {
|
|
1538
|
+
const allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions);
|
|
1539
|
+
const maxFileSize = restrictionInfo.maxFileSize;
|
|
1540
|
+
const minFileSize = restrictionInfo.minFileSize;
|
|
1541
|
+
let i;
|
|
1542
|
+
for (i = 0; i < files.length; i++) {
|
|
1543
|
+
validateFileExtension(files[i], allowedExtensions);
|
|
1544
|
+
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
|
|
1494
1548
|
/**
|
|
1495
1549
|
* @hidden
|
|
1496
1550
|
*/
|
|
@@ -1498,8 +1552,8 @@ const packageMetadata = {
|
|
|
1498
1552
|
name: '@progress/kendo-angular-upload',
|
|
1499
1553
|
productName: 'Kendo UI for Angular',
|
|
1500
1554
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
1501
|
-
publishDate:
|
|
1502
|
-
version: '16.
|
|
1555
|
+
publishDate: 1721846910,
|
|
1556
|
+
version: '16.6.0-develop.2',
|
|
1503
1557
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
1504
1558
|
};
|
|
1505
1559
|
|
|
@@ -1512,11 +1566,12 @@ class FileTemplateDirective {
|
|
|
1512
1566
|
}
|
|
1513
1567
|
}
|
|
1514
1568
|
FileTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1515
|
-
FileTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileTemplateDirective, selector: "[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]", ngImport: i0 });
|
|
1569
|
+
FileTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileTemplateDirective, isStandalone: true, selector: "[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]", ngImport: i0 });
|
|
1516
1570
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileTemplateDirective, decorators: [{
|
|
1517
1571
|
type: Directive,
|
|
1518
1572
|
args: [{
|
|
1519
|
-
selector: '[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]'
|
|
1573
|
+
selector: '[kendoUploadFileTemplate], [kendoFileSelectFileTemplate]',
|
|
1574
|
+
standalone: true
|
|
1520
1575
|
}]
|
|
1521
1576
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1522
1577
|
|
|
@@ -1529,11 +1584,12 @@ class FileInfoTemplateDirective {
|
|
|
1529
1584
|
}
|
|
1530
1585
|
}
|
|
1531
1586
|
FileInfoTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileInfoTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1532
|
-
FileInfoTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileInfoTemplateDirective, selector: "[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]", ngImport: i0 });
|
|
1587
|
+
FileInfoTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileInfoTemplateDirective, isStandalone: true, selector: "[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]", ngImport: i0 });
|
|
1533
1588
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileInfoTemplateDirective, decorators: [{
|
|
1534
1589
|
type: Directive,
|
|
1535
1590
|
args: [{
|
|
1536
|
-
selector: '[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]'
|
|
1591
|
+
selector: '[kendoUploadFileInfoTemplate], [kendoFileSelectFileInfoTemplate]',
|
|
1592
|
+
standalone: true
|
|
1537
1593
|
}]
|
|
1538
1594
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
1539
1595
|
|
|
@@ -1771,219 +1827,120 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1771
1827
|
type: Output
|
|
1772
1828
|
}] } });
|
|
1773
1829
|
|
|
1830
|
+
/* eslint-disable no-debugger */
|
|
1774
1831
|
/**
|
|
1775
1832
|
* @hidden
|
|
1776
1833
|
*/
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
* @hidden
|
|
1784
|
-
*/
|
|
1785
|
-
const INVALIDFILEEXTENSION = "invalidFileExtension";
|
|
1786
|
-
const validateFileExtension = (file, allowedExtensions) => {
|
|
1787
|
-
if (allowedExtensions.length > 0) {
|
|
1788
|
-
if (allowedExtensions.indexOf(file.extension.toLowerCase()) < 0) {
|
|
1789
|
-
file.validationErrors = file.validationErrors || [];
|
|
1790
|
-
if (file.validationErrors.indexOf(INVALIDFILEEXTENSION) < 0) {
|
|
1791
|
-
file.validationErrors.push(INVALIDFILEEXTENSION);
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1834
|
+
class UploadActionButtonsComponent {
|
|
1835
|
+
constructor(uploadService, localization, navigation) {
|
|
1836
|
+
this.uploadService = uploadService;
|
|
1837
|
+
this.localization = localization;
|
|
1838
|
+
this.navigation = navigation;
|
|
1839
|
+
this.hostDefaultClass = true;
|
|
1794
1840
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
if (minFileSize !== 0 && file.size < minFileSize) {
|
|
1798
|
-
file.validationErrors = file.validationErrors || [];
|
|
1799
|
-
if (file.validationErrors.indexOf(INVALIDMINFILESIZE) < 0) {
|
|
1800
|
-
file.validationErrors.push(INVALIDMINFILESIZE);
|
|
1801
|
-
}
|
|
1841
|
+
get actionButtonsEndClassName() {
|
|
1842
|
+
return this.actionsLayout === 'end';
|
|
1802
1843
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
if (file.validationErrors.indexOf(INVALIDMAXFILESIZE) < 0) {
|
|
1806
|
-
file.validationErrors.push(INVALIDMAXFILESIZE);
|
|
1807
|
-
}
|
|
1844
|
+
get actionButtonsStretchedClassName() {
|
|
1845
|
+
return this.actionsLayout === 'stretched';
|
|
1808
1846
|
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
const allowedExtensions = extensions.map((ext) => {
|
|
1812
|
-
const parsedExt = (ext.substring(0, 1) === ".") ? ext : ("." + ext);
|
|
1813
|
-
return parsedExt.toLowerCase();
|
|
1814
|
-
});
|
|
1815
|
-
return allowedExtensions;
|
|
1816
|
-
};
|
|
1817
|
-
/**
|
|
1818
|
-
* @hidden
|
|
1819
|
-
*/
|
|
1820
|
-
const validateFiles = (files, restrictionInfo) => {
|
|
1821
|
-
const allowedExtensions = parseAllowedExtensions(restrictionInfo.allowedExtensions);
|
|
1822
|
-
const maxFileSize = restrictionInfo.maxFileSize;
|
|
1823
|
-
const minFileSize = restrictionInfo.minFileSize;
|
|
1824
|
-
let i;
|
|
1825
|
-
for (i = 0; i < files.length; i++) {
|
|
1826
|
-
validateFileExtension(files[i], allowedExtensions);
|
|
1827
|
-
validateFileSize(files[i], minFileSize, maxFileSize);
|
|
1847
|
+
get actionButtonsStartClassName() {
|
|
1848
|
+
return this.actionsLayout === 'start';
|
|
1828
1849
|
}
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
/**
|
|
1832
|
-
* @hidden
|
|
1833
|
-
*/
|
|
1834
|
-
class DropZoneBase {
|
|
1835
|
-
constructor(element, renderer, cssClass) {
|
|
1836
|
-
this.element = element;
|
|
1837
|
-
this.renderer = renderer;
|
|
1838
|
-
this.hideIntervalElement = null;
|
|
1839
|
-
this.hoverClass = cssClass;
|
|
1850
|
+
get actionButtonsCenterClassName() {
|
|
1851
|
+
return this.actionsLayout === 'center';
|
|
1840
1852
|
}
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
onElementDragEnterListener() {
|
|
1845
|
-
this.addClass(this.hoverClass);
|
|
1846
|
-
this.lastDragElement = new Date();
|
|
1847
|
-
if (!this.hideIntervalElement) {
|
|
1848
|
-
this.hideIntervalElement = setInterval(() => {
|
|
1849
|
-
if (this.calculateTimeDiff(this.lastDragElement) < 100) {
|
|
1850
|
-
return;
|
|
1851
|
-
}
|
|
1852
|
-
this.removeClass(this.hoverClass);
|
|
1853
|
-
clearInterval(this.hideIntervalElement);
|
|
1854
|
-
this.hideIntervalElement = null;
|
|
1855
|
-
}, 100);
|
|
1853
|
+
onUploadButtonFocus() {
|
|
1854
|
+
if (!this.navigation.focused) {
|
|
1855
|
+
this.navigation.focusedIndex = this.navigation.lastIndex;
|
|
1856
1856
|
}
|
|
1857
|
-
return false;
|
|
1858
1857
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
onElementDragOverListener() {
|
|
1863
|
-
this.lastDragElement = new Date();
|
|
1864
|
-
return false;
|
|
1858
|
+
onUploadButtonClick(event) {
|
|
1859
|
+
event.stopImmediatePropagation();
|
|
1860
|
+
this.performUpload();
|
|
1865
1861
|
}
|
|
1866
|
-
|
|
1867
|
-
|
|
1862
|
+
performUpload() {
|
|
1863
|
+
if (!this.disabled) {
|
|
1864
|
+
this.uploadService.uploadFiles();
|
|
1865
|
+
this.navigation.focusSelectButton();
|
|
1866
|
+
}
|
|
1868
1867
|
}
|
|
1869
|
-
|
|
1870
|
-
|
|
1868
|
+
onClearButtonClick(event) {
|
|
1869
|
+
event.stopImmediatePropagation();
|
|
1870
|
+
this.clearFiles();
|
|
1871
1871
|
}
|
|
1872
|
-
|
|
1873
|
-
|
|
1872
|
+
clearFiles() {
|
|
1873
|
+
if (!this.disabled) {
|
|
1874
|
+
this.uploadService.clearFiles();
|
|
1875
|
+
this.navigation.focusSelectButton();
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
textFor(key) {
|
|
1879
|
+
return this.localization.get(key);
|
|
1874
1880
|
}
|
|
1875
1881
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1882
|
+
UploadActionButtonsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadActionButtonsComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1883
|
+
UploadActionButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UploadActionButtonsComponent, isStandalone: true, 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: `
|
|
1884
|
+
<button #clearButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-clear-selected"
|
|
1885
|
+
(click)="onClearButtonClick($event)">
|
|
1886
|
+
{{textFor('clearSelectedFiles')}}
|
|
1887
|
+
</button>
|
|
1888
|
+
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
1889
|
+
(focus)="onUploadButtonFocus()"
|
|
1890
|
+
(click)="onUploadButtonClick($event)">
|
|
1891
|
+
{{textFor('uploadSelectedFiles')}}
|
|
1892
|
+
</button>
|
|
1893
|
+
`, isInline: true });
|
|
1894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadActionButtonsComponent, decorators: [{
|
|
1895
|
+
type: Component,
|
|
1896
|
+
args: [{
|
|
1897
|
+
selector: 'kendo-upload-action-buttons',
|
|
1898
|
+
template: `
|
|
1899
|
+
<button #clearButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-clear-selected"
|
|
1900
|
+
(click)="onClearButtonClick($event)">
|
|
1901
|
+
{{textFor('clearSelectedFiles')}}
|
|
1902
|
+
</button>
|
|
1903
|
+
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
1904
|
+
(focus)="onUploadButtonFocus()"
|
|
1905
|
+
(click)="onUploadButtonClick($event)">
|
|
1906
|
+
{{textFor('uploadSelectedFiles')}}
|
|
1907
|
+
</button>
|
|
1908
|
+
`,
|
|
1909
|
+
standalone: true
|
|
1910
|
+
}]
|
|
1911
|
+
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }]; }, propDecorators: { disabled: [{
|
|
1912
|
+
type: Input
|
|
1913
|
+
}], actionsLayout: [{
|
|
1914
|
+
type: Input
|
|
1915
|
+
}], clearButton: [{
|
|
1916
|
+
type: ViewChild,
|
|
1917
|
+
args: ['clearButton', { static: true }]
|
|
1918
|
+
}], uploadButton: [{
|
|
1919
|
+
type: ViewChild,
|
|
1920
|
+
args: ['uploadButton', { static: true }]
|
|
1921
|
+
}], hostDefaultClass: [{
|
|
1922
|
+
type: HostBinding,
|
|
1923
|
+
args: ['class.k-actions']
|
|
1924
|
+
}], actionButtonsEndClassName: [{
|
|
1925
|
+
type: HostBinding,
|
|
1926
|
+
args: ['class.k-actions-end']
|
|
1927
|
+
}], actionButtonsStretchedClassName: [{
|
|
1928
|
+
type: HostBinding,
|
|
1929
|
+
args: ['class.k-actions-stretched']
|
|
1930
|
+
}], actionButtonsStartClassName: [{
|
|
1931
|
+
type: HostBinding,
|
|
1932
|
+
args: ['class.k-actions-start']
|
|
1933
|
+
}], actionButtonsCenterClassName: [{
|
|
1934
|
+
type: HostBinding,
|
|
1935
|
+
args: ['class.k-actions-center']
|
|
1889
1936
|
}] } });
|
|
1890
1937
|
|
|
1891
1938
|
/**
|
|
1892
1939
|
* @hidden
|
|
1893
1940
|
*/
|
|
1894
|
-
class
|
|
1895
|
-
constructor(
|
|
1896
|
-
|
|
1897
|
-
this.ngZone = ngZone;
|
|
1898
|
-
this.uploadService = uploadService;
|
|
1899
|
-
this.initialClassName = true;
|
|
1900
|
-
this.hideIntervalDocument = null;
|
|
1901
|
-
this.activeClass = 'k-dropzone-active';
|
|
1902
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1903
|
-
this.unsubscribeDocumentDragEnter = this.renderer.listen('document', 'dragenter', () => this.onDocumentDragEnter());
|
|
1904
|
-
this.unsubscribeDocumentDragOver = this.renderer.listen('document', 'dragover', () => this.onDocumentDragOver());
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
ngOnDestroy() {
|
|
1908
|
-
this.ngZone.runOutsideAngular(() => {
|
|
1909
|
-
if (this.unsubscribeDocumentDragEnter) {
|
|
1910
|
-
this.unsubscribeDocumentDragEnter();
|
|
1911
|
-
}
|
|
1912
|
-
if (this.unsubscribeDocumentDragOver) {
|
|
1913
|
-
this.unsubscribeDocumentDragOver();
|
|
1914
|
-
}
|
|
1915
|
-
});
|
|
1916
|
-
}
|
|
1917
|
-
onDocumentDragEnter() {
|
|
1918
|
-
this.addClass(this.activeClass);
|
|
1919
|
-
this.lastDragDocument = new Date();
|
|
1920
|
-
if (!this.hideIntervalDocument) {
|
|
1921
|
-
this.hideIntervalDocument = setInterval(() => {
|
|
1922
|
-
if (this.calculateTimeDiff(this.lastDragDocument) < 100) {
|
|
1923
|
-
return;
|
|
1924
|
-
}
|
|
1925
|
-
this.removeClass(this.activeClass);
|
|
1926
|
-
clearInterval(this.hideIntervalDocument);
|
|
1927
|
-
this.hideIntervalDocument = null;
|
|
1928
|
-
}, 100);
|
|
1929
|
-
}
|
|
1930
|
-
return false;
|
|
1931
|
-
}
|
|
1932
|
-
/**
|
|
1933
|
-
* @hidden
|
|
1934
|
-
*/
|
|
1935
|
-
onDocumentDragOver() {
|
|
1936
|
-
this.lastDragDocument = new Date();
|
|
1937
|
-
return false;
|
|
1938
|
-
}
|
|
1939
|
-
onDropListener(event) {
|
|
1940
|
-
const droppedFiles = event.dataTransfer.files;
|
|
1941
|
-
if (droppedFiles.length > 0 && !this.disabled) {
|
|
1942
|
-
let files = getAllFileInfo(droppedFiles);
|
|
1943
|
-
files = assignGuidToFiles(files, !this.uploadService.async.batch);
|
|
1944
|
-
if (!this.multiple) {
|
|
1945
|
-
files.splice(1, files.length - 1);
|
|
1946
|
-
this.uploadService.clearFiles();
|
|
1947
|
-
}
|
|
1948
|
-
validateFiles(files, this.restrictions);
|
|
1949
|
-
this.uploadService.addFiles(files);
|
|
1950
|
-
}
|
|
1951
|
-
return false;
|
|
1952
|
-
}
|
|
1953
|
-
}
|
|
1954
|
-
DropZoneInternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneInternalDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1955
|
-
DropZoneInternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", 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", "class.k-upload-dropzone": "this.initialClassName" } }, usesInheritance: true, ngImport: i0 });
|
|
1956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneInternalDirective, decorators: [{
|
|
1957
|
-
type: Directive,
|
|
1958
|
-
args: [{
|
|
1959
|
-
selector: `
|
|
1960
|
-
[kendoUploadInternalDropZone],
|
|
1961
|
-
[kendoFileSelectInternalDropZone]
|
|
1962
|
-
`
|
|
1963
|
-
}]
|
|
1964
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
1965
|
-
type: Input
|
|
1966
|
-
}], multiple: [{
|
|
1967
|
-
type: Input
|
|
1968
|
-
}], restrictions: [{
|
|
1969
|
-
type: Input
|
|
1970
|
-
}], initialClassName: [{
|
|
1971
|
-
type: HostBinding,
|
|
1972
|
-
args: ['class.k-dropzone']
|
|
1973
|
-
}, {
|
|
1974
|
-
type: HostBinding,
|
|
1975
|
-
args: ['class.k-upload-dropzone']
|
|
1976
|
-
}], onDropListener: [{
|
|
1977
|
-
type: HostListener,
|
|
1978
|
-
args: ['drop', ['$event']]
|
|
1979
|
-
}] } });
|
|
1980
|
-
|
|
1981
|
-
/**
|
|
1982
|
-
* @hidden
|
|
1983
|
-
*/
|
|
1984
|
-
class FileListItemDirective {
|
|
1985
|
-
constructor(el, navigationService, uploadService) {
|
|
1986
|
-
this.navigationService = navigationService;
|
|
1941
|
+
class FileListItemDirective {
|
|
1942
|
+
constructor(el, navigationService, uploadService) {
|
|
1943
|
+
this.navigationService = navigationService;
|
|
1987
1944
|
this.uploadService = uploadService;
|
|
1988
1945
|
this.fileClass = true;
|
|
1989
1946
|
this.focused = false;
|
|
@@ -2031,11 +1988,12 @@ class FileListItemDirective {
|
|
|
2031
1988
|
}
|
|
2032
1989
|
}
|
|
2033
1990
|
FileListItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListItemDirective, deps: [{ token: i0.ElementRef }, { token: NavigationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2034
|
-
FileListItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", 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-focus": "this.kStateFocused" } }, ngImport: i0 });
|
|
1991
|
+
FileListItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileListItemDirective, isStandalone: true, 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-focus": "this.kStateFocused" } }, ngImport: i0 });
|
|
2035
1992
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListItemDirective, decorators: [{
|
|
2036
1993
|
type: Directive,
|
|
2037
1994
|
args: [{
|
|
2038
|
-
selector: '[kendoUploadFileListItem]'
|
|
1995
|
+
selector: '[kendoUploadFileListItem]',
|
|
1996
|
+
standalone: true
|
|
2039
1997
|
}]
|
|
2040
1998
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: NavigationService }, { type: UploadService }]; }, propDecorators: { files: [{
|
|
2041
1999
|
type: Input
|
|
@@ -2202,7 +2160,7 @@ class FileListItemActionButtonComponent {
|
|
|
2202
2160
|
}
|
|
2203
2161
|
}
|
|
2204
2162
|
FileListItemActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListItemActionButtonComponent, deps: [{ token: UploadService }, { token: i1$1.LocalizationService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2205
|
-
FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: { file: "file", disabled: "disabled", progress: "progress" }, ngImport: i0, template: `
|
|
2163
|
+
FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListItemActionButtonComponent, isStandalone: true, selector: "kendo-upload-file-list-item-action-button", inputs: { file: "file", disabled: "disabled", progress: "progress" }, ngImport: i0, template: `
|
|
2206
2164
|
<span class="k-upload-actions">
|
|
2207
2165
|
<span class="k-upload-pct" *ngIf="isUploading || isPaused">{{progress}}%</span>
|
|
2208
2166
|
|
|
@@ -2251,7 +2209,7 @@ FileListItemActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion
|
|
|
2251
2209
|
(click)="onRemoveCancelClick($event)"
|
|
2252
2210
|
></button>
|
|
2253
2211
|
</span>
|
|
2254
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
2212
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
2255
2213
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListItemActionButtonComponent, decorators: [{
|
|
2256
2214
|
type: Component,
|
|
2257
2215
|
args: [{
|
|
@@ -2305,7 +2263,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2305
2263
|
(click)="onRemoveCancelClick($event)"
|
|
2306
2264
|
></button>
|
|
2307
2265
|
</span>
|
|
2308
|
-
|
|
2266
|
+
`,
|
|
2267
|
+
standalone: true,
|
|
2268
|
+
imports: [NgIf, ButtonComponent]
|
|
2309
2269
|
}]
|
|
2310
2270
|
}], ctorParameters: function () { return [{ type: UploadService }, { type: i1$1.LocalizationService }, { type: NavigationService }]; }, propDecorators: { file: [{
|
|
2311
2271
|
type: Input
|
|
@@ -2362,7 +2322,7 @@ class FileListMultipleItemsComponent extends FileListItemBase {
|
|
|
2362
2322
|
}
|
|
2363
2323
|
}
|
|
2364
2324
|
FileListMultipleItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListMultipleItemsComponent, deps: [{ token: i1$1.LocalizationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2365
|
-
FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: { disabled: "disabled", files: "files", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
2325
|
+
FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListMultipleItemsComponent, isStandalone: true, selector: "kendo-upload-file-list-multiple-items", inputs: { disabled: "disabled", files: "files", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
2366
2326
|
<kendo-progressbar
|
|
2367
2327
|
[@progressState]="showProgress"
|
|
2368
2328
|
[value]="progressComplete"
|
|
@@ -2407,7 +2367,7 @@ FileListMultipleItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
|
2407
2367
|
[disabled]='disabled'
|
|
2408
2368
|
[progress]='progressComplete'>
|
|
2409
2369
|
</kendo-upload-file-list-item-action-button>
|
|
2410
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
2370
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ProgressBarComponent, selector: "kendo-progressbar", inputs: ["label", "progressCssStyle", "progressCssClass", "emptyCssStyle", "emptyCssClass", "animation"], outputs: ["animationEnd"], exportAs: ["kendoProgressBar"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], animations: [
|
|
2411
2371
|
trigger('progressState', [
|
|
2412
2372
|
state('active', style({ opacity: 1 })),
|
|
2413
2373
|
state('inactive', style({ opacity: 0 })),
|
|
@@ -2474,7 +2434,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2474
2434
|
[disabled]='disabled'
|
|
2475
2435
|
[progress]='progressComplete'>
|
|
2476
2436
|
</kendo-upload-file-list-item-action-button>
|
|
2477
|
-
|
|
2437
|
+
`,
|
|
2438
|
+
standalone: true,
|
|
2439
|
+
imports: [ProgressBarComponent, IconWrapperComponent, NgIf, NgFor, NgClass, NgTemplateOutlet, FileListItemActionButtonComponent]
|
|
2478
2440
|
}]
|
|
2479
2441
|
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
2480
2442
|
type: Input
|
|
@@ -2539,7 +2501,7 @@ class FileListSingleItemComponent extends FileListItemBase {
|
|
|
2539
2501
|
}
|
|
2540
2502
|
}
|
|
2541
2503
|
FileListSingleItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListSingleItemComponent, deps: [{ token: i1$1.LocalizationService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2542
|
-
FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListSingleItemComponent, selector: "kendo-upload-file-list-single-item", inputs: { disabled: "disabled", file: "file", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
2504
|
+
FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListSingleItemComponent, isStandalone: true, selector: "kendo-upload-file-list-single-item", inputs: { disabled: "disabled", file: "file", fileInfoTemplate: "fileInfoTemplate" }, usesInheritance: true, ngImport: i0, template: `
|
|
2543
2505
|
<kendo-progressbar
|
|
2544
2506
|
[@progressState]="showProgress"
|
|
2545
2507
|
[value]="progressComplete"
|
|
@@ -2576,7 +2538,7 @@ FileListSingleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
|
|
|
2576
2538
|
[disabled]='disabled'
|
|
2577
2539
|
[progress]='progressComplete'>
|
|
2578
2540
|
</kendo-upload-file-list-item-action-button>
|
|
2579
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
2541
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ProgressBarComponent, selector: "kendo-progressbar", inputs: ["label", "progressCssStyle", "progressCssClass", "emptyCssStyle", "emptyCssClass", "animation"], outputs: ["animationEnd"], exportAs: ["kendoProgressBar"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FileListItemActionButtonComponent, selector: "kendo-upload-file-list-item-action-button", inputs: ["file", "disabled", "progress"] }], animations: [
|
|
2580
2542
|
trigger('progressState', [
|
|
2581
2543
|
state('active', style({ opacity: 1 })),
|
|
2582
2544
|
state('inactive', style({ opacity: 0 })),
|
|
@@ -2635,7 +2597,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2635
2597
|
[disabled]='disabled'
|
|
2636
2598
|
[progress]='progressComplete'>
|
|
2637
2599
|
</kendo-upload-file-list-item-action-button>
|
|
2638
|
-
|
|
2600
|
+
`,
|
|
2601
|
+
standalone: true,
|
|
2602
|
+
imports: [ProgressBarComponent, IconWrapperComponent, NgIf, NgClass, NgTemplateOutlet, FileListItemActionButtonComponent]
|
|
2639
2603
|
}]
|
|
2640
2604
|
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
2641
2605
|
type: Input
|
|
@@ -2721,7 +2685,7 @@ class FileListComponent {
|
|
|
2721
2685
|
}
|
|
2722
2686
|
}
|
|
2723
2687
|
FileListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListComponent, deps: [{ token: UploadService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2724
|
-
FileListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: { disabled: "disabled", fileList: "fileList", fileTemplate: "fileTemplate", fileInfoTemplate: "fileInfoTemplate" }, host: { properties: { "attr.role": "this.fileListRole" } }, viewQueries: [{ propertyName: "fileListItems", predicate: FileListItemDirective, descendants: true }], ngImport: i0, template: `
|
|
2688
|
+
FileListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileListComponent, isStandalone: true, selector: "[kendo-upload-file-list]", inputs: { disabled: "disabled", fileList: "fileList", fileTemplate: "fileTemplate", fileInfoTemplate: "fileInfoTemplate" }, host: { properties: { "attr.role": "this.fileListRole" } }, viewQueries: [{ propertyName: "fileListItems", predicate: FileListItemDirective, descendants: true }], ngImport: i0, template: `
|
|
2725
2689
|
<ng-template ngFor
|
|
2726
2690
|
[ngForOf]="fileList"
|
|
2727
2691
|
let-files
|
|
@@ -2747,7 +2711,7 @@ FileListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
2747
2711
|
}"></ng-container>
|
|
2748
2712
|
</li>
|
|
2749
2713
|
</ng-template>
|
|
2750
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
2714
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: FileListItemDirective, selector: "[kendoUploadFileListItem]", inputs: ["files", "index"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FileListSingleItemComponent, selector: "kendo-upload-file-list-single-item", inputs: ["disabled", "file", "fileInfoTemplate"] }, { kind: "component", type: FileListMultipleItemsComponent, selector: "kendo-upload-file-list-multiple-items", inputs: ["disabled", "files", "fileInfoTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2751
2715
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileListComponent, decorators: [{
|
|
2752
2716
|
type: Component,
|
|
2753
2717
|
args: [{
|
|
@@ -2778,7 +2742,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2778
2742
|
}"></ng-container>
|
|
2779
2743
|
</li>
|
|
2780
2744
|
</ng-template>
|
|
2781
|
-
|
|
2745
|
+
`,
|
|
2746
|
+
standalone: true,
|
|
2747
|
+
imports: [NgFor, FileListItemDirective, NgIf, FileListSingleItemComponent, FileListMultipleItemsComponent, NgTemplateOutlet]
|
|
2782
2748
|
}]
|
|
2783
2749
|
}], ctorParameters: function () { return [{ type: UploadService }, { type: NavigationService }]; }, propDecorators: { disabled: [{
|
|
2784
2750
|
type: Input
|
|
@@ -2796,6 +2762,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2796
2762
|
args: ['attr.role']
|
|
2797
2763
|
}] } });
|
|
2798
2764
|
|
|
2765
|
+
/**
|
|
2766
|
+
* @hidden
|
|
2767
|
+
*/
|
|
2768
|
+
class UploadStatusTotalComponent {
|
|
2769
|
+
constructor(localization) {
|
|
2770
|
+
this.localization = localization;
|
|
2771
|
+
this.checkmarkIcon = checkIcon;
|
|
2772
|
+
this.exceptionSVGIcon = exclamationCircleIcon;
|
|
2773
|
+
this.uploadSVGIcon = uploadIcon;
|
|
2774
|
+
this.pauseSVGIcon = pauseSmIcon;
|
|
2775
|
+
}
|
|
2776
|
+
get iconClass() {
|
|
2777
|
+
if (!this.isUploading && !this.isFailed) {
|
|
2778
|
+
return 'checkmark';
|
|
2779
|
+
}
|
|
2780
|
+
if (!this.isUploading && this.isFailed) {
|
|
2781
|
+
return 'exception';
|
|
2782
|
+
}
|
|
2783
|
+
if (this.isUploading) {
|
|
2784
|
+
return 'upload';
|
|
2785
|
+
}
|
|
2786
|
+
if (this.isPaused) {
|
|
2787
|
+
return 'pause-sm';
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
get SVGIconClass() {
|
|
2791
|
+
if (!this.isUploading && !this.isFailed) {
|
|
2792
|
+
return this.checkmarkIcon;
|
|
2793
|
+
}
|
|
2794
|
+
if (!this.isUploading && this.isFailed) {
|
|
2795
|
+
return this.exceptionSVGIcon;
|
|
2796
|
+
}
|
|
2797
|
+
if (this.isUploading) {
|
|
2798
|
+
return this.uploadSVGIcon;
|
|
2799
|
+
}
|
|
2800
|
+
if (this.isPaused) {
|
|
2801
|
+
return this.pauseSVGIcon;
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
ngDoCheck() {
|
|
2805
|
+
this.isPaused = this.fileList.hasFileWithState([FileState.Paused]);
|
|
2806
|
+
this.isFailed = this.fileList.hasFileWithState([FileState.Failed]);
|
|
2807
|
+
this.isUploading = this.fileList.hasFileWithState([FileState.Uploading]);
|
|
2808
|
+
if (this.isPaused && !this.isUploading) {
|
|
2809
|
+
this.statusText = this.localization.get('headerStatusPaused');
|
|
2810
|
+
}
|
|
2811
|
+
else {
|
|
2812
|
+
this.statusText = this.isUploading ? this.localization.get('headerStatusUploading')
|
|
2813
|
+
: this.localization.get('headerStatusUploaded');
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
UploadStatusTotalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadStatusTotalComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2818
|
+
UploadStatusTotalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UploadStatusTotalComponent, isStandalone: true, selector: "kendo-upload-status-total", inputs: { fileList: "fileList" }, ngImport: i0, template: `
|
|
2819
|
+
<kendo-icon-wrapper
|
|
2820
|
+
[name]="iconClass"
|
|
2821
|
+
[svgIcon]="SVGIconClass"
|
|
2822
|
+
>
|
|
2823
|
+
</kendo-icon-wrapper>
|
|
2824
|
+
{{statusText}}
|
|
2825
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
2826
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadStatusTotalComponent, decorators: [{
|
|
2827
|
+
type: Component,
|
|
2828
|
+
args: [{
|
|
2829
|
+
selector: 'kendo-upload-status-total',
|
|
2830
|
+
template: `
|
|
2831
|
+
<kendo-icon-wrapper
|
|
2832
|
+
[name]="iconClass"
|
|
2833
|
+
[svgIcon]="SVGIconClass"
|
|
2834
|
+
>
|
|
2835
|
+
</kendo-icon-wrapper>
|
|
2836
|
+
{{statusText}}
|
|
2837
|
+
`,
|
|
2838
|
+
standalone: true,
|
|
2839
|
+
imports: [IconWrapperComponent]
|
|
2840
|
+
}]
|
|
2841
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; }, propDecorators: { fileList: [{
|
|
2842
|
+
type: Input
|
|
2843
|
+
}] } });
|
|
2844
|
+
|
|
2799
2845
|
/**
|
|
2800
2846
|
* @hidden
|
|
2801
2847
|
*/
|
|
@@ -2855,11 +2901,12 @@ class FileSelectDirective {
|
|
|
2855
2901
|
}
|
|
2856
2902
|
}
|
|
2857
2903
|
FileSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectDirective, deps: [{ token: UploadService }, { token: NavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2858
|
-
FileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: { dir: "dir", disabled: "disabled", multiple: "multiple", restrictions: "restrictions", accept: "accept", required: "required" }, host: { listeners: { "change": "onInputChange($event)" }, properties: { "attr.type": "this.type", "attr.autocomplete": "this.autocomplete", "attr.tabindex": "this.tabIndex", "attr.aria-hidden": "this.ariaHidden", "class.k-hidden": "this.classNames", "attr.name": "this.nameAttribute", "attr.multiple": "this.multipleAttribute", "attr.dir": "this.dirAttribute", "attr.disabled": "this.disabledAttribute", "attr.accept": "this.acceptAttribute", "attr.required": "this.requiredAttribute" } }, ngImport: i0 });
|
|
2904
|
+
FileSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FileSelectDirective, isStandalone: true, selector: "[kendoFileSelect]", inputs: { dir: "dir", disabled: "disabled", multiple: "multiple", restrictions: "restrictions", accept: "accept", required: "required" }, host: { listeners: { "change": "onInputChange($event)" }, properties: { "attr.type": "this.type", "attr.autocomplete": "this.autocomplete", "attr.tabindex": "this.tabIndex", "attr.aria-hidden": "this.ariaHidden", "class.k-hidden": "this.classNames", "attr.name": "this.nameAttribute", "attr.multiple": "this.multipleAttribute", "attr.dir": "this.dirAttribute", "attr.disabled": "this.disabledAttribute", "attr.accept": "this.acceptAttribute", "attr.required": "this.requiredAttribute" } }, ngImport: i0 });
|
|
2859
2905
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectDirective, decorators: [{
|
|
2860
2906
|
type: Directive,
|
|
2861
2907
|
args: [{
|
|
2862
|
-
selector: '[kendoFileSelect]'
|
|
2908
|
+
selector: '[kendoFileSelect]',
|
|
2909
|
+
standalone: true
|
|
2863
2910
|
}]
|
|
2864
2911
|
}], ctorParameters: function () { return [{ type: UploadService }, { type: NavigationService }, { type: i0.ElementRef }]; }, propDecorators: { dir: [{
|
|
2865
2912
|
type: Input
|
|
@@ -2914,706 +2961,240 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2914
2961
|
/**
|
|
2915
2962
|
* @hidden
|
|
2916
2963
|
*/
|
|
2917
|
-
class
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
}], propDecorators: { cancel: [{
|
|
2924
|
-
type: Input
|
|
2925
|
-
}], clearSelectedFiles: [{
|
|
2926
|
-
type: Input
|
|
2927
|
-
}], dropFilesHere: [{
|
|
2928
|
-
type: Input
|
|
2929
|
-
}], externalDropFilesHere: [{
|
|
2930
|
-
type: Input
|
|
2931
|
-
}], filesBatchStatus: [{
|
|
2932
|
-
type: Input
|
|
2933
|
-
}], filesBatchStatusFailed: [{
|
|
2934
|
-
type: Input
|
|
2935
|
-
}], filesBatchStatusUploaded: [{
|
|
2936
|
-
type: Input
|
|
2937
|
-
}], fileStatusFailed: [{
|
|
2938
|
-
type: Input
|
|
2939
|
-
}], fileStatusUploaded: [{
|
|
2940
|
-
type: Input
|
|
2941
|
-
}], headerStatusPaused: [{
|
|
2942
|
-
type: Input
|
|
2943
|
-
}], headerStatusUploaded: [{
|
|
2944
|
-
type: Input
|
|
2945
|
-
}], headerStatusUploading: [{
|
|
2946
|
-
type: Input
|
|
2947
|
-
}], invalidFileExtension: [{
|
|
2948
|
-
type: Input
|
|
2949
|
-
}], invalidMaxFileSize: [{
|
|
2950
|
-
type: Input
|
|
2951
|
-
}], invalidMinFileSize: [{
|
|
2952
|
-
type: Input
|
|
2953
|
-
}], pause: [{
|
|
2954
|
-
type: Input
|
|
2955
|
-
}], remove: [{
|
|
2956
|
-
type: Input
|
|
2957
|
-
}], resume: [{
|
|
2958
|
-
type: Input
|
|
2959
|
-
}], retry: [{
|
|
2960
|
-
type: Input
|
|
2961
|
-
}], select: [{
|
|
2962
|
-
type: Input
|
|
2963
|
-
}], uploadSelectedFiles: [{
|
|
2964
|
-
type: Input
|
|
2965
|
-
}] } });
|
|
2966
|
-
|
|
2967
|
-
/**
|
|
2968
|
-
* @hidden
|
|
2969
|
-
*/
|
|
2970
|
-
class LocalizedMessagesDirective extends Messages {
|
|
2971
|
-
constructor(service) {
|
|
2972
|
-
super();
|
|
2973
|
-
this.service = service;
|
|
2964
|
+
class DropZoneBase {
|
|
2965
|
+
constructor(element, renderer, cssClass) {
|
|
2966
|
+
this.element = element;
|
|
2967
|
+
this.renderer = renderer;
|
|
2968
|
+
this.hideIntervalElement = null;
|
|
2969
|
+
this.hoverClass = cssClass;
|
|
2974
2970
|
}
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2971
|
+
/**
|
|
2972
|
+
* @hidden
|
|
2973
|
+
*/
|
|
2974
|
+
onElementDragEnterListener() {
|
|
2975
|
+
this.addClass(this.hoverClass);
|
|
2976
|
+
this.lastDragElement = new Date();
|
|
2977
|
+
if (!this.hideIntervalElement) {
|
|
2978
|
+
this.hideIntervalElement = setInterval(() => {
|
|
2979
|
+
if (this.calculateTimeDiff(this.lastDragElement) < 100) {
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
this.removeClass(this.hoverClass);
|
|
2983
|
+
clearInterval(this.hideIntervalElement);
|
|
2984
|
+
this.hideIntervalElement = null;
|
|
2985
|
+
}, 100);
|
|
2981
2986
|
}
|
|
2982
|
-
], usesInheritance: true, ngImport: i0 });
|
|
2983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
2984
|
-
type: Directive,
|
|
2985
|
-
args: [{
|
|
2986
|
-
providers: [
|
|
2987
|
-
{
|
|
2988
|
-
provide: Messages,
|
|
2989
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
2990
|
-
}
|
|
2991
|
-
],
|
|
2992
|
-
selector: `
|
|
2993
|
-
[kendoUploadLocalizedMessages],
|
|
2994
|
-
[kendoFileSelectLocalizedMessages],
|
|
2995
|
-
[kendoUploadDropZoneLocalizedMessages]
|
|
2996
|
-
`
|
|
2997
|
-
}]
|
|
2998
|
-
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
2999
|
-
|
|
3000
|
-
/**
|
|
3001
|
-
* @hidden
|
|
3002
|
-
*/
|
|
3003
|
-
const FILESELECT_VALUE_ACCESSOR = {
|
|
3004
|
-
multi: true,
|
|
3005
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3006
|
-
useExisting: forwardRef(() => FileSelectComponent)
|
|
3007
|
-
};
|
|
3008
|
-
let idx$1 = 0;
|
|
3009
|
-
class FileSelectComponent extends UploadFileSelectBase {
|
|
3010
|
-
constructor(uploadService, localization, navigation, dropZoneService, ngZone, renderer, cdr, wrapper, injector) {
|
|
3011
|
-
super(uploadService, navigation, cdr, injector, ngZone);
|
|
3012
|
-
this.uploadService = uploadService;
|
|
3013
|
-
this.localization = localization;
|
|
3014
|
-
this.navigation = navigation;
|
|
3015
|
-
this.dropZoneService = dropZoneService;
|
|
3016
|
-
this.ngZone = ngZone;
|
|
3017
|
-
this.renderer = renderer;
|
|
3018
|
-
this.cdr = cdr;
|
|
3019
|
-
this.injector = injector;
|
|
3020
|
-
/**
|
|
3021
|
-
* Fires when the value of the component has changed as a result of a successful `select` or `remove` operation.
|
|
3022
|
-
*/
|
|
3023
|
-
this.valueChange = new EventEmitter();
|
|
3024
|
-
/**
|
|
3025
|
-
* @hidden
|
|
3026
|
-
*/
|
|
3027
|
-
this._restrictions = {
|
|
3028
|
-
allowedExtensions: [],
|
|
3029
|
-
maxFileSize: 0,
|
|
3030
|
-
minFileSize: 0
|
|
3031
|
-
};
|
|
3032
|
-
validatePackage(packageMetadata);
|
|
3033
|
-
this.wrapper = wrapper.nativeElement;
|
|
3034
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
3035
|
-
this.navigation.computeKeys();
|
|
3036
|
-
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
3037
|
-
this.direction = rtl ? 'rtl' : 'ltr';
|
|
3038
|
-
});
|
|
3039
|
-
this.subscribeBlur();
|
|
3040
|
-
this.subscribeFocus();
|
|
3041
|
-
this.attachEventHandlers();
|
|
3042
|
-
this.setDefaultSettings();
|
|
3043
|
-
}
|
|
3044
|
-
get dir() {
|
|
3045
|
-
return this.direction;
|
|
3046
|
-
}
|
|
3047
|
-
/**
|
|
3048
|
-
* Sets the `name` attribute of the `input` element of the FileSelect.
|
|
3049
|
-
*/
|
|
3050
|
-
set name(name) {
|
|
3051
|
-
this.uploadService.async.saveField = name;
|
|
3052
|
-
}
|
|
3053
|
-
get name() {
|
|
3054
|
-
return this.uploadService.async.saveField;
|
|
3055
|
-
}
|
|
3056
|
-
ngOnInit() {
|
|
3057
|
-
const { buttonId, fileListId } = this.getIds();
|
|
3058
|
-
this.focusableId = buttonId;
|
|
3059
|
-
this.fileListId = fileListId;
|
|
3060
|
-
if (this.zoneId) {
|
|
3061
|
-
this.dropZoneService.addComponent(this, this.zoneId);
|
|
3062
|
-
}
|
|
3063
|
-
this.subs.add(this.renderer.listen(this.fileSelectInput.nativeElement, 'mouseenter', () => {
|
|
3064
|
-
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-hover');
|
|
3065
|
-
}));
|
|
3066
|
-
this.subs.add(this.renderer.listen(this.fileSelectInput.nativeElement, 'mouseleave', () => {
|
|
3067
|
-
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-hover');
|
|
3068
|
-
}));
|
|
3069
|
-
this.ngZone.runOutsideAngular(() => {
|
|
3070
|
-
this.subs.add(this.renderer.listen(this.wrapper, 'keydown', event => this.handleKeydown(event)));
|
|
3071
|
-
});
|
|
3072
|
-
}
|
|
3073
|
-
/**
|
|
3074
|
-
* @hidden
|
|
3075
|
-
*/
|
|
3076
|
-
textFor(key) {
|
|
3077
|
-
return this.localization.get(key);
|
|
3078
|
-
}
|
|
3079
|
-
ngOnDestroy() {
|
|
3080
|
-
this.fileList.clear();
|
|
3081
|
-
if (this.blurSubscription) {
|
|
3082
|
-
this.blurSubscription.unsubscribe();
|
|
3083
|
-
}
|
|
3084
|
-
if (this.wrapperFocusSubscription) {
|
|
3085
|
-
this.wrapperFocusSubscription.unsubscribe();
|
|
3086
|
-
}
|
|
3087
|
-
if (this.selectButtonFocusSubscription) {
|
|
3088
|
-
this.selectButtonFocusSubscription.unsubscribe();
|
|
3089
|
-
}
|
|
3090
|
-
if (this.localizationChangeSubscription) {
|
|
3091
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
3092
|
-
}
|
|
3093
|
-
if (this.subs) {
|
|
3094
|
-
this.subs.unsubscribe();
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
/**
|
|
3098
|
-
* Removes specific file from the file list.
|
|
3099
|
-
*/
|
|
3100
|
-
removeFileByUid(uid) {
|
|
3101
|
-
this.uploadService.removeFiles(uid);
|
|
3102
|
-
}
|
|
3103
|
-
/**
|
|
3104
|
-
* Visually clears all files from the UI.
|
|
3105
|
-
*/
|
|
3106
|
-
clearFiles() {
|
|
3107
|
-
this.uploadService.clearFiles();
|
|
3108
|
-
}
|
|
3109
|
-
/**
|
|
3110
|
-
* @hidden
|
|
3111
|
-
* Used to determine if the component is empty.
|
|
3112
|
-
*/
|
|
3113
|
-
isEmpty() {
|
|
3114
2987
|
return false;
|
|
3115
2988
|
}
|
|
3116
2989
|
/**
|
|
3117
2990
|
* @hidden
|
|
3118
|
-
* Used by the external dropzone to add files to the FileSelect
|
|
3119
2991
|
*/
|
|
3120
|
-
|
|
3121
|
-
this.
|
|
3122
|
-
|
|
3123
|
-
/**
|
|
3124
|
-
* @hidden
|
|
3125
|
-
*/
|
|
3126
|
-
get selectButtonTabIndex() {
|
|
3127
|
-
return this.disabled ? undefined : this.tabindex;
|
|
3128
|
-
}
|
|
3129
|
-
/**
|
|
3130
|
-
* @hidden
|
|
3131
|
-
*/
|
|
3132
|
-
getIds() {
|
|
3133
|
-
const id = ++idx$1;
|
|
3134
|
-
const buttonId = `k-fileselect-button-${id}`;
|
|
3135
|
-
const fileListId = `k-fileselect-file-list-${id}`;
|
|
3136
|
-
return { buttonId, fileListId };
|
|
3137
|
-
}
|
|
3138
|
-
/**
|
|
3139
|
-
* @hidden
|
|
3140
|
-
*/
|
|
3141
|
-
writeValue(newValue) {
|
|
3142
|
-
super.writeValue(newValue, validateInitialFileSelectFile, 'addInitialFileSelectFiles');
|
|
3143
|
-
}
|
|
3144
|
-
subscribeBlur() {
|
|
3145
|
-
if (!isDocumentAvailable()) {
|
|
3146
|
-
return;
|
|
3147
|
-
}
|
|
3148
|
-
this.ngZone.runOutsideAngular(() => {
|
|
3149
|
-
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
3150
|
-
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
3151
|
-
}));
|
|
3152
|
-
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
3153
|
-
if (this.navigation.focused) {
|
|
3154
|
-
this.ngZone.run(() => {
|
|
3155
|
-
this.navigation.focused = false;
|
|
3156
|
-
this.onTouchedCallback();
|
|
3157
|
-
this.onBlur.emit();
|
|
3158
|
-
});
|
|
3159
|
-
}
|
|
3160
|
-
});
|
|
3161
|
-
});
|
|
3162
|
-
}
|
|
3163
|
-
subscribeFocus() {
|
|
3164
|
-
this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(() => {
|
|
3165
|
-
this.onFocus.emit();
|
|
3166
|
-
});
|
|
3167
|
-
this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(() => {
|
|
3168
|
-
this.fileSelectButton.nativeElement.focus();
|
|
3169
|
-
});
|
|
3170
|
-
}
|
|
3171
|
-
handleKeydown(event) {
|
|
3172
|
-
if (this.disabled) {
|
|
3173
|
-
return;
|
|
3174
|
-
}
|
|
3175
|
-
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
3176
|
-
event.preventDefault();
|
|
3177
|
-
this.fileSelectInput.nativeElement.click();
|
|
3178
|
-
return;
|
|
3179
|
-
}
|
|
3180
|
-
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
3181
|
-
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
3182
|
-
this.navigation.process(event, 'fileselect');
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
attachEventHandlers() {
|
|
3186
|
-
this.subs = this.uploadService.changeEvent.subscribe((files) => {
|
|
3187
|
-
let model = [];
|
|
3188
|
-
if (files !== null) {
|
|
3189
|
-
files.forEach((file) => {
|
|
3190
|
-
if (file.state === FileState.Initial) {
|
|
3191
|
-
model.push(file);
|
|
3192
|
-
}
|
|
3193
|
-
if (file.state === FileState.Selected && file.rawFile && !file.validationErrors) {
|
|
3194
|
-
model.push(file.rawFile);
|
|
3195
|
-
}
|
|
3196
|
-
});
|
|
3197
|
-
}
|
|
3198
|
-
if (model.length === 0) {
|
|
3199
|
-
model = null;
|
|
3200
|
-
}
|
|
3201
|
-
this.onChangeCallback(model);
|
|
3202
|
-
this.valueChange.emit(model);
|
|
3203
|
-
});
|
|
3204
|
-
this.subs.add(this.uploadService.removeEvent.subscribe((args) => {
|
|
3205
|
-
this.remove.emit(args);
|
|
3206
|
-
}));
|
|
3207
|
-
this.subs.add(this.uploadService.selectEvent.subscribe((args) => {
|
|
3208
|
-
this.select.emit(args);
|
|
3209
|
-
}));
|
|
2992
|
+
onElementDragOverListener() {
|
|
2993
|
+
this.lastDragElement = new Date();
|
|
2994
|
+
return false;
|
|
3210
2995
|
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
this.uploadService.component = 'FileSelect';
|
|
2996
|
+
calculateTimeDiff(prevEvent) {
|
|
2997
|
+
return new Date().getTime() - prevEvent.getTime();
|
|
3214
2998
|
}
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileSelectComponent, selector: "kendo-fileselect", inputs: { name: "name" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.dir" } }, providers: [
|
|
3218
|
-
LocalizationService,
|
|
3219
|
-
NavigationService,
|
|
3220
|
-
UploadService,
|
|
3221
|
-
DropZoneService,
|
|
3222
|
-
FILESELECT_VALUE_ACCESSOR,
|
|
3223
|
-
{
|
|
3224
|
-
provide: L10N_PREFIX,
|
|
3225
|
-
useValue: 'kendo.fileselect'
|
|
3226
|
-
},
|
|
3227
|
-
{
|
|
3228
|
-
provide: KendoInput,
|
|
3229
|
-
useExisting: forwardRef(() => FileSelectComponent)
|
|
3230
|
-
}
|
|
3231
|
-
], viewQueries: [{ propertyName: "fileSelectInput", first: true, predicate: ["fileSelectInput"], descendants: true, static: true }], exportAs: ["kendoFileSelect"], usesInheritance: true, ngImport: i0, template: `
|
|
3232
|
-
<ng-container kendoFileSelectLocalizedMessages
|
|
3233
|
-
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
3234
|
-
dropFilesHere="Drop files here to select"
|
|
3235
|
-
|
|
3236
|
-
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
3237
|
-
invalidFileExtension="File type not allowed."
|
|
3238
|
-
|
|
3239
|
-
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
3240
|
-
invalidMaxFileSize="File size too large."
|
|
3241
|
-
|
|
3242
|
-
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
3243
|
-
invalidMinFileSize="File size too small."
|
|
3244
|
-
|
|
3245
|
-
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
3246
|
-
remove="Remove"
|
|
3247
|
-
|
|
3248
|
-
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
3249
|
-
select="Select files..."
|
|
3250
|
-
>
|
|
3251
|
-
</ng-container>
|
|
3252
|
-
<div kendoFileSelectInternalDropZone
|
|
3253
|
-
[restrictions]="restrictions"
|
|
3254
|
-
[multiple]="multiple"
|
|
3255
|
-
[disabled]="disabled">
|
|
3256
|
-
<div class="k-upload-button-wrap">
|
|
3257
|
-
<button
|
|
3258
|
-
kendoButton
|
|
3259
|
-
#fileSelectButton
|
|
3260
|
-
class="k-upload-button"
|
|
3261
|
-
type="button"
|
|
3262
|
-
role="button"
|
|
3263
|
-
(click)="fileSelectInput.click()"
|
|
3264
|
-
(focus)="onFileSelectButtonFocus()"
|
|
3265
|
-
[id]="focusableId"
|
|
3266
|
-
[attr.aria-label]="textFor('select')"
|
|
3267
|
-
[attr.tabindex]="tabindex"
|
|
3268
|
-
[attr.aria-expanded]="hasFileList"
|
|
3269
|
-
[attr.aria-controls]="hasFileList ? fileListId : undefined"
|
|
3270
|
-
>
|
|
3271
|
-
{{textFor('select')}}
|
|
3272
|
-
</button>
|
|
3273
|
-
<input kendoFileSelect #fileSelectInput
|
|
3274
|
-
[dir]="direction"
|
|
3275
|
-
[accept]="accept"
|
|
3276
|
-
[restrictions]="restrictions"
|
|
3277
|
-
[multiple]="multiple"
|
|
3278
|
-
[disabled]="disabled"
|
|
3279
|
-
[required]="isControlRequired"
|
|
3280
|
-
/>
|
|
3281
|
-
</div>
|
|
3282
|
-
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
3283
|
-
</div>
|
|
3284
|
-
<ul kendo-upload-file-list
|
|
3285
|
-
class="k-upload-files k-reset"
|
|
3286
|
-
*ngIf="hasFileList"
|
|
3287
|
-
[disabled]="disabled"
|
|
3288
|
-
[fileList]="fileList.files"
|
|
3289
|
-
[fileTemplate]="fileTemplate"
|
|
3290
|
-
[fileInfoTemplate]="fileInfoTemplate"
|
|
3291
|
-
[id]="fileListId">
|
|
3292
|
-
</ul>
|
|
3293
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { kind: "component", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { kind: "directive", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept", "required"] }, { kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i10.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
3294
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
3295
|
-
type: Component,
|
|
3296
|
-
args: [{
|
|
3297
|
-
exportAs: 'kendoFileSelect',
|
|
3298
|
-
providers: [
|
|
3299
|
-
LocalizationService,
|
|
3300
|
-
NavigationService,
|
|
3301
|
-
UploadService,
|
|
3302
|
-
DropZoneService,
|
|
3303
|
-
FILESELECT_VALUE_ACCESSOR,
|
|
3304
|
-
{
|
|
3305
|
-
provide: L10N_PREFIX,
|
|
3306
|
-
useValue: 'kendo.fileselect'
|
|
3307
|
-
},
|
|
3308
|
-
{
|
|
3309
|
-
provide: KendoInput,
|
|
3310
|
-
useExisting: forwardRef(() => FileSelectComponent)
|
|
3311
|
-
}
|
|
3312
|
-
],
|
|
3313
|
-
selector: 'kendo-fileselect',
|
|
3314
|
-
template: `
|
|
3315
|
-
<ng-container kendoFileSelectLocalizedMessages
|
|
3316
|
-
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
3317
|
-
dropFilesHere="Drop files here to select"
|
|
3318
|
-
|
|
3319
|
-
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
3320
|
-
invalidFileExtension="File type not allowed."
|
|
3321
|
-
|
|
3322
|
-
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
3323
|
-
invalidMaxFileSize="File size too large."
|
|
3324
|
-
|
|
3325
|
-
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
3326
|
-
invalidMinFileSize="File size too small."
|
|
3327
|
-
|
|
3328
|
-
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
3329
|
-
remove="Remove"
|
|
3330
|
-
|
|
3331
|
-
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
3332
|
-
select="Select files..."
|
|
3333
|
-
>
|
|
3334
|
-
</ng-container>
|
|
3335
|
-
<div kendoFileSelectInternalDropZone
|
|
3336
|
-
[restrictions]="restrictions"
|
|
3337
|
-
[multiple]="multiple"
|
|
3338
|
-
[disabled]="disabled">
|
|
3339
|
-
<div class="k-upload-button-wrap">
|
|
3340
|
-
<button
|
|
3341
|
-
kendoButton
|
|
3342
|
-
#fileSelectButton
|
|
3343
|
-
class="k-upload-button"
|
|
3344
|
-
type="button"
|
|
3345
|
-
role="button"
|
|
3346
|
-
(click)="fileSelectInput.click()"
|
|
3347
|
-
(focus)="onFileSelectButtonFocus()"
|
|
3348
|
-
[id]="focusableId"
|
|
3349
|
-
[attr.aria-label]="textFor('select')"
|
|
3350
|
-
[attr.tabindex]="tabindex"
|
|
3351
|
-
[attr.aria-expanded]="hasFileList"
|
|
3352
|
-
[attr.aria-controls]="hasFileList ? fileListId : undefined"
|
|
3353
|
-
>
|
|
3354
|
-
{{textFor('select')}}
|
|
3355
|
-
</button>
|
|
3356
|
-
<input kendoFileSelect #fileSelectInput
|
|
3357
|
-
[dir]="direction"
|
|
3358
|
-
[accept]="accept"
|
|
3359
|
-
[restrictions]="restrictions"
|
|
3360
|
-
[multiple]="multiple"
|
|
3361
|
-
[disabled]="disabled"
|
|
3362
|
-
[required]="isControlRequired"
|
|
3363
|
-
/>
|
|
3364
|
-
</div>
|
|
3365
|
-
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
3366
|
-
</div>
|
|
3367
|
-
<ul kendo-upload-file-list
|
|
3368
|
-
class="k-upload-files k-reset"
|
|
3369
|
-
*ngIf="hasFileList"
|
|
3370
|
-
[disabled]="disabled"
|
|
3371
|
-
[fileList]="fileList.files"
|
|
3372
|
-
[fileTemplate]="fileTemplate"
|
|
3373
|
-
[fileInfoTemplate]="fileInfoTemplate"
|
|
3374
|
-
[id]="fileListId">
|
|
3375
|
-
</ul>
|
|
3376
|
-
`
|
|
3377
|
-
}]
|
|
3378
|
-
}], 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 }, { type: i0.Injector }]; }, propDecorators: { fileSelectInput: [{
|
|
3379
|
-
type: ViewChild,
|
|
3380
|
-
args: ['fileSelectInput', { static: true }]
|
|
3381
|
-
}], dir: [{
|
|
3382
|
-
type: HostBinding,
|
|
3383
|
-
args: ['attr.dir']
|
|
3384
|
-
}], name: [{
|
|
3385
|
-
type: Input
|
|
3386
|
-
}], valueChange: [{
|
|
3387
|
-
type: Output
|
|
3388
|
-
}] } });
|
|
3389
|
-
|
|
3390
|
-
/**
|
|
3391
|
-
* Custom component messages override default component messages ([more information and example]({% slug globalization_upload %})).
|
|
3392
|
-
*
|
|
3393
|
-
* @example
|
|
3394
|
-
* ```html-no-run
|
|
3395
|
-
* <kendo-fileselect>
|
|
3396
|
-
* <kendo-fileselect-messages
|
|
3397
|
-
* dropFilesHere="Drop your file here"
|
|
3398
|
-
* select="Upload file">
|
|
3399
|
-
* </kendo-fileselect-messages>
|
|
3400
|
-
* </kendo-fileselect>
|
|
3401
|
-
* ```
|
|
3402
|
-
*/
|
|
3403
|
-
class CustomMessagesComponent extends Messages {
|
|
3404
|
-
constructor(service) {
|
|
3405
|
-
super();
|
|
3406
|
-
this.service = service;
|
|
2999
|
+
addClass(className) {
|
|
3000
|
+
this.renderer.addClass(this.element.nativeElement, className);
|
|
3407
3001
|
}
|
|
3408
|
-
|
|
3409
|
-
|
|
3002
|
+
removeClass(className) {
|
|
3003
|
+
this.renderer.removeClass(this.element.nativeElement, className);
|
|
3410
3004
|
}
|
|
3411
3005
|
}
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
this.hostDefaultClass = true;
|
|
3443
|
-
}
|
|
3444
|
-
get actionButtonsEndClassName() {
|
|
3445
|
-
return this.actionsLayout === 'end';
|
|
3446
|
-
}
|
|
3447
|
-
get actionButtonsStretchedClassName() {
|
|
3448
|
-
return this.actionsLayout === 'stretched';
|
|
3449
|
-
}
|
|
3450
|
-
get actionButtonsStartClassName() {
|
|
3451
|
-
return this.actionsLayout === 'start';
|
|
3452
|
-
}
|
|
3453
|
-
get actionButtonsCenterClassName() {
|
|
3454
|
-
return this.actionsLayout === 'center';
|
|
3455
|
-
}
|
|
3456
|
-
onUploadButtonFocus() {
|
|
3457
|
-
if (!this.navigation.focused) {
|
|
3458
|
-
this.navigation.focusedIndex = this.navigation.lastIndex;
|
|
3459
|
-
}
|
|
3006
|
+
DropZoneBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneBase, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: 'hoverClass' }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3007
|
+
DropZoneBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DropZoneBase, host: { listeners: { "dragenter": "onElementDragEnterListener()", "dragover": "onElementDragOverListener()" } }, ngImport: i0 });
|
|
3008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneBase, decorators: [{
|
|
3009
|
+
type: Directive
|
|
3010
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
3011
|
+
type: Inject,
|
|
3012
|
+
args: ['hoverClass']
|
|
3013
|
+
}] }]; }, propDecorators: { onElementDragEnterListener: [{
|
|
3014
|
+
type: HostListener,
|
|
3015
|
+
args: ['dragenter']
|
|
3016
|
+
}], onElementDragOverListener: [{
|
|
3017
|
+
type: HostListener,
|
|
3018
|
+
args: ['dragover']
|
|
3019
|
+
}] } });
|
|
3020
|
+
|
|
3021
|
+
/**
|
|
3022
|
+
* @hidden
|
|
3023
|
+
*/
|
|
3024
|
+
class DropZoneInternalDirective extends DropZoneBase {
|
|
3025
|
+
constructor(element, renderer, ngZone, uploadService) {
|
|
3026
|
+
super(element, renderer, 'k-hover');
|
|
3027
|
+
this.ngZone = ngZone;
|
|
3028
|
+
this.uploadService = uploadService;
|
|
3029
|
+
this.initialClassName = true;
|
|
3030
|
+
this.hideIntervalDocument = null;
|
|
3031
|
+
this.activeClass = 'k-dropzone-active';
|
|
3032
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3033
|
+
this.unsubscribeDocumentDragEnter = this.renderer.listen('document', 'dragenter', () => this.onDocumentDragEnter());
|
|
3034
|
+
this.unsubscribeDocumentDragOver = this.renderer.listen('document', 'dragover', () => this.onDocumentDragOver());
|
|
3035
|
+
});
|
|
3460
3036
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3037
|
+
ngOnDestroy() {
|
|
3038
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3039
|
+
if (this.unsubscribeDocumentDragEnter) {
|
|
3040
|
+
this.unsubscribeDocumentDragEnter();
|
|
3041
|
+
}
|
|
3042
|
+
if (this.unsubscribeDocumentDragOver) {
|
|
3043
|
+
this.unsubscribeDocumentDragOver();
|
|
3044
|
+
}
|
|
3045
|
+
});
|
|
3464
3046
|
}
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3047
|
+
onDocumentDragEnter() {
|
|
3048
|
+
this.addClass(this.activeClass);
|
|
3049
|
+
this.lastDragDocument = new Date();
|
|
3050
|
+
if (!this.hideIntervalDocument) {
|
|
3051
|
+
this.hideIntervalDocument = setInterval(() => {
|
|
3052
|
+
if (this.calculateTimeDiff(this.lastDragDocument) < 100) {
|
|
3053
|
+
return;
|
|
3054
|
+
}
|
|
3055
|
+
this.removeClass(this.activeClass);
|
|
3056
|
+
clearInterval(this.hideIntervalDocument);
|
|
3057
|
+
this.hideIntervalDocument = null;
|
|
3058
|
+
}, 100);
|
|
3469
3059
|
}
|
|
3060
|
+
return false;
|
|
3470
3061
|
}
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3062
|
+
/**
|
|
3063
|
+
* @hidden
|
|
3064
|
+
*/
|
|
3065
|
+
onDocumentDragOver() {
|
|
3066
|
+
this.lastDragDocument = new Date();
|
|
3067
|
+
return false;
|
|
3474
3068
|
}
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3069
|
+
onDropListener(event) {
|
|
3070
|
+
const droppedFiles = event.dataTransfer.files;
|
|
3071
|
+
if (droppedFiles.length > 0 && !this.disabled) {
|
|
3072
|
+
let files = getAllFileInfo(droppedFiles);
|
|
3073
|
+
files = assignGuidToFiles(files, !this.uploadService.async.batch);
|
|
3074
|
+
if (!this.multiple) {
|
|
3075
|
+
files.splice(1, files.length - 1);
|
|
3076
|
+
this.uploadService.clearFiles();
|
|
3077
|
+
}
|
|
3078
|
+
validateFiles(files, this.restrictions);
|
|
3079
|
+
this.uploadService.addFiles(files);
|
|
3479
3080
|
}
|
|
3480
|
-
|
|
3481
|
-
textFor(key) {
|
|
3482
|
-
return this.localization.get(key);
|
|
3081
|
+
return false;
|
|
3483
3082
|
}
|
|
3484
3083
|
}
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
{{textFor('clearSelectedFiles')}}
|
|
3490
|
-
</button>
|
|
3491
|
-
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3492
|
-
(focus)="onUploadButtonFocus()"
|
|
3493
|
-
(click)="onUploadButtonClick($event)">
|
|
3494
|
-
{{textFor('uploadSelectedFiles')}}
|
|
3495
|
-
</button>
|
|
3496
|
-
`, isInline: true });
|
|
3497
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadActionButtonsComponent, decorators: [{
|
|
3498
|
-
type: Component,
|
|
3084
|
+
DropZoneInternalDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneInternalDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3085
|
+
DropZoneInternalDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DropZoneInternalDirective, isStandalone: true, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: { disabled: "disabled", multiple: "multiple", restrictions: "restrictions" }, host: { listeners: { "drop": "onDropListener($event)" }, properties: { "class.k-dropzone": "this.initialClassName", "class.k-upload-dropzone": "this.initialClassName" } }, usesInheritance: true, ngImport: i0 });
|
|
3086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropZoneInternalDirective, decorators: [{
|
|
3087
|
+
type: Directive,
|
|
3499
3088
|
args: [{
|
|
3500
|
-
selector:
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
</button>
|
|
3506
|
-
<button #uploadButton role="button" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary k-upload-selected"
|
|
3507
|
-
(focus)="onUploadButtonFocus()"
|
|
3508
|
-
(click)="onUploadButtonClick($event)">
|
|
3509
|
-
{{textFor('uploadSelectedFiles')}}
|
|
3510
|
-
</button>
|
|
3511
|
-
`
|
|
3089
|
+
selector: `
|
|
3090
|
+
[kendoUploadInternalDropZone],
|
|
3091
|
+
[kendoFileSelectInternalDropZone]
|
|
3092
|
+
`,
|
|
3093
|
+
standalone: true
|
|
3512
3094
|
}]
|
|
3513
|
-
}], ctorParameters: function () { return [{ type:
|
|
3095
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: UploadService }]; }, propDecorators: { disabled: [{
|
|
3514
3096
|
type: Input
|
|
3515
|
-
}],
|
|
3097
|
+
}], multiple: [{
|
|
3516
3098
|
type: Input
|
|
3517
|
-
}],
|
|
3518
|
-
type:
|
|
3519
|
-
|
|
3520
|
-
}], uploadButton: [{
|
|
3521
|
-
type: ViewChild,
|
|
3522
|
-
args: ['uploadButton', { static: true }]
|
|
3523
|
-
}], hostDefaultClass: [{
|
|
3524
|
-
type: HostBinding,
|
|
3525
|
-
args: ['class.k-actions']
|
|
3526
|
-
}], actionButtonsEndClassName: [{
|
|
3527
|
-
type: HostBinding,
|
|
3528
|
-
args: ['class.k-actions-end']
|
|
3529
|
-
}], actionButtonsStretchedClassName: [{
|
|
3530
|
-
type: HostBinding,
|
|
3531
|
-
args: ['class.k-actions-stretched']
|
|
3532
|
-
}], actionButtonsStartClassName: [{
|
|
3099
|
+
}], restrictions: [{
|
|
3100
|
+
type: Input
|
|
3101
|
+
}], initialClassName: [{
|
|
3533
3102
|
type: HostBinding,
|
|
3534
|
-
args: ['class.k-
|
|
3535
|
-
}
|
|
3103
|
+
args: ['class.k-dropzone']
|
|
3104
|
+
}, {
|
|
3536
3105
|
type: HostBinding,
|
|
3537
|
-
args: ['class.k-
|
|
3106
|
+
args: ['class.k-upload-dropzone']
|
|
3107
|
+
}], onDropListener: [{
|
|
3108
|
+
type: HostListener,
|
|
3109
|
+
args: ['drop', ['$event']]
|
|
3538
3110
|
}] } });
|
|
3539
3111
|
|
|
3540
3112
|
/**
|
|
3541
3113
|
* @hidden
|
|
3542
3114
|
*/
|
|
3543
|
-
class
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
:
|
|
3589
|
-
|
|
3115
|
+
class Messages extends ComponentMessages {
|
|
3116
|
+
}
|
|
3117
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
3118
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", 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 });
|
|
3119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: Messages, decorators: [{
|
|
3120
|
+
type: Directive
|
|
3121
|
+
}], propDecorators: { cancel: [{
|
|
3122
|
+
type: Input
|
|
3123
|
+
}], clearSelectedFiles: [{
|
|
3124
|
+
type: Input
|
|
3125
|
+
}], dropFilesHere: [{
|
|
3126
|
+
type: Input
|
|
3127
|
+
}], externalDropFilesHere: [{
|
|
3128
|
+
type: Input
|
|
3129
|
+
}], filesBatchStatus: [{
|
|
3130
|
+
type: Input
|
|
3131
|
+
}], filesBatchStatusFailed: [{
|
|
3132
|
+
type: Input
|
|
3133
|
+
}], filesBatchStatusUploaded: [{
|
|
3134
|
+
type: Input
|
|
3135
|
+
}], fileStatusFailed: [{
|
|
3136
|
+
type: Input
|
|
3137
|
+
}], fileStatusUploaded: [{
|
|
3138
|
+
type: Input
|
|
3139
|
+
}], headerStatusPaused: [{
|
|
3140
|
+
type: Input
|
|
3141
|
+
}], headerStatusUploaded: [{
|
|
3142
|
+
type: Input
|
|
3143
|
+
}], headerStatusUploading: [{
|
|
3144
|
+
type: Input
|
|
3145
|
+
}], invalidFileExtension: [{
|
|
3146
|
+
type: Input
|
|
3147
|
+
}], invalidMaxFileSize: [{
|
|
3148
|
+
type: Input
|
|
3149
|
+
}], invalidMinFileSize: [{
|
|
3150
|
+
type: Input
|
|
3151
|
+
}], pause: [{
|
|
3152
|
+
type: Input
|
|
3153
|
+
}], remove: [{
|
|
3154
|
+
type: Input
|
|
3155
|
+
}], resume: [{
|
|
3156
|
+
type: Input
|
|
3157
|
+
}], retry: [{
|
|
3158
|
+
type: Input
|
|
3159
|
+
}], select: [{
|
|
3160
|
+
type: Input
|
|
3161
|
+
}], uploadSelectedFiles: [{
|
|
3162
|
+
type: Input
|
|
3163
|
+
}] } });
|
|
3164
|
+
|
|
3165
|
+
/**
|
|
3166
|
+
* @hidden
|
|
3167
|
+
*/
|
|
3168
|
+
class LocalizedMessagesDirective extends Messages {
|
|
3169
|
+
constructor(service) {
|
|
3170
|
+
super();
|
|
3171
|
+
this.service = service;
|
|
3590
3172
|
}
|
|
3591
3173
|
}
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadStatusTotalComponent, decorators: [{
|
|
3602
|
-
type: Component,
|
|
3174
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3175
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, isStandalone: true, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n ", providers: [
|
|
3176
|
+
{
|
|
3177
|
+
provide: Messages,
|
|
3178
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
3179
|
+
}
|
|
3180
|
+
], usesInheritance: true, ngImport: i0 });
|
|
3181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
3182
|
+
type: Directive,
|
|
3603
3183
|
args: [{
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3184
|
+
providers: [
|
|
3185
|
+
{
|
|
3186
|
+
provide: Messages,
|
|
3187
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
3188
|
+
}
|
|
3189
|
+
],
|
|
3190
|
+
selector: `
|
|
3191
|
+
[kendoUploadLocalizedMessages],
|
|
3192
|
+
[kendoFileSelectLocalizedMessages],
|
|
3193
|
+
[kendoUploadDropZoneLocalizedMessages]
|
|
3194
|
+
`,
|
|
3195
|
+
standalone: true
|
|
3613
3196
|
}]
|
|
3614
|
-
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; }
|
|
3615
|
-
type: Input
|
|
3616
|
-
}] } });
|
|
3197
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
3617
3198
|
|
|
3618
3199
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3619
3200
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -3625,7 +3206,7 @@ const UPLOAD_VALUE_ACCESSOR = {
|
|
|
3625
3206
|
provide: NG_VALUE_ACCESSOR,
|
|
3626
3207
|
useExisting: forwardRef(() => UploadComponent)
|
|
3627
3208
|
};
|
|
3628
|
-
let idx = 0;
|
|
3209
|
+
let idx$1 = 0;
|
|
3629
3210
|
/**
|
|
3630
3211
|
* Represents the [Kendo UI Upload component for Angular]({% slug overview_upload %}).
|
|
3631
3212
|
*/
|
|
@@ -3947,7 +3528,7 @@ class UploadComponent extends UploadFileSelectBase {
|
|
|
3947
3528
|
* @hidden
|
|
3948
3529
|
*/
|
|
3949
3530
|
getIds() {
|
|
3950
|
-
const id = ++idx;
|
|
3531
|
+
const id = ++idx$1;
|
|
3951
3532
|
const buttonId = `k-upload-button-${id}`;
|
|
3952
3533
|
const fileListId = `k-upload-file-list-${id}`;
|
|
3953
3534
|
return { buttonId, fileListId };
|
|
@@ -4108,7 +3689,7 @@ class UploadComponent extends UploadFileSelectBase {
|
|
|
4108
3689
|
}
|
|
4109
3690
|
}
|
|
4110
3691
|
UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", 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 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4111
|
-
UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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", showFileList: "showFileList", tabIndex: "tabIndex", actionsLayout: "actionsLayout" }, outputs: { cancel: "cancel", clear: "clear", complete: "complete", error: "error", pause: "pause", resume: "resume", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.dir" } }, providers: [
|
|
3692
|
+
UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UploadComponent, isStandalone: true, 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", showFileList: "showFileList", tabIndex: "tabIndex", actionsLayout: "actionsLayout" }, outputs: { cancel: "cancel", clear: "clear", complete: "complete", error: "error", pause: "pause", resume: "resume", success: "success", upload: "upload", uploadProgress: "uploadProgress", valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.dir" } }, providers: [
|
|
4112
3693
|
LocalizationService,
|
|
4113
3694
|
NavigationService,
|
|
4114
3695
|
UploadService,
|
|
@@ -4233,7 +3814,7 @@ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versio
|
|
|
4233
3814
|
[disabled]="disabled"
|
|
4234
3815
|
[actionsLayout]="actionsLayout">
|
|
4235
3816
|
</kendo-upload-action-buttons>
|
|
4236
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { kind: "component", type:
|
|
3817
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { kind: "directive", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept", "required"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UploadStatusTotalComponent, selector: "kendo-upload-status-total", inputs: ["fileList"] }, { kind: "component", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }, { kind: "component", type: UploadActionButtonsComponent, selector: "kendo-upload-action-buttons", inputs: ["disabled", "actionsLayout"] }] });
|
|
4237
3818
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadComponent, decorators: [{
|
|
4238
3819
|
type: Component,
|
|
4239
3820
|
args: [{
|
|
@@ -4365,7 +3946,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4365
3946
|
[disabled]="disabled"
|
|
4366
3947
|
[actionsLayout]="actionsLayout">
|
|
4367
3948
|
</kendo-upload-action-buttons>
|
|
4368
|
-
|
|
3949
|
+
`,
|
|
3950
|
+
standalone: true,
|
|
3951
|
+
imports: [LocalizedMessagesDirective, DropZoneInternalDirective, ButtonComponent, FileSelectDirective, NgIf, UploadStatusTotalComponent, FileListComponent, UploadActionButtonsComponent]
|
|
4369
3952
|
}]
|
|
4370
3953
|
}], 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 }, { type: i0.Injector }]; }, propDecorators: { autoUpload: [{
|
|
4371
3954
|
type: Input
|
|
@@ -4435,221 +4018,661 @@ class UploadDropZoneDirective {
|
|
|
4435
4018
|
this.dropZoneService = dropZoneService;
|
|
4436
4019
|
}
|
|
4437
4020
|
/**
|
|
4438
|
-
* @hidden
|
|
4021
|
+
* @hidden
|
|
4022
|
+
*/
|
|
4023
|
+
onElementDragEnter() {
|
|
4024
|
+
return false;
|
|
4025
|
+
}
|
|
4026
|
+
/**
|
|
4027
|
+
* @hidden
|
|
4028
|
+
*/
|
|
4029
|
+
onElementDragOver() {
|
|
4030
|
+
return false;
|
|
4031
|
+
}
|
|
4032
|
+
/**
|
|
4033
|
+
* @hidden
|
|
4034
|
+
*/
|
|
4035
|
+
onDropListener(event) {
|
|
4036
|
+
const components = this.componentInstance;
|
|
4037
|
+
if (!isPresent(components)) {
|
|
4038
|
+
return;
|
|
4039
|
+
}
|
|
4040
|
+
components.forEach((component) => {
|
|
4041
|
+
const droppedFiles = event.dataTransfer.files;
|
|
4042
|
+
if (droppedFiles.length > 0 && !component.disabled) {
|
|
4043
|
+
let files = getAllFileInfo(droppedFiles);
|
|
4044
|
+
if (component instanceof UploadComponent) {
|
|
4045
|
+
files = assignGuidToFiles(files, !component.batch);
|
|
4046
|
+
}
|
|
4047
|
+
else {
|
|
4048
|
+
files = assignGuidToFiles(files, true);
|
|
4049
|
+
}
|
|
4050
|
+
if (!component.multiple) {
|
|
4051
|
+
files.splice(1, files.length - 1);
|
|
4052
|
+
component.clearFiles();
|
|
4053
|
+
}
|
|
4054
|
+
validateFiles(files, component.restrictions);
|
|
4055
|
+
component.addFiles(files);
|
|
4056
|
+
}
|
|
4057
|
+
});
|
|
4058
|
+
return false;
|
|
4059
|
+
}
|
|
4060
|
+
/**
|
|
4061
|
+
* @hidden
|
|
4062
|
+
*/
|
|
4063
|
+
get componentInstance() {
|
|
4064
|
+
return this.dropZoneService.getComponents(this.zoneId);
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
UploadDropZoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneDirective, deps: [{ token: DropZoneService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4068
|
+
UploadDropZoneDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: UploadDropZoneDirective, isStandalone: true, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: { zoneId: ["kendoUploadDropZone", "zoneId"] }, host: { listeners: { "dragenter": "onElementDragEnter()", "dragover": "onElementDragOver()", "drop": "onDropListener($event)" } }, providers: [
|
|
4069
|
+
DropZoneService
|
|
4070
|
+
], ngImport: i0 });
|
|
4071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneDirective, decorators: [{
|
|
4072
|
+
type: Directive,
|
|
4073
|
+
args: [{
|
|
4074
|
+
providers: [
|
|
4075
|
+
DropZoneService
|
|
4076
|
+
],
|
|
4077
|
+
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]',
|
|
4078
|
+
standalone: true
|
|
4079
|
+
}]
|
|
4080
|
+
}], ctorParameters: function () { return [{ type: DropZoneService }]; }, propDecorators: { zoneId: [{
|
|
4081
|
+
type: Input,
|
|
4082
|
+
args: ['kendoUploadDropZone']
|
|
4083
|
+
}], onElementDragEnter: [{
|
|
4084
|
+
type: HostListener,
|
|
4085
|
+
args: ['dragenter']
|
|
4086
|
+
}], onElementDragOver: [{
|
|
4087
|
+
type: HostListener,
|
|
4088
|
+
args: ['dragover']
|
|
4089
|
+
}], onDropListener: [{
|
|
4090
|
+
type: HostListener,
|
|
4091
|
+
args: ['drop', ['$event']]
|
|
4092
|
+
}] } });
|
|
4093
|
+
|
|
4094
|
+
/**
|
|
4095
|
+
* Represents the [Kendo UI UploadDropZone component for Angular]({% slug overview_upload %}).
|
|
4096
|
+
*/
|
|
4097
|
+
class UploadDropZoneComponent extends DropZoneBase {
|
|
4098
|
+
constructor(element, renderer, localization) {
|
|
4099
|
+
super(element, renderer, 'k-external-dropzone-hover');
|
|
4100
|
+
this.localization = localization;
|
|
4101
|
+
this.hostClass = true;
|
|
4102
|
+
this._svgIcon = uploadIcon;
|
|
4103
|
+
this.localizationChangeSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
4104
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
4105
|
+
});
|
|
4106
|
+
}
|
|
4107
|
+
get dirAttribute() {
|
|
4108
|
+
return this.direction;
|
|
4109
|
+
}
|
|
4110
|
+
/**
|
|
4111
|
+
* Defines an SVGIcon to be rendered inside the DropZone.
|
|
4112
|
+
* The input can take either an [existing Kendo SVG icon](slug:svgicon_list) or a custom one.
|
|
4113
|
+
*/
|
|
4114
|
+
set svgIcon(icon) {
|
|
4115
|
+
if (isDevMode() && icon && this.icon && this.iconClass) {
|
|
4116
|
+
throw new Error('Setting both icon/svgIcon and iconClass options at the same time is not supported.');
|
|
4117
|
+
}
|
|
4118
|
+
this._svgIcon = icon;
|
|
4119
|
+
}
|
|
4120
|
+
get svgIcon() {
|
|
4121
|
+
return this._svgIcon;
|
|
4122
|
+
}
|
|
4123
|
+
/**
|
|
4124
|
+
* @hidden
|
|
4125
|
+
*/
|
|
4126
|
+
textFor(key) {
|
|
4127
|
+
return this.localization.get(key);
|
|
4128
|
+
}
|
|
4129
|
+
/**
|
|
4130
|
+
* @hidden
|
|
4131
|
+
*/
|
|
4132
|
+
get iconClasses() {
|
|
4133
|
+
if (this.icon) {
|
|
4134
|
+
return `${this.icon}`;
|
|
4135
|
+
}
|
|
4136
|
+
if (!this.icon && !this.iconClass) {
|
|
4137
|
+
return 'upload';
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
ngOnDestroy() {
|
|
4141
|
+
if (this.localizationChangeSubscription) {
|
|
4142
|
+
this.localizationChangeSubscription.unsubscribe();
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
UploadDropZoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4147
|
+
UploadDropZoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UploadDropZoneComponent, isStandalone: true, selector: "kendo-uploaddropzone", inputs: { zoneId: "zoneId", icon: "icon", iconClass: "iconClass", svgIcon: "svgIcon" }, host: { properties: { "class.k-external-dropzone": "this.hostClass", "attr.dir": "this.dirAttribute" } }, providers: [
|
|
4148
|
+
LocalizationService,
|
|
4149
|
+
{
|
|
4150
|
+
provide: L10N_PREFIX,
|
|
4151
|
+
useValue: 'kendo.uploaddropzone'
|
|
4152
|
+
}
|
|
4153
|
+
], exportAs: ["kendoUploadDropZone"], usesInheritance: true, ngImport: i0, template: `
|
|
4154
|
+
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
4155
|
+
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
4156
|
+
externalDropFilesHere='Drag and drop files here to upload'>
|
|
4157
|
+
</ng-container>
|
|
4158
|
+
<div class='k-dropzone-inner' [kendoUploadDropZone]="zoneId">
|
|
4159
|
+
<kendo-icon-wrapper
|
|
4160
|
+
size="xxxlarge"
|
|
4161
|
+
innerCssClass="k-dropzone-icon"
|
|
4162
|
+
[name]="iconClasses"
|
|
4163
|
+
[customFontClass]="iconClass"
|
|
4164
|
+
[svgIcon]="svgIcon"
|
|
4165
|
+
></kendo-icon-wrapper>
|
|
4166
|
+
<span class="k-dropzone-hint">{{ textFor('externalDropFilesHere') }}</span>
|
|
4167
|
+
<span class="k-dropzone-note">
|
|
4168
|
+
<ng-content></ng-content>
|
|
4169
|
+
</span>
|
|
4170
|
+
</div>
|
|
4171
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { kind: "directive", type: UploadDropZoneDirective, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: ["kendoUploadDropZone"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
4172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneComponent, decorators: [{
|
|
4173
|
+
type: Component,
|
|
4174
|
+
args: [{
|
|
4175
|
+
exportAs: 'kendoUploadDropZone',
|
|
4176
|
+
providers: [
|
|
4177
|
+
LocalizationService,
|
|
4178
|
+
{
|
|
4179
|
+
provide: L10N_PREFIX,
|
|
4180
|
+
useValue: 'kendo.uploaddropzone'
|
|
4181
|
+
}
|
|
4182
|
+
],
|
|
4183
|
+
selector: 'kendo-uploaddropzone',
|
|
4184
|
+
template: `
|
|
4185
|
+
<ng-container kendoUploadDropZoneLocalizedMessages
|
|
4186
|
+
i18n-externalDropFilesHere='kendo.uploaddropzone.externalDropFilesHere|Sets the external drop-zone hint'
|
|
4187
|
+
externalDropFilesHere='Drag and drop files here to upload'>
|
|
4188
|
+
</ng-container>
|
|
4189
|
+
<div class='k-dropzone-inner' [kendoUploadDropZone]="zoneId">
|
|
4190
|
+
<kendo-icon-wrapper
|
|
4191
|
+
size="xxxlarge"
|
|
4192
|
+
innerCssClass="k-dropzone-icon"
|
|
4193
|
+
[name]="iconClasses"
|
|
4194
|
+
[customFontClass]="iconClass"
|
|
4195
|
+
[svgIcon]="svgIcon"
|
|
4196
|
+
></kendo-icon-wrapper>
|
|
4197
|
+
<span class="k-dropzone-hint">{{ textFor('externalDropFilesHere') }}</span>
|
|
4198
|
+
<span class="k-dropzone-note">
|
|
4199
|
+
<ng-content></ng-content>
|
|
4200
|
+
</span>
|
|
4201
|
+
</div>
|
|
4202
|
+
`,
|
|
4203
|
+
standalone: true,
|
|
4204
|
+
imports: [LocalizedMessagesDirective, UploadDropZoneDirective, IconWrapperComponent]
|
|
4205
|
+
}]
|
|
4206
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$1.LocalizationService }]; }, propDecorators: { hostClass: [{
|
|
4207
|
+
type: HostBinding,
|
|
4208
|
+
args: ['class.k-external-dropzone']
|
|
4209
|
+
}], dirAttribute: [{
|
|
4210
|
+
type: HostBinding,
|
|
4211
|
+
args: ['attr.dir']
|
|
4212
|
+
}], zoneId: [{
|
|
4213
|
+
type: Input
|
|
4214
|
+
}], icon: [{
|
|
4215
|
+
type: Input
|
|
4216
|
+
}], iconClass: [{
|
|
4217
|
+
type: Input
|
|
4218
|
+
}], svgIcon: [{
|
|
4219
|
+
type: Input
|
|
4220
|
+
}] } });
|
|
4221
|
+
|
|
4222
|
+
/**
|
|
4223
|
+
* @hidden
|
|
4224
|
+
*/
|
|
4225
|
+
const FILESELECT_VALUE_ACCESSOR = {
|
|
4226
|
+
multi: true,
|
|
4227
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4228
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
4229
|
+
};
|
|
4230
|
+
let idx = 0;
|
|
4231
|
+
class FileSelectComponent extends UploadFileSelectBase {
|
|
4232
|
+
constructor(uploadService, localization, navigation, dropZoneService, ngZone, renderer, cdr, wrapper, injector) {
|
|
4233
|
+
super(uploadService, navigation, cdr, injector, ngZone);
|
|
4234
|
+
this.uploadService = uploadService;
|
|
4235
|
+
this.localization = localization;
|
|
4236
|
+
this.navigation = navigation;
|
|
4237
|
+
this.dropZoneService = dropZoneService;
|
|
4238
|
+
this.ngZone = ngZone;
|
|
4239
|
+
this.renderer = renderer;
|
|
4240
|
+
this.cdr = cdr;
|
|
4241
|
+
this.injector = injector;
|
|
4242
|
+
/**
|
|
4243
|
+
* Fires when the value of the component has changed as a result of a successful `select` or `remove` operation.
|
|
4244
|
+
*/
|
|
4245
|
+
this.valueChange = new EventEmitter();
|
|
4246
|
+
/**
|
|
4247
|
+
* @hidden
|
|
4248
|
+
*/
|
|
4249
|
+
this._restrictions = {
|
|
4250
|
+
allowedExtensions: [],
|
|
4251
|
+
maxFileSize: 0,
|
|
4252
|
+
minFileSize: 0
|
|
4253
|
+
};
|
|
4254
|
+
validatePackage(packageMetadata);
|
|
4255
|
+
this.wrapper = wrapper.nativeElement;
|
|
4256
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
4257
|
+
this.navigation.computeKeys();
|
|
4258
|
+
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => {
|
|
4259
|
+
this.direction = rtl ? 'rtl' : 'ltr';
|
|
4260
|
+
});
|
|
4261
|
+
this.subscribeBlur();
|
|
4262
|
+
this.subscribeFocus();
|
|
4263
|
+
this.attachEventHandlers();
|
|
4264
|
+
this.setDefaultSettings();
|
|
4265
|
+
}
|
|
4266
|
+
get dir() {
|
|
4267
|
+
return this.direction;
|
|
4268
|
+
}
|
|
4269
|
+
/**
|
|
4270
|
+
* Sets the `name` attribute of the `input` element of the FileSelect.
|
|
4439
4271
|
*/
|
|
4440
|
-
|
|
4441
|
-
|
|
4272
|
+
set name(name) {
|
|
4273
|
+
this.uploadService.async.saveField = name;
|
|
4274
|
+
}
|
|
4275
|
+
get name() {
|
|
4276
|
+
return this.uploadService.async.saveField;
|
|
4277
|
+
}
|
|
4278
|
+
ngOnInit() {
|
|
4279
|
+
const { buttonId, fileListId } = this.getIds();
|
|
4280
|
+
this.focusableId = buttonId;
|
|
4281
|
+
this.fileListId = fileListId;
|
|
4282
|
+
if (this.zoneId) {
|
|
4283
|
+
this.dropZoneService.addComponent(this, this.zoneId);
|
|
4284
|
+
}
|
|
4285
|
+
this.subs.add(this.renderer.listen(this.fileSelectInput.nativeElement, 'mouseenter', () => {
|
|
4286
|
+
this.renderer.addClass(this.fileSelectButton.nativeElement, 'k-hover');
|
|
4287
|
+
}));
|
|
4288
|
+
this.subs.add(this.renderer.listen(this.fileSelectInput.nativeElement, 'mouseleave', () => {
|
|
4289
|
+
this.renderer.removeClass(this.fileSelectButton.nativeElement, 'k-hover');
|
|
4290
|
+
}));
|
|
4291
|
+
this.ngZone.runOutsideAngular(() => {
|
|
4292
|
+
this.subs.add(this.renderer.listen(this.wrapper, 'keydown', event => this.handleKeydown(event)));
|
|
4293
|
+
});
|
|
4442
4294
|
}
|
|
4443
4295
|
/**
|
|
4444
4296
|
* @hidden
|
|
4445
4297
|
*/
|
|
4446
|
-
|
|
4447
|
-
return
|
|
4298
|
+
textFor(key) {
|
|
4299
|
+
return this.localization.get(key);
|
|
4300
|
+
}
|
|
4301
|
+
ngOnDestroy() {
|
|
4302
|
+
this.fileList.clear();
|
|
4303
|
+
if (this.blurSubscription) {
|
|
4304
|
+
this.blurSubscription.unsubscribe();
|
|
4305
|
+
}
|
|
4306
|
+
if (this.wrapperFocusSubscription) {
|
|
4307
|
+
this.wrapperFocusSubscription.unsubscribe();
|
|
4308
|
+
}
|
|
4309
|
+
if (this.selectButtonFocusSubscription) {
|
|
4310
|
+
this.selectButtonFocusSubscription.unsubscribe();
|
|
4311
|
+
}
|
|
4312
|
+
if (this.localizationChangeSubscription) {
|
|
4313
|
+
this.localizationChangeSubscription.unsubscribe();
|
|
4314
|
+
}
|
|
4315
|
+
if (this.subs) {
|
|
4316
|
+
this.subs.unsubscribe();
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
/**
|
|
4320
|
+
* Removes specific file from the file list.
|
|
4321
|
+
*/
|
|
4322
|
+
removeFileByUid(uid) {
|
|
4323
|
+
this.uploadService.removeFiles(uid);
|
|
4324
|
+
}
|
|
4325
|
+
/**
|
|
4326
|
+
* Visually clears all files from the UI.
|
|
4327
|
+
*/
|
|
4328
|
+
clearFiles() {
|
|
4329
|
+
this.uploadService.clearFiles();
|
|
4448
4330
|
}
|
|
4449
4331
|
/**
|
|
4450
4332
|
* @hidden
|
|
4333
|
+
* Used to determine if the component is empty.
|
|
4451
4334
|
*/
|
|
4452
|
-
|
|
4453
|
-
const components = this.componentInstance;
|
|
4454
|
-
if (!isPresent(components)) {
|
|
4455
|
-
return;
|
|
4456
|
-
}
|
|
4457
|
-
components.forEach((component) => {
|
|
4458
|
-
const droppedFiles = event.dataTransfer.files;
|
|
4459
|
-
if (droppedFiles.length > 0 && !component.disabled) {
|
|
4460
|
-
let files = getAllFileInfo(droppedFiles);
|
|
4461
|
-
if (component instanceof UploadComponent) {
|
|
4462
|
-
files = assignGuidToFiles(files, !component.batch);
|
|
4463
|
-
}
|
|
4464
|
-
else {
|
|
4465
|
-
files = assignGuidToFiles(files, true);
|
|
4466
|
-
}
|
|
4467
|
-
if (!component.multiple) {
|
|
4468
|
-
files.splice(1, files.length - 1);
|
|
4469
|
-
component.clearFiles();
|
|
4470
|
-
}
|
|
4471
|
-
validateFiles(files, component.restrictions);
|
|
4472
|
-
component.addFiles(files);
|
|
4473
|
-
}
|
|
4474
|
-
});
|
|
4335
|
+
isEmpty() {
|
|
4475
4336
|
return false;
|
|
4476
4337
|
}
|
|
4477
4338
|
/**
|
|
4478
4339
|
* @hidden
|
|
4340
|
+
* Used by the external dropzone to add files to the FileSelect
|
|
4479
4341
|
*/
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
UploadDropZoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneDirective, deps: [{ token: DropZoneService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4485
|
-
UploadDropZoneDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: UploadDropZoneDirective, selector: "[kendoUploadDropZone], [kendoFileSelectDropZone]", inputs: { zoneId: ["kendoUploadDropZone", "zoneId"] }, host: { listeners: { "dragenter": "onElementDragEnter()", "dragover": "onElementDragOver()", "drop": "onDropListener($event)" } }, providers: [
|
|
4486
|
-
DropZoneService
|
|
4487
|
-
], ngImport: i0 });
|
|
4488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadDropZoneDirective, decorators: [{
|
|
4489
|
-
type: Directive,
|
|
4490
|
-
args: [{
|
|
4491
|
-
providers: [
|
|
4492
|
-
DropZoneService
|
|
4493
|
-
],
|
|
4494
|
-
selector: '[kendoUploadDropZone], [kendoFileSelectDropZone]'
|
|
4495
|
-
}]
|
|
4496
|
-
}], ctorParameters: function () { return [{ type: DropZoneService }]; }, propDecorators: { zoneId: [{
|
|
4497
|
-
type: Input,
|
|
4498
|
-
args: ['kendoUploadDropZone']
|
|
4499
|
-
}], onElementDragEnter: [{
|
|
4500
|
-
type: HostListener,
|
|
4501
|
-
args: ['dragenter']
|
|
4502
|
-
}], onElementDragOver: [{
|
|
4503
|
-
type: HostListener,
|
|
4504
|
-
args: ['dragover']
|
|
4505
|
-
}], onDropListener: [{
|
|
4506
|
-
type: HostListener,
|
|
4507
|
-
args: ['drop', ['$event']]
|
|
4508
|
-
}] } });
|
|
4509
|
-
|
|
4510
|
-
/**
|
|
4511
|
-
* Represents the [Kendo UI UploadDropZone component for Angular]({% slug overview_upload %}).
|
|
4512
|
-
*/
|
|
4513
|
-
class UploadDropZoneComponent extends DropZoneBase {
|
|
4514
|
-
constructor(element, renderer, localization) {
|
|
4515
|
-
super(element, renderer, 'k-external-dropzone-hover');
|
|
4516
|
-
this.localization = localization;
|
|
4517
|
-
this.hostClass = true;
|
|
4518
|
-
this._svgIcon = uploadIcon;
|
|
4519
|
-
this.localizationChangeSubscription = this.localization.changes.subscribe(({ rtl }) => {
|
|
4520
|
-
this.direction = rtl ? 'rtl' : 'ltr';
|
|
4521
|
-
});
|
|
4522
|
-
}
|
|
4523
|
-
get dirAttribute() {
|
|
4524
|
-
return this.direction;
|
|
4342
|
+
addFiles(files) {
|
|
4343
|
+
this.uploadService.addFiles(files);
|
|
4525
4344
|
}
|
|
4526
4345
|
/**
|
|
4527
|
-
*
|
|
4528
|
-
* The input can take either an [existing Kendo SVG icon](slug:svgicon_list) or a custom one.
|
|
4346
|
+
* @hidden
|
|
4529
4347
|
*/
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
throw new Error('Setting both icon/svgIcon and iconClass options at the same time is not supported.');
|
|
4533
|
-
}
|
|
4534
|
-
this._svgIcon = icon;
|
|
4535
|
-
}
|
|
4536
|
-
get svgIcon() {
|
|
4537
|
-
return this._svgIcon;
|
|
4348
|
+
get selectButtonTabIndex() {
|
|
4349
|
+
return this.disabled ? undefined : this.tabindex;
|
|
4538
4350
|
}
|
|
4539
4351
|
/**
|
|
4540
4352
|
* @hidden
|
|
4541
4353
|
*/
|
|
4542
|
-
|
|
4543
|
-
|
|
4354
|
+
getIds() {
|
|
4355
|
+
const id = ++idx;
|
|
4356
|
+
const buttonId = `k-fileselect-button-${id}`;
|
|
4357
|
+
const fileListId = `k-fileselect-file-list-${id}`;
|
|
4358
|
+
return { buttonId, fileListId };
|
|
4544
4359
|
}
|
|
4545
4360
|
/**
|
|
4546
4361
|
* @hidden
|
|
4547
4362
|
*/
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
if (!
|
|
4553
|
-
return
|
|
4363
|
+
writeValue(newValue) {
|
|
4364
|
+
super.writeValue(newValue, validateInitialFileSelectFile, 'addInitialFileSelectFiles');
|
|
4365
|
+
}
|
|
4366
|
+
subscribeBlur() {
|
|
4367
|
+
if (!isDocumentAvailable()) {
|
|
4368
|
+
return;
|
|
4554
4369
|
}
|
|
4370
|
+
this.ngZone.runOutsideAngular(() => {
|
|
4371
|
+
this.documentClick = fromEvent(document, 'click').pipe(filter((event) => {
|
|
4372
|
+
return !(this.wrapper !== event.target && this.wrapper.contains(event.target));
|
|
4373
|
+
}));
|
|
4374
|
+
this.blurSubscription = merge(this.documentClick, this.navigation.onTabOut).subscribe(() => {
|
|
4375
|
+
if (this.navigation.focused) {
|
|
4376
|
+
this.ngZone.run(() => {
|
|
4377
|
+
this.navigation.focused = false;
|
|
4378
|
+
this.onTouchedCallback();
|
|
4379
|
+
this.onBlur.emit();
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
});
|
|
4383
|
+
});
|
|
4555
4384
|
}
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
this.
|
|
4385
|
+
subscribeFocus() {
|
|
4386
|
+
this.wrapperFocusSubscription = this.navigation.onWrapperFocus.subscribe(() => {
|
|
4387
|
+
this.onFocus.emit();
|
|
4388
|
+
});
|
|
4389
|
+
this.selectButtonFocusSubscription = this.navigation.onSelectButtonFocus.subscribe(() => {
|
|
4390
|
+
this.fileSelectButton.nativeElement.focus();
|
|
4391
|
+
});
|
|
4392
|
+
}
|
|
4393
|
+
handleKeydown(event) {
|
|
4394
|
+
if (this.disabled) {
|
|
4395
|
+
return;
|
|
4396
|
+
}
|
|
4397
|
+
if (event.target === this.fileSelectButton.nativeElement && (event.keyCode === Keys.Enter || event.keyCode === Keys.Space)) {
|
|
4398
|
+
event.preventDefault();
|
|
4399
|
+
this.fileSelectInput.nativeElement.click();
|
|
4400
|
+
return;
|
|
4401
|
+
}
|
|
4402
|
+
if (hasClasses(event.target, UPLOAD_CLASSES) ||
|
|
4403
|
+
(!isFocusable(event.target) && !hasClasses(event.target, IGNORE_TARGET_CLASSES))) {
|
|
4404
|
+
this.navigation.process(event, 'fileselect');
|
|
4559
4405
|
}
|
|
4560
4406
|
}
|
|
4407
|
+
attachEventHandlers() {
|
|
4408
|
+
this.subs = this.uploadService.changeEvent.subscribe((files) => {
|
|
4409
|
+
let model = [];
|
|
4410
|
+
if (files !== null) {
|
|
4411
|
+
files.forEach((file) => {
|
|
4412
|
+
if (file.state === FileState.Initial) {
|
|
4413
|
+
model.push(file);
|
|
4414
|
+
}
|
|
4415
|
+
if (file.state === FileState.Selected && file.rawFile && !file.validationErrors) {
|
|
4416
|
+
model.push(file.rawFile);
|
|
4417
|
+
}
|
|
4418
|
+
});
|
|
4419
|
+
}
|
|
4420
|
+
if (model.length === 0) {
|
|
4421
|
+
model = null;
|
|
4422
|
+
}
|
|
4423
|
+
this.onChangeCallback(model);
|
|
4424
|
+
this.valueChange.emit(model);
|
|
4425
|
+
});
|
|
4426
|
+
this.subs.add(this.uploadService.removeEvent.subscribe((args) => {
|
|
4427
|
+
this.remove.emit(args);
|
|
4428
|
+
}));
|
|
4429
|
+
this.subs.add(this.uploadService.selectEvent.subscribe((args) => {
|
|
4430
|
+
this.select.emit(args);
|
|
4431
|
+
}));
|
|
4432
|
+
}
|
|
4433
|
+
setDefaultSettings() {
|
|
4434
|
+
this.uploadService.async.autoUpload = false;
|
|
4435
|
+
this.uploadService.component = 'FileSelect';
|
|
4436
|
+
}
|
|
4561
4437
|
}
|
|
4562
|
-
|
|
4563
|
-
|
|
4438
|
+
FileSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", 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 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4439
|
+
FileSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FileSelectComponent, isStandalone: true, selector: "kendo-fileselect", inputs: { name: "name" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.dir": "this.dir" } }, providers: [
|
|
4564
4440
|
LocalizationService,
|
|
4441
|
+
NavigationService,
|
|
4442
|
+
UploadService,
|
|
4443
|
+
DropZoneService,
|
|
4444
|
+
FILESELECT_VALUE_ACCESSOR,
|
|
4565
4445
|
{
|
|
4566
4446
|
provide: L10N_PREFIX,
|
|
4567
|
-
useValue: 'kendo.
|
|
4447
|
+
useValue: 'kendo.fileselect'
|
|
4448
|
+
},
|
|
4449
|
+
{
|
|
4450
|
+
provide: KendoInput,
|
|
4451
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
4568
4452
|
}
|
|
4569
|
-
], exportAs: ["
|
|
4570
|
-
<ng-container
|
|
4571
|
-
i18n-
|
|
4572
|
-
|
|
4453
|
+
], viewQueries: [{ propertyName: "fileSelectInput", first: true, predicate: ["fileSelectInput"], descendants: true, static: true }], exportAs: ["kendoFileSelect"], usesInheritance: true, ngImport: i0, template: `
|
|
4454
|
+
<ng-container kendoFileSelectLocalizedMessages
|
|
4455
|
+
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
4456
|
+
dropFilesHere="Drop files here to select"
|
|
4457
|
+
|
|
4458
|
+
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
4459
|
+
invalidFileExtension="File type not allowed."
|
|
4460
|
+
|
|
4461
|
+
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
4462
|
+
invalidMaxFileSize="File size too large."
|
|
4463
|
+
|
|
4464
|
+
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
4465
|
+
invalidMinFileSize="File size too small."
|
|
4466
|
+
|
|
4467
|
+
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
4468
|
+
remove="Remove"
|
|
4469
|
+
|
|
4470
|
+
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
4471
|
+
select="Select files..."
|
|
4472
|
+
>
|
|
4573
4473
|
</ng-container>
|
|
4574
|
-
<div
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4474
|
+
<div kendoFileSelectInternalDropZone
|
|
4475
|
+
[restrictions]="restrictions"
|
|
4476
|
+
[multiple]="multiple"
|
|
4477
|
+
[disabled]="disabled">
|
|
4478
|
+
<div class="k-upload-button-wrap">
|
|
4479
|
+
<button
|
|
4480
|
+
kendoButton
|
|
4481
|
+
#fileSelectButton
|
|
4482
|
+
class="k-upload-button"
|
|
4483
|
+
type="button"
|
|
4484
|
+
role="button"
|
|
4485
|
+
(click)="fileSelectInput.click()"
|
|
4486
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4487
|
+
[id]="focusableId"
|
|
4488
|
+
[attr.aria-label]="textFor('select')"
|
|
4489
|
+
[attr.tabindex]="tabindex"
|
|
4490
|
+
[attr.aria-expanded]="hasFileList"
|
|
4491
|
+
[attr.aria-controls]="hasFileList ? fileListId : undefined"
|
|
4492
|
+
>
|
|
4493
|
+
{{textFor('select')}}
|
|
4494
|
+
</button>
|
|
4495
|
+
<input kendoFileSelect #fileSelectInput
|
|
4496
|
+
[dir]="direction"
|
|
4497
|
+
[accept]="accept"
|
|
4498
|
+
[restrictions]="restrictions"
|
|
4499
|
+
[multiple]="multiple"
|
|
4500
|
+
[disabled]="disabled"
|
|
4501
|
+
[required]="isControlRequired"
|
|
4502
|
+
/>
|
|
4586
4503
|
</div>
|
|
4587
|
-
|
|
4588
|
-
|
|
4504
|
+
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
4505
|
+
</div>
|
|
4506
|
+
<ul kendo-upload-file-list
|
|
4507
|
+
class="k-upload-files k-reset"
|
|
4508
|
+
*ngIf="hasFileList"
|
|
4509
|
+
[disabled]="disabled"
|
|
4510
|
+
[fileList]="fileList.files"
|
|
4511
|
+
[fileTemplate]="fileTemplate"
|
|
4512
|
+
[fileInfoTemplate]="fileInfoTemplate"
|
|
4513
|
+
[id]="fileListId">
|
|
4514
|
+
</ul>
|
|
4515
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoUploadLocalizedMessages],\n [kendoFileSelectLocalizedMessages],\n [kendoUploadDropZoneLocalizedMessages]\n " }, { kind: "directive", type: DropZoneInternalDirective, selector: "\n [kendoUploadInternalDropZone],\n [kendoFileSelectInternalDropZone]\n ", inputs: ["disabled", "multiple", "restrictions"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: FileSelectDirective, selector: "[kendoFileSelect]", inputs: ["dir", "disabled", "multiple", "restrictions", "accept", "required"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FileListComponent, selector: "[kendo-upload-file-list]", inputs: ["disabled", "fileList", "fileTemplate", "fileInfoTemplate"] }] });
|
|
4516
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectComponent, decorators: [{
|
|
4589
4517
|
type: Component,
|
|
4590
4518
|
args: [{
|
|
4591
|
-
exportAs: '
|
|
4519
|
+
exportAs: 'kendoFileSelect',
|
|
4592
4520
|
providers: [
|
|
4593
4521
|
LocalizationService,
|
|
4522
|
+
NavigationService,
|
|
4523
|
+
UploadService,
|
|
4524
|
+
DropZoneService,
|
|
4525
|
+
FILESELECT_VALUE_ACCESSOR,
|
|
4594
4526
|
{
|
|
4595
4527
|
provide: L10N_PREFIX,
|
|
4596
|
-
useValue: 'kendo.
|
|
4528
|
+
useValue: 'kendo.fileselect'
|
|
4529
|
+
},
|
|
4530
|
+
{
|
|
4531
|
+
provide: KendoInput,
|
|
4532
|
+
useExisting: forwardRef(() => FileSelectComponent)
|
|
4597
4533
|
}
|
|
4598
4534
|
],
|
|
4599
|
-
selector: 'kendo-
|
|
4535
|
+
selector: 'kendo-fileselect',
|
|
4600
4536
|
template: `
|
|
4601
|
-
<ng-container
|
|
4602
|
-
i18n-
|
|
4603
|
-
|
|
4537
|
+
<ng-container kendoFileSelectLocalizedMessages
|
|
4538
|
+
i18n-dropFilesHere="kendo.fileselect.dropFilesHere|The drop zone hint"
|
|
4539
|
+
dropFilesHere="Drop files here to select"
|
|
4540
|
+
|
|
4541
|
+
i18n-invalidFileExtension="kendo.fileselect.invalidFileExtension|The text for the invalid allowed extensions restriction message"
|
|
4542
|
+
invalidFileExtension="File type not allowed."
|
|
4543
|
+
|
|
4544
|
+
i18n-invalidMaxFileSize="kendo.fileselect.invalidMaxFileSize|The text for the invalid max file size restriction message"
|
|
4545
|
+
invalidMaxFileSize="File size too large."
|
|
4546
|
+
|
|
4547
|
+
i18n-invalidMinFileSize="kendo.fileselect.invalidMinFileSize|The text for the invalid min file size restriction message"
|
|
4548
|
+
invalidMinFileSize="File size too small."
|
|
4549
|
+
|
|
4550
|
+
i18n-remove="kendo.fileselect.remove|The text for the Remove button"
|
|
4551
|
+
remove="Remove"
|
|
4552
|
+
|
|
4553
|
+
i18n-select="kendo.fileselect.select|The text for the Select button"
|
|
4554
|
+
select="Select files..."
|
|
4555
|
+
>
|
|
4604
4556
|
</ng-container>
|
|
4605
|
-
<div
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4557
|
+
<div kendoFileSelectInternalDropZone
|
|
4558
|
+
[restrictions]="restrictions"
|
|
4559
|
+
[multiple]="multiple"
|
|
4560
|
+
[disabled]="disabled">
|
|
4561
|
+
<div class="k-upload-button-wrap">
|
|
4562
|
+
<button
|
|
4563
|
+
kendoButton
|
|
4564
|
+
#fileSelectButton
|
|
4565
|
+
class="k-upload-button"
|
|
4566
|
+
type="button"
|
|
4567
|
+
role="button"
|
|
4568
|
+
(click)="fileSelectInput.click()"
|
|
4569
|
+
(focus)="onFileSelectButtonFocus()"
|
|
4570
|
+
[id]="focusableId"
|
|
4571
|
+
[attr.aria-label]="textFor('select')"
|
|
4572
|
+
[attr.tabindex]="tabindex"
|
|
4573
|
+
[attr.aria-expanded]="hasFileList"
|
|
4574
|
+
[attr.aria-controls]="hasFileList ? fileListId : undefined"
|
|
4575
|
+
>
|
|
4576
|
+
{{textFor('select')}}
|
|
4577
|
+
</button>
|
|
4578
|
+
<input kendoFileSelect #fileSelectInput
|
|
4579
|
+
[dir]="direction"
|
|
4580
|
+
[accept]="accept"
|
|
4581
|
+
[restrictions]="restrictions"
|
|
4582
|
+
[multiple]="multiple"
|
|
4583
|
+
[disabled]="disabled"
|
|
4584
|
+
[required]="isControlRequired"
|
|
4585
|
+
/>
|
|
4586
|
+
</div>
|
|
4587
|
+
<div class="k-dropzone-hint">{{textFor('dropFilesHere')}}</div>
|
|
4617
4588
|
</div>
|
|
4618
|
-
|
|
4589
|
+
<ul kendo-upload-file-list
|
|
4590
|
+
class="k-upload-files k-reset"
|
|
4591
|
+
*ngIf="hasFileList"
|
|
4592
|
+
[disabled]="disabled"
|
|
4593
|
+
[fileList]="fileList.files"
|
|
4594
|
+
[fileTemplate]="fileTemplate"
|
|
4595
|
+
[fileInfoTemplate]="fileInfoTemplate"
|
|
4596
|
+
[id]="fileListId">
|
|
4597
|
+
</ul>
|
|
4598
|
+
`,
|
|
4599
|
+
standalone: true,
|
|
4600
|
+
imports: [LocalizedMessagesDirective, DropZoneInternalDirective, ButtonComponent, FileSelectDirective, NgIf, FileListComponent]
|
|
4619
4601
|
}]
|
|
4620
|
-
}], ctorParameters: function () { return [{ type: i0.
|
|
4621
|
-
type:
|
|
4622
|
-
args: ['
|
|
4623
|
-
}],
|
|
4602
|
+
}], 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 }, { type: i0.Injector }]; }, propDecorators: { fileSelectInput: [{
|
|
4603
|
+
type: ViewChild,
|
|
4604
|
+
args: ['fileSelectInput', { static: true }]
|
|
4605
|
+
}], dir: [{
|
|
4624
4606
|
type: HostBinding,
|
|
4625
4607
|
args: ['attr.dir']
|
|
4626
|
-
}],
|
|
4627
|
-
type: Input
|
|
4628
|
-
}], icon: [{
|
|
4629
|
-
type: Input
|
|
4630
|
-
}], iconClass: [{
|
|
4631
|
-
type: Input
|
|
4632
|
-
}], svgIcon: [{
|
|
4608
|
+
}], name: [{
|
|
4633
4609
|
type: Input
|
|
4610
|
+
}], valueChange: [{
|
|
4611
|
+
type: Output
|
|
4634
4612
|
}] } });
|
|
4635
4613
|
|
|
4636
4614
|
/**
|
|
4637
|
-
*
|
|
4615
|
+
* Custom component messages override default component messages ([more information and example]({% slug globalization_upload %})).
|
|
4616
|
+
*
|
|
4617
|
+
* @example
|
|
4618
|
+
* ```html-no-run
|
|
4619
|
+
* <kendo-fileselect>
|
|
4620
|
+
* <kendo-fileselect-messages
|
|
4621
|
+
* dropFilesHere="Drop your file here"
|
|
4622
|
+
* select="Upload file">
|
|
4623
|
+
* </kendo-fileselect-messages>
|
|
4624
|
+
* </kendo-fileselect>
|
|
4625
|
+
* ```
|
|
4626
|
+
*/
|
|
4627
|
+
class CustomMessagesComponent extends Messages {
|
|
4628
|
+
constructor(service) {
|
|
4629
|
+
super();
|
|
4630
|
+
this.service = service;
|
|
4631
|
+
}
|
|
4632
|
+
get override() {
|
|
4633
|
+
return true;
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4637
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-upload-messages, kendo-fileselect-messages, kendo-uploaddropzone-messages", providers: [
|
|
4638
|
+
{
|
|
4639
|
+
provide: Messages,
|
|
4640
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
4641
|
+
}
|
|
4642
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
4643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
4644
|
+
type: Component,
|
|
4645
|
+
args: [{
|
|
4646
|
+
providers: [
|
|
4647
|
+
{
|
|
4648
|
+
provide: Messages,
|
|
4649
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
4650
|
+
}
|
|
4651
|
+
],
|
|
4652
|
+
selector: 'kendo-upload-messages, kendo-fileselect-messages, kendo-uploaddropzone-messages',
|
|
4653
|
+
template: ``,
|
|
4654
|
+
standalone: true
|
|
4655
|
+
}]
|
|
4656
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
4657
|
+
|
|
4658
|
+
/**
|
|
4659
|
+
* Utility array that contains all `FileSelect` related components and directives
|
|
4638
4660
|
*/
|
|
4639
|
-
const
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
FileSelectDirective,
|
|
4647
|
-
LocalizedMessagesDirective
|
|
4661
|
+
const KENDO_FILESELECT = [
|
|
4662
|
+
FileSelectComponent,
|
|
4663
|
+
FileTemplateDirective,
|
|
4664
|
+
FileInfoTemplateDirective,
|
|
4665
|
+
CustomMessagesComponent,
|
|
4666
|
+
UploadDropZoneDirective,
|
|
4667
|
+
UploadDropZoneComponent
|
|
4648
4668
|
];
|
|
4649
4669
|
/**
|
|
4650
|
-
*
|
|
4670
|
+
* Utility array that contains all `Upload` related components and directives
|
|
4651
4671
|
*/
|
|
4652
|
-
const
|
|
4672
|
+
const KENDO_UPLOAD = [
|
|
4673
|
+
UploadComponent,
|
|
4674
|
+
UploadActionButtonsComponent,
|
|
4675
|
+
UploadStatusTotalComponent,
|
|
4653
4676
|
FileTemplateDirective,
|
|
4654
4677
|
FileInfoTemplateDirective,
|
|
4655
4678
|
CustomMessagesComponent,
|
|
@@ -4657,106 +4680,66 @@ const PUBLIC_DIRECTIVES = [
|
|
|
4657
4680
|
UploadDropZoneComponent
|
|
4658
4681
|
];
|
|
4659
4682
|
/**
|
|
4660
|
-
*
|
|
4683
|
+
* Utility array that contains all `@progress/kendo-angular-upload` related components and directives
|
|
4661
4684
|
*/
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, declarations: [FileTemplateDirective,
|
|
4666
|
-
FileInfoTemplateDirective,
|
|
4667
|
-
CustomMessagesComponent,
|
|
4668
|
-
UploadDropZoneDirective,
|
|
4669
|
-
UploadDropZoneComponent, DropZoneInternalDirective,
|
|
4670
|
-
FileListComponent,
|
|
4671
|
-
FileListItemDirective,
|
|
4672
|
-
FileListItemActionButtonComponent,
|
|
4673
|
-
FileListMultipleItemsComponent,
|
|
4674
|
-
FileListSingleItemComponent,
|
|
4675
|
-
FileSelectDirective,
|
|
4676
|
-
LocalizedMessagesDirective], imports: [CommonModule, ButtonsModule, ProgressBarModule, IconsModule], exports: [FileTemplateDirective,
|
|
4677
|
-
FileInfoTemplateDirective,
|
|
4678
|
-
CustomMessagesComponent,
|
|
4679
|
-
UploadDropZoneDirective,
|
|
4680
|
-
UploadDropZoneComponent, DropZoneInternalDirective,
|
|
4681
|
-
FileListComponent,
|
|
4682
|
-
FileListItemDirective,
|
|
4683
|
-
FileListItemActionButtonComponent,
|
|
4684
|
-
FileListMultipleItemsComponent,
|
|
4685
|
-
FileListSingleItemComponent,
|
|
4686
|
-
FileSelectDirective,
|
|
4687
|
-
LocalizedMessagesDirective, CommonModule,
|
|
4688
|
-
ButtonsModule] });
|
|
4689
|
-
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule, ButtonsModule, ProgressBarModule, IconsModule, CommonModule,
|
|
4690
|
-
ButtonsModule] });
|
|
4691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
|
|
4692
|
-
type: NgModule,
|
|
4693
|
-
args: [{
|
|
4694
|
-
declarations: [
|
|
4695
|
-
PUBLIC_DIRECTIVES,
|
|
4696
|
-
SHARED_DECLARATIONS
|
|
4697
|
-
],
|
|
4698
|
-
exports: [
|
|
4699
|
-
PUBLIC_DIRECTIVES,
|
|
4700
|
-
SHARED_DECLARATIONS,
|
|
4701
|
-
CommonModule,
|
|
4702
|
-
ButtonsModule
|
|
4703
|
-
],
|
|
4704
|
-
imports: [CommonModule, ButtonsModule, ProgressBarModule, IconsModule]
|
|
4705
|
-
}]
|
|
4706
|
-
}] });
|
|
4707
|
-
|
|
4708
|
-
const FILESELECT_DECLARATIONS = [
|
|
4709
|
-
FileSelectComponent
|
|
4685
|
+
const KENDO_UPLOADS = [
|
|
4686
|
+
...KENDO_FILESELECT,
|
|
4687
|
+
...KENDO_UPLOAD
|
|
4710
4688
|
];
|
|
4689
|
+
|
|
4690
|
+
// IMPORTANT: NgModule export kept for backwards compatibility
|
|
4711
4691
|
/**
|
|
4712
4692
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the FileSelect component.
|
|
4713
4693
|
*/
|
|
4714
4694
|
class FileSelectModule {
|
|
4715
4695
|
}
|
|
4716
4696
|
FileSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4717
|
-
FileSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule,
|
|
4718
|
-
FileSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule,
|
|
4697
|
+
FileSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule, imports: [FileSelectComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent], exports: [FileSelectComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent] });
|
|
4698
|
+
FileSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule, providers: [
|
|
4699
|
+
IconsService,
|
|
4700
|
+
PopupService,
|
|
4701
|
+
ResizeBatchService
|
|
4702
|
+
], imports: [FileSelectComponent, CustomMessagesComponent, UploadDropZoneComponent] });
|
|
4719
4703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FileSelectModule, decorators: [{
|
|
4720
4704
|
type: NgModule,
|
|
4721
4705
|
args: [{
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4706
|
+
exports: [...KENDO_FILESELECT],
|
|
4707
|
+
imports: [...KENDO_FILESELECT],
|
|
4708
|
+
providers: [
|
|
4709
|
+
IconsService,
|
|
4710
|
+
PopupService,
|
|
4711
|
+
ResizeBatchService
|
|
4712
|
+
]
|
|
4728
4713
|
}]
|
|
4729
4714
|
}] });
|
|
4730
4715
|
|
|
4731
|
-
|
|
4732
|
-
UploadComponent,
|
|
4733
|
-
UploadActionButtonsComponent,
|
|
4734
|
-
UploadStatusTotalComponent
|
|
4735
|
-
];
|
|
4716
|
+
// IMPORTANT: NgModule export kept for backwards compatibility
|
|
4736
4717
|
/**
|
|
4737
4718
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the Upload component.
|
|
4738
4719
|
*/
|
|
4739
4720
|
class UploadModule {
|
|
4740
4721
|
}
|
|
4741
4722
|
UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4742
|
-
UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UploadModule,
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4723
|
+
UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UploadModule, imports: [UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent], exports: [UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent] });
|
|
4724
|
+
UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadModule, providers: [
|
|
4725
|
+
IconsService,
|
|
4726
|
+
PopupService,
|
|
4727
|
+
ResizeBatchService
|
|
4728
|
+
], imports: [UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, CustomMessagesComponent, UploadDropZoneComponent] });
|
|
4748
4729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadModule, decorators: [{
|
|
4749
4730
|
type: NgModule,
|
|
4750
4731
|
args: [{
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4732
|
+
exports: [...KENDO_UPLOAD],
|
|
4733
|
+
imports: [...KENDO_UPLOAD],
|
|
4734
|
+
providers: [
|
|
4735
|
+
IconsService,
|
|
4736
|
+
PopupService,
|
|
4737
|
+
ResizeBatchService
|
|
4738
|
+
]
|
|
4757
4739
|
}]
|
|
4758
4740
|
}] });
|
|
4759
4741
|
|
|
4742
|
+
// IMPORTANT: NgModule export kept for backwards compatibility
|
|
4760
4743
|
/**
|
|
4761
4744
|
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
4762
4745
|
* definition for the Uploads components.
|
|
@@ -4785,16 +4768,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4785
4768
|
class UploadsModule {
|
|
4786
4769
|
}
|
|
4787
4770
|
UploadsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4788
|
-
UploadsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UploadsModule, exports: [
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4771
|
+
UploadsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UploadsModule, imports: [FileSelectComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent, UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent], exports: [FileSelectComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent, UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, FileTemplateDirective, FileInfoTemplateDirective, CustomMessagesComponent, UploadDropZoneDirective, UploadDropZoneComponent] });
|
|
4772
|
+
UploadsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadsModule, providers: [
|
|
4773
|
+
IconsService,
|
|
4774
|
+
PopupService,
|
|
4775
|
+
ResizeBatchService
|
|
4776
|
+
], imports: [FileSelectComponent, CustomMessagesComponent, UploadDropZoneComponent, UploadComponent, UploadActionButtonsComponent, UploadStatusTotalComponent, CustomMessagesComponent, UploadDropZoneComponent] });
|
|
4792
4777
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadsModule, decorators: [{
|
|
4793
4778
|
type: NgModule,
|
|
4794
4779
|
args: [{
|
|
4795
|
-
exports: [
|
|
4796
|
-
|
|
4797
|
-
|
|
4780
|
+
exports: [...KENDO_UPLOADS],
|
|
4781
|
+
imports: [...KENDO_UPLOADS],
|
|
4782
|
+
providers: [
|
|
4783
|
+
IconsService,
|
|
4784
|
+
PopupService,
|
|
4785
|
+
ResizeBatchService
|
|
4798
4786
|
]
|
|
4799
4787
|
}]
|
|
4800
4788
|
}] });
|
|
@@ -4803,5 +4791,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4803
4791
|
* Generated bundle index. Do not edit.
|
|
4804
4792
|
*/
|
|
4805
4793
|
|
|
4806
|
-
export { CancelEvent, ClearEvent, CustomMessagesComponent, DropZoneService, ErrorEvent, FileInfoTemplateDirective, FileListComponent, FileListItemActionButtonComponent, FileListItemBase, FileListMultipleItemsComponent, FileListSingleItemComponent, FileMap, FileSelectComponent, FileSelectDirective, FileSelectModule, FileState, FileTemplateDirective, NavigationService, PauseEvent, RemoveEvent, ResumeEvent, SelectEvent, SuccessEvent, UPLOAD_VALUE_ACCESSOR, UploadActionButtonsComponent, UploadComponent, UploadDropZoneComponent, UploadDropZoneDirective, UploadEvent, UploadModule, UploadProgressEvent, UploadService, UploadStatusTotalComponent, UploadsModule, validateFiles };
|
|
4794
|
+
export { CancelEvent, ClearEvent, CustomMessagesComponent, DropZoneService, ErrorEvent, FileInfoTemplateDirective, FileListComponent, FileListItemActionButtonComponent, FileListItemBase, FileListMultipleItemsComponent, FileListSingleItemComponent, FileMap, FileSelectComponent, FileSelectDirective, FileSelectModule, FileState, FileTemplateDirective, KENDO_FILESELECT, KENDO_UPLOAD, KENDO_UPLOADS, NavigationService, PauseEvent, RemoveEvent, ResumeEvent, SelectEvent, SuccessEvent, UPLOAD_VALUE_ACCESSOR, UploadActionButtonsComponent, UploadComponent, UploadDropZoneComponent, UploadDropZoneDirective, UploadEvent, UploadModule, UploadProgressEvent, UploadService, UploadStatusTotalComponent, UploadsModule, validateFiles };
|
|
4807
4795
|
|