@sumaris-net/ngx-components 18.12.4 → 18.12.6
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/doc/changelog.md +7 -1
- package/esm2022/src/app/shared/file/url.utils.mjs +34 -3
- package/esm2022/src/app/shared/pipes/url.pipes.mjs +3 -11
- package/fesm2022/sumaris-net.ngx-components.mjs +195 -172
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/file/url.utils.d.ts +22 -0
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -46,6 +46,28 @@ export declare abstract class UrlUtils {
|
|
|
46
46
|
* @throws {Error} If the provided URL is missing or undefined.
|
|
47
47
|
*/
|
|
48
48
|
static normalizeUrl(url: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* This function completes a base URL with an object containing key-value pairs
|
|
51
|
+
* representing the query parameters to add. It properly encodes the
|
|
52
|
+
* parameters and ensures they are added with the appropriate separator ('?' or '&').
|
|
53
|
+
* Parameters with null or undefined values are automatically filtered out.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // In a template
|
|
57
|
+
* <a [href]="'https://example.com' | appendQueryParams:{id: 123, name: 'test'}">Link</a>
|
|
58
|
+
* // Result: https://example.com?id=123&name=test
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // If the URL already contains parameters
|
|
62
|
+
* <a [href]="'https://example.com?page=1' | appendQueryParams:{sort: 'asc'}">Link</a>
|
|
63
|
+
* // Result: https://example.com?page=1&sort=asc
|
|
64
|
+
*
|
|
65
|
+
* @param url
|
|
66
|
+
* @param queryParams
|
|
67
|
+
*/
|
|
68
|
+
static appendQueryParams(url: string | any[], queryParams: {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}): string;
|
|
49
71
|
/**
|
|
50
72
|
* Extracts and returns the root URL from the given complete URL string.
|
|
51
73
|
*
|
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.12.
|
|
5
|
+
"version": "18.12.6",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|