ngx-print 1.4.0 → 1.5.0

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.
@@ -0,0 +1,15 @@
1
+ export class PrintOptions {
2
+ printSectionId = null;
3
+ printTitle = null;
4
+ useExistingCss = false;
5
+ bodyClass = '';
6
+ previewOnly = false;
7
+ closeWindow = true;
8
+ printDelay = 0;
9
+ constructor(options) {
10
+ if (options) {
11
+ Object.assign(this, options);
12
+ }
13
+ }
14
+ }
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpbnQtb3B0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvcHJpbnQtb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sWUFBWTtJQUN2QixjQUFjLEdBQVcsSUFBSSxDQUFDO0lBQzlCLFVBQVUsR0FBVyxJQUFJLENBQUM7SUFDMUIsY0FBYyxHQUFZLEtBQUssQ0FBQztJQUNoQyxTQUFTLEdBQVcsRUFBRSxDQUFDO0lBQ3ZCLFdBQVcsR0FBWSxLQUFLLENBQUM7SUFDN0IsV0FBVyxHQUFZLElBQUksQ0FBQztJQUM1QixVQUFVLEdBQVcsQ0FBQyxDQUFDO0lBRXZCLFlBQVksT0FBK0I7UUFDekMsSUFBSSxPQUFPLEVBQUU7WUFDWCxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxPQUFPLENBQUMsQ0FBQztTQUM5QjtJQUNILENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjbGFzcyBQcmludE9wdGlvbnMge1xyXG4gIHByaW50U2VjdGlvbklkOiBzdHJpbmcgPSBudWxsO1xyXG4gIHByaW50VGl0bGU6IHN0cmluZyA9IG51bGw7XHJcbiAgdXNlRXhpc3RpbmdDc3M6IGJvb2xlYW4gPSBmYWxzZTtcclxuICBib2R5Q2xhc3M6IHN0cmluZyA9ICcnO1xyXG4gIHByZXZpZXdPbmx5OiBib29sZWFuID0gZmFsc2U7XHJcbiAgY2xvc2VXaW5kb3c6IGJvb2xlYW4gPSB0cnVlO1xyXG4gIHByaW50RGVsYXk6IG51bWJlciA9IDA7XHJcblxyXG4gIGNvbnN0cnVjdG9yKG9wdGlvbnM/OiBQYXJ0aWFsPFByaW50T3B0aW9ucz4pIHtcclxuICAgIGlmIChvcHRpb25zKSB7XHJcbiAgICAgIE9iamVjdC5hc3NpZ24odGhpcywgb3B0aW9ucyk7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Public API Surface of ngx-print
3
3
  */
4
+ export * from './lib/ngx-print.service';
4
5
  export * from './lib/ngx-print.directive';
5
6
  export * from './lib/ngx-print.module';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG5neC1wcmludFxyXG4gKi9cclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1wcmludC5kaXJlY3RpdmUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9uZ3gtcHJpbnQubW9kdWxlJztcclxuIl19
7
+ export * from './lib/print-options';
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxxQkFBcUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBuZ3gtcHJpbnRcclxuICovXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1wcmludC5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvbmd4LXByaW50LmRpcmVjdGl2ZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1wcmludC5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9wcmludC1vcHRpb25zJztcclxuIl19
@@ -1,60 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, HostListener, NgModule } from '@angular/core';
2
+ import { Injectable, Directive, Input, HostListener, NgModule } from '@angular/core';
3
3
 
