@sumaris-net/ngx-components 18.6.33 → 18.6.34
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.
- package/esm2022/src/app/shared/functions.mjs +7 -1
- package/esm2022/src/app/shared/print/print.service.mjs +28 -10
- package/fesm2022/sumaris-net.ngx-components.mjs +32 -8
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/functions.d.ts +6 -0
- package/src/app/shared/print/print.service.d.ts +21 -6
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -88,6 +88,12 @@ export declare function getPropertyByPathAsString(obj: any, path: string | strin
|
|
|
88
88
|
export declare function setPropertyByPath<T = any>(obj: T, path: string | string[], value: any): T;
|
|
89
89
|
export declare function sleep(ms: number): Promise<void>;
|
|
90
90
|
export declare function isPromise<T>(value: T | Promise<T>): value is Promise<T>;
|
|
91
|
+
/**
|
|
92
|
+
* Rounds a numeric value to two decimal places.
|
|
93
|
+
*
|
|
94
|
+
* @param {number | undefined | null} value - The value to be rounded. Can be a number, undefined, or null.
|
|
95
|
+
* @return {number} The rounded value with two decimal places if the input value is a valid number; otherwise, returns the input value.
|
|
96
|
+
*/
|
|
91
97
|
export declare function round(value: number | undefined | null): number;
|
|
92
98
|
export declare function equalsOrNil(value1: any, value2: any): boolean;
|
|
93
99
|
/**
|
|
@@ -16,7 +16,7 @@ export declare class PrintService {
|
|
|
16
16
|
protected translate: TranslateService;
|
|
17
17
|
protected storage: StorageService;
|
|
18
18
|
protected document: Document;
|
|
19
|
-
private
|
|
19
|
+
private _printId;
|
|
20
20
|
constructor(toastController: ToastController, translate: TranslateService, storage: StorageService, document: Document);
|
|
21
21
|
nextJobId(): number;
|
|
22
22
|
/**
|
|
@@ -25,7 +25,7 @@ export declare class PrintService {
|
|
|
25
25
|
* @param {string} [url] - The URL from which to extract the job ID. If not provided, `window.location.href` will be used.
|
|
26
26
|
* @return {number | undefined} The extracted job ID as a number, or `undefined` if the job ID is not present or invalid.
|
|
27
27
|
*/
|
|
28
|
-
getJobId(url?: string):
|
|
28
|
+
getJobId(url?: string): string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Determines whether the provided URL or the current page's URL contains
|
|
31
31
|
* a specific query parameter, indicating it's a printing-related URL.
|
|
@@ -35,10 +35,25 @@ export declare class PrintService {
|
|
|
35
35
|
* @return {boolean} Returns true if the query parameter is found in the URL; otherwise, false.
|
|
36
36
|
*/
|
|
37
37
|
isPrintingUrl(url?: string, queryParam?: string): boolean;
|
|
38
|
-
printElement(element: HTMLElement, opts?: PrintOptions): Promise<
|
|
39
|
-
printHTML(html: string, opts?: PrintOptions): Promise<
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
printElement(element: HTMLElement, opts?: PrintOptions): Promise<number | string>;
|
|
39
|
+
printHTML(html: string, opts?: PrintOptions): Promise<number | string>;
|
|
40
|
+
/**
|
|
41
|
+
* Prints the content of a URL by rendering it in an iframe.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} url The URL of the content to print. This parameter is required.
|
|
44
|
+
* @param {Omit<PrintOptions, 'style'>} [opts] Optional settings for printing, excluding the 'style' option.
|
|
45
|
+
* @return {Promise<number>} A promise that resolves to the ID of the print job.
|
|
46
|
+
*/
|
|
47
|
+
printUrl(url: string, opts?: Omit<PrintOptions, 'style'>): Promise<number | string>;
|
|
48
|
+
/**
|
|
49
|
+
* Prints the content of the specified iframe element.
|
|
50
|
+
*
|
|
51
|
+
* @param {HTMLIFrameElement} iframe - The iframe element whose content needs to be printed. Must be a valid and loaded iframe element.
|
|
52
|
+
* @param {PrintOptions} [opts] - Optional parameters for the print operation, which may include options for toast messages and job configuration.
|
|
53
|
+
* @return {Promise<number>} A promise that resolves to the unique ID of the print job.
|
|
54
|
+
* @throws Will throw an error if the required 'iframe' argument is missing or invalid.
|
|
55
|
+
*/
|
|
56
|
+
printIframe(iframe: HTMLIFrameElement, opts?: PrintOptions): Promise<number | string>;
|
|
42
57
|
markAsLoading(id: string | number): Promise<void>;
|
|
43
58
|
markAsLoaded(id: string | number): Promise<void>;
|
|
44
59
|
isLoaded(id: string | number): Promise<boolean>;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "18.6.
|
|
5
|
+
"version": "18.6.34",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|