ngx-print 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-print.mjs","sources":["../../../src/lib/ngx-print.directive.ts","../../../src/lib/ngx-print.module.ts","../../../src/public_api.ts","../../../src/ngx-print.ts"],"sourcesContent":["import { Directive, HostListener, Input } from '@angular/core';\r\n@Directive({\r\n selector: \"button[ngxPrint]\",\r\n standalone: true\r\n})\r\nexport class NgxPrintDirective {\r\n\r\n public _printStyle = [];\r\n\r\n /**\r\n * Prevents the print dialog from opening on the window\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() previewOnly: boolean = false;\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() printSectionId: string;\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() printTitle: string;\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() useExistingCss = false;\r\n\r\n /**\r\n * A delay in milliseconds to force the print dialog to wait before opened. Default: 0\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() printDelay: number = 0;\r\n\r\n /**\r\n * Whether to close the window after print() returns.\r\n *\r\n */\r\n @Input() closeWindow: boolean = true;\r\n\r\n /**\r\n * Class attribute to apply to the body element.\r\n *\r\n */\r\n @Input() bodyClass: string = '';\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input()\r\n set printStyle(values: { [key: string]: { [key: string]: string } }) {\r\n for (let key in values) {\r\n if (values.hasOwnProperty(key)) {\r\n this._printStyle.push((key + JSON.stringify(values[key])).replace(/['\"]+/g, ''));\r\n }\r\n }\r\n this.returnStyleValues();\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @returns the string that create the stylesheet which will be injected\r\n * later within <style></style> tag.\r\n *\r\n * -join/replace to transform an array objects to css-styled string\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n public returnStyleValues() {\r\n return `<style> ${this._printStyle.join(' ').replace(/,/g, ';')} </style>`;\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @returns html for the given tag\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n private _styleSheetFile = '';\r\n\r\n /**\r\n * @memberof NgxPrintDirective\r\n * @param cssList\r\n */\r\n @Input()\r\n set styleSheetFile(cssList: string) {\r\n let linkTagFn = function (cssFileName) {\r\n return `<link rel=\"stylesheet\" type=\"text/css\" href=\"${cssFileName}\">`;\r\n }\r\n if (cssList.indexOf(',') !== -1) {\r\n const valueArr = cssList.split(',');\r\n for (let val of valueArr) {\r\n this._styleSheetFile = this._styleSheetFile + linkTagFn(val);\r\n }\r\n } else {\r\n this._styleSheetFile = linkTagFn(cssList);\r\n }\r\n }\r\n\r\n /**\r\n * @returns string which contains the link tags containing the css which will\r\n * be injected later within <head></head> tag.\r\n *\r\n */\r\n private returnStyleSheetLinkTags() {\r\n return this._styleSheetFile;\r\n }\r\n private getElementTag(tag: keyof HTMLElementTagNameMap): string {\r\n const html: string[] = [];\r\n const elements = document.getElementsByTagName(tag);\r\n for (let index = 0; index < elements.length; index++) {\r\n html.push(elements[index].outerHTML);\r\n }\r\n return html.join('\\r\\n');\r\n }\r\n\r\n /**\r\n *\r\n * @description When printing, the default option of form elements are printed.\r\n * Here we update what that default is to print the current values.\r\n *\r\n * @param elements the html element collection to save defaults to\r\n *\r\n */\r\n private updateInputDefaults(elements: HTMLCollectionOf<HTMLInputElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n element['defaultValue'] = element.value;\r\n if (element['checked']) element['defaultChecked'] = true;\r\n }\r\n }\r\n private updateSelectDefaults(elements: HTMLCollectionOf<HTMLSelectElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n const selectedIdx = element.selectedIndex;\r\n const selectedOption: HTMLOptionElement = element.options[selectedIdx];\r\n\r\n selectedOption.defaultSelected = true;\r\n }\r\n }\r\n private updateTextAreaDefaults(elements: HTMLCollectionOf<HTMLTextAreaElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n element['defaultValue'] = element.value;\r\n }\r\n }\r\n\r\n /**\r\n * @description Retrieves the html contents of the print section id.\r\n * Updates the html elements to default their form values to the current form values\r\n *\r\n * @returns {string | null} html section to be printed\r\n *\r\n */\r\n private getHtmlContents(): string | null {\r\n const printContents = document.getElementById(this.printSectionId);\r\n if (!printContents) return null;\r\n\r\n const inputEls = printContents.getElementsByTagName('input');\r\n const selectEls = printContents.getElementsByTagName('select');\r\n const textAreaEls = printContents.getElementsByTagName('textarea');\r\n\r\n this.updateInputDefaults(inputEls);\r\n this.updateSelectDefaults(selectEls);\r\n this.updateTextAreaDefaults(textAreaEls);\r\n\r\n return printContents.innerHTML;\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @HostListener('click')\r\n public print(): void {\r\n let printContents, popupWin, styles = '', links = '';\r\n const baseTag = this.getElementTag('base');\r\n\r\n if (this.useExistingCss) {\r\n styles = this.getElementTag('style');\r\n links = this.getElementTag('link');\r\n }\r\n\r\n printContents = this.getHtmlContents();\r\n popupWin = window.open(\"\", \"_blank\", \"top=0,left=0,height=auto,width=auto\");\r\n popupWin.document.open();\r\n popupWin.document.write(`\r\n <html>\r\n <head>\r\n <title>${this.printTitle ? this.printTitle : \"\"}</title>\r\n ${baseTag}\r\n ${this.returnStyleValues()}\r\n ${this.returnStyleSheetLinkTags()}\r\n ${styles}\r\n ${links}\r\n </head>\r\n <body ${this.bodyClass ? `class=\"${this.bodyClass}\"` : ''}>\r\n ${printContents}\r\n <script defer>\r\n function triggerPrint(event) {\r\n window.removeEventListener('load', triggerPrint, false);\r\n ${this.previewOnly || !this.closeWindow ? '' : `setTimeout(function() {\r\n closeWindow(window.print());\r\n }, ${this.printDelay});`}\r\n }\r\n function closeWindow(){\r\n window.close();\r\n }\r\n window.addEventListener('load', triggerPrint, false);\r\n </script>\r\n </body>\r\n </html>`);\r\n popupWin.document.close();\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxPrintDirective } from './ngx-print.directive';\r\n\r\n@NgModule({\r\n imports: [NgxPrintDirective],\r\n exports: [NgxPrintDirective]\r\n})\r\nexport class NgxPrintModule { }\r\n","/*\r\n * Public API Surface of ngx-print\r\n */\r\n\r\nexport * from './lib/ngx-print.directive';\r\nexport * from './lib/ngx-print.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAKa,iBAAiB,CAAA;IAErB,WAAW,GAAG,EAAE,CAAC;AAExB;;;;AAIG;IACM,WAAW,GAAY,KAAK,CAAC;AAEtC;;;;AAIG;AACM,IAAA,cAAc,CAAS;AAEhC;;;;AAIG;AACM,IAAA,UAAU,CAAS;AAE5B;;;;AAIG;IACM,cAAc,GAAG,KAAK,CAAC;AAEhC;;;;AAIG;IACM,UAAU,GAAW,CAAC,CAAC;AAEhC;;;AAGG;IACM,WAAW,GAAY,IAAI,CAAC;AAErC;;;AAGG;IACM,SAAS,GAAW,EAAE,CAAC;AAEhC;;;;AAIG;IACH,IACI,UAAU,CAAC,MAAoD,EAAA;AACjE,QAAA,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AACtB,YAAA,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;gBAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAClF,aAAA;AACF,SAAA;QACD,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;AAED;;;;;;;;;AASG;IACI,iBAAiB,GAAA;AACtB,QAAA,OAAO,WAAW,I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AAA,CAAA;sBAAtB,KAAK;gBAOG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBAMG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBAQF,UAAU,EAAA,CAAA;sBADb,KAAK;gBAsCF,cAAc,EAAA,CAAA;sBADjB,KAAK;gBA2FC,KAAK,EAAA,CAAA;sBADX,YAAY;uBAAC,OAAO,CAAA;;;MCrLV,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;yGAEhB,cAAc,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-print.mjs","sources":["../../../src/lib/ngx-print.base.ts","../../../src/lib/ngx-print.service.ts","../../../src/lib/print-options.ts","../../../src/lib/ngx-print.directive.ts","../../../src/lib/ngx-print.module.ts","../../../src/public_api.ts","../../../src/ngx-print.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\r\nimport { PrintOptions } from \"./print-options\";\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class PrintBase {\r\n\r\n private _printStyle: string[] = [];\r\n private _styleSheetFile: string = '';\r\n\r\n //#region Getters and Setters\r\n /**\r\n * Sets the print styles based on the provided values.\r\n *\r\n * @param {Object} values - Key-value pairs representing print styles.\r\n * @protected\r\n */\r\n protected setPrintStyle(values: { [key: string]: { [key: string]: string } }) {\r\n this._printStyle = [];\r\n for (let key in values) {\r\n if (values.hasOwnProperty(key)) {\r\n this._printStyle.push((key + JSON.stringify(values[key])).replace(/['\"]+/g, ''));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @returns the string that create the stylesheet which will be injected\r\n * later within <style></style> tag.\r\n *\r\n * -join/replace to transform an array objects to css-styled string\r\n */\r\n public returnStyleValues() {\r\n return `<style> ${this._printStyle.join(' ').replace(/,/g, ';')} </style>`;\r\n }\r\n\r\n /**\r\n * @returns string which contains the link tags containing the css which will\r\n * be injected later within <head></head> tag.\r\n *\r\n */\r\n private returnStyleSheetLinkTags() {\r\n return this._styleSheetFile;\r\n }\r\n\r\n /**\r\n * Sets the style sheet file based on the provided CSS list.\r\n *\r\n * @param {string} cssList - CSS file or list of CSS files.\r\n * @protected\r\n */\r\n protected setStyleSheetFile(cssList: string) {\r\n let linkTagFn = function (cssFileName) {\r\n return `<link rel=\"stylesheet\" type=\"text/css\" href=\"${cssFileName}\">`;\r\n };\r\n\r\n if (cssList.indexOf(',') !== -1) {\r\n const valueArr = cssList.split(',');\r\n this._styleSheetFile = valueArr.map(val => linkTagFn(val)).join('');\r\n } else {\r\n this._styleSheetFile = linkTagFn(cssList);\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Private methods used by PrintBase\r\n\r\n /**\r\n * Updates the default values for input elements.\r\n *\r\n * @param {HTMLCollectionOf<HTMLInputElement>} elements - Collection of input elements.\r\n * @private\r\n */\r\n private updateInputDefaults(elements: HTMLCollectionOf<HTMLInputElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n element['defaultValue'] = element.value;\r\n if (element['checked']) element['defaultChecked'] = true;\r\n }\r\n }\r\n\r\n /**\r\n * Updates the default values for select elements.\r\n *\r\n * @param {HTMLCollectionOf<HTMLSelectElement>} elements - Collection of select elements.\r\n * @private\r\n */\r\n private updateSelectDefaults(elements: HTMLCollectionOf<HTMLSelectElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n const selectedIdx = element.selectedIndex;\r\n const selectedOption: HTMLOptionElement = element.options[selectedIdx];\r\n\r\n selectedOption.defaultSelected = true;\r\n }\r\n }\r\n\r\n /**\r\n * Updates the default values for textarea elements.\r\n *\r\n * @param {HTMLCollectionOf<HTMLTextAreaElement>} elements - Collection of textarea elements.\r\n * @private\r\n */\r\n private updateTextAreaDefaults(elements: HTMLCollectionOf<HTMLTextAreaElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = elements[i];\r\n element['defaultValue'] = element.value;\r\n }\r\n }\r\n\r\n /**\r\n * Converts a canvas element to an image and returns its HTML string.\r\n *\r\n * @param {HTMLCanvasElement} element - The canvas element to convert.\r\n * @returns {string} - HTML string of the image.\r\n * @private\r\n */\r\n private canvasToImageHtml(element: HTMLCanvasElement): string {\r\n const dataUrl = element.toDataURL();\r\n return `<img src=\"${dataUrl}\" style=\"max-width: 100%;\">`;\r\n }\r\n\r\n /**\r\n * Includes canvas contents in the print section via img tags.\r\n *\r\n * @param {HTMLCollectionOf<HTMLCanvasElement>} elements - Collection of canvas elements.\r\n * @private\r\n */\r\n private updateCanvasToImage(elements: HTMLCollectionOf<HTMLCanvasElement>): void {\r\n for (let i = 0; i < elements.length; i++) {\r\n const element = this.canvasToImageHtml(elements[i]);\r\n elements[i].insertAdjacentHTML('afterend', element);\r\n elements[i].remove();\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves the HTML content of a specified printing section.\r\n *\r\n * @param {string} printSectionId - Id of the printing section.\r\n * @returns {string | null} - HTML content of the printing section, or null if not found.\r\n * @private\r\n */\r\n private getHtmlContents(printSectionId: string): string | null {\r\n const printContents = document.getElementById(printSectionId);\r\n if (!printContents) return null;\r\n\r\n const inputEls = printContents.getElementsByTagName('input');\r\n const selectEls = printContents.getElementsByTagName('select');\r\n const textAreaEls = printContents.getElementsByTagName('textarea');\r\n const canvasEls = printContents.getElementsByTagName('canvas');\r\n\r\n this.updateInputDefaults(inputEls);\r\n this.updateSelectDefaults(selectEls);\r\n this.updateTextAreaDefaults(textAreaEls);\r\n this.updateCanvasToImage(canvasEls);\r\n\r\n return printContents.innerHTML;\r\n }\r\n\r\n /**\r\n * Retrieves the HTML content of elements with the specified tag.\r\n *\r\n * @param {keyof HTMLElementTagNameMap} tag - HTML tag name.\r\n * @returns {string} - Concatenated outerHTML of elements with the specified tag.\r\n * @private\r\n */\r\n private getElementTag(tag: keyof HTMLElementTagNameMap): string {\r\n const html: string[] = [];\r\n const elements = document.getElementsByTagName(tag);\r\n for (let index = 0; index < elements.length; index++) {\r\n html.push(elements[index].outerHTML);\r\n }\r\n return html.join('\\r\\n');\r\n }\r\n //#endregion\r\n\r\n\r\n /**\r\n * Prints the specified content using the provided print options.\r\n *\r\n * @param {PrintOptions} printOptions - Options for printing.\r\n * @public\r\n */\r\n protected print(printOptions: PrintOptions): void {\r\n\r\n let styles = '', links = '', popOut = 'top=0,left=0,height=auto,width=auto';\r\n const baseTag = this.getElementTag('base');\r\n\r\n if (printOptions.useExistingCss) {\r\n styles = this.getElementTag('style');\r\n links = this.getElementTag('link');\r\n }\r\n\r\n // If the openNewTab option is set to true, then set the popOut option to an empty string. \r\n // This will cause the print dialog to open in a new tab.\r\n if (printOptions.openNewTab) {\r\n popOut = '';\r\n }\r\n\r\n const printContents = this.getHtmlContents(printOptions.printSectionId);\r\n if (!printContents) {\r\n // Handle the case where the specified print section is not found.\r\n console.error(`Print section with id ${printOptions.printSectionId} not found.`);\r\n return;\r\n }\r\n\r\n const popupWin = window.open(\"\", \"_blank\", popOut);\r\n\r\n if (!popupWin) {\r\n // the popup window could not be opened.\r\n console.error('Could not open print window.');\r\n return;\r\n }\r\n\r\n popupWin.document.open();\r\n popupWin.document.write(`\r\n <html>\r\n <head>\r\n <title>${printOptions.printTitle ? printOptions.printTitle : \"\"}</title>\r\n ${baseTag}\r\n ${this.returnStyleValues()}\r\n ${this.returnStyleSheetLinkTags()}\r\n ${styles}\r\n ${links}\r\n </head>\r\n <body ${printOptions.bodyClass ? `class=\"${printOptions.bodyClass}\"` : ''}>\r\n ${printContents}\r\n <script defer>\r\n function triggerPrint(event) {\r\n window.removeEventListener('load', triggerPrint, false);\r\n ${printOptions.previewOnly ? '' : `setTimeout(function() {\r\n closeWindow(window.print());\r\n }, ${printOptions.printDelay});`}\r\n }\r\n function closeWindow(){\r\n ${printOptions.closeWindow ? 'window.close();' : ''}\r\n }\r\n window.addEventListener('load', triggerPrint, false);\r\n </script>\r\n </body>\r\n </html>`);\r\n popupWin.document.close();\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { PrintBase } from \"./ngx-print.base\";\r\nimport { PrintOptions } from \"./print-options\";\r\n\r\n/**\r\n * Service for handling printing functionality in Angular applications.\r\n * Extends the base printing class (PrintBase).\r\n *\r\n * @export\r\n * @class NgxPrintService\r\n * @extends {PrintBase}\r\n */\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class NgxPrintService extends PrintBase {\r\n\r\n /**\r\n * Initiates the printing process using the provided print options.\r\n *\r\n * @param {PrintOptions} printOptions - Options for configuring the printing process.\r\n * @memberof NgxPrintService\r\n * @returns {void}\r\n */\r\n public print(printOptions: PrintOptions): void {\r\n // Call the print method in the parent class\r\n super.print(printOptions);\r\n }\r\n\r\n /**\r\n * Sets the print style for the printing process.\r\n *\r\n * @param {{ [key: string]: { [key: string]: string } }} values - A dictionary representing the print styles.\r\n * @memberof NgxPrintService\r\n * @setter\r\n */\r\n set printStyle(values: { [key: string]: { [key: string]: string } }) {\r\n super.setPrintStyle(values);\r\n }\r\n\r\n\r\n /**\r\n * Sets the stylesheet file for the printing process.\r\n *\r\n * @param {string} cssList - A string representing the path to the stylesheet file.\r\n * @memberof NgxPrintService\r\n * @setter\r\n */\r\n set styleSheetFile(cssList: string) {\r\n super.setStyleSheetFile(cssList);\r\n }\r\n}\r\n","export class PrintOptions {\r\n printSectionId: string = null;\r\n printTitle: string = null;\r\n useExistingCss: boolean = false;\r\n bodyClass: string = '';\r\n openNewTab: boolean = false;\r\n previewOnly: boolean = false;\r\n closeWindow: boolean = true;\r\n printDelay: number = 0;\r\n\r\n constructor(options?: Partial<PrintOptions>) {\r\n if (options) {\r\n Object.assign(this, options);\r\n }\r\n }\r\n}\r\n","import { Directive, HostListener, Input } from '@angular/core';\r\nimport { PrintBase } from './ngx-print.base';\r\nimport { PrintOptions } from './print-options';\r\n@Directive({\r\n selector: \"button[ngxPrint]\",\r\n standalone: true\r\n})\r\nexport class NgxPrintDirective extends PrintBase {\r\n private printOptions = new PrintOptions();\r\n /**\r\n * Prevents the print dialog from opening on the window\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() set previewOnly(value: boolean) {\r\n this.printOptions = { ...this.printOptions, previewOnly: value };\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() set printSectionId(value: string) {\r\n this.printOptions = { ...this.printOptions, printSectionId: value };\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() set printTitle(value: string) {\r\n this.printOptions = { ...this.printOptions, printTitle: value };\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() set useExistingCss(value: boolean) {\r\n this.printOptions = { ...this.printOptions, useExistingCss: value };\r\n }\r\n\r\n /**\r\n * A delay in milliseconds to force the print dialog to wait before opened. Default: 0\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input() set printDelay(value: number) {\r\n this.printOptions = { ...this.printOptions, printDelay: value };\r\n }\r\n\r\n /**\r\n * Whether to close the window after print() returns.\r\n *\r\n */\r\n @Input() set closeWindow(value: boolean) {\r\n this.printOptions = { ...this.printOptions, closeWindow: value };\r\n }\r\n\r\n /**\r\n * Class attribute to apply to the body element.\r\n *\r\n */\r\n @Input() set bodyClass(value: string) {\r\n this.printOptions = { ...this.printOptions, bodyClass: value };\r\n }\r\n\r\n /**\r\n * Whether to open a new window or default to new window.\r\n *\r\n */\r\n @Input() set openNewTab(value: boolean) {\r\n this.printOptions = { ...this.printOptions, openNewTab: value };\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @Input()\r\n set printStyle(values: { [key: string]: { [key: string]: string } }) {\r\n super.setPrintStyle(values);\r\n }\r\n\r\n\r\n /**\r\n * @memberof NgxPrintDirective\r\n * @param cssList\r\n */\r\n @Input()\r\n set styleSheetFile(cssList: string) {\r\n super.setStyleSheetFile(cssList);\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * @memberof NgxPrintDirective\r\n */\r\n @HostListener('click')\r\n public print(): void {\r\n super.print(this.printOptions);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NgxPrintDirective } from './ngx-print.directive';\r\n\r\n@NgModule({\r\n imports: [NgxPrintDirective],\r\n exports: [NgxPrintDirective]\r\n})\r\nexport class NgxPrintModule { }\r\n","/*\r\n * Public API Surface of ngx-print\r\n */\r\nexport * from './lib/ngx-print.service';\r\nexport * from './lib/ngx-print.directive';\r\nexport * from './lib/ngx-print.module';\r\nexport * from './lib/print-options';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAMa,SAAS,CAAA;IAEV,WAAW,GAAa,EAAE,CAAC;IAC3B,eAAe,GAAW,EAAE,CAAC;;AAGrC;;;;;AAKG;AACO,IAAA,aAAa,CAAC,MAAoD,EAAA;AACxE,QAAA,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AACtB,QAAA,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AACpB,YAAA,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;gBAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EA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A,CAAA;sBADjB,KAAK;gBAWC,KAAK,EAAA,CAAA;sBADX,YAAY;uBAAC,OAAO,CAAA;;;MChGV,cAAc,CAAA;uGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAAd,cAAc,EAAA,OAAA,EAAA,CAHf,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;wGAEhB,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,101 @@
1
+ import { PrintOptions } from "./print-options";
2
+ import * as i0 from "@angular/core";
3
+ export declare class PrintBase {
4
+ private _printStyle;
5
+ private _styleSheetFile;
6
+ /**
7
+ * Sets the print styles based on the provided values.
8
+ *
9
+ * @param {Object} values - Key-value pairs representing print styles.
10
+ * @protected
11
+ */
12
+ protected setPrintStyle(values: {
13
+ [key: string]: {
14
+ [key: string]: string;
15
+ };
16
+ }): void;
17
+ /**
18
+ *
19
+ *
20
+ * @returns the string that create the stylesheet which will be injected
21
+ * later within <style></style> tag.
22
+ *
23
+ * -join/replace to transform an array objects to css-styled string
24
+ */
25
+ returnStyleValues(): string;
26
+ /**
27
+ * @returns string which contains the link tags containing the css which will
28
+ * be injected later within <head></head> tag.
29
+ *
30
+ */
31
+ private returnStyleSheetLinkTags;
32
+ /**
33
+ * Sets the style sheet file based on the provided CSS list.
34
+ *
35
+ * @param {string} cssList - CSS file or list of CSS files.
36
+ * @protected
37
+ */
38
+ protected setStyleSheetFile(cssList: string): void;
39
+ /**
40
+ * Updates the default values for input elements.
41
+ *
42
+ * @param {HTMLCollectionOf<HTMLInputElement>} elements - Collection of input elements.
43
+ * @private
44
+ */
45
+ private updateInputDefaults;
46
+ /**
47
+ * Updates the default values for select elements.
48
+ *
49
+ * @param {HTMLCollectionOf<HTMLSelectElement>} elements - Collection of select elements.
50
+ * @private
51
+ */
52
+ private updateSelectDefaults;
53
+ /**
54
+ * Updates the default values for textarea elements.
55
+ *
56
+ * @param {HTMLCollectionOf<HTMLTextAreaElement>} elements - Collection of textarea elements.
57
+ * @private
58
+ */
59
+ private updateTextAreaDefaults;
60
+ /**
61
+ * Converts a canvas element to an image and returns its HTML string.
62
+ *
63
+ * @param {HTMLCanvasElement} element - The canvas element to convert.
64
+ * @returns {string} - HTML string of the image.
65
+ * @private
66
+ */
67
+ private canvasToImageHtml;
68
+ /**
69
+ * Includes canvas contents in the print section via img tags.
70
+ *
71
+ * @param {HTMLCollectionOf<HTMLCanvasElement>} elements - Collection of canvas elements.
72
+ * @private
73
+ */
74
+ private updateCanvasToImage;
75
+ /**
76
+ * Retrieves the HTML content of a specified printing section.
77
+ *
78
+ * @param {string} printSectionId - Id of the printing section.
79
+ * @returns {string | null} - HTML content of the printing section, or null if not found.
80
+ * @private
81
+ */
82
+ private getHtmlContents;
83
+ /**
84
+ * Retrieves the HTML content of elements with the specified tag.
85
+ *
86
+ * @param {keyof HTMLElementTagNameMap} tag - HTML tag name.
87
+ * @returns {string} - Concatenated outerHTML of elements with the specified tag.
88
+ * @private
89
+ */
90
+ private getElementTag;
91
+ /**
92
+ * Prints the specified content using the provided print options.
93
+ *
94
+ * @param {PrintOptions} printOptions - Options for printing.
95
+ * @public
96
+ */
97
+ protected print(printOptions: PrintOptions): void;
98
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrintBase, never>;
99
+ static ɵprov: i0.ɵɵInjectableDeclaration<PrintBase>;
100
+ }
101
+ //# sourceMappingURL=ngx-print.base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-print.base.d.ts","sourceRoot":"","sources":["../../../src/lib/ngx-print.base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;;AAE/C,qBAGa,SAAS;IAElB,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,eAAe,CAAc;IAGrC;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE;IAS5E;;;;;;;OAOG;IACI,iBAAiB;IAIxB;;;;KAIC;IACD,OAAO,CAAC,wBAAwB;IAIhC;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAiB3C;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAKzB;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAWrB;;;;;OAKG;IACH,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;yCAtLxC,SAAS;6CAAT,SAAS;CAkPrB"}
@@ -1,46 +1,52 @@
1
+ import { PrintBase } from './ngx-print.base';
1
2
  import * as i0 from "@angular/core";
2
- export declare class NgxPrintDirective {
3
- _printStyle: any[];
3
+ export declare class NgxPrintDirective extends PrintBase {
4
+ private printOptions;
4
5
  /**
5
6
  * Prevents the print dialog from opening on the window
6
7
  *
7
8
  * @memberof NgxPrintDirective
8
9
  */
9
- previewOnly: boolean;
10
+ set previewOnly(value: boolean);
10
11
  /**
11
12
  *
12
13
  *
13
14
  * @memberof NgxPrintDirective
14
15
  */
15
- printSectionId: string;
16
+ set printSectionId(value: string);
16
17
  /**
17
18
  *
18
19
  *
19
20
  * @memberof NgxPrintDirective
20
21
  */
21
- printTitle: string;
22
+ set printTitle(value: string);
22
23
  /**
23
24
  *
24
25
  *
25
26
  * @memberof NgxPrintDirective
26
27
  */
27
- useExistingCss: boolean;
28
+ set useExistingCss(value: boolean);
28
29
  /**
29
30
  * A delay in milliseconds to force the print dialog to wait before opened. Default: 0
30
31
  *
31
32
  * @memberof NgxPrintDirective
32
33
  */
33
- printDelay: number;
34
+ set printDelay(value: number);
34
35
  /**
35
36
  * Whether to close the window after print() returns.
36
37
  *
37
38
  */
38
- closeWindow: boolean;
39
+ set closeWindow(value: boolean);
39
40
  /**
40
41
  * Class attribute to apply to the body element.
41
42
  *
42
43
  */
43
- bodyClass: string;
44
+ set bodyClass(value: string);
45
+ /**
46
+ * Whether to open a new window or default to new window.
47
+ *
48
+ */
49
+ set openNewTab(value: boolean);
44
50
  /**
45
51
  *
46
52
  *
@@ -51,56 +57,11 @@ export declare class NgxPrintDirective {
51
57
  [key: string]: string;
52
58
  };
53
59
  });
54
- /**
55
- *
56
- *
57
- * @returns the string that create the stylesheet which will be injected
58
- * later within <style></style> tag.
59
- *
60
- * -join/replace to transform an array objects to css-styled string
61
- *
62
- * @memberof NgxPrintDirective
63
- */
64
- returnStyleValues(): string;
65
- /**
66
- *
67
- *
68
- * @returns html for the given tag
69
- *
70
- * @memberof NgxPrintDirective
71
- */
72
- private _styleSheetFile;
73
60
  /**
74
61
  * @memberof NgxPrintDirective
75
62
  * @param cssList
76
63
  */
77
64
  set styleSheetFile(cssList: string);
78
- /**
79
- * @returns string which contains the link tags containing the css which will
80
- * be injected later within <head></head> tag.
81
- *
82
- */
83
- private returnStyleSheetLinkTags;
84
- private getElementTag;
85
- /**
86
- *
87
- * @description When printing, the default option of form elements are printed.
88
- * Here we update what that default is to print the current values.
89
- *
90
- * @param elements the html element collection to save defaults to
91
- *
92
- */
93
- private updateInputDefaults;
94
- private updateSelectDefaults;
95
- private updateTextAreaDefaults;
96
- /**
97
- * @description Retrieves the html contents of the print section id.
98
- * Updates the html elements to default their form values to the current form values
99
- *
100
- * @returns {string | null} html section to be printed
101
- *
102
- */
103
- private getHtmlContents;
104
65
  /**
105
66
  *
106
67
  *
@@ -108,6 +69,6 @@ export declare class NgxPrintDirective {
108
69
  */
109
70
  print(): void;
110
71
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxPrintDirective, never>;
111
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPrintDirective, "button[ngxPrint]", never, { "previewOnly": { "alias": "previewOnly"; "required": false; }; "printSectionId": { "alias": "printSectionId"; "required": false; }; "printTitle": { "alias": "printTitle"; "required": false; }; "useExistingCss": { "alias": "useExistingCss"; "required": false; }; "printDelay": { "alias": "printDelay"; "required": false; }; "closeWindow": { "alias": "closeWindow"; "required": false; }; "bodyClass": { "alias": "bodyClass"; "required": false; }; "printStyle": { "alias": "printStyle"; "required": false; }; "styleSheetFile": { "alias": "styleSheetFile"; "required": false; }; }, {}, never, never, true, never>;
72
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPrintDirective, "button[ngxPrint]", never, { "previewOnly": { "alias": "previewOnly"; "required": false; }; "printSectionId": { "alias": "printSectionId"; "required": false; }; "printTitle": { "alias": "printTitle"; "required": false; }; "useExistingCss": { "alias": "useExistingCss"; "required": false; }; "printDelay": { "alias": "printDelay"; "required": false; }; "closeWindow": { "alias": "closeWindow"; "required": false; }; "bodyClass": { "alias": "bodyClass"; "required": false; }; "openNewTab": { "alias": "openNewTab"; "required": false; }; "printStyle": { "alias": "printStyle"; "required": false; }; "styleSheetFile": { "alias": "styleSheetFile"; "required": false; }; }, {}, never, never, true, never>;
112
73
  }
113
74
  //# sourceMappingURL=ngx-print.directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-print.directive.d.ts","sourceRoot":"","sources":["../../../src/lib/ngx-print.directive.ts"],"names":[],"mappings":";AACA,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Ac,CAAC,KAAK,EAAE,MAAM,EAExC;IAED;;;;OAIG;IACH,IAAa,UAAU,CAAC,KAAK,EAAE,MAAM,EAEpC;IAED;;;;OAIG;IACH,IAAa,cAAc,CAAC,KAAK,EAAE,OAAO,EAEzC;IAED;;;;OAIG;IACH,IAAa,UAAU,CAAC,KAAK,EAAE,MAAM,EAEpC;IAED;;;OAGG;IACH,IAAa,WAAW,CAAC,KAAK,EAAE,OAAO,EAEtC;IAED;;;OAGG;IACH,IAAa,SAAS,CAAC,KAAK,EAAE,MAAM,EAEnC;IAED;;;OAGG;IACH,IAAa,UAAU,CAAC,KAAK,EAAE,OAAO,EAErC;IAED;;;;OAIG;IACH,IACI,UAAU,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,EAElE;IAGD;;;OAGG;IACH,IACI,cAAc,CAAC,OAAO,EAAE,MAAM,EAEjC;IAED;;;;OAIG;IAEI,KAAK,IAAI,IAAI;yCAjGT,iBAAiB;2CAAjB,iBAAiB;CAoG7B"}
@@ -0,0 +1,44 @@
1
+ import { PrintBase } from "./ngx-print.base";
2
+ import { PrintOptions } from "./print-options";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Service for handling printing functionality in Angular applications.
6
+ * Extends the base printing class (PrintBase).
7
+ *
8
+ * @export
9
+ * @class NgxPrintService
10
+ * @extends {PrintBase}
11
+ */
12
+ export declare class NgxPrintService extends PrintBase {
13
+ /**
14
+ * Initiates the printing process using the provided print options.
15
+ *
16
+ * @param {PrintOptions} printOptions - Options for configuring the printing process.
17
+ * @memberof NgxPrintService
18
+ * @returns {void}
19
+ */
20
+ print(printOptions: PrintOptions): void;
21
+ /**
22
+ * Sets the print style for the printing process.
23
+ *
24
+ * @param {{ [key: string]: { [key: string]: string } }} values - A dictionary representing the print styles.
25
+ * @memberof NgxPrintService
26
+ * @setter
27
+ */
28
+ set printStyle(values: {
29
+ [key: string]: {
30
+ [key: string]: string;
31
+ };
32
+ });
33
+ /**
34
+ * Sets the stylesheet file for the printing process.
35
+ *
36
+ * @param {string} cssList - A string representing the path to the stylesheet file.
37
+ * @memberof NgxPrintService
38
+ * @setter
39
+ */
40
+ set styleSheetFile(cssList: string);
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxPrintService, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxPrintService>;
43
+ }
44
+ //# sourceMappingURL=ngx-print.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-print.service.d.ts","sourceRoot":"","sources":["../../../src/lib/ngx-print.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;;AAE/C;;;;;;;GAOG;AACH,qBAGa,eAAgB,SAAQ,SAAS;IAE5C;;;;;;OAMG;IACI,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAK9C;;;;;;OAMG;IACH,IAAI,UAAU,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAA;KAAE,EAElE;IAGD;;;;;;OAMG;IACH,IAAI,cAAc,CAAC,OAAO,EAAE,MAAM,EAEjC;yCAnCU,eAAe;6CAAf,eAAe;CAoC3B"}
@@ -0,0 +1,12 @@
1
+ export declare class PrintOptions {
2
+ printSectionId: string;
3
+ printTitle: string;
4
+ useExistingCss: boolean;
5
+ bodyClass: string;
6
+ openNewTab: boolean;
7
+ previewOnly: boolean;
8
+ closeWindow: boolean;
9
+ printDelay: number;
10
+ constructor(options?: Partial<PrintOptions>);
11
+ }
12
+ //# sourceMappingURL=print-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-options.d.ts","sourceRoot":"","sources":["../../../src/lib/print-options.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,cAAc,EAAE,MAAM,CAAQ;IAC9B,UAAU,EAAE,MAAM,CAAQ;IAC1B,cAAc,EAAE,OAAO,CAAS;IAChC,SAAS,EAAE,MAAM,CAAM;IACvB,UAAU,EAAE,OAAO,CAAS;IAC5B,WAAW,EAAE,OAAO,CAAS;IAC7B,WAAW,EAAE,OAAO,CAAQ;IAC5B,UAAU,EAAE,MAAM,CAAK;gBAEX,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;CAK5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-print",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "Plug n' Play Angular (2++) directive to print your stuff",
5
5
  "author": "https://github.com/selemxmn/ngx-print/graphs/contributors",
6
6
  "repository": {
package/public_api.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './lib/ngx-print.service';
1
2
  export * from './lib/ngx-print.directive';
2
3
  export * from './lib/ngx-print.module';
4
+ export * from './lib/print-options';
3
5
  //# sourceMappingURL=public_api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAGA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}