ngx-croppie
Version:
Simple angular wrapper around croppie (WIP)
2 lines • 1.88 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("croppie"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-croppie",["exports","@angular/core","croppie","@angular/common"],e):e(t["ngx-croppie"]={},t.ng.core,null,t.ng.common)}(this,function(t,e,o,i){"use strict";var p=function(){function t(){this.outputFormatOptions={type:"base64",size:"viewport"},this.defaultZoom=0,this.result=new e.EventEmitter}return Object.defineProperty(t.prototype,"imageUrl",{get:function(){return this.imgUrl},set:function(t){this.imgUrl!==t&&(this.imgUrl=t,this._croppie&&this.bindToCroppie(this.imageUrl,this.points,this.defaultZoom))},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this._croppie=new o(this.imageEdit.nativeElement,this.croppieOptions),this.bindToCroppie(this.imageUrl,this.points,this.defaultZoom)},t.prototype.bindToCroppie=function(t,e,o){this._croppie.bind({url:t,points:e,zoom:o})},t.prototype.newResult=function(){var e=this;this._croppie.result(this.outputFormatOptions).then(function(t){e.result.emit(t)})},t.prototype.rotate=function(t){this._croppie.rotate(t)},t.prototype.get=function(){return this._croppie.get()},t.decorators=[{type:e.Component,args:[{selector:"ngx-croppie",template:'<div #imageEdit (update)="newResult()"></div>'}]}],t.propDecorators={imageEdit:[{type:e.ViewChild,args:["imageEdit"]}],croppieOptions:[{type:e.Input}],points:[{type:e.Input}],outputFormatOptions:[{type:e.Input}],defaultZoom:[{type:e.Input}],result:[{type:e.Output}],imageUrl:[{type:e.Input}]},t}(),n=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[p],exports:[p]}]}],t}();t.NgxCroppieComponent=p,t.NgxCroppieModule=n,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-croppie.umd.min.js.map