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

ngx-printer

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-printer - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

8

bundles/ngx-printer.umd.js

@@ -658,5 +658,9 @@ (function (global, factory) {

if (printOpenWindow === false) {
if (this.openNgxPrinter) {
document.body.removeChild(this.openNgxPrinter);
if (!this.openNgxPrinter) {
return;
}
if (document.body.getElementsByTagName('ngx-printer').length === 0) {
return;
}
document.body.removeChild(this.openNgxPrinter);
}

@@ -663,0 +667,0 @@ };

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("ngx-printer",["exports","@angular/core","rxjs"],t):t((e=e||self)["ngx-printer"]={},e.ng.core,e.rxjs)}(this,function(e,t,n){"use strict";var i=function(){function e(e,n){this.elementRef=e,this.renderer=n,this._renderClass="default",this._imgSrc="default",this.completed=new t.EventEmitter}return Object.defineProperty(e.prototype,"renderClass",{get:function(){return this._renderClass},set:function(e){this._renderClass=e,this.setCustomClass()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imgSrc",{get:function(){return this._imgSrc},set:function(e){this._imgSrc=e,this.addImage(this._imgSrc)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setCustomClass=function(){var e=this.elementRef.nativeElement;this.renderer.removeClass(e,"default"),this.renderer.addClass(e,this._renderClass)},e.prototype.addImage=function(e){var t=this,n=this.elementRef.nativeElement,i=this.renderer.createElement("img");this.renderer.setAttribute(i,"src",e),this.renderer.listen(i,"load",function(e){console.log("loading completed",e),t.completed.emit(!0)}),this.renderer.appendChild(n,i)},e.decorators=[{type:t.Component,args:[{selector:"ngx-printer",template:"\n <ng-content></ng-content>\n ",styles:[":host.default{background-color:#fff;height:100%;width:100%;position:fixed;top:0;left:0;margin:0;z-index:1000000}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={completed:[{type:t.Output}]},e}();var r=function(){this.printOpenWindow=!0,this.timeToWaitRender=200};var o=function(){function e(e,t,i){this.resolver=t,this.injector=i,this.printWindowOpen=new n.BehaviorSubject(!1),this._printItems=new n.BehaviorSubject([]),this.$printItems=this._printItems.asObservable(),this.timeToWaitRender=200,this.renderClass="default",this.printOpenWindow=!0,this.$printWindowOpen=this.printWindowOpen.asObservable(),this.eventadded=[],this.setRootConfigOptions(e)}return e.prototype.setRootConfigOptions=function(e){e&&(e.printOpenWindow&&(this.printOpenWindow=e.printOpenWindow),e.timeToWaitRender&&(this.timeToWaitRender=e.timeToWaitRender),e.renderClass&&(this.renderClass=e.renderClass))},e.prototype.printDiv=function(e){var t=document.getElementById(e);t?this.print(t,this.printOpenWindow):console.log("div with id ${divID} not found..")},e.prototype.printByClassName=function(e){var t=document.getElementsByClassName(e);t&&t.length>0?this.print(t[0],this.printOpenWindow):console.log("element with id ${className} not found..")},e.prototype.printAngular=function(e){var t=this.createComponent(e);this.print(t.nativeElement,this.printOpenWindow)},e.prototype.printImg=function(e){var t=this,n=this.createComponent(null,e),i=this.printOpenWindow;n.instance.completed.subscribe(function(e){n.hostView.detectChanges(),console.log("completed:",e),t.print(n.location.nativeElement,i)})},e.prototype.printHTMLElement=function(e){this.print(e,this.printOpenWindow)},e.prototype.createComponent=function(e,t){var n,r=this.resolver.resolveComponentFactory(i);if(e){var o=this.resolveNgContent(e);n=r.create(this.injector,o)}else n=r.create(this.injector);return n.instance.renderClass=this.renderClass,t?(n.instance.imgSrc=t,n):(n.hostView.detectChanges(),n.location)},e.prototype.print=function(e,t){if(!0===t){var n=e.cloneNode(!0);this.printInNewWindow(n)}if(!1===t){n=e.cloneNode(!0);var i=this.createComponent(n).nativeElement;this.openNgxPrinter=i,document.body.appendChild(this.openNgxPrinter),this.printCurrentWindow()}},e.prototype.printInNewWindow=function(e){var t=this,n=window.open("","PRINT"),i=document.title;n.document.write("<HTML><HEAD><TITLE>"+i+"</TITLE></HEAD><BODY></BODY></HTML>");var r=n.document;r.body.style.margin="0 0",r.body.appendChild(e),n.document.close(),setTimeout(function(){return t.printTabWindow(n,r)},this.timeToWaitRender)},e.prototype.printTabWindow=function(e,t){this.registerPrintEvent(e,!0),this.printWindowOpen.next(!0),e.focus(),!1===t.execCommand("print")&&e.print()},e.prototype.printCurrentWindow=function(){var e=this;this.registerPrintEvent(window,!1),setTimeout(function(){e.printWindowOpen.next(!0),!1===document.execCommand("print")&&window.print()},this.timeToWaitRender)},e.prototype.registerPrintEvent=function(e,t){var n=this,i=this;e.focus(),i.eventadded[e.name]||e.addEventListener("afterprint",function(){n.eventadded[e.name]=!0,t&&(i.eventadded[e.name]=!1),i.cleanUp(e,t),i.printWindowOpen.next(!1)})},e.prototype.cleanUp=function(e,t){!0===t&&(console.log("close print window"),e.close(),setTimeout(function(){e.close()},20)),!1===t&&this.openNgxPrinter&&document.body.removeChild(this.openNgxPrinter)},e.prototype.resolveNgContent=function(e){if("string"==typeof e)return[[document.createTextNode(e)]];if(e instanceof t.TemplateRef)return[e.createEmbeddedView(null).rootNodes];if(e instanceof HTMLElement)return[[e]];var n=this.resolver.resolveComponentFactory(e).create(this.injector);return n.changeDetectorRef.detectChanges(),[[n.location.nativeElement]]},e.prototype.addPrintItem=function(e){var t=this._printItems.getValue();t.push(e),this._printItems.next(t)},e.prototype.removePrintItem=function(e){var t=this._printItems.getValue().filter(function(t){return t.id!==e});this._printItems.next(t)},e.prototype.printPrintItem=function(e){this.printHTMLElement(e.nativeElement)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r,decorators:[{type:t.Optional}]},{type:t.ComponentFactoryResolver},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r,8),t.ɵɵinject(t.ComponentFactoryResolver),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e}();var s=function(){};var p=function(){function e(e,t){this.el=e,this.printerService=t}return e.prototype.ngOnInit=function(){if(this.el.nativeElement.id){var e=new s;e.id=this.el.nativeElement.id,e.nativeElement=this.el.nativeElement,this.printerService.addPrintItem(e)}},e.prototype.ngOnDestroy=function(){this.el.nativeElement.id&&this.printerService.removePrintItem(this.el.nativeElement.id)},e.decorators=[{type:t.Directive,args:[{selector:"[ngxPrintItem]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:o}]},e.propDecorators={printName:[{type:t.Input}]},e}();var a=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:r,useValue:t}]}},e.decorators=[{type:t.NgModule,args:[{declarations:[i,p],imports:[],exports:[i,p],entryComponents:[i]}]}],e}();e.NgxPrinterComponent=i,e.NgxPrinterModule=a,e.NgxPrinterService=o,e.PrintItem=s,e.PrintItemDirective=p,e.PrintServiceConfig=r,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("ngx-printer",["exports","@angular/core","rxjs"],t):t((e=e||self)["ngx-printer"]={},e.ng.core,e.rxjs)}(this,function(e,t,n){"use strict";var i=function(){function e(e,n){this.elementRef=e,this.renderer=n,this._renderClass="default",this._imgSrc="default",this.completed=new t.EventEmitter}return Object.defineProperty(e.prototype,"renderClass",{get:function(){return this._renderClass},set:function(e){this._renderClass=e,this.setCustomClass()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imgSrc",{get:function(){return this._imgSrc},set:function(e){this._imgSrc=e,this.addImage(this._imgSrc)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setCustomClass=function(){var e=this.elementRef.nativeElement;this.renderer.removeClass(e,"default"),this.renderer.addClass(e,this._renderClass)},e.prototype.addImage=function(e){var t=this,n=this.elementRef.nativeElement,i=this.renderer.createElement("img");this.renderer.setAttribute(i,"src",e),this.renderer.listen(i,"load",function(e){console.log("loading completed",e),t.completed.emit(!0)}),this.renderer.appendChild(n,i)},e.decorators=[{type:t.Component,args:[{selector:"ngx-printer",template:"\n <ng-content></ng-content>\n ",styles:[":host.default{background-color:#fff;height:100%;width:100%;position:fixed;top:0;left:0;margin:0;z-index:1000000}"]}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},e.propDecorators={completed:[{type:t.Output}]},e}();var r=function(){this.printOpenWindow=!0,this.timeToWaitRender=200};var o=function(){function e(e,t,i){this.resolver=t,this.injector=i,this.printWindowOpen=new n.BehaviorSubject(!1),this._printItems=new n.BehaviorSubject([]),this.$printItems=this._printItems.asObservable(),this.timeToWaitRender=200,this.renderClass="default",this.printOpenWindow=!0,this.$printWindowOpen=this.printWindowOpen.asObservable(),this.eventadded=[],this.setRootConfigOptions(e)}return e.prototype.setRootConfigOptions=function(e){e&&(e.printOpenWindow&&(this.printOpenWindow=e.printOpenWindow),e.timeToWaitRender&&(this.timeToWaitRender=e.timeToWaitRender),e.renderClass&&(this.renderClass=e.renderClass))},e.prototype.printDiv=function(e){var t=document.getElementById(e);t?this.print(t,this.printOpenWindow):console.log("div with id ${divID} not found..")},e.prototype.printByClassName=function(e){var t=document.getElementsByClassName(e);t&&t.length>0?this.print(t[0],this.printOpenWindow):console.log("element with id ${className} not found..")},e.prototype.printAngular=function(e){var t=this.createComponent(e);this.print(t.nativeElement,this.printOpenWindow)},e.prototype.printImg=function(e){var t=this,n=this.createComponent(null,e),i=this.printOpenWindow;n.instance.completed.subscribe(function(e){n.hostView.detectChanges(),console.log("completed:",e),t.print(n.location.nativeElement,i)})},e.prototype.printHTMLElement=function(e){this.print(e,this.printOpenWindow)},e.prototype.createComponent=function(e,t){var n,r=this.resolver.resolveComponentFactory(i);if(e){var o=this.resolveNgContent(e);n=r.create(this.injector,o)}else n=r.create(this.injector);return n.instance.renderClass=this.renderClass,t?(n.instance.imgSrc=t,n):(n.hostView.detectChanges(),n.location)},e.prototype.print=function(e,t){if(!0===t){var n=e.cloneNode(!0);this.printInNewWindow(n)}if(!1===t){n=e.cloneNode(!0);var i=this.createComponent(n).nativeElement;this.openNgxPrinter=i,document.body.appendChild(this.openNgxPrinter),this.printCurrentWindow()}},e.prototype.printInNewWindow=function(e){var t=this,n=window.open("","PRINT"),i=document.title;n.document.write("<HTML><HEAD><TITLE>"+i+"</TITLE></HEAD><BODY></BODY></HTML>");var r=n.document;r.body.style.margin="0 0",r.body.appendChild(e),n.document.close(),setTimeout(function(){return t.printTabWindow(n,r)},this.timeToWaitRender)},e.prototype.printTabWindow=function(e,t){this.registerPrintEvent(e,!0),this.printWindowOpen.next(!0),e.focus(),!1===t.execCommand("print")&&e.print()},e.prototype.printCurrentWindow=function(){var e=this;this.registerPrintEvent(window,!1),setTimeout(function(){e.printWindowOpen.next(!0),!1===document.execCommand("print")&&window.print()},this.timeToWaitRender)},e.prototype.registerPrintEvent=function(e,t){var n=this,i=this;e.focus(),i.eventadded[e.name]||e.addEventListener("afterprint",function(){n.eventadded[e.name]=!0,t&&(i.eventadded[e.name]=!1),i.cleanUp(e,t),i.printWindowOpen.next(!1)})},e.prototype.cleanUp=function(e,t){if(!0===t&&(console.log("close print window"),e.close(),setTimeout(function(){e.close()},20)),!1===t){if(!this.openNgxPrinter)return;if(0===document.body.getElementsByTagName("ngx-printer").length)return;document.body.removeChild(this.openNgxPrinter)}},e.prototype.resolveNgContent=function(e){if("string"==typeof e)return[[document.createTextNode(e)]];if(e instanceof t.TemplateRef)return[e.createEmbeddedView(null).rootNodes];if(e instanceof HTMLElement)return[[e]];var n=this.resolver.resolveComponentFactory(e).create(this.injector);return n.changeDetectorRef.detectChanges(),[[n.location.nativeElement]]},e.prototype.addPrintItem=function(e){var t=this._printItems.getValue();t.push(e),this._printItems.next(t)},e.prototype.removePrintItem=function(e){var t=this._printItems.getValue().filter(function(t){return t.id!==e});this._printItems.next(t)},e.prototype.printPrintItem=function(e){this.printHTMLElement(e.nativeElement)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r,decorators:[{type:t.Optional}]},{type:t.ComponentFactoryResolver},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r,8),t.ɵɵinject(t.ComponentFactoryResolver),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e}();var s=function(){};var p=function(){function e(e,t){this.el=e,this.printerService=t}return e.prototype.ngOnInit=function(){if(this.el.nativeElement.id){var e=new s;e.id=this.el.nativeElement.id,e.nativeElement=this.el.nativeElement,this.printerService.addPrintItem(e)}},e.prototype.ngOnDestroy=function(){this.el.nativeElement.id&&this.printerService.removePrintItem(this.el.nativeElement.id)},e.decorators=[{type:t.Directive,args:[{selector:"[ngxPrintItem]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef},{type:o}]},e.propDecorators={printName:[{type:t.Input}]},e}();var a=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:r,useValue:t}]}},e.decorators=[{type:t.NgModule,args:[{declarations:[i,p],imports:[],exports:[i,p],entryComponents:[i]}]}],e}();e.NgxPrinterComponent=i,e.NgxPrinterModule=a,e.NgxPrinterService=o,e.PrintItem=s,e.PrintItemDirective=p,e.PrintServiceConfig=r,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-printer.umd.min.js.map

@@ -319,5 +319,9 @@ /**

if (printOpenWindow === false) {
if (this.openNgxPrinter) {
document.body.removeChild(this.openNgxPrinter);
if (!this.openNgxPrinter) {
return;
}
if (document.body.getElementsByTagName('ngx-printer').length === 0) {
return;
}
document.body.removeChild(this.openNgxPrinter);
}

@@ -460,2 +464,2 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25ne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aW5kb3dEb2MgPSBwcmludFdpbmRvdy5kb2N1bWVudDtcclxuICAgIHByaW50V2luZG93RG9jLmJvZHkuc3R5bGUubWFyZ2luID0gJzAgMCc7XHJcbiAgICBwcmludFdpbmRvd0RvYy5ib2R5LmFwcGVuZENoaWxkKGRpdlRvUHJpbnQpO1xyXG4gICAgcHJpbnRXaW5kb3cuZG9jdW1lbnQuY2xvc2UoKTtcclxuICAgIC8vIHByaW50V2luZG93RG9jLmJvZHkuaW5uZXJIVE1MID0gZGl2VG9QcmludC5vdXRlckhUTUw7XHJcbiAgICBzZXRUaW1lb3V0KFxyXG4gICAgICAoKSA9PiB0aGlzLnByaW50VGFiV2luZG93KHByaW50V2luZG93LCBwcmludFdpbmRvd0RvYyksXHJcbiAgICAgIHRoaXMudGltZVRvV2FpdFJlbmRlclxyXG4gICAgKTtcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFByaW50IHdpbmRvdyBpbiBuZXcgdGFiXHJcbiAgICovXHJcbiAgcHJpdmF0ZSBwcmludFRhYldpbmRvdyhwcmludFdpbmRvdzogV2luZG93LCBwcmludFdpbmRvd0RvYzogRG9jdW1lbnQpIHtcclxuICAgIHRoaXMucmVnaXN0ZXJQcmludEV2ZW50KHByaW50V2luZG93LCB0cnVlKTtcclxuICAgIHRoaXMucHJpbnRXaW5kb3dPcGVuLm5leHQodHJ1ZSk7XHJcbiAgICBwcmludFdpbmRvdy5mb2N1cygpOyAvLyBuZWNlc3NhcnkgZm9yIElFID49IDEwKi9cclxuICAgIGlmIChwcmludFdpbmRvd0RvYy5leGVjQ29tbWFuZCgncHJpbnQnKSA9PT0gZmFsc2UpIHtcclxuICAgICAgcHJpbnRXaW5kb3cucHJpbnQoKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFByaW50IHRoZSB3aG9sZSBjdXJyZW50IHdpbmRvd1xyXG4gICAqL1xyXG4gIHByaW50Q3VycmVudFdpbmRvdygpIHtcclxuICAgIHRo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pbmcgdG8gY3VycmVudCB3aW5kb3dcclxuICAgKi9cclxuICByZW5kZXJDbGFzcyA9ICdkZWZhdWx0JztcclxuXHJcbiAgLyoqXHJcbiAgICogT3BlbiBuZXcgd2luZG93IHRvIHByaW50IG9yIG5vdFxyXG4gICAqIERlZmF1bHQgaXMgdHJ1ZVxyXG4gICAqL1xyXG4gIHByaW50T3BlbldpbmRvdyA9IHRydWU7XHJcblxyXG4gICRwcmludFdpbmRvd09wZW4gPSB0aGlzLnByaW50V2luZG93T3Blbi5hc09ic2VydmFibGUoKTtcclxuICBldmVudGFkZGVkID0gW107XHJcblxyXG4gIGNvbnN0cnVjdG9yKFxyXG4gICAgQE9wdGlvbmFsKCkgY29uZmlnOiBQcmludFNlcnZpY2VDb25maWcsXHJcbiAgICBwcml2YXRlIHJlc29sdmVyOiBDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIsXHJcbiAgICBwcml2YXRlIGluamVjdG9yOiBJbmplY3RvclxyXG4gICkge1xyXG4gICAgdGhpcy5zZXRSb290Q29uZmlnT3B0aW9ucyhjb25maWcpO1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogU2V0IGNvbmZpZyBmcm9tIGZvclJvb3RcclxuICAgKiBAcGFyYW0gY29uZmlnXHJcbiAgICovXHJcbiAgcHJpdmF0ZSBzZXRSb290Q29uZmlnT3B0aW9ucyhjb25maWc6IFByaW50U2VydmljZUNvbmZpZykge1xyXG4gICAgaWYgKGNvbmZpZykge1xyXG4gICAgICBpZiAoY29uZmlnLnByaW50T3BlbldpbmRvdykge1xyXG4gICAgICAgIHRoaXMucHJpbnRPcGVuV2luZG93ID0gY29uZmlnLnByaW50T3BlbldpbmRvdztcclxuICAgICAgfVxyXG4gICAgICBpZiAoY29uZmlnLnRpbWVUb1dhaXRSZW5kZXIpIHtcclxuICAgICAgICB0aGlzLnRpbWVUb1dhaXRSZW5kZXIgPSBjb25maWcudGltZVRvV2FpdFJlbmRlcjtcclxuICAgICAgfVxyXG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50Q29udGVudENsb25lID0gcHJpbnRDb250ZW50LmNsb25lTm9kZSh0cnVlKTtcclxuICAgICAgdGhpcy5wcmludEluTmV3V2luZG93KHByaW50Q29udGVudENsb25lKTtcclxuICAgIH1cclxuICAgIGlmIChwcmludE9wZW5XaW5kb3cgPT09IGZhbHNlKSB7XHJcbiAgICAgIGNvbnN0IHByaW50Q29udGVudENsb25lID0gcHJpbnRDb250ZW50LmNsb25lTm9kZSh0cnVlKTtcclxuICAgICAgY29uc3QgbmF0aXZlRWwgPSB0aGlzLmNyZWF0ZUNvbXBvbmVudChwcmludENvbnRlbnRDbG9uZSkubmF0aXZlRWxlbWVudDtcclxuICAgICAgdGhpcy5vcGVuTmd4UHJpbnRlciA9IG5hdGl2ZUVsO1xyXG4gICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHRoaXMub3Blbk5neFByaW50ZXIpO1xyXG4gICAgICB0aGlzLnByaW50Q3VycmVudFdpbmRvdygpO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogUHJpbnQgdXNpbmcgYSBuZXcgd2luZG93IC8gdGFiXHJcbiAgICogQHBhcmFtIGRpdlRvUHJpbnRcclxuICAgKi9cclxuICBwcml2YXRlIHByaW50SW5OZXdXaW5kb3coZGl2VG9QcmludDogSFRNTEVsZW1lbnQpIHtcclxuICAgIGNvbnN0IHByaW50V2luZG93ID0gd2luZG93Lm9wZW4oJycsICdQUklOVCcpO1xyXG4gICAgbGV0IHRpdGxlID0gZG9jdW1lbnQudGl0bGU7XHJcblxyXG4gICAgcHJpbnRXaW5kb3cuZG9jdW1lbnQud3JpdGUoXHJcbiAgICAgICc8SFRNTD48SEVBRD48VElUTEU+JyArIHRpdGxlICsgJzwvVElUTEU+PC9IRUFEPjxCT0RZPjwvQk9EWT48L0hUTUw+J1xyXG4gICAgKTtcclxuICAgIC8vIHByaW50V2luZG93LmRvY3VtZW50LndyaXRlKGRvY3VtZW50LmRvY3VtZW50RWxlb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cmludFdpdGhPcGVuSW5OZXdXaW5kb3cpO1xyXG4gICAgICAgICAgICB0aGF0LnByaW50V2luZG93T3Blbi5uZXh0KGZhbHNlKTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgfSAqL1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogQ2xvc2UgdGFiIG9yIGNsZWFuIHVwIGRvbVxyXG4gICAqIEBpbnRlcm5hbFxyXG4gICAqL1xyXG4gIHByaXZhdGUgY2xlYW5VcChwcmludFdpbmRvdzogV2luZG93LCBwcmludE9wZW5XaW5kb3c6IGJvb2xlYW4pIHtcclxuICAgIGlmIChwcmludE9wZW5XaW5kb3cgPT09IHRydWUpIHtcclxuICAgICAgY29uc29sZS5sb2coJ2Nsb3NlIHByaW50IHdpbmRvdycpO1xyXG4gICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICB9LCAyMCk7XHJcbiAgICB9XHJcbiAgICBpZiAocHJpbnRPcGVuV2luZG93ID09PSBmYWxzZSkge1xyXG4gICAgICAgIGlmICghdGhpcy5vcGVuTmd4UHJpbnRlcikge1xyXG4gICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZG9jdW1lbnQuYm9keS5nZXRFbGVtZW50c0J5VGFnTmFtZSgnbmd4LXByaW50ZXInKS5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgZG9jdW1lbnQuYm9keS5yZW1vdmVDaGlsZCh0aGlzLm9wZW5OZ3hQcmludGVyKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIENyZWF0ZSBub2RlIG9yIGFuZ3VsYXIgY29tcG9uZW50XHJcbiAgICogQHBhcmFtIGNvbnRlbnRcclxuICAgKi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RpdmVFbGVtZW50KTtcclxuICB9XHJcbn1cclxuIl19

@@ -461,5 +461,9 @@ /**

if (printOpenWindow === false) {
if (this.openNgxPrinter) {
document.body.removeChild(this.openNgxPrinter);
if (!this.openNgxPrinter) {
return;
}
if (document.body.getElementsByTagName('ngx-printer').length === 0) {
return;
}
document.body.removeChild(this.openNgxPrinter);
}

@@ -652,2 +656,2 @@ };

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1wcmludGVyLyIsInNvdXJjZXMiOlsibGliL25neC1wcmludGVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUNBLE9BQU8sRUFDTCxVQUFVLEVBQ1YsV0FBVyxFQUNYLHdCQUF3QixFQUN4QixRQUFRLEVBQ1IsUUFBUSxFQUVULE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBYyxlQUFlLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDbkQsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7Ozs7OztBQU81RDtJQWtDRSwyQkFDYyxNQUEwQixFQUM5QixRQUFrQyxFQUNsQyxRQUFrQjtRQURsQixhQUFRLEdBQVIsUUFBUSxDQUEwQjtRQUNsQyxhQUFRLEdBQVIsUUFBUSxDQUFVO1FBakNwQixvQkFBZSxHQUFHLElBQUksZUFBZSxDQUFVLEtBQUssQ0FBQyxDQUFDOzs7O1FBS3RELGdCQUFXLEdBQUcsSUFBSSxlQUFlLENBQWMsRUFBRSxDQUFDLENBQUM7UUFDM0QsZ0JBQVcsR0FBRyxJQUFJLENBQUMsV0FBVyxDQUFDLFlBQVksRUFBRSxDQUFDOzs7OztRQVE5Qyxx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CBpcyB0cnVlXHJcbiAgICovXHJcbiAgcHJpbnRPcGVuV2luZG93ID0gdHJ1ZTtcclxuXHJcbiAgJHByaW50V2luZG93T3BlbiA9IHRoaXMucHJpbnRXaW5kb3dPcGVuLmFzT2JzZXJ2YWJsZSgpO1xyXG4gIGV2ZW50YWRkZWQgPSBbXTtcclxuXHJcbiAgY29uc3RydWN0b3IoXHJcbiAgICBAT3B0aW9uYWwoKSBjb25maWc6IFByaW50U2VydmljZUNvbmZpZyxcclxuICAgIHByaXZhdGUgcmVzb2x2ZXI6IENvbXBvbmVudEZhY3RvcnlSZXNvbHZlcixcclxuICAgIHByaXZhdGUgaW5qZWN0b3I6IEluamVjdG9yXHJcbiAgKSB7XHJcbiAgICB0aGlzLnNldFJvb3RDb25maWdPcHRpb25zKGNvbmZpZyk7XHJcbiAgfVxyXG5cclxuICAvKipcclxuICAgKiBTZXQgY29uZmlnIGZyb20gZm9yUm9vdFxyXG4gICAqIEBwYXJhbSBjb25maWdcclxuICAgKi9cclxuICBwcml2YXRlIHNldFJvb3RDb25maWdPcHRpb25zKGNvbmZpZzogUHJpbnRTZXJ2aWNlQ29uZmlnKSB7XHJcbiAgICBpZiAoY29uZmlnKSB7XHJcbiAgICAgIGlmIChjb25maWcucHJpbnRPcGVuV2luZG93KSB7XHJcbiAgICAgICAgdGhpcy5wcmludE9wZW5XaW5kb3cgPSBjb25maWcucHJpbnRPcGVuV2luZG93O1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcudGltZVRvV2FpdFJlbmRlcikge1xyXG4gICAgICAgIHRoaXMudGltZVRvV2FpdFJlbmRlciA9IGNvbmZpZy50aW1lVG9XYWl0UmVuZGVyO1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcucmVuZGVyQ2xhc3MpIHtcclxuICAgICAgICB0aGlzLnJlbmRlckNsYXNzID0gY29uZmlnLnJlbmRlckNsYXNzO1xyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgfVxyXG5cclxu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gMCc7XHJcbiAgICBwcmludFdpbmRvd0RvYy5ib2R5LmFwcGVuZENoaWxkKGRpdlRvUHJpbnQpO1xyXG4gICAgcHJpbnRXaW5kb3cuZG9jdW1lbnQuY2xvc2UoKTtcclxuICAgIC8vIHByaW50V2luZG93RG9jLmJvZHkuaW5uZXJIVE1MID0gZGl2VG9QcmludC5vdXRlckhUTUw7XHJcbiAgICBzZXRUaW1lb3V0KFxyXG4gICAgICAoKSA9PiB0aGlzLnByaW50VGFiV2luZG93KHByaW50V2luZG93LCBwcmludFdpbmRvd0RvYyksXHJcbiAgICAgIHRoaXMudGltZVRvV2FpdFJlbmRlclxyXG4gICAgKTtcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFByaW50IHdpbmRvdyBpbiBuZXcgdGFiXHJcbiAgICovXHJcbiAgcHJpdmF0ZSBwcmludFRhYldpbmRvdyhwcmludFdpbmRvdzogV2luZG93LCBwcmludFdpbmRvd0RvYzogRG9jdW1lbnQpIHtcclxuICAgIHRoaXMucmVnaXN0ZXJQcmludEV2ZW50KHByaW50V2luZG93LCB0cnVlKTtcclxuICAgIHRoaXMucHJpbnRXaW5kb3dPcGVuLm5leHQodHJ1ZSk7XHJcbiAgICBwcmludFdpbmRvdy5mb2N1cygpOyAvLyBuZWNlc3NhcnkgZm9yIElFID49IDEwKi9cclxuICAgIGlmIChwcmludFdpbmRvd0RvYy5leGVjQ29tbWFuZCgncHJpbnQnKSA9PT0gZmFsc2UpIHtcclxuICAgICAgcHJpbnRXaW5kb3cucHJpbnQoKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFByaW50IHRoZSB3aG9sZSBjdXJyZW50IHdpbmRvd1xyXG4gICAqL1xyXG4gIHByaW50Q3VycmVudFdpbmRvdygpIHtcclxuICAgIHRoaXMucmVnaXN0ZXJQcmludEV2ZW50KHdpbmRvdywgZmFsc2UpO1xyXG4gICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgIHR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yXG4gICkge1xyXG4gICAgdGhpcy5zZXRSb290Q29uZmlnT3B0aW9ucyhjb25maWcpO1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogU2V0IGNvbmZpZyBmcm9tIGZvclJvb3RcclxuICAgKiBAcGFyYW0gY29uZmlnXHJcbiAgICovXHJcbiAgcHJpdmF0ZSBzZXRSb290Q29uZmlnT3B0aW9ucyhjb25maWc6IFByaW50U2VydmljZUNvbmZpZykge1xyXG4gICAgaWYgKGNvbmZpZykge1xyXG4gICAgICBpZiAoY29uZmlnLnByaW50T3BlbldpbmRvdykge1xyXG4gICAgICAgIHRoaXMucHJpbnRPcGVuV2luZG93ID0gY29uZmlnLnByaW50T3BlbldpbmRvdztcclxuICAgICAgfVxyXG4gICAgICBpZiAoY29uZmlnLnRpbWVUb1dhaXRSZW5kZXIpIHtcclxuICAgICAgICB0aGlzLnRpbWVUb1dhaXRSZW5kZXIgPSBjb25maWcudGltZVRvV2FpdFJlbmRlcjtcclxuICAgICAgfVxyXG4gICAgICBpZiAoY29uZmlnLnJlbmRlckNsYXNzKSB7XHJcbiAgICAgICAgdGhpcy5yZW5kZXJDbGFzcyA9IGNvbmZpZy5yZW5kZXJDbGFzcztcclxuICAgICAgfVxyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgLyoqKlxyXG4gICAqIFByaW50IGEgZGl2IGlkZW50aWZpZWQgYnkgaXRzIGlkXHJcbiAgICogQGV4YW1wbGVcclxuICAgKiB0aGlzLnByaW50ZXJTZXJ2aWNlLnByaW50RGl2KCdwcmludERpdicpO1xyXG4gICAqL1xyXG4gIHB1YmxpYyBwcmludERpdihkaXZJRDogc3RyaW5nKSB7XHJcbiAgICBjb25zdCBkaXZUb1ByaW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZGl2SUQpO1xyXG5cclxuICAgIGlmIChkaXZUb1ByaW50KSB7XHJcbiAgICAgIHRoaXMucHJpbnQoZGl2VG9QcmludCwgdGhpcy5wcmludE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gIGlmIChpbWdTcmMpIHtcclxuICAgICAgY29tcG9uZW50UmVmLmluc3RhbmNlLmltZ1NyYyA9IGltZ1NyYztcclxuICAgICAgcmV0dXJuIGNvbXBvbmVudFJlZjtcclxuICAgIH1cclxuXHJcbiAgICBjb21wb25lbnRSZWYuaG9zdFZpZXcuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgcmV0dXJuIGNvbXBvbmVudFJlZi5sb2NhdGlvbjsgLy8gbG9jYXRpb24gaXMgbmF0aXZlIGVsZW1lbnRcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIE1haW4gcHJpbnQgZnVuY3Rpb25cclxuICAgKiBAcGFyYW0gcHJpbnRDb250ZW50XHJcbiAgICovXHJcbiAgcHJpdmF0ZSBwcmludChwcmludENvbnRlbnQ6IGFueSwgcHJpbnRPcGVuV2luZG93OiBib29sZWFuKSB7XHJcbiAgICBpZiAocHJpbnRPcGVuV2luZG93ID09PSB0cnVlKSB7XHJcbiAgICAgIGNvbnN0IHByaW50Q29udGVudENsb25lID0gcHJpbnRDb250ZW50LmNsb25lTm9kZSh0cnVlKTtcclxuICAgICAgdGhpcy5wcmludEluTmV3V2luZG93KHByaW50Q29udGVudENsb25lKTtcclxuICAgIH1cclxuICAgIGlmIChwcmludE9wZW5XaW5kb3cgPT09IGZhbHNlKSB7XHJcbiAgICAgIGNvbnN0IHByaW50Q29udGVudENsb25lID0gcHJpbnRDb250ZW50LmNsb25lTm9kZSh0cnVlKTtcclxuICAgICAgY29uc3QgbmF0aXZlRWwgPSB0aGlzLmNyZWF0ZUNvbXBvbmVudChwcmludENvbnRlbnRDbG9uZSkubmF0aXZlRWxlbWVudDtcclxuICAgICAgdGhpcy5vcGVuTmd4UHJpbnRlciA9IG5hdGl2ZUVsO1xyXG4gICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHRoaXMub3Blbk5neFByaW50ZXIpO1xyXG4gICAgICB0aGlzLnByaW50Q3VycmVudFdpbmRvdygpO1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XVlcnlMaXN0LmFkZExpc3RlbmVyKGZ1bmN0aW9uKG1xbCkge1xyXG4gICAgICAgICAgY29uc29sZS5sb2cobXFsKTtcclxuICAgICAgICAgIGlmIChtcWwubWF0Y2hlcykge1xyXG4gICAgICAgICAgICBjb25zb2xlLmxvZygnd2Via2l0IGVxdWl2YWxlbnQgb2Ygb25iZWZvcmVwcmludCcpO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgaWYgKCFtcWwubWF0Y2hlcykge1xyXG4gICAgICAgICAgICBjb25zb2xlLmxvZygnd2Via2l0IGVxdWl2YWxlbnQgb2YgYWZ0ZXJwcmludCcpO1xyXG4gICAgICAgICAgICBpZiAocHJpbnRXaXRoT3BlbkluTmV3V2luZG93KSB7XHJcbiAgICAgICAgICAgICAgdGhhdC5ldmVudGFkZGVkW3ByaW50V2luZG93Lm5hbWVdID0gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhhdC5jbGVhblVwKHByaW50V2luZG93LCBwcmludFdpdGhPcGVuSW5OZXdXaW5kb3cpO1xyXG4gICAgICAgICAgICB0aGF0LnByaW50V2luZG93T3Blbi5uZXh0KGZhbHNlKTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgfSAqL1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogQ2xvc2UgdGFiIG9yIGNsZWFuIHVwIGRvbVxyXG4gICAqIEBpbnRlcm5hbFxyXG4gICAqL1xyXG4gIHByaXZhdGUgY2xlYW5VcChwcmludFdpbmRvdzogV2luZG93LCBwcmludE9wZW5XaW5kb3c6IGJvb2xlYW4pIHtcclxuICAgIGlmIChwcmludE9wZW5XaW5kb3cgPT09IHRydWUpIHtcclxuICAgICAgY29uc29sZS5sb2coJ2Nsb3NlIHByaW50IHdpbmRvdycpO1xyXG4gICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICB9LCAyMCk7XHJcbiAgICB9XHJcbiAgICBpZiAocHJpbnRPcGVuV2luZG93ID09PSBmYWxzZSkge1xyXG4gICAgICAgIGlmICghdGhpcy5vcGVuTmd4UHJpbnRlcikge1xyXG4gICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZG9jdW1lbnQuYm9keS5nZXRFbGVtZW50c0J5VGFnTmFtZSgnbmd4LXByaW50ZXInKS5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgZG9jdW1lbnQuYm9keS5yZW1vdmVDaGlsZCh0aGlzLm9wZW5OZ3hQcmludGVyKTtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIENyZWF0ZSBub2RlIG9yIGFuZ3VsYXIgY29tcG9uZW50XHJcbiAgICogQHBhcmFtIGNvbnRlbnRcclxuICAgKiBAaW50ZXJuYWxcclxuICAgKi9cclxuICBwcml2YXRlIHJlc29sdmVOZ0NvbnRlbnQ8VD4oY29udGVudDogQ29udGVudDxUPikge1xyXG4gICAgaWYgKHR5cGVvZiBjb250ZW50ID09PSAnc3RyaW5nJykge1xyXG4gICAgICBjb25zdCBlbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoY29udGVudCk7XHJcbiAgICAgIHJldHVybiBbW2VsZW1lbnRdXTtcclxuICAgIH1cclxuXHJcbiAgICBpZiAoY29udGVudCBpbnN0YW5jZW9mIFRlbXBsYXRlUmVmKSB7XHJcbiAgICAgIGNvbnN0IHZpZXdSZWYgPSBjb250ZW50LmNyZWF0ZUVtYmVkZGVkVmlldyhudWxsKTtcclxuICAgICAgcmV0dXJuIFt2aWV3UmVmLnJvb3ROb2Rlc107XHJcbiAgICB9XHJcblxyXG4gICAgaWYgKGNvbnRlbnQgaW5zdGFuY2VvZiBIVE1MRWxl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ZlUHJpbnRJdGVtKGlkT2ZJdGVtVG9SZW1vdmU6IHN0cmluZyk6IHZvaWQge1xyXG4gICAgY29uc3QgdG1wSXRlbXMgPSB0aGlzLl9wcmludEl0ZW1zLmdldFZhbHVlKCk7XHJcbiAgICBjb25zdCBuZXdJaXRlbXMgPSB0bXBJdGVtcy5maWx0ZXIoaXRlbSA9PiBpdGVtLmlkICE9PSBpZE9mSXRlbVRvUmVtb3ZlKTtcclxuICAgIHRoaXMuX3ByaW50SXRlbXMubmV4dChuZXdJaXRlbXMpO1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogUHJpbnQgYSBwcmludCBJdGVtXHJcbiAgICogQHBhcmFtIHByaW50SXRlbVRvUHJpbnRcclxuICAgKi9cclxuICBwdWJsaWMgcHJpbnRQcmludEl0ZW0ocHJpbnRJdGVtVG9QcmludDogUHJpbnRJdGVtKTogdm9pZCB7XHJcbiAgICB0aGlzLnByaW50SFRNTEVsZW1lbnQocHJpbnRJdGVtVG9QcmludC5uYXRpdmVFbGVtZW50KTtcclxuICB9XHJcbn1cclxuIl19

@@ -484,5 +484,9 @@ import { EventEmitter, Component, ElementRef, Renderer2, Output, TemplateRef, Injectable, Optional, ComponentFactoryResolver, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Directive, Input, NgModule } from '@angular/core';

if (printOpenWindow === false) {
if (this.openNgxPrinter) {
document.body.removeChild(this.openNgxPrinter);
if (!this.openNgxPrinter) {
return;
}
if (document.body.getElementsByTagName('ngx-printer').length === 0) {
return;
}
document.body.removeChild(this.openNgxPrinter);
}

@@ -489,0 +493,0 @@ }

@@ -655,5 +655,9 @@ import { EventEmitter, Component, ElementRef, Renderer2, Output, TemplateRef, Injectable, Optional, ComponentFactoryResolver, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Directive, Input, NgModule } from '@angular/core';

if (printOpenWindow === false) {
if (this.openNgxPrinter) {
document.body.removeChild(this.openNgxPrinter);
if (!this.openNgxPrinter) {
return;
}
if (document.body.getElementsByTagName('ngx-printer').length === 0) {
return;
}
document.body.removeChild(this.openNgxPrinter);
}

@@ -660,0 +664,0 @@ };

{
"name": "ngx-printer",
"version": "0.3.0",
"version": "0.3.1",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "^7.1.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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