4
- class NgxPrintDirective {
4
+ class PrintBase {
5
5
  _printStyle = [];
6
+ _styleSheetFile = '';
7
+ //#region Getters and Setters
6
8
  /**
7
- * Prevents the print dialog from opening on the window
8
- *
9
- * @memberof NgxPrintDirective
10
- */
11
- previewOnly = false;
12
- /**
13
- *
14
- *
15
- * @memberof NgxPrintDirective
16
- */
17
- printSectionId;
18
- /**
19
- *
20
- *
21
- * @memberof NgxPrintDirective
22
- */
23
- printTitle;
24
- /**
25
- *
26
- *
27
- * @memberof NgxPrintDirective
28
- */
29
- useExistingCss = false;
30
- /**
31
- * A delay in milliseconds to force the print dialog to wait before opened. Default: 0
32
- *
33
- * @memberof NgxPrintDirective
34
- */
35
- printDelay = 0;
36
- /**
37
- * Whether to close the window after print() returns.
38
- *
39
- */
40
- closeWindow = true;
41
- /**
42
- * Class attribute to apply to the body element.
43
- *
44
- */
45
- bodyClass = '';
46
- /**
9
+ * Sets the print styles based on the provided values.
47
10
  *
48
- *
49
- * @memberof NgxPrintDirective
11
+ * @param {Object} values - Key-value pairs representing print styles.
12
+ * @protected
50
13
  */
51
- set printStyle(values) {
14
+ setPrintStyle(values) {
15
+ this._printStyle = [];
52
16
  for (let key in values) {
53
17
  if (values.hasOwnProperty(key)) {
54
18
  this._printStyle.push((key + JSON.stringify(values[key])).replace(/['"]+/g, ''));
55
19
  }
56
20
  }
57
- this.returnStyleValues();
58
21
  }
59
22
  /**
60
23
  *
@@ -63,62 +26,44 @@ class NgxPrintDirective {
63
26
  * later within <style></style> tag.
64
27
  *
65
28
  * -join/replace to transform an array objects to css-styled string
66
- *
67
- * @memberof NgxPrintDirective
68
29
  */
69
30
  returnStyleValues() {
70
31
  return `<style> ${this._printStyle.join(' ').replace(/,/g, ';')} </style>`;
71
32
  }
72
33
  /**
73
- *
74
- *
75
- * @returns html for the given tag
76
- *
77
- * @memberof NgxPrintDirective
78
- */
79
- _styleSheetFile = '';
34
+ * @returns string which contains the link tags containing the css which will
35
+ * be injected later within <head></head> tag.
36
+ *
37
+ */
38
+ returnStyleSheetLinkTags() {
39
+ return this._styleSheetFile;
40
+ }
80
41
  /**
81
- * @memberof NgxPrintDirective
82
- * @param cssList
42
+ * Sets the style sheet file based on the provided CSS list.
43
+ *
44
+ * @param {string} cssList - CSS file or list of CSS files.
45
+ * @protected
83
46
  */
84
- set styleSheetFile(cssList) {
47
+ setStyleSheetFile(cssList) {
85
48
  let linkTagFn = function (cssFileName) {
86
49
  return `<link rel="stylesheet" type="text/css" href="${cssFileName}">`;
87
50
  };
88
51
  if (cssList.indexOf(',') !== -1) {
89
52
  const valueArr = cssList.split(',');
90
- for (let val of valueArr) {
91
- this._styleSheetFile = this._styleSheetFile + linkTagFn(val);
92
- }
53
+ this._styleSheetFile = valueArr.map(val => linkTagFn(val)).join('');
93
54
  }
94
55
  else {
95
56
  this._styleSheetFile = linkTagFn(cssList);
96
57
  }
97
58
  }
59
+ //#endregion
60
+ //#region Private methods used by PrintBase
98
61
  /**
99
- * @returns string which contains the link tags containing the css which will
100
- * be injected later within <head></head> tag.
62
+ * Updates the default values for input elements.
101
63
  *
64
+ * @param {HTMLCollectionOf<HTMLInputElement>} elements - Collection of input elements.
65
+ * @private
102
66
  */
103
- returnStyleSheetLinkTags() {
104
- return this._styleSheetFile;
105
- }
106
- getElementTag(tag) {
107
- const html = [];
108
- const elements = document.getElementsByTagName(tag);
109
- for (let index = 0; index < elements.length; index++) {
110
- html.push(elements[index].outerHTML);
111
- }
112
- return html.join('\r\n');
113
- }
114
- /**
115
- *
116
- * @description When printing, the default option of form elements are printed.
117
- * Here we update what that default is to print the current values.
118
- *
119
- * @param elements the html element collection to save defaults to
120
- *
121
- */
122
67
  updateInputDefaults(elements) {
123
68
  for (let i = 0; i < elements.length; i++) {
124
69
  const element = elements[i];
@@ -127,6 +72,12 @@ class NgxPrintDirective {
127
72
  element['defaultChecked'] = true;
128
73
  }
129
74
  }
75
+ /**
76
+ * Updates the default values for select elements.
77
+ *
78
+ * @param {HTMLCollectionOf<HTMLSelectElement>} elements - Collection of select elements.
79
+ * @private
80
+ */
130
81
  updateSelectDefaults(elements) {
131
82
  for (let i = 0; i < elements.length; i++) {
132
83
  const element = elements[i];
@@ -135,6 +86,12 @@ class NgxPrintDirective {
135
86
  selectedOption.defaultSelected = true;
136
87
  }
137
88
  }
89
+ /**
90
+ * Updates the default values for textarea elements.
91
+ *
92
+ * @param {HTMLCollectionOf<HTMLTextAreaElement>} elements - Collection of textarea elements.
93
+ * @private
94
+ */
138
95
  updateTextAreaDefaults(elements) {
139
96
  for (let i = 0; i < elements.length; i++) {
140
97
  const element = elements[i];
@@ -142,14 +99,14 @@ class NgxPrintDirective {
142
99
  }
143
100
  }
144
101
  /**
145
- * @description Retrieves the html contents of the print section id.
146
- * Updates the html elements to default their form values to the current form values
147
- *
148
- * @returns {string | null} html section to be printed
102
+ * Retrieves the HTML content of a specified printing section.
149
103
  *
104
+ * @param {string} printSectionId - Id of the printing section.
105
+ * @returns {string | null} - HTML content of the printing section, or null if not found.
106
+ * @private
150
107
  */
151
- getHtmlContents() {
152
- const printContents = document.getElementById(this.printSectionId);
108
+ getHtmlContents(printSectionId) {
109
+ const printContents = document.getElementById(printSectionId);
153
110
  if (!printContents)
154
111
  return null;
155
112
  const inputEls = printContents.getElementsByTagName('input');
@@ -161,52 +118,228 @@ class NgxPrintDirective {
161
118
  return printContents.innerHTML;
162
119
  }
163
120
  /**
121
+ * Retrieves the HTML content of elements with the specified tag.
164
122
  *
123
+ * @param {keyof HTMLElementTagNameMap} tag - HTML tag name.
124
+ * @returns {string} - Concatenated outerHTML of elements with the specified tag.
125
+ * @private
126
+ */
127
+ getElementTag(tag) {
128
+ const html = [];
129
+ const elements = document.getElementsByTagName(tag);
130
+ for (let index = 0; index < elements.length; index++) {
131
+ html.push(elements[index].outerHTML);
132
+ }
133
+ return html.join('\r\n');
134
+ }
135
+ //#endregion
136
+ /**
137
+ * Prints the specified content using the provided print options.
165
138
  *
166
- * @memberof NgxPrintDirective
139
+ * @param {PrintOptions} printOptions - Options for printing.
140
+ * @public
167
141
  */
168
- print() {
169
- let printContents, popupWin, styles = '', links = '';
142
+ print(printOptions) {
143
+ let styles = '', links = '';
170
144
  const baseTag = this.getElementTag('base');
171
- if (this.useExistingCss) {
145
+ if (printOptions.useExistingCss) {
172
146
  styles = this.getElementTag('style');
173
147
  links = this.getElementTag('link');
174
148
  }
175
- printContents = this.getHtmlContents();
176
- popupWin = window.open("", "_blank", "top=0,left=0,height=auto,width=auto");
149
+ const printContents = this.getHtmlContents(printOptions.printSectionId);
150
+ if (!printContents) {
151
+ // Handle the case where the specified print section is not found.
152
+ console.error(`Print section with id ${printOptions.printSectionId} not found.`);
153
+ return;
154
+ }
155
+ const popupWin = window.open("", "_blank", "top=0,left=0,height=auto,width=auto");
177
156
  popupWin.document.open();
178
157
  popupWin.document.write(`
179
- <html>
180
- <head>
181
- <title>${this.printTitle ? this.printTitle : ""}</title>
182
- ${baseTag}
183
- ${this.returnStyleValues()}
184
- ${this.returnStyleSheetLinkTags()}
185
- ${styles}
186
- ${links}
187
- </head>
188
- <body ${this.bodyClass ? `class="${this.bodyClass}"` : ''}>
189
- ${printContents}
190
- <script defer>
191
- function triggerPrint(event) {
192
- window.removeEventListener('load', triggerPrint, false);
193
- ${this.previewOnly || !this.closeWindow ? '' : `setTimeout(function() {
194
- closeWindow(window.print());
195
- }, ${this.printDelay});`}
196
- }
197
- function closeWindow(){
198
- window.close();
199
- }
200
- window.addEventListener('load', triggerPrint, false);
201
- </script>
202
- </body>
203
- </html>`);
158
+ <html>
159
+ <head>
160
+ <title>${printOptions.printTitle ? printOptions.printTitle : ""}</title>
161
+ ${baseTag}
162
+ ${this.returnStyleValues()}
163
+ ${this.returnStyleSheetLinkTags()}
164
+ ${styles}
165
+ ${links}
166
+ </head>
167
+ <body ${printOptions.bodyClass ? `class="${printOptions.bodyClass}"` : ''}>
168
+ ${printContents}
169
+ <script defer>
170
+ function triggerPrint(event) {
171
+ window.removeEventListener('load', triggerPrint, false);
172
+ ${printOptions.previewOnly ? '' : `setTimeout(function() {
173
+ closeWindow(window.print());
174
+ }, ${printOptions.printDelay});`}
175
+ }
176
+ function closeWindow(){
177
+ ${printOptions.closeWindow ? 'window.close();' : ''}
178
+ }
179
+ window.addEventListener('load', triggerPrint, false);
180
+ </script>
181
+ </body>
182
+ </html>`);
204
183
  popupWin.document.close();
205
184
  }
206
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
207
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NgxPrintDirective, isStandalone: true, selector: "button[ngxPrint]", inputs: { previewOnly: "previewOnly", printSectionId: "printSectionId", printTitle: "printTitle", useExistingCss: "useExistingCss", printDelay: "printDelay", closeWindow: "closeWindow", bodyClass: "bodyClass", printStyle: "printStyle", styleSheetFile: "styleSheetFile" }, host: { listeners: { "click": "print()" } }, ngImport: i0 });
185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PrintBase, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
186
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PrintBase, providedIn: 'root' });
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PrintBase, decorators: [{
189
+ type: Injectable,
190
+ args: [{
191
+ providedIn: 'root'
192
+ }]
193
+ }] });
194
+
195
+ /**
196
+ * Service for handling printing functionality in Angular applications.
197
+ * Extends the base printing class (PrintBase).
198
+ *
199
+ * @export
200
+ * @class NgxPrintService
201
+ * @extends {PrintBase}
202
+ */
203
+ class NgxPrintService extends PrintBase {
204
+ /**
205
+ * Initiates the printing process using the provided print options.
206
+ *
207
+ * @param {PrintOptions} printOptions - Options for configuring the printing process.
208
+ * @memberof NgxPrintService
209
+ * @returns {void}
210
+ */
211
+ print(printOptions) {
212
+ // Call the print method in the parent class
213
+ super.print(printOptions);
214
+ }
215
+ /**
216
+ * Sets the print style for the printing process.
217
+ *
218
+ * @param {{ [key: string]: { [key: string]: string } }} values - A dictionary representing the print styles.
219
+ * @memberof NgxPrintService
220
+ * @setter
221
+ */
222
+ set printStyle(values) {
223
+ super.setPrintStyle(values);
224
+ }
225
+ /**
226
+ * Sets the stylesheet file for the printing process.
227
+ *
228
+ * @param {string} cssList - A string representing the path to the stylesheet file.
229
+ * @memberof NgxPrintService
230
+ * @setter
231
+ */
232
+ set styleSheetFile(cssList) {
233
+ super.setStyleSheetFile(cssList);
234
+ }
235
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
236
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintService, providedIn: "root" });
237
+ }
238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintService, decorators: [{
239
+ type: Injectable,
240
+ args: [{
241
+ providedIn: "root",
242
+ }]
243
+ }] });
244
+
245
+ class PrintOptions {
246
+ printSectionId = null;
247
+ printTitle = null;
248
+ useExistingCss = false;
249
+ bodyClass = '';
250
+ previewOnly = false;
251
+ closeWindow = true;
252
+ printDelay = 0;
253
+ constructor(options) {
254
+ if (options) {
255
+ Object.assign(this, options);
256
+ }
257
+ }
258
+ }
259
+
260
+ class NgxPrintDirective extends PrintBase {
261
+ printOptions = new PrintOptions();
262
+ /**
263
+ * Prevents the print dialog from opening on the window
264
+ *
265
+ * @memberof NgxPrintDirective
266
+ */
267
+ set previewOnly(value) {
268
+ this.printOptions = { ...this.printOptions, previewOnly: value };
269
+ }
270
+ /**
271
+ *
272
+ *
273
+ * @memberof NgxPrintDirective
274
+ */
275
+ set printSectionId(value) {
276
+ this.printOptions = { ...this.printOptions, printSectionId: value };
277
+ }
278
+ /**
279
+ *
280
+ *
281
+ * @memberof NgxPrintDirective
282
+ */
283
+ set printTitle(value) {
284
+ this.printOptions = { ...this.printOptions, printSectionId: value };
285
+ }
286
+ /**
287
+ *
288
+ *
289
+ * @memberof NgxPrintDirective
290
+ */
291
+ set useExistingCss(value) {
292
+ this.printOptions = { ...this.printOptions, useExistingCss: value };
293
+ }
294
+ /**
295
+ * A delay in milliseconds to force the print dialog to wait before opened. Default: 0
296
+ *
297
+ * @memberof NgxPrintDirective
298
+ */
299
+ set printDelay(value) {
300
+ this.printOptions = { ...this.printOptions, printDelay: value };
301
+ }
302
+ /**
303
+ * Whether to close the window after print() returns.
304
+ *
305
+ */
306
+ set closeWindow(value) {
307
+ this.printOptions = { ...this.printOptions, closeWindow: value };
308
+ }
309
+ /**
310
+ * Class attribute to apply to the body element.
311
+ *
312
+ */
313
+ set bodyClass(value) {
314
+ this.printOptions = { ...this.printOptions, bodyClass: value };
315
+ }
316
+ /**
317
+ *
318
+ *
319
+ * @memberof NgxPrintDirective
320
+ */
321
+ set printStyle(values) {
322
+ super.setPrintStyle(values);
323
+ }
324
+ /**
325
+ * @memberof NgxPrintDirective
326
+ * @param cssList
327
+ */
328
+ set styleSheetFile(cssList) {
329
+ super.setStyleSheetFile(cssList);
330
+ }
331
+ /**
332
+ *
333
+ *
334
+ * @memberof NgxPrintDirective
335
+ */
336
+ print() {
337
+ super.print(this.printOptions);
338
+ }
339
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
340
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: NgxPrintDirective, isStandalone: true, selector: "button[ngxPrint]", inputs: { previewOnly: "previewOnly", printSectionId: "printSectionId", printTitle: "printTitle", useExistingCss: "useExistingCss", printDelay: "printDelay", closeWindow: "closeWindow", bodyClass: "bodyClass", printStyle: "printStyle", styleSheetFile: "styleSheetFile" }, host: { listeners: { "click": "print()" } }, usesInheritance: true, ngImport: i0 });
208
341
  }
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintDirective, decorators: [{
342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintDirective, decorators: [{
210
343
  type: Directive,
211
344
  args: [{
212
345
  selector: "button[ngxPrint]",
@@ -236,11 +369,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
236
369
  }] } });
237
370
 
238
371
  class NgxPrintModule {
239
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
240
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintModule, imports: [NgxPrintDirective], exports: [NgxPrintDirective] });
241
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintModule });
372
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
373
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintModule, imports: [NgxPrintDirective], exports: [NgxPrintDirective] });
374
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintModule });
242
375
  }
243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxPrintModule, decorators: [{
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: NgxPrintModule, decorators: [{
244
377
  type: NgModule,
245
378
  args: [{
246
379
  imports: [NgxPrintDirective],
@@ -256,5 +389,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
256
389
  * Generated bundle index. Do not edit.
257
390
  */
258
391
 
259
- export { NgxPrintDirective, NgxPrintModule };
392
+ export { NgxPrintDirective, NgxPrintModule, NgxPrintService, PrintOptions };
260
393
  //# sourceMappingURL=ngx-print.mjs.map
@@ -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,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC;KAC5E;AAED;;;;;;AAMG;IACK,eAAe,GAAG,EAAE,CAAC;AAE7B;;;AAGG;IACH,IACI,cAAc,CAAC,OAAe,EAAA;QAChC,IAAI,SAAS,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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 * 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\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 * 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 = '';\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 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\", \"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>${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 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, printSectionId: 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 *\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;gBAC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