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

angular2-image-upload

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-image-upload - npm Package Compare versions

Comparing version 1.0.0-rc.0 to 1.0.0-rc.1

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="1.0.0-rc.1"></a>
# [1.0.0-rc.1](https://github.com/aberezkin/ng2-image-upload/compare/v1.0.0-rc.0...v1.0.0-rc.1) (2018-04-16)
<a name="1.0.0-rc.0"></a>

@@ -7,0 +12,0 @@ # [1.0.0-rc.0](https://github.com/aberezkin/ng2-image-upload/compare/v0.6.5...v1.0.0-rc.0) (2017-09-28)

2

lib/image-upload/before-upload.interface.d.ts

@@ -5,5 +5,5 @@ export interface UploadMetadata {

abort: boolean;
formData: {
formData?: {
[name: string]: any;
};
}
import { EventEmitter, OnChanges, OnInit } from '@angular/core';
import { Headers } from '@angular/http';
import { UploadMetadata } from './before-upload.interface';
import { ImageService } from './image.service';
import { Style } from "./style";
import { UploadMetadata } from './before-upload.interface';
import { Style } from './style';
export declare class FileHolder {

@@ -22,8 +22,9 @@ src: string;

showFileTooLargeMessage: boolean;
beforeUpload: (UploadMetadata) => UploadMetadata | Promise<UploadMetadata>;
beforeUpload: (param: UploadMetadata) => UploadMetadata | Promise<UploadMetadata>;
buttonCaption: string;
disabled: boolean;
cssClass: string;
clearButtonCaption: string;
dropBoxMessage: string;
fileTooLargeMessage: string;
fileTooLargeMessage: any;
headers: Headers | {

@@ -48,2 +49,3 @@ [name: string]: any;

uploadFinished: EventEmitter<FileHolder>;
previewClicked: EventEmitter<FileHolder>;
private inputElement;

@@ -55,2 +57,3 @@ private pendingFilesCounter;

deleteFile(file: FileHolder): void;
previewFileClicked(file: FileHolder): void;
ngOnChanges(changes: any): void;

@@ -57,0 +60,0 @@ onFileChange(files: FileList): void;

@@ -58,2 +58,3 @@ "use strict";

this.buttonCaption = 'Select Images';
this.disabled = false;
this.cssClass = 'img-ul';

@@ -69,2 +70,3 @@ this.clearButtonCaption = 'Clear';

this.uploadFinished = new core_1.EventEmitter();
this.previewClicked = new core_1.EventEmitter();
this.pendingFilesCounter = 0;

@@ -94,2 +96,5 @@ this.onFileOver = function (isOver) { return _this.fileOver = isOver; };

};
ImageUploadComponent.prototype.previewFileClicked = function (file) {
this.previewClicked.emit(file);
};
ImageUploadComponent.prototype.ngOnChanges = function (changes) {

@@ -101,2 +106,4 @@ if (changes.uploadedFiles && changes.uploadedFiles.currentValue.length > 0) {

ImageUploadComponent.prototype.onFileChange = function (files) {
if (this.disabled)
return;
var remainingSlots = this.countRemainingSlots();

@@ -112,3 +119,3 @@ var filesToUploadNum = files.length > remainingSlots ? remainingSlots : files.length;

ImageUploadComponent.prototype.onResponse = function (response, fileHolder) {
fileHolder.serverResponse = response;
fileHolder.serverResponse = { status: response.status, response: response };
fileHolder.pending = false;

@@ -201,3 +208,3 @@ this.uploadFinished.emit(fileHolder);

this.imageService
.postImage(this.url, fileHolder.file, this.headers, this.partName, customForm, this.withCredentials)
.postImage(url, fileHolder.file, this.headers, this.partName, customForm, this.withCredentials)
.subscribe(function (response) { return _this.onResponse(response, fileHolder); }, function (error) {

@@ -217,4 +224,4 @@ _this.onResponse(error, fileHolder);

selector: 'image-upload',
template: "\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label class=\"img-ul-upload img-ul-button\" [ngStyle]=\"style?.selectButton\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <label *ngIf=\"fileCounter > 0\" class=\"img-ul-clear img-ul-button\" (click)=\"deleteAll()\" [ngStyle]=\"style?.clearButton\">\n <span [innerText]=\"clearButtonCaption\"></span>\n </label>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" class=\"img-ul-x-mark\" (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
styles: ["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]
template: "\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label *ngIf=\"fileCounter != max\"\n class=\"img-ul-upload img-ul-button\" \n [ngStyle]=\"style?.selectButton\"\n [ngClass]=\"{'img-ul-disabled': disabled}\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [disabled]=\"disabled\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <button *ngIf=\"fileCounter > 0\"\n [disabled]=\"disabled\"\n class=\"img-ul-clear img-ul-button\" \n (click)=\"deleteAll()\" \n [ngStyle]=\"style?.clearButton\"\n [innerText]=\"clearButtonCaption\">\n </button>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n (click)=\"previewFileClicked(file)\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" \n [ngClass]=\"{'img-ul-disabled': disabled}\" \n class=\"img-ul-x-mark\" \n (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
styles: ["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-clear:disabled {\n background-color: #FF6464;\n cursor: default;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n border: none;\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-x-mark.img-ul-disabled {\n display: none;\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n .img-ul-upload.img-ul-disabled {\n background-color: #86E9C9;\n cursor: default;\n }\n\n .img-ul-upload.img-ul-disabled:active span {\n top: 0px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]
},] },

@@ -228,2 +235,3 @@ ];

'buttonCaption': [{ type: core_1.Input },],
'disabled': [{ type: core_1.Input },],
'cssClass': [{ type: core_1.Input, args: ['class',] },],

@@ -246,4 +254,5 @@ 'clearButtonCaption': [{ type: core_1.Input },],

'uploadFinished': [{ type: core_1.Output },],
'previewClicked': [{ type: core_1.Output },],
'inputElement': [{ type: core_1.ViewChild, args: ['input',] },],
};
exports.ImageUploadComponent = ImageUploadComponent;

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

[{"__symbolic":"module","version":3,"metadata":{"FileHolder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":11,"character":47,"context":{"typeName":"File"}}]}]}},"ImageUploadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"image-upload","template":"\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label class=\"img-ul-upload img-ul-button\" [ngStyle]=\"style?.selectButton\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <label *ngIf=\"fileCounter > 0\" class=\"img-ul-clear img-ul-button\" (click)=\"deleteAll()\" [ngStyle]=\"style?.clearButton\">\n <span [innerText]=\"clearButtonCaption\"></span>\n </label>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" class=\"img-ul-x-mark\" (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ","styles":["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]}]}],"members":{"beforeUpload":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"buttonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"cssClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["class"]}]}],"clearButtonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"dropBoxMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fileTooLargeMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"headers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxFileSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preview":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"partName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"supportedExtensions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["extensions"]}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"withCredentials":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"uploadedFiles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadStateChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadFinished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./image.service","name":"ImageService"}]}],"ngOnInit":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"deleteFile":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onFileChange":[{"__symbolic":"method"}],"onResponse":[{"__symbolic":"method"}],"processUploadedFiles":[{"__symbolic":"method"}],"uploadFiles":[{"__symbolic":"method"}],"uploadSingleFile":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"FileHolder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":11,"character":47,"context":{"typeName":"File"}}]}]}},"ImageUploadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"image-upload","template":"\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label class=\"img-ul-upload img-ul-button\" [ngStyle]=\"style?.selectButton\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <label *ngIf=\"fileCounter > 0\" class=\"img-ul-clear img-ul-button\" (click)=\"deleteAll()\" [ngStyle]=\"style?.clearButton\">\n <span [innerText]=\"clearButtonCaption\"></span>\n </label>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" class=\"img-ul-x-mark\" (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ","styles":["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]}]}],"members":{"beforeUpload":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"buttonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"cssClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["class"]}]}],"clearButtonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"dropBoxMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fileTooLargeMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"headers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxFileSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preview":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"partName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"supportedExtensions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["extensions"]}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"withCredentials":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"uploadedFiles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadStateChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadFinished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./image.service","name":"ImageService"}]}],"ngOnInit":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"deleteFile":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onFileChange":[{"__symbolic":"method"}],"onResponse":[{"__symbolic":"method"}],"processUploadedFiles":[{"__symbolic":"method"}],"uploadFiles":[{"__symbolic":"method"}],"uploadSingleFile":[{"__symbolic":"method"}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"FileHolder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":11,"character":47,"context":{"typeName":"File"}}]}]}},"ImageUploadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"image-upload","template":"\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label *ngIf=\"fileCounter != max\"\n class=\"img-ul-upload img-ul-button\" \n [ngStyle]=\"style?.selectButton\"\n [ngClass]=\"{'img-ul-disabled': disabled}\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [disabled]=\"disabled\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <button *ngIf=\"fileCounter > 0\"\n [disabled]=\"disabled\"\n class=\"img-ul-clear img-ul-button\" \n (click)=\"deleteAll()\" \n [ngStyle]=\"style?.clearButton\"\n [innerText]=\"clearButtonCaption\">\n </button>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n (click)=\"previewFileClicked(file)\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" \n [ngClass]=\"{'img-ul-disabled': disabled}\" \n class=\"img-ul-x-mark\" \n (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ","styles":["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-clear:disabled {\n background-color: #FF6464;\n cursor: default;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n border: none;\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-x-mark.img-ul-disabled {\n display: none;\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n .img-ul-upload.img-ul-disabled {\n background-color: #86E9C9;\n cursor: default;\n }\n\n .img-ul-upload.img-ul-disabled:active span {\n top: 0px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]}]}],"members":{"beforeUpload":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"buttonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"cssClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["class"]}]}],"clearButtonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"dropBoxMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fileTooLargeMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"headers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxFileSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preview":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"partName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"supportedExtensions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["extensions"]}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"withCredentials":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"uploadedFiles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadStateChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadFinished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"previewClicked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./image.service","name":"ImageService"}]}],"ngOnInit":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"deleteFile":[{"__symbolic":"method"}],"previewFileClicked":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onFileChange":[{"__symbolic":"method"}],"onResponse":[{"__symbolic":"method"}],"processUploadedFiles":[{"__symbolic":"method"}],"uploadFiles":[{"__symbolic":"method"}],"uploadSingleFile":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"FileHolder":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":11,"character":47,"context":{"typeName":"File"}}]}]}},"ImageUploadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"image-upload","template":"\n <div\n fileDrop\n [accept]=\"supportedExtensions\"\n (fileOver)=\"onFileOver($event)\"\n (fileDrop)=\"onFileChange($event)\"\n [ngClass]=\"cssClass\"\n [ngClass]=\"{'img-ul-file-is-over': fileOver}\" \n [ngStyle]=\"style?.layout\"\n >\n <div class=\"img-ul-file-upload img-ul-hr-inline-group\"> \n <label *ngIf=\"fileCounter != max\"\n class=\"img-ul-upload img-ul-button\" \n [ngStyle]=\"style?.selectButton\"\n [ngClass]=\"{'img-ul-disabled': disabled}\">\n <span [innerText]=\"buttonCaption\"></span>\n <input\n type=\"file\"\n [disabled]=\"disabled\"\n [accept]=\"supportedExtensions\"\n multiple (change)=\"onFileChange(input.files)\"\n #input>\n </label>\n <button *ngIf=\"fileCounter > 0\"\n [disabled]=\"disabled\"\n class=\"img-ul-clear img-ul-button\" \n (click)=\"deleteAll()\" \n [ngStyle]=\"style?.clearButton\"\n [innerText]=\"clearButtonCaption\">\n </button>\n <div class=\"img-ul-drag-box-msg\" [innerText]=\"dropBoxMessage\"></div>\n </div>\n\n <p class=\"img-ul-file-too-large\" *ngIf=\"showFileTooLargeMessage\" [innerText]=\"fileTooLargeMessage\"></p>\n\n <div *ngIf=\"preview\" class=\"img-ul-container img-ul-hr-inline-group\" [ngStyle]=\"style?.previewPanel\">\n <div\n class=\"img-ul-image\"\n *ngFor=\"let file of files\"\n (click)=\"previewFileClicked(file)\"\n [ngStyle]=\"{'background-image': 'url('+ file.src +')'}\"\n >\n <div *ngIf=\"file.pending\" class=\"img-ul-loading-overlay\">\n <div class=\"img-ul-spinning-circle\"></div>\n </div>\n <div *ngIf=\"!file.pending\" \n [ngClass]=\"{'img-ul-disabled': disabled}\" \n class=\"img-ul-x-mark\" \n (click)=\"deleteFile(file)\">\n <span class=\"img-ul-close\"></span>\n </div>\n </div>\n </div>\n </div>\n ","styles":["\n .img-ul {\n --active-color: #3C9;\n --common-radius: 3px;\n background-color: #f8f8f8;\n border-radius: var(--common-radius);\n border: #d0d0d0 dashed 1px;\n font-family: sans-serif;\n position: relative;\n color: #9b9b9b;\n }\n\n .img-ul-file-is-over {\n border: var(--active-color) solid;\n }\n\n .img-ul-hr-inline-group:after {\n clear: both;\n content: \"\";\n display: table;\n }\n\n .img-ul-file-upload { \n padding: 16px;\n }\n\n .img-ul-drag-box-msg { \n display: inline-block;\n font-weight: 600;\n margin-left: 12px;\n padding-top: 14px;\n }\n\n label.img-ul-button input[type=file] {\n display: none;\n position: fixed;\n top: -99999px;\n }\n\n .img-ul-clear {\n background-color: #FF0000;\n }\n\n .img-ul-clear:disabled {\n background-color: #FF6464;\n cursor: default;\n }\n\n .img-ul-upload {\n background-color: var(--active-color);\n }\n\n .img-ul-button {\n -moz-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n -webkit-box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n border: none;\n box-shadow: 2px 2px 4px 0 rgba(148, 148, 148, 0.6);\n color: #FFF;\n cursor: pointer;\n display: inline-block;\n float: left;\n font-size: 1.25em;\n font-weight: 500;\n padding: 10px;\n text-transform: uppercase;\n }\n\n .img-ul-button:active span {\n display: block;\n position: relative;\n top: 1px;\n }\n\n .img-ul-container {\n background-color: #fdfdfd;\n padding: 0 10px;\n }\n\n .img-ul-image { \n background: center center no-repeat;\n background-size: contain;\n display: inline-block;\n float: left;\n height: 86px;\n margin: 6px;\n position: relative;\n width: 86px;\n }\n\n .img-ul-x-mark {\n background-color: #000;\n border-radius: 2px;\n color: #FFF;\n cursor: pointer;\n float: right;\n height: 20px;\n margin: 2px;\n opacity: .7;\n text-align: center;\n width: 20px;\n }\n\n .img-ul-close {\n height: 20px;\n opacity: .7;\n padding-right: 3px;\n position: relative;\n width: 20px;\n }\n\n .img-ul-x-mark:hover .img-ul-close {\n opacity: 1;\n }\n\n .img-ul-close:before, .img-ul-close:after {\n background-color: #FFF;\n border-radius: 2px;\n content: '';\n height: 15px;\n position: absolute;\n top: 0;\n width: 2px;\n }\n\n .img-ul-close:before {\n transform: rotate(45deg);\n }\n\n .img-ul-close:after {\n transform: rotate(-45deg);\n }\n\n .img-ul-x-mark.img-ul-disabled {\n display: none;\n }\n\n .img-ul-loading-overlay {\n background-color: #000;\n bottom: 0;\n left: 0;\n opacity: .7;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .img-ul-spinning-circle {\n height: 30px;\n width: 30px;\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n border-radius: 50%;\n border: 3px solid rgba(255, 255, 255, 0);\n border-top: 3px solid #FFF;\n border-right: 3px solid #FFF;\n -webkit-animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n animation: spinner 2s infinite cubic-bezier(0.085, 0.625, 0.855, 0.360);\n }\n\n .img-ul-file-too-large {\n color: red;\n padding: 0 15px;\n }\n\n .img-ul-upload.img-ul-disabled {\n background-color: #86E9C9;\n cursor: default;\n }\n\n .img-ul-upload.img-ul-disabled:active span {\n top: 0px;\n }\n\n @-webkit-keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spinner {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n "]}]}],"members":{"beforeUpload":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"buttonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"cssClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["class"]}]}],"clearButtonCaption":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"dropBoxMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fileTooLargeMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"headers":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"maxFileSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preview":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"partName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"supportedExtensions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["extensions"]}]}],"url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"withCredentials":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"uploadedFiles":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"removed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadStateChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"uploadFinished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"previewClicked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./image.service","name":"ImageService"}]}],"ngOnInit":[{"__symbolic":"method"}],"deleteAll":[{"__symbolic":"method"}],"deleteFile":[{"__symbolic":"method"}],"previewFileClicked":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onFileChange":[{"__symbolic":"method"}],"onResponse":[{"__symbolic":"method"}],"processUploadedFiles":[{"__symbolic":"method"}],"uploadFiles":[{"__symbolic":"method"}],"uploadSingleFile":[{"__symbolic":"method"}]}}}}]
{
"name": "angular2-image-upload",
"version": "1.0.0-rc.0",
"version": "1.0.0-rc.1",
"description": "An angular component that uploads images using native browser upload or drag-n-drop.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,1 +7,29 @@ # Image Upload Module

### [Demo & Readme](https://aberezkin.github.io/ng2-image-upload/)
### Install
`npm install angular2-image-upload --save`
### Usage
In your `app.module.ts` import it using `@NgModule` decorator.
`import { ImageUploadModule } from "angular2-image-upload";`
````typescript
@NgModule({
imports: [
...,
ImageUploadModule.forRoot(),
...
]
})
````
Now you have `image-upload` declaration and you can use it in your html code.
`<image-upload></image-upload>`
You can use bindings to configure this element for your needs.
See the demo for more detailed instructions.

@@ -5,3 +5,3 @@ export interface UploadMetadata {

abort: boolean;
formData: { [name: string]: any };
formData?: { [name: string]: any };
}

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

import {Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild} from '@angular/core';
import {Headers} from '@angular/http';
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core';
import { Headers, Response } from '@angular/http';
import { UploadMetadata } from './before-upload.interface';
import {ImageService} from './image.service';
import {Style} from "./style";
import {UploadMetadata} from './before-upload.interface';
import { ImageService } from './image.service';
import { Style } from './style';

@@ -28,12 +28,13 @@ export class FileHolder {

@Input() beforeUpload: (UploadMetadata) => UploadMetadata | Promise<UploadMetadata> = data => data;
@Input() buttonCaption: string = 'Select Images';
@Input('class') cssClass: string = 'img-ul';
@Input() clearButtonCaption: string = 'Clear';
@Input() dropBoxMessage: string = 'Drop your images here!';
@Input() fileTooLargeMessage: string;
@Input() beforeUpload: (param: UploadMetadata) => UploadMetadata | Promise<UploadMetadata> = data => data;
@Input() buttonCaption = 'Select Images';
@Input() disabled = false;
@Input('class') cssClass = 'img-ul';
@Input() clearButtonCaption = 'Clear';
@Input() dropBoxMessage = 'Drop your images here!';
@Input() fileTooLargeMessage;
@Input() headers: Headers | { [name: string]: any };
@Input() max: number = 100;
@Input() max = 100;
@Input() maxFileSize: number;
@Input() preview: boolean = true;
@Input() preview = true;
@Input() partName: string;

@@ -43,7 +44,8 @@ @Input() style: Style;

@Input() url: string;
@Input() withCredentials: boolean = false;
@Input() withCredentials = false;
@Input() uploadedFiles: string[] | Array<{ url: string, fileName: string, blob?: Blob }> = [];
@Output() removed: EventEmitter<FileHolder> = new EventEmitter<FileHolder>();
@Output() uploadStateChanged: EventEmitter<boolean> = new EventEmitter<boolean>();
@Output() uploadFinished: EventEmitter<FileHolder> = new EventEmitter<FileHolder>();
@Output() removed = new EventEmitter<FileHolder>();
@Output() uploadStateChanged = new EventEmitter<boolean>();
@Output() uploadFinished = new EventEmitter<FileHolder>();
@Output() previewClicked = new EventEmitter<FileHolder>();

@@ -79,2 +81,6 @@ @ViewChild('input')

previewFileClicked(file: FileHolder) {
this.previewClicked.emit(file);
}
ngOnChanges(changes) {

@@ -87,2 +93,4 @@ if (changes.uploadedFiles && changes.uploadedFiles.currentValue.length > 0) {

onFileChange(files: FileList) {
if (this.disabled) return;
let remainingSlots = this.countRemainingSlots();

@@ -104,4 +112,4 @@ let filesToUploadNum = files.length > remainingSlots ? remainingSlots : files.length;

private onResponse(response, fileHolder: FileHolder) {
fileHolder.serverResponse = response;
private onResponse(response: Response, fileHolder: FileHolder) {
fileHolder.serverResponse = { status: response.status, response };
fileHolder.pending = false;

@@ -149,3 +157,3 @@

const beforeUploadResult: UploadMetadata = await this.beforeUpload({file, url: this.url, abort: false});
const beforeUploadResult: UploadMetadata = await this.beforeUpload({ file, url: this.url, abort: false });

@@ -177,3 +185,3 @@ if (beforeUploadResult.abort) {

this.imageService
.postImage(this.url, fileHolder.file, this.headers, this.partName, customForm, this.withCredentials)
.postImage(url, fileHolder.file, this.headers, this.partName, customForm, this.withCredentials)
.subscribe(

@@ -180,0 +188,0 @@ response => this.onResponse(response, fileHolder),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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