@geogirafe/lib-geoportal 1.3.0-dev.2938077459 → 1.3.0-dev.2938437315

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.
@@ -3,7 +3,7 @@ import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
3
3
  /**
4
4
  * Create a link to a page or an email if the pattern matches
5
5
  */
6
- export declare function getLinkFriendlyString(inputStr: string): string;
6
+ export declare function getLinkFriendlyString(value: unknown): string;
7
7
  export default class SelectionPanelMobile extends GirafeHTMLElement {
8
8
  protected templateUrl: string | null;
9
9
  protected styleUrls: string[] | null;
@@ -6,12 +6,13 @@ import { isValidEmail } from '../../tools/utils/utils.js';
6
6
  /**
7
7
  * Create a link to a page or an email if the pattern matches
8
8
  */
9
- export function getLinkFriendlyString(inputStr) {
9
+ export function getLinkFriendlyString(value) {
10
+ const inputStr = String(value);
10
11
  // Create a link if starting with http
11
12
  if (inputStr.startsWith('http')) {
12
13
  return `<a href="${inputStr}" target="_blank" rel="noreferrer">${inputStr}</a>`;
13
14
  }
14
- // Create an emial link if has email form
15
+ // Create an email link if has email form
15
16
  if (isValidEmail(inputStr)) {
16
17
  return `<a href="mailto:${inputStr}">${inputStr}</a>`;
17
18
  }
@@ -1,6 +1,7 @@
1
1
  import type OlFeature from 'ol/Feature.js';
2
2
  import GirafeDraggableElement from '../../base/GirafeDraggableElement.js';
3
3
  import type { GridDataById } from '../../tools/featuretogriddatabyid.js';
4
+ import type GirafeConfig from '../../tools/configuration/girafeconfig.js';
4
5
  /**
5
6
  * Represents a Feature displayed in the SelectionWindowComponent.
6
7
  */
@@ -135,5 +136,11 @@ declare class SelectionWindowComponent extends GirafeDraggableElement {
135
136
  * @static
136
137
  */
137
138
  static createWindowFeatures(gridDataById: GridDataById): WindowFeature[];
139
+ /**
140
+ * Converts a feature property value (string, number, boolean...) to a linkified and sanitized html string.
141
+ * @returns The html string to display.
142
+ * @static
143
+ */
144
+ static formatDisplayedValue(value: unknown, config: GirafeConfig): string;
138
145
  }
139
146
  export default SelectionWindowComponent;
@@ -182,8 +182,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
182
182
  });
183
183
  this.displayedProperties.forEach((keyValue) => {
184
184
  keyValue[0] = this.context.i18nManager.getTranslation(this.columnAliasHelper.getColumnAlias(windowFeature.id, keyValue[0]));
185
- keyValue[1] = linkify(keyValue[1]);
186
- keyValue[1] = sanitize(keyValue[1], this.context.configManager.Config);
185
+ keyValue[1] = SelectionWindowComponent.formatDisplayedValue(keyValue[1], this.context.configManager.Config);
187
186
  });
188
187
  // Render and translate data.
189
188
  this.render();
@@ -312,5 +311,13 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
312
311
  });
313
312
  return windowFeatures;
314
313
  }
314
+ /**
315
+ * Converts a feature property value (string, number, boolean...) to a linkified and sanitized html string.
316
+ * @returns The html string to display.
317
+ * @static
318
+ */
319
+ static formatDisplayedValue(value, config) {
320
+ return sanitize(linkify(String(value)), config);
321
+ }
315
322
  }
316
323
  export default SelectionWindowComponent;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.3.0-dev.2938077459",
8
+ "version": "1.3.0-dev.2938437315",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.3.0-dev.2938077459", "build":"2938077459", "date":"12/10/2026"}
1
+ {"version":"1.3.0-dev.2938437315", "build":"2938437315", "date":"12/10/2026"}