ngx-printer
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -158,3 +158,3 @@ (function (global, factory) { | ||
if (config) { | ||
if (config.printOpenWindow) { | ||
if (config.hasOwnProperty('printOpenWindow')) { | ||
this.printOpenWindow = config.printOpenWindow; | ||
@@ -174,3 +174,3 @@ } | ||
} | ||
if (config.printPreviewOnly) { | ||
if (config.hasOwnProperty('printPreviewOnly')) { | ||
this.printPreviewOnly = config.printPreviewOnly; | ||
@@ -177,0 +177,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("ngx-printer",["exports","@angular/core","rxjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ngx-printer"]={},t.ng.core,t.rxjs)}(this,(function(t,e,i){"use strict";var n,r=function(){function t(t,i){this.elementRef=t,this.renderer=i,this._renderClass="default",this._imgSrc="default",this.completed=new e.EventEmitter}return Object.defineProperty(t.prototype,"renderClass",{get:function(){return this._renderClass},set:function(t){this._renderClass=t,this.setCustomClass()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgSrc",{get:function(){return this._imgSrc},set:function(t){this._imgSrc=t,this.addImage(this._imgSrc)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.setCustomClass=function(){var t=this.elementRef.nativeElement;this.renderer.removeClass(t,"default"),this.renderer.addClass(t,this._renderClass)},t.prototype.addImage=function(t){var e=this,i=this.elementRef.nativeElement,n=this.renderer.createElement("img");this.renderer.setAttribute(n,"src",t),this.renderer.listen(n,"load",(function(t){console.log("loading completed",t),e.completed.emit(!0)})),this.renderer.appendChild(i,n)},t}();r.decorators=[{type:e.Component,args:[{selector:"ngx-printer",template:"\n <ng-content></ng-content>\n ",styles:[":host.default{background-color:#fff;height:100%;left:0;margin:0;position:fixed;top:0;width:100%;z-index:1000000}"]}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]},r.propDecorators={completed:[{type:e.Output}]},(n=t.ngxPrintMarkerPosition||(t.ngxPrintMarkerPosition={}))[n.Topleft=0]="Topleft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight";var o=function(){this.printOpenWindow=!0,this.timeToWaitRender=200,this.appRootName="app-root",this.markerPosition=t.ngxPrintMarkerPosition.Topleft,this.printPreviewOnly=!1},s=function(){function t(t,e,n){this.resolver=e,this.injector=n,this.printWindowOpen=new i.BehaviorSubject(!1),this._printItems=new i.BehaviorSubject([]),this.$printItems=this._printItems.asObservable(),this.timeToWaitRender=200,this.renderClass="default",this.printOpenWindow=!0,this.appRootName="app-root",this.printPreviewOnly=!1,this.appRootDislaySetting="",this.$printWindowOpen=this.printWindowOpen.asObservable(),this.eventadded=[],this.setRootConfigOptions(t)}return t.prototype.setRootConfigOptions=function(t){t&&(t.printOpenWindow&&(this.printOpenWindow=t.printOpenWindow),t.timeToWaitRender&&(this.timeToWaitRender=t.timeToWaitRender),t.renderClass&&(this.renderClass=t.renderClass),t.appRootName&&(this.appRootName=t.appRootName),t.markerPosition&&(this.markerPosition=t.markerPosition),t.printPreviewOnly&&(this.printPreviewOnly=t.printPreviewOnly))},t.prototype.printDiv=function(t){var e=document.getElementById(t);e?this.print(e,this.printOpenWindow):console.log("div with id "+t+" not found..")},t.prototype.printByClassName=function(t){var e=document.getElementsByClassName(t);e&&e.length>0?this.print(e[0],this.printOpenWindow):console.log("element with id ${className} not found..")},t.prototype.printAngular=function(t,e){var i=this.createComponent(t,null,e);this.print(i.nativeElement,this.printOpenWindow)},t.prototype.printImg=function(t){var e=this,i=this.createComponent(null,t),n=this.printOpenWindow;i.instance.completed.subscribe((function(t){i.hostView.detectChanges(),console.log("completed:",t),e.print(i.location.nativeElement,n)}))},t.prototype.printHTMLElement=function(t){this.print(t,this.printOpenWindow)},t.prototype.createComponent=function(t,e,i){var n,o=this.resolver.resolveComponentFactory(r);if(t){void 0===i&&(i=null);var s=this.resolveNgContent(t,i);n=o.create(this.injector,s)}else n=o.create(this.injector);return n.instance.renderClass=this.renderClass,e?(n.instance.imgSrc=e,n):(n.hostView.detectChanges(),n.location)},t.prototype.print=function(t,e){if(!0===e){var i=document.importNode(t,!0);this.hideBeforePrint(i),this.printInNewWindow(i)}if(!1===e){i=document.importNode(t,!0);this.hideBeforePrint(i);var n=this.createComponent(i).nativeElement;this.openNgxPrinter=n,document.body.appendChild(this.openNgxPrinter),this.getAppRoot(),this.appRoot&&(this.appRoot.style.display="none"),this.printCurrentWindow()}},t.prototype.printInNewWindow=function(t){var e=this,i=window.open("","PRINT"),n=document.title;i.document.write("<HTML><HEAD><TITLE>"+n+"</TITLE></HEAD><BODY></BODY></HTML>");var r=i.document;this.copyCss(r),r.body.style.margin="0 0",r.body.appendChild(t),i.document.close(),setTimeout((function(){return e.printTabWindow(i,r)}),this.timeToWaitRender)},t.prototype.copyCss=function(t){var e=document.querySelectorAll("link"),i=document.querySelectorAll("style"),n=document.querySelector("base"),r=t.getElementsByTagName("head")[0];n&&r.appendChild(document.importNode(n,!0)),e.forEach((function(t){r.appendChild(document.importNode(t,!0))})),i.forEach((function(t){r.appendChild(document.importNode(t,!0))}))},t.prototype.printTabWindow=function(t,e){this.printPreviewOnly||(this.registerPrintEvent(t,!0),this.printWindowOpen.next(!0),t.focus(),!1===e.execCommand("print")&&t.print())},t.prototype.printCurrentWindow=function(){var t=this;this.printPreviewOnly||(this.registerPrintEvent(window,!1),setTimeout((function(){t.printWindowOpen.next(!0),!1===document.execCommand("print")&&window.print()}),this.timeToWaitRender))},t.prototype.registerPrintEvent=function(t,e){var i=this,n=this;t.focus(),n.eventadded[t.name]||t.addEventListener("afterprint",(function(){i.eventadded[t.name]=!0,e&&(n.eventadded[t.name]=!1),n.cleanUp(t,e),n.printWindowOpen.next(!1)}))},t.prototype.cleanUp=function(t,e){if(!0===e&&(console.log("close print window"),t.close(),setTimeout((function(){t.close()}),20)),!1===e){if(!this.openNgxPrinter)return;if(0===document.body.getElementsByTagName("ngx-printer").length)return;this.appRoot&&(""!==this.appRootDislaySetting?this.appRoot.style.display=this.appRootDislaySetting:this.appRoot.style.display=""),document.body.removeChild(this.openNgxPrinter),this.openNgxPrinter=null}},t.prototype.resolveNgContent=function(t,i){if("string"==typeof t)return[[document.createTextNode(t)]];if(t instanceof e.TemplateRef){var n=t.createEmbeddedView(i);return n.detectChanges(),[n.rootNodes]}if(t instanceof HTMLElement)return[[t]];var r=this.resolver.resolveComponentFactory(t).create(this.injector);return r.changeDetectorRef.detectChanges(),[[r.location.nativeElement]]},t.prototype.hideBeforePrint=function(t){for(var e=t.querySelectorAll(".no_print_indicator"),i=0;i<e.length;i++){e[i].style.display="none"}},t.prototype.getAppRoot=function(){var t=document.body.getElementsByTagName(this.appRootName);if(0===t.length)return null;this.appRoot=t[0],this.appRootDislaySetting=this.appRoot.style.display},t.prototype.addPrintItem=function(t){var e=this._printItems.getValue();e.push(t),this._printItems.next(e)},t.prototype.removePrintItem=function(t){var e=this._printItems.getValue().filter((function(e){return e.id!==t}));this._printItems.next(e)},t.prototype.getPrintItem=function(t){return this._printItems.getValue().find((function(e){return e.id===t}))},t.prototype.printPrintItem=function(t){this.printHTMLElement(t.nativeElement)},t.prototype.printPrintItems=function(t,e){var i=document.createElement("div");e?i.classList.add(e):(i.style.display="flex",i.style.flexDirection="column"),t.forEach((function(t){i.appendChild(t.nativeElement.cloneNode(!0))})),this.printHTMLElement(i)},t}();s.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new s(e.ɵɵinject(o,8),e.ɵɵinject(e.ComponentFactoryResolver),e.ɵɵinject(e.INJECTOR))},token:s,providedIn:"root"}),s.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[{type:o,decorators:[{type:e.Optional}]},{type:e.ComponentFactoryResolver},{type:e.Injector}]};var p=function(){},a=function(){function t(t,e){this.el=t,this.printerService=e}return t.prototype.ngOnInit=function(){if(this.el.nativeElement.id){var t=new p;t.id=this.el.nativeElement.id,t.nativeElement=this.el.nativeElement,this.printerService.addPrintItem(t)}},t.prototype.ngOnDestroy=function(){this.el.nativeElement.id&&this.printerService.removePrintItem(this.el.nativeElement.id)},t}();a.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItem]"}]}],a.ctorParameters=function(){return[{type:e.ElementRef},{type:s}]},a.propDecorators={printName:[{type:e.Input}]};var c=function(){function t(t,e){this.el=t,this.printerService=e,this.printItemId="",this.divID="",this.className="",this.printWindow="false"}return t.prototype.ngOnInit=function(){var t=this;this.el.nativeElement&&this.checkInputs()&&this.el.nativeElement.addEventListener("click",(function(){""!==t.printItemId&&t.prinPrintItem(),""!==t.divID&&t.printerService.printDiv(t.divID),""!==t.className&&t.printerService.printByClassName(t.className),"false"!==t.printWindow&&t.printerService.printCurrentWindow()}))},t.prototype.checkInputs=function(){return!("false"===this.printWindow&&""===this.printItemId&&""===this.divID&&""===this.className)},t.prototype.prinPrintItem=function(){var t=this.printerService.getPrintItem(this.printItemId);t&&this.printerService.printPrintItem(t)},t}();c.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItemButton]"}]}],c.ctorParameters=function(){return[{type:e.ElementRef},{type:s}]},c.propDecorators={printItemId:[{type:e.Input}],divID:[{type:e.Input}],className:[{type:e.Input}],printWindow:[{type:e.Input}]};var d=function(){function i(i,n,r){this.el=i,this.renderer2=n,this.printerService=r,this.customClass="",this.directPrint=!1,this.imgPosition=t.ngxPrintMarkerPosition.Topleft,this.backgroundImage="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4x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A0MUgzMS4yOWMwLjA3MiwwLDAuMTM2LTAuMDI3LDAuMjAzLTAuMDQxaDYuODkzVjM0LjQ1eiIvPg0KPC9zdmc+DQo=",this.imgMainStyles={"background-color":"#c3c3b6",height:"16px",width:"16px",position:"absolute",cursor:"pointer"},this.imgPositionTopLeft={left:"1px",top:"1px"},this.imgPositionTopRight={right:"1px",top:"1px"},this.imgPositionBottomLeft={left:"1px",bottom:"1px"},this.imgPositionBottomRight={right:"1px",bottom:"1px"},this.printClicked=new e.EventEmitter}return i.prototype.ngOnInit=function(){var t=this,e=document.createElement("div");this.imgPosition=this.printerService.markerPosition,this.addIndicatorDiv(this.el,e),e.addEventListener("click",(function(){if(t.directPrint){var e=t.el.nativeElement.getElementsByClassName("print_indicator");e&&e.length>0?(t.renderer2.setStyle(e[0],"visibility","hidden"),t.printerService.printHTMLElement(t.el.nativeElement),t.renderer2.setStyle(e[0],"visibility","visible")):console.log("element with indicator class not found..")}t.printClicked.emit(!0)}))},i.prototype.addIndicatorDiv=function(t,e){var i=t.nativeElement;this.renderer2.addClass(e,"print_indicator"),this.renderer2.setStyle(i,"position","relative"),this.renderer2.appendChild(t.nativeElement,e),""===this.customClass?this.setCss(e):this.renderer2.addClass(e,this.customClass)},i.prototype.setCss=function(t){var e=this;Object.keys(this.imgMainStyles).forEach((function(i){t.style.setProperty(""+i,e.imgMainStyles[i])})),this.setPosition(t);var i="url("+this.backgroundImage+")";t.style.setProperty("background-image",i)},i.prototype.setPosition=function(e){var i=this;switch(this.imgPosition){case t.ngxPrintMarkerPosition.Topleft:Object.keys(this.imgPositionTopLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopLeft[t])}));break;case t.ngxPrintMarkerPosition.TopRight:Object.keys(this.imgPositionTopRight).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopRight[t])}));break;case t.ngxPrintMarkerPosition.BottomLeft:Object.keys(this.imgPositionBottomLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionBottomLeft[t])}));break;case t.ngxPrintMarkerPosition.BottomRight:Object.keys(this.imgPositionBottomRight).forEach((function(t){e.style.setProperty(""+t,i.imgPositionBottomRight[t])}));break;default:Object.keys(this.imgPositionTopLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopLeft[t])}))}},i}();d.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItemMarker]"}]}],d.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:s}]},d.propDecorators={customClass:[{type:e.Input}],directPrint:[{type:e.Input}],imgPosition:[{type:e.Input}],backgroundImage:[{type:e.Input}],printClicked:[{type:e.Output}]};var l=function(t,e){this.el=t,this.renderer2=e,this.el&&this.renderer2.addClass(this.el.nativeElement,"no_print_indicator")};l.decorators=[{type:e.Directive,args:[{selector:"[ngxNoPrint]"}]}],l.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]};var u=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:o,useValue:e}]}},t}();u.decorators=[{type:e.NgModule,args:[{declarations:[r,a,c,d,l],imports:[],exports:[r,a,c,d,l],entryComponents:[r]}]}],t.NgxPrinterComponent=r,t.NgxPrinterModule=u,t.NgxPrinterService=s,t.NoPrintDirective=l,t.PrintItem=p,t.PrintItemButtonDirective=c,t.PrintItemDirective=a,t.PrintItemMarkerDirective=d,t.PrintServiceConfig=o,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("ngx-printer",["exports","@angular/core","rxjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ngx-printer"]={},t.ng.core,t.rxjs)}(this,(function(t,e,i){"use strict";var n,r=function(){function t(t,i){this.elementRef=t,this.renderer=i,this._renderClass="default",this._imgSrc="default",this.completed=new e.EventEmitter}return Object.defineProperty(t.prototype,"renderClass",{get:function(){return this._renderClass},set:function(t){this._renderClass=t,this.setCustomClass()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgSrc",{get:function(){return this._imgSrc},set:function(t){this._imgSrc=t,this.addImage(this._imgSrc)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.setCustomClass=function(){var t=this.elementRef.nativeElement;this.renderer.removeClass(t,"default"),this.renderer.addClass(t,this._renderClass)},t.prototype.addImage=function(t){var e=this,i=this.elementRef.nativeElement,n=this.renderer.createElement("img");this.renderer.setAttribute(n,"src",t),this.renderer.listen(n,"load",(function(t){console.log("loading completed",t),e.completed.emit(!0)})),this.renderer.appendChild(i,n)},t}();r.decorators=[{type:e.Component,args:[{selector:"ngx-printer",template:"\n <ng-content></ng-content>\n ",styles:[":host.default{background-color:#fff;height:100%;left:0;margin:0;position:fixed;top:0;width:100%;z-index:1000000}"]}]}],r.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]},r.propDecorators={completed:[{type:e.Output}]},(n=t.ngxPrintMarkerPosition||(t.ngxPrintMarkerPosition={}))[n.Topleft=0]="Topleft",n[n.TopRight=1]="TopRight",n[n.BottomLeft=2]="BottomLeft",n[n.BottomRight=3]="BottomRight";var o=function(){this.printOpenWindow=!0,this.timeToWaitRender=200,this.appRootName="app-root",this.markerPosition=t.ngxPrintMarkerPosition.Topleft,this.printPreviewOnly=!1},s=function(){function t(t,e,n){this.resolver=e,this.injector=n,this.printWindowOpen=new i.BehaviorSubject(!1),this._printItems=new i.BehaviorSubject([]),this.$printItems=this._printItems.asObservable(),this.timeToWaitRender=200,this.renderClass="default",this.printOpenWindow=!0,this.appRootName="app-root",this.printPreviewOnly=!1,this.appRootDislaySetting="",this.$printWindowOpen=this.printWindowOpen.asObservable(),this.eventadded=[],this.setRootConfigOptions(t)}return t.prototype.setRootConfigOptions=function(t){t&&(t.hasOwnProperty("printOpenWindow")&&(this.printOpenWindow=t.printOpenWindow),t.timeToWaitRender&&(this.timeToWaitRender=t.timeToWaitRender),t.renderClass&&(this.renderClass=t.renderClass),t.appRootName&&(this.appRootName=t.appRootName),t.markerPosition&&(this.markerPosition=t.markerPosition),t.hasOwnProperty("printPreviewOnly")&&(this.printPreviewOnly=t.printPreviewOnly))},t.prototype.printDiv=function(t){var e=document.getElementById(t);e?this.print(e,this.printOpenWindow):console.log("div with id "+t+" not found..")},t.prototype.printByClassName=function(t){var e=document.getElementsByClassName(t);e&&e.length>0?this.print(e[0],this.printOpenWindow):console.log("element with id ${className} not found..")},t.prototype.printAngular=function(t,e){var i=this.createComponent(t,null,e);this.print(i.nativeElement,this.printOpenWindow)},t.prototype.printImg=function(t){var e=this,i=this.createComponent(null,t),n=this.printOpenWindow;i.instance.completed.subscribe((function(t){i.hostView.detectChanges(),console.log("completed:",t),e.print(i.location.nativeElement,n)}))},t.prototype.printHTMLElement=function(t){this.print(t,this.printOpenWindow)},t.prototype.createComponent=function(t,e,i){var n,o=this.resolver.resolveComponentFactory(r);if(t){void 0===i&&(i=null);var s=this.resolveNgContent(t,i);n=o.create(this.injector,s)}else n=o.create(this.injector);return n.instance.renderClass=this.renderClass,e?(n.instance.imgSrc=e,n):(n.hostView.detectChanges(),n.location)},t.prototype.print=function(t,e){if(!0===e){var i=document.importNode(t,!0);this.hideBeforePrint(i),this.printInNewWindow(i)}if(!1===e){i=document.importNode(t,!0);this.hideBeforePrint(i);var n=this.createComponent(i).nativeElement;this.openNgxPrinter=n,document.body.appendChild(this.openNgxPrinter),this.getAppRoot(),this.appRoot&&(this.appRoot.style.display="none"),this.printCurrentWindow()}},t.prototype.printInNewWindow=function(t){var e=this,i=window.open("","PRINT"),n=document.title;i.document.write("<HTML><HEAD><TITLE>"+n+"</TITLE></HEAD><BODY></BODY></HTML>");var r=i.document;this.copyCss(r),r.body.style.margin="0 0",r.body.appendChild(t),i.document.close(),setTimeout((function(){return e.printTabWindow(i,r)}),this.timeToWaitRender)},t.prototype.copyCss=function(t){var e=document.querySelectorAll("link"),i=document.querySelectorAll("style"),n=document.querySelector("base"),r=t.getElementsByTagName("head")[0];n&&r.appendChild(document.importNode(n,!0)),e.forEach((function(t){r.appendChild(document.importNode(t,!0))})),i.forEach((function(t){r.appendChild(document.importNode(t,!0))}))},t.prototype.printTabWindow=function(t,e){this.printPreviewOnly||(this.registerPrintEvent(t,!0),this.printWindowOpen.next(!0),t.focus(),!1===e.execCommand("print")&&t.print())},t.prototype.printCurrentWindow=function(){var t=this;this.printPreviewOnly||(this.registerPrintEvent(window,!1),setTimeout((function(){t.printWindowOpen.next(!0),!1===document.execCommand("print")&&window.print()}),this.timeToWaitRender))},t.prototype.registerPrintEvent=function(t,e){var i=this,n=this;t.focus(),n.eventadded[t.name]||t.addEventListener("afterprint",(function(){i.eventadded[t.name]=!0,e&&(n.eventadded[t.name]=!1),n.cleanUp(t,e),n.printWindowOpen.next(!1)}))},t.prototype.cleanUp=function(t,e){if(!0===e&&(console.log("close print window"),t.close(),setTimeout((function(){t.close()}),20)),!1===e){if(!this.openNgxPrinter)return;if(0===document.body.getElementsByTagName("ngx-printer").length)return;this.appRoot&&(""!==this.appRootDislaySetting?this.appRoot.style.display=this.appRootDislaySetting:this.appRoot.style.display=""),document.body.removeChild(this.openNgxPrinter),this.openNgxPrinter=null}},t.prototype.resolveNgContent=function(t,i){if("string"==typeof t)return[[document.createTextNode(t)]];if(t instanceof e.TemplateRef){var n=t.createEmbeddedView(i);return n.detectChanges(),[n.rootNodes]}if(t instanceof HTMLElement)return[[t]];var r=this.resolver.resolveComponentFactory(t).create(this.injector);return r.changeDetectorRef.detectChanges(),[[r.location.nativeElement]]},t.prototype.hideBeforePrint=function(t){for(var e=t.querySelectorAll(".no_print_indicator"),i=0;i<e.length;i++){e[i].style.display="none"}},t.prototype.getAppRoot=function(){var t=document.body.getElementsByTagName(this.appRootName);if(0===t.length)return null;this.appRoot=t[0],this.appRootDislaySetting=this.appRoot.style.display},t.prototype.addPrintItem=function(t){var e=this._printItems.getValue();e.push(t),this._printItems.next(e)},t.prototype.removePrintItem=function(t){var e=this._printItems.getValue().filter((function(e){return e.id!==t}));this._printItems.next(e)},t.prototype.getPrintItem=function(t){return this._printItems.getValue().find((function(e){return e.id===t}))},t.prototype.printPrintItem=function(t){this.printHTMLElement(t.nativeElement)},t.prototype.printPrintItems=function(t,e){var i=document.createElement("div");e?i.classList.add(e):(i.style.display="flex",i.style.flexDirection="column"),t.forEach((function(t){i.appendChild(t.nativeElement.cloneNode(!0))})),this.printHTMLElement(i)},t}();s.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new s(e.ɵɵinject(o,8),e.ɵɵinject(e.ComponentFactoryResolver),e.ɵɵinject(e.INJECTOR))},token:s,providedIn:"root"}),s.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[{type:o,decorators:[{type:e.Optional}]},{type:e.ComponentFactoryResolver},{type:e.Injector}]};var p=function(){},a=function(){function t(t,e){this.el=t,this.printerService=e}return t.prototype.ngOnInit=function(){if(this.el.nativeElement.id){var t=new p;t.id=this.el.nativeElement.id,t.nativeElement=this.el.nativeElement,this.printerService.addPrintItem(t)}},t.prototype.ngOnDestroy=function(){this.el.nativeElement.id&&this.printerService.removePrintItem(this.el.nativeElement.id)},t}();a.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItem]"}]}],a.ctorParameters=function(){return[{type:e.ElementRef},{type:s}]},a.propDecorators={printName:[{type:e.Input}]};var c=function(){function t(t,e){this.el=t,this.printerService=e,this.printItemId="",this.divID="",this.className="",this.printWindow="false"}return t.prototype.ngOnInit=function(){var t=this;this.el.nativeElement&&this.checkInputs()&&this.el.nativeElement.addEventListener("click",(function(){""!==t.printItemId&&t.prinPrintItem(),""!==t.divID&&t.printerService.printDiv(t.divID),""!==t.className&&t.printerService.printByClassName(t.className),"false"!==t.printWindow&&t.printerService.printCurrentWindow()}))},t.prototype.checkInputs=function(){return!("false"===this.printWindow&&""===this.printItemId&&""===this.divID&&""===this.className)},t.prototype.prinPrintItem=function(){var t=this.printerService.getPrintItem(this.printItemId);t&&this.printerService.printPrintItem(t)},t}();c.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItemButton]"}]}],c.ctorParameters=function(){return[{type:e.ElementRef},{type:s}]},c.propDecorators={printItemId:[{type:e.Input}],divID:[{type:e.Input}],className:[{type:e.Input}],printWindow:[{type:e.Input}]};var d=function(){function i(i,n,r){this.el=i,this.renderer2=n,this.printerService=r,this.customClass="",this.directPrint=!1,this.imgPosition=t.ngxPrintMarkerPosition.Topleft,this.backgroundImage="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNTAgNTAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGQ9Ik0zOS4zODcsMjEuNDcxSDMyLjI5VjExLjE5OWMwLTAuNTUzLTAuNDQ3LTEtMS0xSDE3LjQ4NGMtMC41NTMsMC0xLDAuNDQ3LTEsMXYxMC4yNzFIOS4zODdjLTAuNTUzLDAtMSwwLjQ0Ny0xLDFWMzUuNDUNCgljMCwwLjU1MywwLjQ0NywxLDEsMWg2Ljg5NHYzLjU2NWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDEzLjgwNmMwLjU1MywwLDEtMC40NDcsMS0xVjM2LjQ1aDcuMzAxYzAuNTUzLDAsMS0wLjQ0NywxLTFWMjIuNDcxDQoJQzQwLjM4NywyMS45MTgsMzkuOTM5LDIxLjQ3MSwzOS4zODcsMjEuNDcxeiBNMTguNDg0LDEyLjE5OUgzMC4yOXY5LjI3MUgxOC40ODRWMTIuMTk5eiBNMzAuMDg2LDM5LjAxNkgxOC4yOHYtNi4zMjloMTEuODA2VjM5LjAxNg0KCXogTTM4LjM4NywzNC40NWgtNi4zMDF2LTIuNzY0YzAtMC41NTMtMC40NDctMS0xLTFIMTcuMjhjLTAuNTUzLDAtMSwwLjQ0Ny0xLDF2Mi43NjRoLTUuODk0VjIzLjQ3MWg2Ljg5NA0KCWMwLjA2OCwwLjAxNCwwLjEzMSwwLjA0MSwwLjIwMywwLjA0MUgzMS4yOWMwLjA3MiwwLDAuMTM2LTAuMDI3LDAuMjAzLTAuMDQxaDYuODkzVjM0LjQ1eiIvPg0KPC9zdmc+DQo=",this.imgMainStyles={"background-color":"#c3c3b6",height:"16px",width:"16px",position:"absolute",cursor:"pointer"},this.imgPositionTopLeft={left:"1px",top:"1px"},this.imgPositionTopRight={right:"1px",top:"1px"},this.imgPositionBottomLeft={left:"1px",bottom:"1px"},this.imgPositionBottomRight={right:"1px",bottom:"1px"},this.printClicked=new e.EventEmitter}return i.prototype.ngOnInit=function(){var t=this,e=document.createElement("div");this.imgPosition=this.printerService.markerPosition,this.addIndicatorDiv(this.el,e),e.addEventListener("click",(function(){if(t.directPrint){var e=t.el.nativeElement.getElementsByClassName("print_indicator");e&&e.length>0?(t.renderer2.setStyle(e[0],"visibility","hidden"),t.printerService.printHTMLElement(t.el.nativeElement),t.renderer2.setStyle(e[0],"visibility","visible")):console.log("element with indicator class not found..")}t.printClicked.emit(!0)}))},i.prototype.addIndicatorDiv=function(t,e){var i=t.nativeElement;this.renderer2.addClass(e,"print_indicator"),this.renderer2.setStyle(i,"position","relative"),this.renderer2.appendChild(t.nativeElement,e),""===this.customClass?this.setCss(e):this.renderer2.addClass(e,this.customClass)},i.prototype.setCss=function(t){var e=this;Object.keys(this.imgMainStyles).forEach((function(i){t.style.setProperty(""+i,e.imgMainStyles[i])})),this.setPosition(t);var i="url("+this.backgroundImage+")";t.style.setProperty("background-image",i)},i.prototype.setPosition=function(e){var i=this;switch(this.imgPosition){case t.ngxPrintMarkerPosition.Topleft:Object.keys(this.imgPositionTopLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopLeft[t])}));break;case t.ngxPrintMarkerPosition.TopRight:Object.keys(this.imgPositionTopRight).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopRight[t])}));break;case t.ngxPrintMarkerPosition.BottomLeft:Object.keys(this.imgPositionBottomLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionBottomLeft[t])}));break;case t.ngxPrintMarkerPosition.BottomRight:Object.keys(this.imgPositionBottomRight).forEach((function(t){e.style.setProperty(""+t,i.imgPositionBottomRight[t])}));break;default:Object.keys(this.imgPositionTopLeft).forEach((function(t){e.style.setProperty(""+t,i.imgPositionTopLeft[t])}))}},i}();d.decorators=[{type:e.Directive,args:[{selector:"[ngxPrintItemMarker]"}]}],d.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2},{type:s}]},d.propDecorators={customClass:[{type:e.Input}],directPrint:[{type:e.Input}],imgPosition:[{type:e.Input}],backgroundImage:[{type:e.Input}],printClicked:[{type:e.Output}]};var l=function(t,e){this.el=t,this.renderer2=e,this.el&&this.renderer2.addClass(this.el.nativeElement,"no_print_indicator")};l.decorators=[{type:e.Directive,args:[{selector:"[ngxNoPrint]"}]}],l.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]};var u=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[{provide:o,useValue:e}]}},t}();u.decorators=[{type:e.NgModule,args:[{declarations:[r,a,c,d,l],imports:[],exports:[r,a,c,d,l],entryComponents:[r]}]}],t.NgxPrinterComponent=r,t.NgxPrinterModule=u,t.NgxPrinterService=s,t.NoPrintDirective=l,t.PrintItem=p,t.PrintItemButtonDirective=c,t.PrintItemDirective=a,t.PrintItemMarkerDirective=d,t.PrintServiceConfig=o,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-printer.umd.min.js.map |
@@ -0,1 +1,5 @@ | ||
# 0.9.2 | ||
- fixes #25 | ||
- security issues | ||
# 0.9.1 | ||
@@ -2,0 +6,0 @@ - fixes #21, #22 |
@@ -55,3 +55,3 @@ import { Injectable, TemplateRef, ComponentFactoryResolver, Injector, Optional } from '@angular/core'; | ||
if (config) { | ||
if (config.printOpenWindow) { | ||
if (config.hasOwnProperty('printOpenWindow')) { | ||
this.printOpenWindow = config.printOpenWindow; | ||
@@ -71,3 +71,3 @@ } | ||
} | ||
if (config.printPreviewOnly) { | ||
if (config.hasOwnProperty('printPreviewOnly')) { | ||
this.printPreviewOnly = config.printPreviewOnly; | ||
@@ -422,2 +422,2 @@ } | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLi8uLi9wcm9qZWN0cy9uZ3gtcHJpbnRlci9zcmMvIiwic291cmNlcyI6WyJsaWIvbmd4LXByaW50ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQ0wsVUFBVSxFQUNWLFdBQVcsRUFDWCx3QkFBd0IsRUFDeEIsUUFBUSxFQUNSLFFBQVEsRUFFVCxNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM5RCxPQUFPLEVBQWMsZUFBZSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ25ELE9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lnIGZyb20gZm9yUm9vdFxyXG4gICAqIEBwYXJhbSBjb25maWdcclxuICAgKi9cclxuICBwcml2YXRlIHNldFJvb3RDb25maWdPcHRpb25zKGNvbmZpZzogUHJpbnRTZXJ2aWNlQ29uZmlnKTogdm9pZCB7XHJcbiAgICBpZiAoY29uZmlnKSB7XHJcbiAgICAgIGlmIChjb25maWcucHJpbnRPcGVuV2luZG93KSB7XHJcbiAgICAgICAgdGhpcy5wcmludE9wZW5XaW5kb3cgPSBjb25maWcucHJpbnRPcGVuV2luZG93O1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcudGltZVRvV2FpdFJlbmRlcikge1xyXG4gICAgICAgIHRoaXMudGltZVRvV2FpdFJlbmRlciA9IGNvbmZpZy50aW1lVG9XYWl0UmVuZGVyO1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcucmVuZGVyQ2xhc3MpIHtcclxuICAgICAgICB0aGlzLnJlbmRlckNsYXNzID0gY29uZmlnLnJlbmRlckNsYXNzO1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcuYXBwUm9vdE5hbWUpIHtcclxuICAgICAgICB0aGlzLmFwcFJvb3ROYW1lID0gY29uZmlnLmFwcFJvb3ROYW1lO1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcubWFya2VyUG9zaXRpb24pIHtcclxuICAgICAgICB0aGlzLm1hcmtlclBvc2l0aW9uID0gY29uZmlnLm1hcmtlclBvc2l0aW9uO1xyXG4gICAgICB9XHJcbiAgICAgIGlmIChjb25maWcucHJpbnRQcmV2aWV3T25seSkge1xyXG4gICAgICAgIHRoaXMucHJpbnRQcmV2aWV3T25seSA9IGNvbmZpZy5wcmludFByZXZpZXdPbmx5O1xyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICAvKioqXHJcbiAgICogUHJpbnQgYSBkaXYgaWRlbnRpZmllZCBieSBpdHMgaWRcclxuICAgKiBAZXhhbXBsZVxyXG4gICAq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7XHJcbiAgICAgICAgcHJpbnRXaW5kb3cuY2xvc2UoKTtcclxuICAgICAgfSwgMjApO1xyXG4gICAgfVxyXG4gICAgaWYgKHByaW50T3BlbldpbmRvdyA9PT0gZmFsc2UpIHtcclxuICAgICAgICBpZiAoIXRoaXMub3Blbk5neFByaW50ZXIpIHtcclxuICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGRvY3VtZW50LmJvZHkuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ25neC1wcmludGVyJykubGVuZ3RoID09PSAwKSB7XHJcbiAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBpZiAodGhpcy5hcHBSb290KSB7XHJcbiAgICAgICAgICBpZiAodGhpcy5hcHBSb290RGlzbGF5U2V0dGluZyAhPT0gJycpIHtcclxuICAgICAgICAgICAgdGhpcy5hcHBSb290LnN0eWxlLmRpc3BsYXkgPSB0aGlzLmFwcFJvb3REaXNsYXlTZXR0aW5nO1xyXG4gICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgdGhpcy5hcHBSb290LnN0eWxlLmRpc3BsYXkgPSAnJztcclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQodGhpcy5vcGVuTmd4UHJpbnRlcik7XHJcbiAgICAgICAgdGhpcy5vcGVuTmd4UHJpbnRlciA9IG51bGw7XHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICAvKipcclxuICAgKiBDcmVhdGUgbm9kZSBvciBhbmd1bGFyIGNvbXBvbmVudFxyXG4gICAqIEBwYXJhbSBjb250ZW50XHJcbiAgICogQGludGVybmFsXHJcbiAgICovXHJcbiAgcHJpdmF0ZSByZXNvbHZlTmdDb250ZW50PFQ+KGNvbnRlbnQ6IENvbnRlbnQ8VD4sIGNvbnRleHQ6IGFueSk6IGFueSB7XHJcbiAgICBpZiAodHlw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cbiAgICogRG8gbm90IGZpcmUgcHJpbnQgZXZlbnQgLSBqdXN0IHNob3cgcHJldmlld1xyXG4gICAqIERlZmF1bHQgaXMgZmFsc2VcclxuICAgKi9cclxuICBwcmludFByZXZpZXdPbmx5ID0gZmFsc2U7XHJcblxyXG4gIGFwcFJvb3Q6IEhUTUxFbGVtZW50O1xyXG4gIGFwcFJvb3REaXNsYXlTZXR0aW5nID0gJyc7XHJcblxyXG4gICRwcmludFdpbmRvd09wZW4gPSB0aGlzLnByaW50V2luZG93T3Blbi5hc09ic2VydmFibGUoKTtcclxuICBldmVudGFkZGVkID0gW107XHJcbiAgbWFya2VyUG9zaXRpb246IG5neFByaW50TWFya2VyUG9zaXRpb247XHJcblxyXG5cclxuICBjb25zdHJ1Y3RvcihcclxuICAgIEBPcHRpb25hbCgpIGNvbmZpZzogUHJpbnRTZXJ2aWNlQ29uZmlnLFxyXG4gICAgcHJpdmF0ZSByZXNvbHZlcjogQ29tcG9uZW50RmFjdG9yeVJlc29sdmVyLFxyXG4gICAgcHJpdmF0ZSBpbmplY3RvcjogSW5qZWN0b3JcclxuICApIHtcclxuICAgIHRoaXMuc2V0Um9vdENvbmZpZ09wdGlvbnMoY29uZmlnKTtcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFNldCBjb25maWcgZnJvbSBmb3JSb290XHJcbiAgICogQHBhcmFtIGNvbmZpZ1xyXG4gICAqL1xyXG4gIHByaXZhdGUgc2V0Um9vdENvbmZpZ09wdGlvbnMoY29uZmlnOiBQcmludFNlcnZpY2VDb25maWcpOiB2b2lkIHtcclxuICAgIGlmIChjb25maWcpIHtcclxuICAgICAgaWYgKGNvbmZpZy5oYXNPd25Qcm9wZXJ0eSgncHJpbnRPcGVuV2luZG93JykpIHtcclxuICAgICAgICB0aGlzLnByaW50T3BlbldpbmRvdyA9IGNvbmZpZy5wcmludE9wZW5XaW5kb3c7XHJcbiAgICAgIH1cclxuICAgICAgaWYgKGNvbmZpZy50aW1lVG9XYWl0UmVuZGVyKSB7XHJcbiAgICAgICAgdGhpcy50aW1lVG9XYWl0UmVuZGVyID0gY29uZmlnLnRpbWVUb1dhaXRSZW5kZXI7XHJcbiAgICAgIH1cclxuICAgICAgaWYgKGNvbmZpZy5yZW5kZXJDbGFzcykge1xyXG4gICAgICAgIHRoaXMucmVuZGVyQ2xhc3MgPSBjb25maWcucmVuZGVyQ2xhc3M7XHJcbiAgICAgIH1cclxuICAgICAgaWYgKGNvbmZpZy5hcHBSb290TmFtZSkge1xyXG4gICAgICAgIHRoaXMuYXBwUm9vdE5hbWUgPSBjb25maWcuYXBwUm9vdE5hbWU7XHJcbiAgICAgIH1cclxuICAgICAgaWYgKGNvbmZpZy5tYXJrZXJQb3NpdGlvbikge1xyXG4gICAgICAgIHRoaXMubWFya2VyUG9zaXRpb24gPSBjb25maWcubWFya2VyUG9zaXRpb247XHJcbiAgICAgIH1cclxuICAgICAgaWYgKGNvbmZpZy5oYXNPd25Qcm9wZXJ0eSgncHJpbnRQcmV2aWV3T25seScpKSB7XHJcbiAgICAgICAgdGhpcy5wcmludFByZXZpZXdPbmx5ID0gY29uZmlnLnByaW50UHJldmlld09ubHk7XHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKipcclxuICAgKiBQcmludCBhIGRpdiBpZGVudGlmaWVkIGJ5IGl0cyBpZFxyXG4gICAqIEBleGFtcGxlXHJcbiAgICogdGhpcy5wcmludGVyU2VydmljZS5wcmludERpdigncHJpbnREaXYnKTtcclxuICAgKi9cclxuICBwdWJsaWMgcHJpbnREaXYoZGl2SUQ6IHN0cmluZyk6IHZvaWQge1xyXG4gICAgY29uc3QgZGl2VG9QcmludCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGRpdklEKTtcclxuXHJcbiAgICBpZiAoZGl2VG9QcmludCkge1xyXG4gICAgICB0aGlzLnByaW50KGRpdlRvUHJpbnQsIHRoaXMucHJpbnRPcGVuV2luZG93KTtcclxuICAgIH0gZWxz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kgPT4ge1xyXG4gICAgICB0aGlzLmV2ZW50YWRkZWRbcHJpbnRXaW5kb3cubmFtZV0gPSB0cnVlO1xyXG4gICAgICAvLyBjb25zb2xlLmxvZygnYWZ0ZXJwcmludCcpO1xyXG4gICAgICBpZiAocHJpbnRXaXRoT3BlbkluTmV3V2luZG93KSB7XHJcbiAgICAgICAgdGhhdC5ldmVudGFkZGVkW3ByaW50V2luZG93Lm5hbWVdID0gZmFsc2U7XHJcbiAgICAgIH1cclxuICAgICAgdGhhdC5jbGVhblVwKHByaW50V2luZG93LCBwcmludFdpdGhPcGVuSW5OZXdXaW5kb3cpO1xyXG4gICAgICB0aGF0LnByaW50V2luZG93T3Blbi5uZXh0KGZhbHNlKTtcclxuICAgIH0pO1xyXG4gIH1cclxuXHJcbiAgLyoqXHJcbiAgICogQ2xvc2UgdGFiIG9yIGNsZWFuIHVwIGRvbVxyXG4gICAqIEBpbnRlcm5hbFxyXG4gICAqL1xyXG4gIHByaXZhdGUgY2xlYW5VcChwcmludFdpbmRvdzogV2luZG93LCBwcmludE9wZW5XaW5kb3c6IGJvb2xlYW4pOiB2b2lkIHtcclxuICAgIGlmIChwcmludE9wZW5XaW5kb3cgPT09IHRydWUpIHtcclxuICAgICAgY29uc29sZS5sb2coJ2Nsb3NlIHByaW50IHdpbmRvdycpO1xyXG4gICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICBwcmludFdpbmRvdy5jbG9zZSgpO1xyXG4gICAgICB9LCAyMCk7XHJcbiAgICB9XHJcbiAgICBpZiAocHJpbnRPcGVuV2luZG93ID09PSBmYWxzZSkge1xyXG4gICAgICAgIGlmICghdGhpcy5vcGVuTmd4UHJpbnRlcikge1xyXG4gICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZG9jdW1lbnQuYm9keS5nZXRFbGVtZW50c0J5VGFnTmFtZSgnbmd4LXByaW50ZXInKS5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmFwcFJvb3QpIHtcclxuICAgICAgICAgIGlmICh0aGlzLmFwcFJvb3REaXNsYXlTZXR0aW5nICE9PSAnJykge1xyXG4gICAgICAgICAgICB0aGlzLmFwcFJvb3Quc3R5bGUuZGlzcGxheSA9IHRoaXMuYXBwUm9vdERpc2xheVNldHRpbmc7XHJcbiAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLmFwcFJvb3Quc3R5bGUuZGlzcGxheSA9ICcnO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgZG9jdW1lbnQuYm9keS5yZW1vdmVDaGlsZCh0aGlzLm9wZW5OZ3hQcmludGVyKTtcclxuICAgICAgICB0aGlzLm9wZW5OZ3hQcmludGVyID0gbnVsbDtcclxuICAgIH1cclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIENyZWF0ZSBub2RlIG9yIGFuZ3VsYXIgY29tcG9uZW50XHJcbiAgICogQHBhcmFtIGNvbnRlbnRcclxuICAgKiBAaW50ZXJuYWxcclxuICAgKi9cclxuICBwcml2YXRlIHJlc29sdmVOZ0NvbnRlbnQ8VD4oY29udGVudDogQ29udGVudDxUPiwgY29udGV4dDogYW55KTogYW55IHtcclxuICAgIGlmICh0eXBlb2YgY29udGVudCA9PT0gJ3N0cmluZycpIHtcclxuICAgICAgY29uc3QgZWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKGNvbnRlbnQpO1xyXG4gICAgICByZXR1cm4gW1tlbGVtZW50XV07XHJcbiAgICB9XHJcblxyXG4gICAgaWYgKGNvbnRlbnQgaW5zdGFuY2VvZiBUZW1wbGF0ZVJlZikge1xyXG4gICAgICBjb25zdCB2aWV3UmVmID0gY29udGVudC5jcmVhdGVFbWJlZGRlZFZpZXcoY29udGV4dC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G9QcmludDogUHJpbnRJdGVtKTogdm9pZCB7XHJcbiAgICB0aGlzLnByaW50SFRNTEVsZW1lbnQocHJpbnRJdGVtVG9QcmludC5uYXRpdmVFbGVtZW50KTtcclxuICB9XHJcblxyXG4gIC8qKlxyXG4gICAqIFByaW50IGFsIGxpc3Qgb2YgcHJpbnQgSXRlbXMgb25lIGFmdGVyIHRoZSBvdGhlclxyXG4gICAqIEBwYXJhbSBwcmludEl0ZW1Ub1ByaW50XHJcbiAgICovXHJcbiAgcHVibGljIHByaW50UHJpbnRJdGVtcyhwcmludEl0ZW1zVG9QcmludDogUHJpbnRJdGVtW10sIGNsYXNzTmFtZT86IHN0cmluZyk6IHZvaWQge1xyXG4gICAgY29uc3QgbmV3RGl2ID0gPEhUTUxEaXZFbGVtZW50PmRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xyXG5cclxuICAgIGlmIChjbGFzc05hbWUpIHtcclxuICAgICAgbmV3RGl2LmNsYXNzTGlzdC5hZGQoY2xhc3NOYW1lKTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgIG5ld0Rpdi5zdHlsZS5kaXNwbGF5ID0gJ2ZsZXgnO1xyXG4gICAgICBuZXdEaXYuc3R5bGUuZmxleERpcmVjdGlvbiA9ICdjb2x1bW4nO1xyXG4gICAgfVxyXG5cclxuICAgIHByaW50SXRlbXNUb1ByaW50LmZvckVhY2goZWxlbWVudCA9PiB7XHJcbiAgICAgIG5ld0Rpdi5hcHBlbmRDaGlsZChlbGVtZW50Lm5hdGl2ZUVsZW1lbnQuY2xvbmVOb2RlKHRydWUpKTtcclxuICAgIH0pO1xyXG5cclxuXHJcbiAgICB0aGlzLnByaW50SFRNTEVsZW1lbnQobmV3RGl2KTtcclxuICB9XHJcbn1cclxuIl19 |
@@ -147,3 +147,3 @@ import { EventEmitter, Component, ElementRef, Renderer2, Output, TemplateRef, ɵɵdefineInjectable, ɵɵinject, ComponentFactoryResolver, INJECTOR, Injectable, Optional, Injector, Directive, Input, NgModule } from '@angular/core'; | ||
if (config) { | ||
if (config.printOpenWindow) { | ||
if (config.hasOwnProperty('printOpenWindow')) { | ||
this.printOpenWindow = config.printOpenWindow; | ||
@@ -163,3 +163,3 @@ } | ||
} | ||
if (config.printPreviewOnly) { | ||
if (config.hasOwnProperty('printPreviewOnly')) { | ||
this.printPreviewOnly = config.printPreviewOnly; | ||
@@ -166,0 +166,0 @@ } |
{ | ||
"name": "ngx-printer", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^11.0.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
350663