import { Component, EventEmitter, Input, Output, ViewChild } from "@angular/core";
var UploadButtonComponent = (function () {
    function UploadButtonComponent() {
        this.icon = "cloud-upload";
        this._color = "primary";
        this.addFiles = new EventEmitter();
    }
    /*
    constructor(private renderer: Renderer) {
      console.log("Hello UploadButton Component");
    }
    */
    UploadButtonComponent.prototype.selectFile = function () {
        /*
        let event = new MouseEvent("click", {bubbles: true});
        this.renderer.invokeElementMethod(
          this.navtiveBtnRef.nativeElement
          , "dispatchEvent"
          , [event]
        );
        */
        this.navtiveBtnRef.nativeElement.click();
    };
    UploadButtonComponent.prototype.addFile = function () {
        var files = this.navtiveBtnRef.nativeElement.files;
        this.addFiles.emit(files);
    };
    return UploadButtonComponent;
}());
export { UploadButtonComponent };
UploadButtonComponent.decorators = [
    { type: Component, args: [{
                selector: "upload-button",
                template: "\n    <button ion-button (click)=\"selectFile()\" [color]=\"_color\">\n      <ion-icon [name]=\"icon\">\n        <span *ngIf=\"text\">{{text}}</span>\n      </ion-icon>\n    </button>\n    <input\n      type=\"file\" (change)=\"addFile()\"\n      [attr.multiple]=\"_multiple?'':null\"\n      [attr.accept]=\"_accept?_accept:null\"\n      hidden #input/>\n  ",
                styles: ["\n\n  "]
            },] },
];
/** @nocollapse */
UploadButtonComponent.ctorParameters = function () { return []; };
UploadButtonComponent.propDecorators = {
    'text': [{ type: Input },],
    '_multiple': [{ type: Input },],
    '_accept': [{ type: Input },],
    'icon': [{ type: Input },],
    '_color': [{ type: Input },],
    'addFiles': [{ type: Output },],
    'navtiveBtnRef': [{ type: ViewChild, args: ["input",] },],
};
//# sourceMappingURL=upload-button.component.js.map