@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "18.12.4",
4
+ "version": "18.12.6",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -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
  *
@@ -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.4",
5
+ "version": "18.12.6",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{