Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-angular-upload

Package Overview
Dependencies
Maintainers
1
Versions
905
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-angular-upload - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1-dev.201708300744

7

dist/es/file-info.d.ts
import { Subscription } from 'rxjs';
/**
* Contains information related to the selected file.
* Contains information which is related to the selected file.
*/

@@ -32,3 +32,4 @@ export interface FileInfo {

* The current state of the file—`Failed`, `Selected`, `Uploaded`, or `Uploading`.
* A special value for `FileState` is `Initial`. It is automatically applied to initial files without explicitly set state.
* `Initial` is a special value for `FileState`.
* It is automatically applied to initial files without you having to explicitly set their state.
*/

@@ -50,3 +51,3 @@ state?: FileState;

/**
* An initially selected fake file without set state.
* An initially selected fake file without a set state.
*/

@@ -53,0 +54,0 @@ Initial = 1,

@@ -11,3 +11,3 @@ /**

/**
* An initially selected fake file without set state.
* An initially selected fake file without a set state.
*/

@@ -14,0 +14,0 @@ FileState[FileState["Initial"] = 1] = "Initial";

@@ -76,3 +76,5 @@ import { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core';

event.preventDefault();
this.navigationService.focusedIndex = this.index;
if (!util.isFocusable(event.target) && !util.hasClasses(event.target, util.IGNORE_TARGET_CLASSSES)) {
this.navigationService.focusedIndex = this.index;
}
};

@@ -79,0 +81,0 @@ return FileListItemDirective;

@@ -6,3 +6,3 @@ /**

/**
* List of allowed file extensions. Recognizes entries of both `.type` and `type` values.
* The list of the allowed file extensions. Recognizes entries of both `.type` and `type` values.
*/

@@ -9,0 +9,0 @@ allowedExtensions?: Array<string>;

@@ -59,5 +59,5 @@ import { Directive, ElementRef, HostBinding, HostListener, Input } from '@angular/core';

/*
Chrome and Internet Explorer don't trigger change event
when file with the same name is selected consecutive times.
As a workaround we clear the input value after handling the file.
Chrome and Internet Explorer do not trigger a `change` event
when a file with the same name is selected a number of consecutive times.
As a workaround, clear the input value after handling the file.
*/

@@ -64,0 +64,0 @@ var native = this.element.nativeElement;

@@ -15,11 +15,11 @@ import { ComponentMessages } from '@progress/kendo-angular-l10n';

/**
* Sets the drop zone hint.
* Sets the drop-zone hint.
*/
dropFilesHere: string;
/**
* Sets the header status message after file upload completion.
* Sets the header status message after the file upload completes.
*/
headerStatusUploaded: string;
/**
* Sets the header status message during file upload.
* Sets the header status message during the upload of the file.
*/

@@ -26,0 +26,0 @@ headerStatusUploading: string;

@@ -41,6 +41,2 @@ import { Injectable, EventEmitter } from '@angular/core';

NavigationService.prototype.process = function (event) {
if (event.keyCode !== Keys.tab &&
event.keyCode !== Keys.space) {
event.preventDefault();
}
var handler = this.action(event);

@@ -47,0 +43,0 @@ if (handler) {

@@ -30,4 +30,3 @@ import { Headers, Response } from '@angular/http';

* Fires when the user cancels the process of uploading a file or a batch of files.
*
* Arguments for the `cancel` event:
* Arguments for the `cancel` event.
*/

@@ -38,3 +37,3 @@ export declare class CancelEvent {

* Constructs the event arguments for the `cancel` event.
* @param files - The list of the files that were to be uploaded.
* @param files - The list of the files that were going to be uploaded.
*/

@@ -61,5 +60,4 @@ constructor(files: Array<FileInfo>);

*
* Fires when an upload or removal operation fails.
*
* Arguments for the `error` event:
* Fires when an `upload` or `remove` operation fails.
* Arguments for the `error` event.
*/

@@ -84,5 +82,4 @@ export declare class ErrorEvent {

*
* Fires when an uploaded or selected file is about to be removed. If you cancel the event, the removal is prevented.
*
* Arguments for the `remove` event:
* Fires when an uploaded or selected file will be removed. If you cancel the event, the removal is prevented.
* Arguments for the `remove` event.
*/

@@ -98,3 +95,3 @@ export declare class RemoveEvent extends PreventableEvent {

* Constructs the event arguments for the `remove` event.
* @param files - The list of the files that are about to be removed.
* @param files - The list of the files that will be removed.
* @param headers - The headers of the request.

@@ -110,4 +107,3 @@ */

* Fires when the user selects a file or multiple files for upload. If you cancel the event, the selection is prevented.
*
* Arguments for the `select` event:
* Arguments for the `select` event.
*/

@@ -128,4 +124,3 @@ export declare class SelectEvent extends PreventableEvent {

* Fires when the selected files are successfully uploaded or removed.
*
* Arguments for the `success` event:
* Arguments for the `success` event.
*/

@@ -145,4 +140,4 @@ export declare class SuccessEvent extends PreventableEvent {

/**
* Fires when one or more files are about to be uploaded. If you cancel the event, the upload is prevented.
* Headers can be added to the request:
* Fires when one or more files will be uploaded. If you cancel the event, the upload is prevented.
* You can add headers to the request.
* {% embed_file events/upload/upload.component.ts preview %}

@@ -157,3 +152,3 @@ * {% embed_file shared/app.component.ts %}

/**
* The optional object that is sent to the `upload` handler in the form of key/value pair:
* The optional object that is sent to the `upload` handler in the form of key/value pair.
* {% embed_file events/upload2/upload.component.ts %}

@@ -166,3 +161,3 @@ * {% embed_file shared/app.component.ts %}

* Constructs the event arguments for the `upload` event.
* @param files - The list of the files that are about to be uploaded.
* @param files - The list of the files that will be uploaded.
* @param headers - The headers of the request.

@@ -169,0 +164,0 @@ */

@@ -33,4 +33,3 @@ import * as tslib_1 from "tslib";

* Fires when the user cancels the process of uploading a file or a batch of files.
*
* Arguments for the `cancel` event:
* Arguments for the `cancel` event.
*/

@@ -40,3 +39,3 @@ var CancelEvent = (function () {

* Constructs the event arguments for the `cancel` event.
* @param files - The list of the files that were to be uploaded.
* @param files - The list of the files that were going to be uploaded.
*/

@@ -72,5 +71,4 @@ function CancelEvent(files) {

*
* Fires when an upload or removal operation fails.
*
* Arguments for the `error` event:
* Fires when an `upload` or `remove` operation fails.
* Arguments for the `error` event.
*/

@@ -98,5 +96,4 @@ var ErrorEvent = (function () {

*
* Fires when an uploaded or selected file is about to be removed. If you cancel the event, the removal is prevented.
*
* Arguments for the `remove` event:
* Fires when an uploaded or selected file will be removed. If you cancel the event, the removal is prevented.
* Arguments for the `remove` event.
*/

@@ -107,3 +104,3 @@ var RemoveEvent = (function (_super) {

* Constructs the event arguments for the `remove` event.
* @param files - The list of the files that are about to be removed.
* @param files - The list of the files that will be removed.
* @param headers - The headers of the request.

@@ -126,4 +123,3 @@ */

* Fires when the user selects a file or multiple files for upload. If you cancel the event, the selection is prevented.
*
* Arguments for the `select` event:
* Arguments for the `select` event.
*/

@@ -150,4 +146,3 @@ var SelectEvent = (function (_super) {

* Fires when the selected files are successfully uploaded or removed.
*
* Arguments for the `success` event:
* Arguments for the `success` event.
*/

@@ -173,4 +168,4 @@ var SuccessEvent = (function (_super) {

/**
* Fires when one or more files are about to be uploaded. If you cancel the event, the upload is prevented.
* Headers can be added to the request:
* Fires when one or more files will be uploaded. If you cancel the event, the upload is prevented.
* You can add headers to the request.
* {% embed_file events/upload/upload.component.ts preview %}

@@ -185,3 +180,3 @@ * {% embed_file shared/app.component.ts %}

* Constructs the event arguments for the `upload` event.
* @param files - The list of the files that are about to be uploaded.
* @param files - The list of the files that will be uploaded.
* @param headers - The headers of the request.

@@ -188,0 +183,0 @@ */

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":82,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":148,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":82,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":148,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":80,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":143,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":80,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":143,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}}]

@@ -35,7 +35,8 @@ import { EventEmitter, OnDestroy, ElementRef, NgZone } from '@angular/core';

* When enabled, all files in the selection are uploaded in one request.
* Files selected one after the other will be uploaded in separate requests.
* Any files that are selected one after the other are uploaded in separate requests.
*/
batch: boolean;
/**
* Configures whether credentials (cookies, headers) should be sent for cross-site requests (it is `true` by default).
* Configures whether credentials (cookies, headers) will be sent for cross-site requests.
* The default values is `true`.
* Setting `withCredentials` has no effect on same-site requests.

@@ -69,3 +70,3 @@ * To add credentials to the request, use the `saveHeaders` or `removeHeaders` property,

* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
* which contains the list of file names submitted to `removeUrl`.
* which contains the list of file names that are submitted to `removeUrl`.
* The default value is `fileNames`.

@@ -76,7 +77,7 @@ */

* Configures the [`Headers`](https://angular.io/docs/ts/latest/api/http/index/Headers-class.html)
* that are attached to each remove request.
* that are attached to each `remove` request.
*/
removeHeaders: Headers;
/**
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the remove request.
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the `remove` request.
* The default value is `POST`.

@@ -87,8 +88,8 @@ */

* Sets the URL of the endpoint for the `remove` request.
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after the `removeField` property.
* It contains the list of file names to be removed.
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key is named after the `removeField` property.
* It contains the list of file names which will be removed.
*/
removeUrl: string;
/**
* Enables multiple files selection.
* Enables the selection of multiple files.
* If set to `false`, only one file can be selected at a time.

@@ -110,3 +111,3 @@ */

/**
* Sets the accept attribute of the input element of the Upload.
* Sets the `accept` attribute of the `input` element of the Upload.
*/

@@ -139,3 +140,3 @@ accept: string;

/**
* Fires when an upload or remove operation has failed.
* Fires when an `upload` or `remove` operation has failed.
*/

@@ -164,3 +165,3 @@ error: EventEmitter<ErrorEvent>;

/**
* Fires when the value of the component has changed as a result of successful upload, remove or clear operation.
* Fires when the value of the component has changed as a result of a successful `upload`, `remove` or `clear` operation.
*/

@@ -251,22 +252,22 @@ valueChange: EventEmitter<Array<FileInfo>>;

/**
* Blurs the Upload component if it was previously focused
* Blurs the Upload if it was previously focused.
*/
blurComponent(): void;
/**
* Trigger the removal of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be removed.
* Triggers the removal of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be removed.
*/
removeFilesByUid(uid: string): void;
/**
* Trigger another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid The uid of the file or a batch of files to be retried.
* Triggers another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid - The `uid` of the file or a batch of files to be retried.
*/
retryUploadByUid(uid: string): void;
/**
* Cancel the upload of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be canceled.
* Cancels the upload of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be canceled.
*/
cancelUploadByUid(uid: string): void;
/**
* Upload the currently selected file(s) that pass the set restrictions.
* Uploads the currently selected files which pass the set restrictions.
*/

@@ -273,0 +274,0 @@ uploadFiles(): void;

@@ -33,3 +33,3 @@ /* tslint:disable: no-use-before-declare */

/**
* Enables multiple files selection.
* Enables the selection of multiple files.
* If set to `false`, only one file can be selected at a time.

@@ -67,3 +67,3 @@ */

/**
* Fires when an upload or remove operation has failed.
* Fires when an `upload` or `remove` operation has failed.
*/

@@ -92,3 +92,3 @@ this.error = new EventEmitter();

/**
* Fires when the value of the component has changed as a result of successful upload, remove or clear operation.
* Fires when the value of the component has changed as a result of a successful `upload`, `remove` or `clear` operation.
*/

@@ -151,3 +151,3 @@ this.valueChange = new EventEmitter();

* When enabled, all files in the selection are uploaded in one request.
* Files selected one after the other will be uploaded in separate requests.
* Any files that are selected one after the other are uploaded in separate requests.
*/

@@ -161,3 +161,4 @@ set: function (batch) { this.async.batch = batch; },

/**
* Configures whether credentials (cookies, headers) should be sent for cross-site requests (it is `true` by default).
* Configures whether credentials (cookies, headers) will be sent for cross-site requests.
* The default values is `true`.
* Setting `withCredentials` has no effect on same-site requests.

@@ -216,3 +217,3 @@ * To add credentials to the request, use the `saveHeaders` or `removeHeaders` property,

* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
* which contains the list of file names submitted to `removeUrl`.
* which contains the list of file names that are submitted to `removeUrl`.
* The default value is `fileNames`.

@@ -228,3 +229,3 @@ */

* Configures the [`Headers`](https://angular.io/docs/ts/latest/api/http/index/Headers-class.html)
* that are attached to each remove request.
* that are attached to each `remove` request.
*/

@@ -238,3 +239,3 @@ set: function (removeHeaders) { this.async.removeHeaders = removeHeaders; },

/**
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the remove request.
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the `remove` request.
* The default value is `POST`.

@@ -250,4 +251,4 @@ */

* Sets the URL of the endpoint for the `remove` request.
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after the `removeField` property.
* It contains the list of file names to be removed.
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key is named after the `removeField` property.
* It contains the list of file names which will be removed.
*/

@@ -345,3 +346,6 @@ set: function (removeUrl) { this.async.removeUrl = removeUrl; },

}
this.navigation.process(event);
if (util.hasClasses(event.target, util.UPLOAD_CLASSES) ||
(!util.isFocusable(event.target) && !util.hasClasses(event.target, util.IGNORE_TARGET_CLASSSES))) {
this.navigation.process(event);
}
};

@@ -447,3 +451,3 @@ /**

/**
* Blurs the Upload component if it was previously focused
* Blurs the Upload if it was previously focused.
*/

@@ -458,4 +462,4 @@ UploadComponent.prototype.blurComponent = function () {

/**
* Trigger the removal of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be removed.
* Triggers the removal of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be removed.
*/

@@ -466,4 +470,4 @@ UploadComponent.prototype.removeFilesByUid = function (uid) {

/**
* Trigger another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid The uid of the file or a batch of files to be retried.
* Triggers another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid - The `uid` of the file or a batch of files to be retried.
*/

@@ -474,4 +478,4 @@ UploadComponent.prototype.retryUploadByUid = function (uid) {

/**
* Cancel the upload of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be canceled.
* Cancels the upload of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be canceled.
*/

@@ -482,3 +486,3 @@ UploadComponent.prototype.cancelUploadByUid = function (uid) {

/**
* Upload the currently selected file(s) that pass the set restrictions.
* Uploads the currently selected files which pass the set restrictions.
*/

@@ -485,0 +489,0 @@ UploadComponent.prototype.uploadFiles = function () {

@@ -21,3 +21,3 @@ import { Injectable, EventEmitter } from '@angular/core';

this.uploadEvent = new EventEmitter();
//required for ControlValueAccessor integration
// Required for the `ControlValueAccessor` integration
this.changeEvent = new EventEmitter();

@@ -63,3 +63,3 @@ this.fileList = new FileMap();

var removedFiles = this.fileList.get(uid);
// cloning the Headers so the default ones are not overridden
// Clone the Headers so that the default ones are not overridden
var removeEventArgs = new RemoveEvent(removedFiles, new Headers(async.removeHeaders));

@@ -66,0 +66,0 @@ this.removeEvent.emit(removeEventArgs);

declare const _default: {
IGNORE_TARGET_CLASSSES: string;
UPLOAD_CLASSES: string;
assignGuidToFiles: Function;

@@ -8,4 +10,6 @@ fileHasValidationErrors: Function;

getTotalFilesSizeMessage: Function;
hasClasses: (element: HTMLElement, classNames: string) => boolean;
inputFiles: Function;
isDocumentAvailable: Function;
isFocusable: Function;
supportsFormData: Function;

@@ -12,0 +16,0 @@ userAgent: Function;

@@ -145,3 +145,34 @@ /* tslint:disable: no-bitwise */

};
var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
var IGNORE_TARGET_CLASSSES = 'k-icon k-select k-input';
var UPLOAD_CLASSES = 'k-upload-button k-clear-selected k-upload-selected k-upload-action';
var isVisible = function (element) {
var rect = element.getBoundingClientRect();
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
};
var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
var hasClasses = function (element, classNames) {
var namesList = toClassList(classNames);
return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));
};
var isFocusable = function (element, checkVisibility) {
if (checkVisibility === void 0) { checkVisibility = true; }
if (element.tagName) {
var tagName = element.tagName.toLowerCase();
var tabIndex = element.getAttribute('tabIndex');
var validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
var focusable = false;
if (focusableRegex.test(tagName)) {
focusable = !element.disabled;
}
else {
focusable = validTabIndex;
}
return focusable && (!checkVisibility || isVisible(element));
}
return false;
};
export default {
IGNORE_TARGET_CLASSSES: IGNORE_TARGET_CLASSSES,
UPLOAD_CLASSES: UPLOAD_CLASSES,
assignGuidToFiles: assignGuidToFiles,

@@ -153,4 +184,6 @@ fileHasValidationErrors: fileHasValidationErrors,

getTotalFilesSizeMessage: getTotalFilesSizeMessage,
hasClasses: hasClasses,
inputFiles: inputFiles,
isDocumentAvailable: isDocumentAvailable,
isFocusable: isFocusable,
supportsFormData: supportsFormData,

@@ -157,0 +190,0 @@ userAgent: userAgent,

import { Subscription } from 'rxjs';
/**
* Contains information related to the selected file.
* Contains information which is related to the selected file.
*/

@@ -32,3 +32,4 @@ export interface FileInfo {

* The current state of the file&mdash;`Failed`, `Selected`, `Uploaded`, or `Uploading`.
* A special value for `FileState` is `Initial`. It is automatically applied to initial files without explicitly set state.
* `Initial` is a special value for `FileState`.
* It is automatically applied to initial files without you having to explicitly set their state.
*/

@@ -50,3 +51,3 @@ state?: FileState;

/**
* An initially selected fake file without set state.
* An initially selected fake file without a set state.
*/

@@ -53,0 +54,0 @@ Initial = 1,

@@ -13,3 +13,3 @@ "use strict";

/**
* An initially selected fake file without set state.
* An initially selected fake file without a set state.
*/

@@ -16,0 +16,0 @@ FileState[FileState["Initial"] = 1] = "Initial";

@@ -78,3 +78,5 @@ "use strict";

event.preventDefault();
this.navigationService.focusedIndex = this.index;
if (!util_1.default.isFocusable(event.target) && !util_1.default.hasClasses(event.target, util_1.default.IGNORE_TARGET_CLASSSES)) {
this.navigationService.focusedIndex = this.index;
}
};

@@ -81,0 +83,0 @@ return FileListItemDirective;

@@ -6,3 +6,3 @@ /**

/**
* List of allowed file extensions. Recognizes entries of both `.type` and `type` values.
* The list of the allowed file extensions. Recognizes entries of both `.type` and `type` values.
*/

@@ -9,0 +9,0 @@ allowedExtensions?: Array<string>;

@@ -61,5 +61,5 @@ "use strict";

/*
Chrome and Internet Explorer don't trigger change event
when file with the same name is selected consecutive times.
As a workaround we clear the input value after handling the file.
Chrome and Internet Explorer do not trigger a `change` event
when a file with the same name is selected a number of consecutive times.
As a workaround, clear the input value after handling the file.
*/

@@ -66,0 +66,0 @@ var native = this.element.nativeElement;

@@ -15,11 +15,11 @@ import { ComponentMessages } from '@progress/kendo-angular-l10n';

/**
* Sets the drop zone hint.
* Sets the drop-zone hint.
*/
dropFilesHere: string;
/**
* Sets the header status message after file upload completion.
* Sets the header status message after the file upload completes.
*/
headerStatusUploaded: string;
/**
* Sets the header status message during file upload.
* Sets the header status message during the upload of the file.
*/

@@ -26,0 +26,0 @@ headerStatusUploading: string;

@@ -43,6 +43,2 @@ "use strict";

NavigationService.prototype.process = function (event) {
if (event.keyCode !== Keys.tab &&
event.keyCode !== Keys.space) {
event.preventDefault();
}
var handler = this.action(event);

@@ -49,0 +45,0 @@ if (handler) {

@@ -30,4 +30,3 @@ import { Headers, Response } from '@angular/http';

* Fires when the user cancels the process of uploading a file or a batch of files.
*
* Arguments for the `cancel` event:
* Arguments for the `cancel` event.
*/

@@ -38,3 +37,3 @@ export declare class CancelEvent {

* Constructs the event arguments for the `cancel` event.
* @param files - The list of the files that were to be uploaded.
* @param files - The list of the files that were going to be uploaded.
*/

@@ -61,5 +60,4 @@ constructor(files: Array<FileInfo>);

*
* Fires when an upload or removal operation fails.
*
* Arguments for the `error` event:
* Fires when an `upload` or `remove` operation fails.
* Arguments for the `error` event.
*/

@@ -84,5 +82,4 @@ export declare class ErrorEvent {

*
* Fires when an uploaded or selected file is about to be removed. If you cancel the event, the removal is prevented.
*
* Arguments for the `remove` event:
* Fires when an uploaded or selected file will be removed. If you cancel the event, the removal is prevented.
* Arguments for the `remove` event.
*/

@@ -98,3 +95,3 @@ export declare class RemoveEvent extends PreventableEvent {

* Constructs the event arguments for the `remove` event.
* @param files - The list of the files that are about to be removed.
* @param files - The list of the files that will be removed.
* @param headers - The headers of the request.

@@ -110,4 +107,3 @@ */

* Fires when the user selects a file or multiple files for upload. If you cancel the event, the selection is prevented.
*
* Arguments for the `select` event:
* Arguments for the `select` event.
*/

@@ -128,4 +124,3 @@ export declare class SelectEvent extends PreventableEvent {

* Fires when the selected files are successfully uploaded or removed.
*
* Arguments for the `success` event:
* Arguments for the `success` event.
*/

@@ -145,4 +140,4 @@ export declare class SuccessEvent extends PreventableEvent {

/**
* Fires when one or more files are about to be uploaded. If you cancel the event, the upload is prevented.
* Headers can be added to the request:
* Fires when one or more files will be uploaded. If you cancel the event, the upload is prevented.
* You can add headers to the request.
* {% embed_file events/upload/upload.component.ts preview %}

@@ -157,3 +152,3 @@ * {% embed_file shared/app.component.ts %}

/**
* The optional object that is sent to the `upload` handler in the form of key/value pair:
* The optional object that is sent to the `upload` handler in the form of key/value pair.
* {% embed_file events/upload2/upload.component.ts %}

@@ -166,3 +161,3 @@ * {% embed_file shared/app.component.ts %}

* Constructs the event arguments for the `upload` event.
* @param files - The list of the files that are about to be uploaded.
* @param files - The list of the files that will be uploaded.
* @param headers - The headers of the request.

@@ -169,0 +164,0 @@ */

@@ -35,4 +35,3 @@ "use strict";

* Fires when the user cancels the process of uploading a file or a batch of files.
*
* Arguments for the `cancel` event:
* Arguments for the `cancel` event.
*/

@@ -42,3 +41,3 @@ var CancelEvent = (function () {

* Constructs the event arguments for the `cancel` event.
* @param files - The list of the files that were to be uploaded.
* @param files - The list of the files that were going to be uploaded.
*/

@@ -74,5 +73,4 @@ function CancelEvent(files) {

*
* Fires when an upload or removal operation fails.
*
* Arguments for the `error` event:
* Fires when an `upload` or `remove` operation fails.
* Arguments for the `error` event.
*/

@@ -100,5 +98,4 @@ var ErrorEvent = (function () {

*
* Fires when an uploaded or selected file is about to be removed. If you cancel the event, the removal is prevented.
*
* Arguments for the `remove` event:
* Fires when an uploaded or selected file will be removed. If you cancel the event, the removal is prevented.
* Arguments for the `remove` event.
*/

@@ -109,3 +106,3 @@ var RemoveEvent = (function (_super) {

* Constructs the event arguments for the `remove` event.
* @param files - The list of the files that are about to be removed.
* @param files - The list of the files that will be removed.
* @param headers - The headers of the request.

@@ -128,4 +125,3 @@ */

* Fires when the user selects a file or multiple files for upload. If you cancel the event, the selection is prevented.
*
* Arguments for the `select` event:
* Arguments for the `select` event.
*/

@@ -152,4 +148,3 @@ var SelectEvent = (function (_super) {

* Fires when the selected files are successfully uploaded or removed.
*
* Arguments for the `success` event:
* Arguments for the `success` event.
*/

@@ -175,4 +170,4 @@ var SuccessEvent = (function (_super) {

/**
* Fires when one or more files are about to be uploaded. If you cancel the event, the upload is prevented.
* Headers can be added to the request:
* Fires when one or more files will be uploaded. If you cancel the event, the upload is prevented.
* You can add headers to the request.
* {% embed_file events/upload/upload.component.ts preview %}

@@ -187,3 +182,3 @@ * {% embed_file shared/app.component.ts %}

* Constructs the event arguments for the `upload` event.
* @param files - The list of the files that are about to be uploaded.
* @param files - The list of the files that will be uploaded.
* @param headers - The headers of the request.

@@ -190,0 +185,0 @@ */

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":82,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":148,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":82,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":148,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":80,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":143,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"PreventableEvent":{"__symbolic":"class","members":{"preventDefault":[{"__symbolic":"method"}],"isDefaultPrevented":[{"__symbolic":"method"}]}},"CancelEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"ClearEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ErrorEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":80,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"RemoveEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}},"SelectEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]}]}]}},"SuccessEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"error","message":"Could not resolve type","line":143,"character":24,"context":{"typeName":"OperationType"}},{"__symbolic":"reference","module":"@angular/http","name":"Response"}]}]}},"UploadEvent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PreventableEvent"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"./file-info","name":"FileInfo"}]},{"__symbolic":"reference","module":"@angular/http","name":"Headers"}]}]}}}}]

@@ -35,7 +35,8 @@ import { EventEmitter, OnDestroy, ElementRef, NgZone } from '@angular/core';

* When enabled, all files in the selection are uploaded in one request.
* Files selected one after the other will be uploaded in separate requests.
* Any files that are selected one after the other are uploaded in separate requests.
*/
batch: boolean;
/**
* Configures whether credentials (cookies, headers) should be sent for cross-site requests (it is `true` by default).
* Configures whether credentials (cookies, headers) will be sent for cross-site requests.
* The default values is `true`.
* Setting `withCredentials` has no effect on same-site requests.

@@ -69,3 +70,3 @@ * To add credentials to the request, use the `saveHeaders` or `removeHeaders` property,

* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
* which contains the list of file names submitted to `removeUrl`.
* which contains the list of file names that are submitted to `removeUrl`.
* The default value is `fileNames`.

@@ -76,7 +77,7 @@ */

* Configures the [`Headers`](https://angular.io/docs/ts/latest/api/http/index/Headers-class.html)
* that are attached to each remove request.
* that are attached to each `remove` request.
*/
removeHeaders: Headers;
/**
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the remove request.
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the `remove` request.
* The default value is `POST`.

@@ -87,8 +88,8 @@ */

* Sets the URL of the endpoint for the `remove` request.
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after the `removeField` property.
* It contains the list of file names to be removed.
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key is named after the `removeField` property.
* It contains the list of file names which will be removed.
*/
removeUrl: string;
/**
* Enables multiple files selection.
* Enables the selection of multiple files.
* If set to `false`, only one file can be selected at a time.

@@ -110,3 +111,3 @@ */

/**
* Sets the accept attribute of the input element of the Upload.
* Sets the `accept` attribute of the `input` element of the Upload.
*/

@@ -139,3 +140,3 @@ accept: string;

/**
* Fires when an upload or remove operation has failed.
* Fires when an `upload` or `remove` operation has failed.
*/

@@ -164,3 +165,3 @@ error: EventEmitter<ErrorEvent>;

/**
* Fires when the value of the component has changed as a result of successful upload, remove or clear operation.
* Fires when the value of the component has changed as a result of a successful `upload`, `remove` or `clear` operation.
*/

@@ -251,22 +252,22 @@ valueChange: EventEmitter<Array<FileInfo>>;

/**
* Blurs the Upload component if it was previously focused
* Blurs the Upload if it was previously focused.
*/
blurComponent(): void;
/**
* Trigger the removal of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be removed.
* Triggers the removal of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be removed.
*/
removeFilesByUid(uid: string): void;
/**
* Trigger another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid The uid of the file or a batch of files to be retried.
* Triggers another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid - The `uid` of the file or a batch of files to be retried.
*/
retryUploadByUid(uid: string): void;
/**
* Cancel the upload of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be canceled.
* Cancels the upload of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be canceled.
*/
cancelUploadByUid(uid: string): void;
/**
* Upload the currently selected file(s) that pass the set restrictions.
* Uploads the currently selected files which pass the set restrictions.
*/

@@ -273,0 +274,0 @@ uploadFiles(): void;

@@ -35,3 +35,3 @@ "use strict";

/**
* Enables multiple files selection.
* Enables the selection of multiple files.
* If set to `false`, only one file can be selected at a time.

@@ -69,3 +69,3 @@ */

/**
* Fires when an upload or remove operation has failed.
* Fires when an `upload` or `remove` operation has failed.
*/

@@ -94,3 +94,3 @@ this.error = new core_1.EventEmitter();

/**
* Fires when the value of the component has changed as a result of successful upload, remove or clear operation.
* Fires when the value of the component has changed as a result of a successful `upload`, `remove` or `clear` operation.
*/

@@ -153,3 +153,3 @@ this.valueChange = new core_1.EventEmitter();

* When enabled, all files in the selection are uploaded in one request.
* Files selected one after the other will be uploaded in separate requests.
* Any files that are selected one after the other are uploaded in separate requests.
*/

@@ -163,3 +163,4 @@ set: function (batch) { this.async.batch = batch; },

/**
* Configures whether credentials (cookies, headers) should be sent for cross-site requests (it is `true` by default).
* Configures whether credentials (cookies, headers) will be sent for cross-site requests.
* The default values is `true`.
* Setting `withCredentials` has no effect on same-site requests.

@@ -218,3 +219,3 @@ * To add credentials to the request, use the `saveHeaders` or `removeHeaders` property,

* Sets the [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key
* which contains the list of file names submitted to `removeUrl`.
* which contains the list of file names that are submitted to `removeUrl`.
* The default value is `fileNames`.

@@ -230,3 +231,3 @@ */

* Configures the [`Headers`](https://angular.io/docs/ts/latest/api/http/index/Headers-class.html)
* that are attached to each remove request.
* that are attached to each `remove` request.
*/

@@ -240,3 +241,3 @@ set: function (removeHeaders) { this.async.removeHeaders = removeHeaders; },

/**
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the remove request.
* Sets the [`RequestMethod`](https://angular.io/docs/ts/latest/api/http/index/RequestMethod-enum.html) of the `remove` request.
* The default value is `POST`.

@@ -252,4 +253,4 @@ */

* Sets the URL of the endpoint for the `remove` request.
* The request [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) key is named after the `removeField` property.
* It contains the list of file names to be removed.
* The [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) request key is named after the `removeField` property.
* It contains the list of file names which will be removed.
*/

@@ -347,3 +348,6 @@ set: function (removeUrl) { this.async.removeUrl = removeUrl; },

}
this.navigation.process(event);
if (util_1.default.hasClasses(event.target, util_1.default.UPLOAD_CLASSES) ||
(!util_1.default.isFocusable(event.target) && !util_1.default.hasClasses(event.target, util_1.default.IGNORE_TARGET_CLASSSES))) {
this.navigation.process(event);
}
};

@@ -449,3 +453,3 @@ /**

/**
* Blurs the Upload component if it was previously focused
* Blurs the Upload if it was previously focused.
*/

@@ -460,4 +464,4 @@ UploadComponent.prototype.blurComponent = function () {

/**
* Trigger the removal of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be removed.
* Triggers the removal of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be removed.
*/

@@ -468,4 +472,4 @@ UploadComponent.prototype.removeFilesByUid = function (uid) {

/**
* Trigger another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid The uid of the file or a batch of files to be retried.
* Triggers another upload attempt of an unsuccessfully uploaded file or a batch of files.
* @param uid - The `uid` of the file or a batch of files to be retried.
*/

@@ -476,4 +480,4 @@ UploadComponent.prototype.retryUploadByUid = function (uid) {

/**
* Cancel the upload of a file or a batch of files.
* @param uid The uid of the file or a batch of files to be canceled.
* Cancels the upload of a file or a batch of files.
* @param uid - The `uid` of the file or a batch of files that will be canceled.
*/

@@ -484,3 +488,3 @@ UploadComponent.prototype.cancelUploadByUid = function (uid) {

/**
* Upload the currently selected file(s) that pass the set restrictions.
* Uploads the currently selected files which pass the set restrictions.
*/

@@ -487,0 +491,0 @@ UploadComponent.prototype.uploadFiles = function () {

@@ -23,3 +23,3 @@ "use strict";

this.uploadEvent = new core_1.EventEmitter();
//required for ControlValueAccessor integration
// Required for the `ControlValueAccessor` integration
this.changeEvent = new core_1.EventEmitter();

@@ -65,3 +65,3 @@ this.fileList = new file_map_1.FileMap();

var removedFiles = this.fileList.get(uid);
// cloning the Headers so the default ones are not overridden
// Clone the Headers so that the default ones are not overridden
var removeEventArgs = new upload_events_1.RemoveEvent(removedFiles, new http_1.Headers(async.removeHeaders));

@@ -68,0 +68,0 @@ this.removeEvent.emit(removeEventArgs);

declare const _default: {
IGNORE_TARGET_CLASSSES: string;
UPLOAD_CLASSES: string;
assignGuidToFiles: Function;

@@ -8,4 +10,6 @@ fileHasValidationErrors: Function;

getTotalFilesSizeMessage: Function;
hasClasses: (element: HTMLElement, classNames: string) => boolean;
inputFiles: Function;
isDocumentAvailable: Function;
isFocusable: Function;
supportsFormData: Function;

@@ -12,0 +16,0 @@ userAgent: Function;

@@ -147,3 +147,34 @@ "use strict";

};
var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
var IGNORE_TARGET_CLASSSES = 'k-icon k-select k-input';
var UPLOAD_CLASSES = 'k-upload-button k-clear-selected k-upload-selected k-upload-action';
var isVisible = function (element) {
var rect = element.getBoundingClientRect();
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
};
var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
var hasClasses = function (element, classNames) {
var namesList = toClassList(classNames);
return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));
};
var isFocusable = function (element, checkVisibility) {
if (checkVisibility === void 0) { checkVisibility = true; }
if (element.tagName) {
var tagName = element.tagName.toLowerCase();
var tabIndex = element.getAttribute('tabIndex');
var validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
var focusable = false;
if (focusableRegex.test(tagName)) {
focusable = !element.disabled;
}
else {
focusable = validTabIndex;
}
return focusable && (!checkVisibility || isVisible(element));
}
return false;
};
exports.default = {
IGNORE_TARGET_CLASSSES: IGNORE_TARGET_CLASSSES,
UPLOAD_CLASSES: UPLOAD_CLASSES,
assignGuidToFiles: assignGuidToFiles,

@@ -155,4 +186,6 @@ fileHasValidationErrors: fileHasValidationErrors,

getTotalFilesSizeMessage: getTotalFilesSizeMessage,
hasClasses: hasClasses,
inputFiles: inputFiles,
isDocumentAvailable: isDocumentAvailable,
isFocusable: isFocusable,
supportsFormData: supportsFormData,

@@ -159,0 +192,0 @@ userAgent: userAgent,

{
"name": "@progress/kendo-angular-upload",
"description": "Kendo UI Angular 2 Upload Component",
"version": "1.2.0",
"version": "1.2.1-dev.201708300744",
"main": "dist/npm/main.js",

@@ -6,0 +6,0 @@ "module": "dist/es/main.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc