@geogirafe/lib-geoportal 1.1.0-dev.2321895443 → 1.1.0-dev.2334445027

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.
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Suche sichtbar",
353
353
  "Search...": "Suchen...",
354
354
  "search_tip": "Ort, Objekt oder Karte suchen",
355
+ "search_tooltip": "Suchen Sie nach einem Ort, einer Adresse, einer Karte oder geografischen Daten",
355
356
  "searchFillColor": "Suchresultat Füllfarbe",
356
357
  "searchStrokeColor": "Suchresultat Strichfarbe",
357
358
  "Select all": "Alles auswählen",
@@ -353,6 +353,7 @@
353
353
  "Search visible": "Search visible",
354
354
  "Search...": "Search...",
355
355
  "search_tip": "Search for a place, object or map",
356
+ "search_tooltip": "Search for a place, address, map, or geographic data",
356
357
  "searchFillColor": "Search result fill color",
357
358
  "searchStrokeColor": "Search result stroke color",
358
359
  "Select all": "Select all",
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Recherche visible",
353
353
  "Search...": "Rechercher...",
354
354
  "search_tip": "Rechercher un lieu, un objet ou une carte",
355
+ "search_tooltip": "Rechercher un lieu, une adresse, une carte ou une donnée géographique",
355
356
  "searchFillColor": "Couleur de remplissage des résultats de recherche",
356
357
  "searchStrokeColor": "Couleur du trait des résultats de recherche",
357
358
  "Select all": "Tout sélectionner",
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Ricerca visibile",
353
353
  "Search...": "Cerca...",
354
354
  "search_tip": "Cerca un luogo, un oggetto o una mappa",
355
+ "search_tooltip": "Cerca un luogo, un indirizzo, una mappa o un dato geografico",
355
356
  "searchFillColor": "Colore di riempimento dei risultati della ricerca",
356
357
  "searchStrokeColor": "Colore del tratto dei risultati della ricerca",
357
358
  "Select all": "Seleziona tutto",
@@ -68,6 +68,7 @@ declare class SearchComponent extends GirafeHTMLElement {
68
68
  onMouseMove(): void;
69
69
  onKeyDown(e: KeyboardEvent): void;
70
70
  private navigateToResult;
71
+ private createTooltip;
71
72
  private initColorPicker;
72
73
  private updatePreviewLayerStyle;
73
74
  private defaultColorHasChanged;
@@ -2,6 +2,7 @@ import { html as uHtml } from 'uhtml';
2
2
  import Collection from 'ol/Collection.js';
3
3
  import Feature from 'ol/Feature.js';
4
4
  import GeoJSON from 'ol/format/GeoJSON.js';
5
+ import tippy from 'tippy.js';
5
6
  import VectorSource from 'ol/source/Vector.js';
6
7
  import VectorLayer from 'ol/layer/Vector.js';
7
8
  import { Point } from 'ol/geom.js';
@@ -20,9 +21,9 @@ class SearchComponent extends GirafeHTMLElement {
20
21
  return uHtml `<style>
21
22
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
22
23
  </style><style>
23
- .hidden{display:none}#searchbox{background-color:var(--bkg-color);border:1px solid #cfd6dd;border-radius:4px;flex-direction:row;width:100%;height:2.25rem;display:flex}#search{-webkit-appearance:none;width:auto;height:2.25rem;color:var(--text-color);background:0 0;border:0;outline:none;-webkit-flex:auto;-ms-flex:auto;flex:auto;margin:0 0 0 .5rem;padding-left:.8rem;font-size:1rem}.search-icon,.close-icon,.select-color-icon{width:14px;color:var(--text-color);padding:0 1rem}.close-button,.select-color-button{cursor:pointer;background-color:#0000;border:none;padding:0}#results{z-index:1000;background-color:var(--bkg-color);scrollbar-width:thin;width:36rem;max-height:31rem;margin-top:.1rem;margin-bottom:.5rem;position:absolute;top:3.5rem;overflow-x:hidden}.result,.title{width:34rem;padding:.3rem 1rem;line-height:1.3rem;display:inline-block}.title{color:var(--text-color);padding-top:1.5rem;font-size:1.3rem;font-weight:600;line-height:2.5rem}.result{cursor:pointer;text-align:left;width:100%;color:var(--text-color);background:0 0;border:none;border-top:1px solid #ccc}.title img{width:14px;margin-right:1rem}.title span{text-transform:uppercase}.result.selected{color:var(--text-color);background-color:#aaa!important}#no-result{background:var(--warning-color);opacity:.75;visibility:hidden;pointer-events:none;border-radius:6px;width:fit-content;margin:auto;padding:.5rem 0;font-size:1rem;position:absolute;top:3.5rem;left:0;right:0}#no-result>span{padding:1.3rem}@keyframes fadeOut{0%{opacity:1}80%{opacity:1}to{opacity:0}}.shown-then-fadeout{animation:2s ease-in-out forwards fadeOut;visibility:visible!important}
24
+ .hidden{display:none}#searchbox{background-color:var(--bkg-color);border:1px solid #cfd6dd;border-radius:4px;flex-direction:row;width:100%;height:2.25rem;display:flex;& slot[name=search-tooltip]{display:none}}#search{-webkit-appearance:none;width:auto;height:2.25rem;color:var(--text-color);background:0 0;border:0;outline:none;-webkit-flex:auto;-ms-flex:auto;flex:auto;margin:0 0 0 .5rem;padding-left:.8rem;font-size:1rem}.search-icon,.close-icon,.select-color-icon{width:14px;color:var(--text-color);padding:0 1rem}.close-button,.select-color-button{cursor:pointer;background-color:#0000;border:none;padding:0}#results{z-index:1000;background-color:var(--bkg-color);scrollbar-width:thin;width:36rem;max-height:31rem;margin-top:.1rem;margin-bottom:.5rem;position:absolute;top:3.5rem;overflow-x:hidden}.result,.title{width:34rem;padding:.3rem 1rem;line-height:1.3rem;display:inline-block}.title{color:var(--text-color);padding-top:1.5rem;font-size:1.3rem;font-weight:600;line-height:2.5rem}.result{cursor:pointer;text-align:left;width:100%;color:var(--text-color);background:0 0;border:none;border-top:1px solid #ccc}.title img{width:14px;margin-right:1rem}.title span{text-transform:uppercase}.result.selected{color:var(--text-color);background-color:#aaa!important}#no-result{background:var(--warning-color);opacity:.75;visibility:hidden;pointer-events:none;border-radius:6px;width:fit-content;margin:auto;padding:.5rem 0;font-size:1rem;position:absolute;top:3.5rem;left:0;right:0}#no-result>span{padding:1.3rem}@keyframes fadeOut{0%{opacity:1}80%{opacity:1}to{opacity:0}}.shown-then-fadeout{animation:2s ease-in-out forwards fadeOut;visibility:visible!important}
24
25
  </style>
25
- <link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="searchbox"><input tip="search_tip" id="search" class="gg-input" length="20" maxlength="1000" autocomplete="off" autocorrect="off" i18n="Search..." placeholder="Search..." oninput="${(e) => this.doSearchDebounced(e)}" onfocusin="${() => this.onFocusIn()}" onfocusout="${() => this.onFocusOut()}" onkeydown="${(e) => this.onKeyDown(e)}"> <img class="${this.allResults.length > 0 ? 'hidden' : 'search-icon'}" alt="search-icon" src="${this.searchIcon}"> <button class="${this.allResults.length > 0 ? 'close-button' : 'hidden'}" onclick="${() => this.clearSearch(true)}"><img class="close-icon" alt="close-icon" src="icons/close.svg"></button> <button tip="change_search_result_color" id="colorPickerBtn" class="${this.paintSearchResults ? 'select-color-button' : 'hidden'}"><img class="select-color-icon" alt="select-color-icon" src="${this.paintbrushIcon}"></button><div id="results" class="${Object.keys(this.groupedResults).length === 0 || this.forceHide ? 'hidden' : ''}" onmousemove="${() => this.onMouseMove()}">${Object.keys(this.groupedResults).map(group => uHtml `<div class="title"><img alt="result icon" src="${this.getIcon(group)}"> <span i18n="${group}"></span></div>${this.groupedResults[group].map(result => uHtml ` <button class="${result.get('selected') ? 'result selected' : 'result'}" onmousedown="${() => this.onMouseDown()}" onclick="${() => this.onSelect(result)}" onmouseover="${() => this.onMouseOver(result)}" onmouseleave="${() => this.onMouseLeave()}">${result.get('label')}</button> `)} `)}</div><div id="no-result" class="${this.showNoResultWarning ? 'shown-then-fadeout' : ''}"><span i18n="${'No match found'}"></span></div></div>`;
26
+ <link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="searchbox"><slot name="search-tooltip"></slot><input id="search" class="gg-input" length="20" maxlength="1000" autocomplete="off" autocorrect="off" i18n="Search..." placeholder="Search..." oninput="${(e) => this.doSearchDebounced(e)}" onfocusin="${() => this.onFocusIn()}" onfocusout="${() => this.onFocusOut()}" onkeydown="${(e) => this.onKeyDown(e)}"> <img class="${this.allResults.length > 0 ? 'hidden' : 'search-icon'}" alt="search-icon" src="${this.searchIcon}"> <button class="${this.allResults.length > 0 ? 'close-button' : 'hidden'}" onclick="${() => this.clearSearch(true)}"><img class="close-icon" alt="close-icon" src="icons/close.svg"></button> <button tip="change_search_result_color" id="colorPickerBtn" class="${this.paintSearchResults ? 'select-color-button' : 'hidden'}"><img class="select-color-icon" alt="select-color-icon" src="${this.paintbrushIcon}"></button><div id="results" class="${Object.keys(this.groupedResults).length === 0 || this.forceHide ? 'hidden' : ''}" onmousemove="${() => this.onMouseMove()}">${Object.keys(this.groupedResults).map(group => uHtml `<div class="title"><img alt="result icon" src="${this.getIcon(group)}"> <span i18n="${group}"></span></div>${this.groupedResults[group].map(result => uHtml ` <button class="${result.get('selected') ? 'result selected' : 'result'}" onmousedown="${() => this.onMouseDown()}" onclick="${() => this.onSelect(result)}" onmouseover="${() => this.onMouseOver(result)}" onmouseleave="${() => this.onMouseLeave()}">${result.get('label')}</button> `)} `)}</div><div id="no-result" class="${this.showNoResultWarning ? 'shown-then-fadeout' : ''}"><span i18n="${'No match found'}"></span></div></div>`;
26
27
  };
27
28
  searchIcon = SearchIcon;
28
29
  paintbrushIcon = PaintbrushIcon;
@@ -116,6 +117,7 @@ class SearchComponent extends GirafeHTMLElement {
116
117
  this.render();
117
118
  super.girafeTranslate();
118
119
  this.registerEvents();
120
+ this.createTooltip();
119
121
  if (this.context.permalinkManager.hasSearch()) {
120
122
  this.subscribe('application.isReady', () => {
121
123
  if (this.state.application.isReady) {
@@ -454,6 +456,39 @@ class SearchComponent extends GirafeHTMLElement {
454
456
  break;
455
457
  }
456
458
  }
459
+ createTooltip() {
460
+ const searchInput = this.shadowRoot?.getElementById('search');
461
+ if (searchInput) {
462
+ // Create a tooltip using tippy.js
463
+ tippy(searchInput, {
464
+ content: () => {
465
+ // Check if there's a slot named "search-tooltip"
466
+ const slot = this.shadow.querySelector('slot[name="search-tooltip"]');
467
+ if (slot) {
468
+ const assignedNodes = slot.assignedNodes({ flatten: true });
469
+ if (assignedNodes.length > 0) {
470
+ // Create a temporary div to hold the content
471
+ const tooltipContent = document.createElement('div');
472
+ assignedNodes.forEach((node) => {
473
+ tooltipContent.appendChild(node.cloneNode(true));
474
+ });
475
+ return tooltipContent;
476
+ }
477
+ }
478
+ // Fallback to the default tooltip text if no slot content is found
479
+ return this.context.i18nManager.getTranslation('search_tooltip') || 'Search...';
480
+ },
481
+ trigger: 'mouseenter',
482
+ hideOnClick: false,
483
+ interactive: true,
484
+ theme: 'light',
485
+ placement: 'bottom',
486
+ arrow: true,
487
+ appendTo: document.body,
488
+ maxWidth: '300px'
489
+ });
490
+ }
491
+ }
457
492
  initColorPicker() {
458
493
  super.render();
459
494
  const colorPicker = this.shadowRoot?.getElementById('colorPickerBtn');
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geomapfish.dev"
7
7
  },
8
- "version": "1.1.0-dev.2321895443",
8
+ "version": "1.1.0-dev.2334445027",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -86,7 +86,13 @@
86
86
  <header>
87
87
  <girafe-theme-select data-tour="theme-selection"></girafe-theme-select>
88
88
  <img class="logo" alt="geogirafe-logo" src="images/logo/horizontal_black.svg" />
89
- <girafe-search id="search"></girafe-search>
89
+ <girafe-search id="search">
90
+ <!-- <div slot="search-tooltip">
91
+ <p>
92
+ Create a custom tooltip
93
+ </p>
94
+ </div> -->
95
+ </girafe-search>
90
96
  <girafe-oauth></girafe-oauth>
91
97
  <girafe-nav-history></girafe-nav-history>
92
98
  <girafe-video-record></girafe-video-record>
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2321895443", "build":"2321895443", "date":"12/02/2026"}
1
+ {"version":"1.1.0-dev.2334445027", "build":"2334445027", "date":"18/02/2026"}