@geogirafe/lib-geoportal 1.0.2183182793 → 1.0.2188794150
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/assets/i18n/de.json +5 -0
- package/assets/i18n/en.json +5 -0
- package/assets/i18n/fr.json +5 -0
- package/assets/i18n/it.json +5 -0
- package/components/lr-panel/component.js +1 -1
- package/components/print/component.d.ts +9 -7
- package/components/print/component.js +21 -2
- package/components/treeview/treeviewgroup/component.js +1 -1
- package/components/treeview/treeviewitem/component.js +2 -2
- package/components/treeview/treeviewtheme/component.js +1 -1
- package/models/gmf.d.ts +1 -0
- package/models/layers/layer.d.ts +2 -2
- package/models/layers/layer.js +2 -2
- package/models/layers/layercog.d.ts +1 -1
- package/models/layers/layercog.js +2 -2
- package/models/layers/layervectortiles.js +1 -1
- package/models/layers/layerwms.d.ts +1 -1
- package/models/layers/layerwms.js +2 -2
- package/models/layers/layerwmts.d.ts +1 -1
- package/models/layers/layerwmts.js +2 -2
- package/models/layers/layerxyz.d.ts +1 -1
- package/models/layers/layerxyz.js +2 -2
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/state/stateToggleManager.d.ts +1 -7
- package/tools/state/stateToggleManager.js +2 -17
- package/tools/state/stateToggleManager.spec.js +0 -5
package/assets/i18n/de.json
CHANGED
|
@@ -245,6 +245,7 @@
|
|
|
245
245
|
"palette_option_spectral": "Spektral",
|
|
246
246
|
"palette_option_viridis": "Viridis",
|
|
247
247
|
"Please log in to edit layers...": "Melden Sie sich an um Layer zu editieren...",
|
|
248
|
+
"Please review or disable them before printing.": "Bitte prüfe oder deaktiviere sie vor dem Drucken.",
|
|
248
249
|
"plugin_infra3d": "Infra3D",
|
|
249
250
|
"PNG export": "PNG-Export",
|
|
250
251
|
"Point": "Punkt",
|
|
@@ -255,6 +256,7 @@
|
|
|
255
256
|
"Preview": "Vorschau",
|
|
256
257
|
"Print": "Drucken",
|
|
257
258
|
"print-panel": "Karte drucken",
|
|
259
|
+
"Private layers are enabled and will be printed.": "Private Layer sind aktiviert und werden gedruckt.",
|
|
258
260
|
"Profile width": "Profilbreite",
|
|
259
261
|
"profile_background_color": "Hintergrundfarbe",
|
|
260
262
|
"profile_background_color_help": "Farbe nach",
|
|
@@ -390,6 +392,7 @@
|
|
|
390
392
|
"Take measure": "Messen",
|
|
391
393
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Vielen Dank für Ihre Nachricht. Falls erforderlich, wird sich so schnell wie möglich jemand mit Ihnen in Verbindung setzen.",
|
|
392
394
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Der folgende Link wird mit Ihrer Nachricht gesendet. Er enthält Ihre aktuelle Konfiguration und hilft uns, Ihr Problem zu verstehen.",
|
|
395
|
+
"The generated document may contain sensitive data.": "Das generierte Dokument kann sensible Daten enthalten.",
|
|
393
396
|
"The print server is unavailable. Please, try later.": "Der Druckserver ist nicht verfügbar. Bitte versuche es später erneut.",
|
|
394
397
|
"theme": "Standardthema",
|
|
395
398
|
"Theme selection": "Themenauswahl",
|
|
@@ -413,6 +416,8 @@
|
|
|
413
416
|
"view_bookmarks": "Lesezeichen anzeigen",
|
|
414
417
|
"visual": "Darstellung",
|
|
415
418
|
"warn": "Warnung",
|
|
419
|
+
"Warning: Private Layers are active": "Warnung: Private Layer sind aktiv",
|
|
420
|
+
"Warning: This document may contain sensitive data.": "Warnung: Dieses Dokument kann sensible Daten enthalten.",
|
|
416
421
|
"Web Mercator projection distorts distances and areas": "Die Web Mercator Projektion verzerrt Distanz- und Flächenangaben",
|
|
417
422
|
"Why are you contacting us?": "Warum kontaktieren Sie uns?",
|
|
418
423
|
"window": "Fenster",
|
package/assets/i18n/en.json
CHANGED
|
@@ -246,6 +246,7 @@
|
|
|
246
246
|
"palette_option_spectral": "Spectral",
|
|
247
247
|
"palette_option_viridis": "Viridis",
|
|
248
248
|
"Please log in to edit layers...": "Please log in to edit layers...",
|
|
249
|
+
"Please review or disable them before printing.": "Please review or disable them before printing.",
|
|
249
250
|
"plugin_infra3d": "Infra3D",
|
|
250
251
|
"PNG export": "PNG export",
|
|
251
252
|
"Point": "Point",
|
|
@@ -256,6 +257,7 @@
|
|
|
256
257
|
"Preview": "Preview",
|
|
257
258
|
"Print": "Print",
|
|
258
259
|
"print-panel": "Print map",
|
|
260
|
+
"Private layers are enabled and will be printed.": "Private layers are enabled and will be printed.",
|
|
259
261
|
"Profile width": "Profile width",
|
|
260
262
|
"profile_background_color": "Background color",
|
|
261
263
|
"profile_background_color_help": "Color by",
|
|
@@ -392,6 +394,7 @@
|
|
|
392
394
|
"Take measure": "Take measure",
|
|
393
395
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Thanks for your message. If necessary, someone will get in touch with you as soon as possible.",
|
|
394
396
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.",
|
|
397
|
+
"The generated document may contain sensitive data.": "The generated document may contain sensitive data.",
|
|
395
398
|
"The print server is unavailable. Please, try later.": "The print server is unavailable. Please, try later.",
|
|
396
399
|
"theme": "Default theme",
|
|
397
400
|
"Theme selection": "Theme selection",
|
|
@@ -415,6 +418,8 @@
|
|
|
415
418
|
"view_bookmarks": "View bookmarks",
|
|
416
419
|
"visual": "Visual",
|
|
417
420
|
"warn": "Warning",
|
|
421
|
+
"Warning: Private Layers are active": "Warning: Private Layers are active",
|
|
422
|
+
"Warning: This document may contain sensitive data.": "Warning: This document may contain sensitive data.",
|
|
418
423
|
"Web Mercator projection distorts distances and areas": "Web Mercator projection distorts distances and areas",
|
|
419
424
|
"Why are you contacting us?": "Why are you contacting us?",
|
|
420
425
|
"window": "Window",
|
package/assets/i18n/fr.json
CHANGED
|
@@ -245,6 +245,7 @@
|
|
|
245
245
|
"palette_option_spectral": "Spectral",
|
|
246
246
|
"palette_option_viridis": "Viridis",
|
|
247
247
|
"Please log in to edit layers...": "Veuillez vous connecter pour modifier les couches...",
|
|
248
|
+
"Please review or disable them before printing.": "Veuillez les vérifier ou les désactiver avant impression.",
|
|
248
249
|
"plugin_infra3d": "Infra3D",
|
|
249
250
|
"PNG export": "Export PNG",
|
|
250
251
|
"Point": "Point",
|
|
@@ -255,6 +256,7 @@
|
|
|
255
256
|
"Preview": "Aperçu",
|
|
256
257
|
"Print": "Imprimer",
|
|
257
258
|
"print-panel": "Imprimer la carte",
|
|
259
|
+
"Private layers are enabled and will be printed.": "Les couches privées sont activées et seront imprimées.",
|
|
258
260
|
"Profile width": "Largeur du profil",
|
|
259
261
|
"profile_background_color": "Couleur de fond",
|
|
260
262
|
"profile_background_color_help": "Coloration par",
|
|
@@ -390,6 +392,7 @@
|
|
|
390
392
|
"Take measure": "Prendre une mesure",
|
|
391
393
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Merci pour votre message. Si nécessaire, quelqu'un prendra contact avec vous dès que possible.",
|
|
392
394
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Le lien ci-dessous sera envoyé avec votre message. Il contient votre configuration courante et nous aidera à analyser votre demande.",
|
|
395
|
+
"The generated document may contain sensitive data.": "Le document généré peut contenir des données sensibles.",
|
|
393
396
|
"The print server is unavailable. Please, try later.": "Le serveur d'impression est indisponible. Veuillez réessayer plus tard.",
|
|
394
397
|
"theme": "Thème par défaut",
|
|
395
398
|
"Theme selection": "Sélection du thème",
|
|
@@ -413,6 +416,8 @@
|
|
|
413
416
|
"view_bookmarks": "Voir les favoris",
|
|
414
417
|
"visual": "Présentation",
|
|
415
418
|
"warn": "Avertissement",
|
|
419
|
+
"Warning: Private Layers are active": "Attention : Des couches privées sont actives",
|
|
420
|
+
"Warning: This document may contain sensitive data.": "Attention : Ce document peut contenir des données sensibles.",
|
|
416
421
|
"Web Mercator projection distorts distances and areas": "La projection de Mercator déforme les distances et les surfaces",
|
|
417
422
|
"Why are you contacting us?": "Pourquoi nous contactez-vous ?",
|
|
418
423
|
"window": "Fenêtre",
|
package/assets/i18n/it.json
CHANGED
|
@@ -245,6 +245,7 @@
|
|
|
245
245
|
"palette_option_spectral": "Spettrale",
|
|
246
246
|
"palette_option_viridis": "Viridis",
|
|
247
247
|
"Please log in to edit layers...": "Effettua il login per modificare i livelli...",
|
|
248
|
+
"Please review or disable them before printing.": "Si prega di verificarli o disabilitarli prima della stampa.",
|
|
248
249
|
"plugin_infra3d": "Infra3D",
|
|
249
250
|
"PNG export": "Esporta PNG",
|
|
250
251
|
"Point": "Punto",
|
|
@@ -255,6 +256,7 @@
|
|
|
255
256
|
"Preview": "Anteprima",
|
|
256
257
|
"Print": "Stampa",
|
|
257
258
|
"print-panel": "Stampa mappa",
|
|
259
|
+
"Private layers are enabled and will be printed.": "I layer privati sono abilitati e verranno stampati.",
|
|
258
260
|
"Profile width": "Larghezza del profilo",
|
|
259
261
|
"profile_background_color": "Colore di sfondo",
|
|
260
262
|
"profile_background_color_help": "Colore per",
|
|
@@ -390,6 +392,7 @@
|
|
|
390
392
|
"Take measure": "Prendi misura",
|
|
391
393
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Grazie per il tuo messaggio. Se necessario, qualcuno ti contatterà il prima possibile.",
|
|
392
394
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Il seguente link verrà inviato con il tuo messaggio. Contiene la tua configurazione attuale e ci aiuterà a capire il problema.",
|
|
395
|
+
"The generated document may contain sensitive data.": "Il documento generato potrebbe contenere dati sensibili.",
|
|
393
396
|
"The print server is unavailable. Please, try later.": "Il server di stampa non è disponibile. Riprova più tardi.",
|
|
394
397
|
"theme": "Tema predefinito",
|
|
395
398
|
"Theme selection": "Selezione del tema",
|
|
@@ -413,6 +416,8 @@
|
|
|
413
416
|
"view_bookmarks": "Visualizza segnalibri",
|
|
414
417
|
"visual": "Rappresentazione",
|
|
415
418
|
"warn": "Avviso",
|
|
419
|
+
"Warning: Private Layers are active": "Attenzione: I layer privati sono attivi",
|
|
420
|
+
"Warning: This document may contain sensitive data.": "Attenzione: Questo documento potrebbe contenere dati sensibili.",
|
|
416
421
|
"Web Mercator projection distorts distances and areas": "La proiezione Web Mercator distorce le distanze e le aree",
|
|
417
422
|
"Why are you contacting us?": "Perché ci stai contattando?",
|
|
418
423
|
"window": "Finestre",
|
|
@@ -65,7 +65,7 @@ class LRPanelComponent extends GirafeResizableElement {
|
|
|
65
65
|
togglePaths.push(togglePath);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return togglePaths;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Subscribes to changes in togglePaths and shows or hides the component based on the changes.
|
|
@@ -23,13 +23,14 @@ declare class PrintComponent extends GirafeHTMLElement {
|
|
|
23
23
|
private visible;
|
|
24
24
|
private isWithCapabilitiesComponentSetup;
|
|
25
25
|
private hasErrorFetchingCapabilities;
|
|
26
|
-
showCustomScale: boolean;
|
|
27
|
-
attributeNames: string[];
|
|
28
|
-
printFormats: string[];
|
|
29
|
-
layouts: MFPCapabilitiesLayout[];
|
|
30
|
-
selectedLayout?: MFPCapabilitiesLayout;
|
|
31
|
-
scales: number[];
|
|
32
|
-
dpis: number[];
|
|
26
|
+
protected showCustomScale: boolean;
|
|
27
|
+
protected attributeNames: string[];
|
|
28
|
+
protected printFormats: string[];
|
|
29
|
+
protected layouts: MFPCapabilitiesLayout[];
|
|
30
|
+
protected selectedLayout?: MFPCapabilitiesLayout;
|
|
31
|
+
protected scales: number[];
|
|
32
|
+
protected dpis: number[];
|
|
33
|
+
protected hasRestrictedLayers: boolean;
|
|
33
34
|
constructor();
|
|
34
35
|
connectedCallback(): void;
|
|
35
36
|
/**
|
|
@@ -151,6 +152,7 @@ declare class PrintComponent extends GirafeHTMLElement {
|
|
|
151
152
|
* @private
|
|
152
153
|
*/
|
|
153
154
|
private registerEvents;
|
|
155
|
+
private verifyRestrictedLayers;
|
|
154
156
|
/**
|
|
155
157
|
* Set the visibility of the panel.
|
|
156
158
|
* @private
|
|
@@ -5,6 +5,7 @@ import { toDegrees, toRadians } from 'ol/math';
|
|
|
5
5
|
import { unByKeyAll } from '../../tools/utils/olutils';
|
|
6
6
|
import { padNumber } from 'ol/string';
|
|
7
7
|
import GirafeHTMLElement from '../../base/GirafeHTMLElement';
|
|
8
|
+
import Layer from '../../models/layers/layer';
|
|
8
9
|
/** Represents the status of a printing process. */
|
|
9
10
|
var PrintStatus;
|
|
10
11
|
(function (PrintStatus) {
|
|
@@ -23,7 +24,7 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
23
24
|
return uHtml `<style>
|
|
24
25
|
*{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-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}
|
|
25
26
|
</style><style>
|
|
26
|
-
#panel{min-width:20rem;height:100%;overflow:auto}#content{background:var(--bkg-color);color:var(--text-color);margin:0;padding:1.5rem}#content .message{text-align:center;width:100%}#content .message *{margin:.25rem}.option{margin-top:.5rem;display:flex}.option label{width:40%}.option label:after{content:" :"}.option input,.option select,.option textarea{flex-grow:1}.option input.gg-checkbox{flex-grow:0}.rotation{flex-grow:1;gap:.5rem;display:flex}#rotationSlider{width:0}#rotationNumber{flex-grow:0;width:4rem}#content #export-pdf{float:right;margin-top:1rem}#content button{background-color:var(--bkg-color);color:var(--text-color);border:solid 1px var(--text-color);cursor:pointer;border-radius:3px;outline:0}#content button:hover{background-color:var(--bkg-color-grad2)}#content #print-list{margin-top:5rem}#print-list .print-item{border:solid 1px var(--text-color);color:var(--text-color);margin-top:.5rem;padding:.5rem;position:relative}#print-list .print-item .container{text-align:unset;border:none;width:100%;display:inline}#print-list .print-item .cancel{cursor:pointer;color:var(--text-color-grad1);background-color:#0000;border:none;position:absolute;top:.5rem;right:.5rem}.print-item .cancel i:before{content:"uf00d"}.print-item .cancel:hover{border-color:var(--text-color);color:var(--text-color)}.print-item i.status{float:left;text-align:center;width:3rem;margin-right:1rem}.print-item:has(.success):hover{background-color:var(--bkg-color-grad2);cursor:pointer}.print-item i.status:before{line-height:3rem;display:block}.print-item p{line-height:1.3rem}.print-item p.time{margin-right:.5rem;position:absolute;bottom:0;right:0}#custom-scale{color:var(--text-color);flex-flow:wrap;justify-content:flex-start;align-items:center;display:flex}#custom-scale .svg-info{margin-left:.5rem}#custom-scale>div{align-items:center;width:100%;display:flex}.gg-custom-scale{justify-content:flex-end}
|
|
27
|
+
#panel{min-width:20rem;height:100%;overflow:auto}#content{background:var(--bkg-color);color:var(--text-color);margin:0;padding:1.5rem}#content .message{text-align:center;width:100%}#content .message *{margin:.25rem}.option{margin-top:.5rem;display:flex}.option label{width:40%}.option label:after{content:" :"}.option input,.option select,.option textarea{flex-grow:1}.option input.gg-checkbox{flex-grow:0}.rotation{flex-grow:1;gap:.5rem;display:flex}#rotationSlider{width:0}#rotationNumber{flex-grow:0;width:4rem}#content #export-pdf{float:right;margin-top:1rem}#content button{background-color:var(--bkg-color);color:var(--text-color);border:solid 1px var(--text-color);cursor:pointer;border-radius:3px;outline:0}#content button:hover{background-color:var(--bkg-color-grad2)}#content #print-list{margin-top:5rem}#print-list .print-item{border:solid 1px var(--text-color);color:var(--text-color);margin-top:.5rem;padding:.5rem;position:relative}#print-list .print-item .container{text-align:unset;border:none;width:100%;display:inline}#print-list .print-item .cancel{cursor:pointer;color:var(--text-color-grad1);background-color:#0000;border:none;position:absolute;top:.5rem;right:.5rem}.print-item .cancel i:before{content:"uf00d"}.print-item .cancel:hover{border-color:var(--text-color);color:var(--text-color)}.print-item i.status{float:left;text-align:center;width:3rem;margin-right:1rem}.print-item:has(.success):hover{background-color:var(--bkg-color-grad2);cursor:pointer}.print-item i.status:before{line-height:3rem;display:block}.print-item p{line-height:1.3rem}.print-item p.time{margin-right:.5rem;position:absolute;bottom:0;right:0}#custom-scale{color:var(--text-color);flex-flow:wrap;justify-content:flex-start;align-items:center;display:flex}#custom-scale .svg-info{margin-left:.5rem}#custom-scale>div{align-items:center;width:100%;display:flex}.gg-custom-scale{justify-content:flex-end}.warning{border-top:1px solid #333;border-bottom:1px solid #333;margin-top:1rem;margin-bottom:1rem;padding:.5rem}.warning h3{margin:0 0 1rem;font-size:1rem}.warning span{display:block}
|
|
27
28
|
</style>
|
|
28
29
|
<div id="panel"><div id="content"><div class="${this.getRenderState() === 'loading' ? '' : 'hidden'}"><div class="message"><div i18n="Connecting to the print server, please wait."></div><img alt="loading-icon" src="icons/loading.svg" class="gg-spin"></div></div><div class="${this.getRenderState() === 'error' ? '' : 'hidden'}"><div class="message" i18n="The print server is unavailable. Please, try later."></div></div><div class="${this.getRenderState() === 'setup' ? '' : 'hidden'}"><div class="option"><label for="layout" i18n="Layout" class="gg-label">Layout</label> <select id="layout" class="gg-select" onchange="${(evt) => this.onLayoutChanged(evt)}">${this.layouts.map((layout) => uHtml `<option i18n="${layout.name}" ?selected="${this.selectedLayout?.name === layout.name}" value="${layout.name}">${layout.name}</option>`)}</select></div><div class="option gg-custom-scale"><label for="scale" i18n="Scale" class="gg-label">Scale</label> <select id="scale" class="gg-select" onchange="${(evt) => this.onScaleChanged(evt)}">${this.scales.map((scale) => uHtml `<option ?selected="${this.getSelectedScale() === scale}" value="${scale}"><span>1 : </span><span i18n="${scale}" i18nfn="formatNumber">${scale}</span></option>`)}<option i18n="Manual entry" class="${this.context.configManager.Config.print?.customScale === true ? '' : 'hidden'}" value="custom">Manual entry</select></div><div class="${this.showCustomScale === true ? 'option' : 'hidden'}"><div id="custom-scale"><label for="scale" i18n="Custom scale" class="gg-label">Custom scale</label><div><span>1 : </span><input class="gg-input" type="number" min="10" onkeypress="${(evt) => this.onCustomScaleTyped(evt)}"> <span class="svg-info" tip="Press 'Enter' to apply"><img alt="Info" src="icons/info.svg"></span></div></div></div><div class="option"><label for="format" i18n="Format" class="gg-label">Format</label> <select id="format" class="gg-select" onchange="${(evt) => this.onFormatChanged(evt)}">${this.printFormats.map((format) => uHtml `<option ?selected="${this.getSelectedFormat() === format}" value="${format}">${format.toUpperCase()}</option>`)}</select></div>${uHtml `<div class="option"><label for="dpi" class="gg-label">DPI</label> <select id="dpi" class="gg-select" onchange="${(evt) => this.onDpiChanged(evt)}">${this.dpis.map((dpi) => uHtml `<option ?selected="${this.getSelectedDpi() === dpi}" value="${dpi}">${dpi}</option>`)}</select></div>`}<div class="option"><label for="rotationSlider" i18n="Rotation" class="gg-label">Rotation</label><div class="rotation"><input id="rotationSlider" class="gg-range" type="range" min="-180" max="180" step="1" value="${this.getRotation()}" oninput="${(evt) => this.onInputRotationChanged(evt)}"> <input id="rotationNumber" class="gg-input" type="number" min="-180" max="180" step="1" value="${this.getRotation()}" oninput="${(evt) => this.onInputRotationChanged(evt)}"></div></div>${this.attributeNames.map((attrName) => { if (this.getAttributeInputType(attrName) === 'number') {
|
|
29
30
|
return uHtml `<div class="option"><label for="${attrName}" i18n="${this.attrNameForI18n(attrName)}" class="gg-label">${attrName}</label> <input id="${attrName}" type="number" class="gg-input" value="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`;
|
|
@@ -31,7 +32,7 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
31
32
|
return uHtml `<div class="option"><label for="${attrName}" i18n="${this.attrNameForI18n(attrName)}" class="gg-label">${attrName}</label> <input id="${attrName}" type="checkbox" class="gg-checkbox" ?checked="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`;
|
|
32
33
|
} if (this.getAttributeInputType(attrName) === 'textarea') {
|
|
33
34
|
return uHtml `<div class="option"><textarea id="${attrName}" class="gg-textarea" i18n="${this.attrNameForI18n(attrName)}" placeholder="${attrName}">${this.getCapabilitiesAttribute(attrName)?.default}</textarea></div>`;
|
|
34
|
-
} return uHtml `<div class="option"><input id="${this.attrNameForI18n(attrName)}" class="gg-input" i18n="${attrName}" placeholder="${attrName}" value="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`; })} <button id="export-pdf" class="gg-button" onclick="${() => this.print()}" i18n="Print">Print</button><div id="print-list">${this.printList.map((printItem) => uHtml `<div id="${printItem.id}" class="print-item" title="${printItem.elementTitle}"><button class="cancel" tabindex="0" onclick="${() => this.onCancelPrintElementClicked(printItem.id)}"><img alt="close-icon" src="icons/close.svg"></button> <button class="container" tabindex="0" onclick="${() => this.onPrintElementClicked(printItem.id)}"><img alt="loading-icon" src="icons/loading.svg" class="${printItem.status === PrintStatus.Started ? 'gg-spin' : 'hidden'}"> <img alt="loading-icon" src="icons/download.svg" class="${printItem.status === PrintStatus.Success ? '' : 'hidden'}"> <img alt="loading-icon" src="icons/error.svg" class="${printItem.status === PrintStatus.Errored ? '' : 'hidden'}"><p><span i18n="${printItem.selectedLayoutName}">${printItem.selectedLayoutName}</span> <span>(</span><span>${printItem.selectedFormat.toUpperCase()}</span><span>)</span><p class="time">${printItem.time}</button></div>`)}</div></div></div></div>`;
|
|
35
|
+
} return uHtml `<div class="option"><input id="${this.attrNameForI18n(attrName)}" class="gg-input" i18n="${attrName}" placeholder="${attrName}" value="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`; })}<div class="${this.hasRestrictedLayers ? 'warning' : 'hidden'}"><h3 i18n="Warning: Private Layers are active">Warning: Private Layers are active</h3><span i18n="Private layers are enabled and will be printed."></span> <span i18n="The generated document may contain sensitive data."></span> <span i18n="Please review or disable them before printing."></span></div><button id="export-pdf" class="gg-button" onclick="${() => this.print()}" i18n="Print">Print</button><div id="print-list">${this.printList.map((printItem) => uHtml `<div id="${printItem.id}" class="print-item" title="${printItem.elementTitle}"><button class="cancel" tabindex="0" onclick="${() => this.onCancelPrintElementClicked(printItem.id)}"><img alt="close-icon" src="icons/close.svg"></button> <button class="container" tabindex="0" onclick="${() => this.onPrintElementClicked(printItem.id)}"><img alt="loading-icon" src="icons/loading.svg" class="${printItem.status === PrintStatus.Started ? 'gg-spin' : 'hidden'}"> <img alt="loading-icon" src="icons/download.svg" class="${printItem.status === PrintStatus.Success ? '' : 'hidden'}"> <img alt="loading-icon" src="icons/error.svg" class="${printItem.status === PrintStatus.Errored ? '' : 'hidden'}"><p><span i18n="${printItem.selectedLayoutName}">${printItem.selectedLayoutName}</span> <span>(</span><span>${printItem.selectedFormat.toUpperCase()}</span><span>)</span><p class="time">${printItem.time}</button></div>`)}</div></div></div></div>`;
|
|
35
36
|
};
|
|
36
37
|
default_dpi = 96;
|
|
37
38
|
default_scale = 10000;
|
|
@@ -55,6 +56,7 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
55
56
|
selectedLayout;
|
|
56
57
|
scales = [];
|
|
57
58
|
dpis = [];
|
|
59
|
+
hasRestrictedLayers = false;
|
|
58
60
|
constructor() {
|
|
59
61
|
super('print');
|
|
60
62
|
}
|
|
@@ -360,6 +362,14 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
360
362
|
this.render();
|
|
361
363
|
}
|
|
362
364
|
}));
|
|
365
|
+
this.eventsCallbacks.push(this.subscribe(/layers\.layersList\..*\.activeState/, () => {
|
|
366
|
+
this.verifyRestrictedLayers();
|
|
367
|
+
this.render();
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
verifyRestrictedLayers() {
|
|
371
|
+
const allLayers = this.context.layerManager.getFlattenedLayerTree(this.state.layers.layersList);
|
|
372
|
+
this.hasRestrictedLayers = allLayers.find((l) => l instanceof Layer && l.active && l.restricted) !== undefined;
|
|
363
373
|
}
|
|
364
374
|
/**
|
|
365
375
|
* Set the visibility of the panel.
|
|
@@ -367,6 +377,7 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
367
377
|
*/
|
|
368
378
|
async togglePanel(visible) {
|
|
369
379
|
this.visible = visible;
|
|
380
|
+
this.verifyRestrictedLayers();
|
|
370
381
|
this.render();
|
|
371
382
|
}
|
|
372
383
|
/**
|
|
@@ -578,6 +589,14 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
578
589
|
if (this.getCapabilitiesAttribute('datasource')) {
|
|
579
590
|
customAttributes['datasource'] = this.selectedFeaturesToDatasource();
|
|
580
591
|
}
|
|
592
|
+
if (this.hasRestrictedLayers) {
|
|
593
|
+
let comment = '';
|
|
594
|
+
if (customAttributes['comments']) {
|
|
595
|
+
comment = customAttributes['comments'];
|
|
596
|
+
}
|
|
597
|
+
comment += `\n${this.context.i18nManager.getTranslation('Warning: This document may contain sensitive data.')}`;
|
|
598
|
+
customAttributes['comments'] = comment;
|
|
599
|
+
}
|
|
581
600
|
return customAttributes;
|
|
582
601
|
}
|
|
583
602
|
/**
|
|
@@ -5,7 +5,7 @@ import TreeViewGroupElement from '../tools/treeviewgroupelement';
|
|
|
5
5
|
class TreeViewGroupComponent extends TreeViewGroupElement {
|
|
6
6
|
template = () => {
|
|
7
7
|
return uHtml `<style>
|
|
8
|
-
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-
|
|
8
|
+
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
|
|
9
9
|
</style><style>
|
|
10
10
|
*{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-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}
|
|
11
11
|
</style>
|
|
@@ -10,11 +10,11 @@ import WmsLegendHelper from '../../../tools/wms/wmslegendhelper';
|
|
|
10
10
|
class TreeViewItemComponent extends TreeViewElement {
|
|
11
11
|
template = () => {
|
|
12
12
|
return uHtml `<style>
|
|
13
|
-
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-
|
|
13
|
+
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
|
|
14
14
|
</style><style>
|
|
15
15
|
*{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-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}
|
|
16
16
|
</style>
|
|
17
|
-
<link rel="stylesheet" href="lib/tippy.js/tippy.css"><link rel="stylesheet" href="lib/tippy.js/backdrop.css"><link rel="stylesheet" href="lib/tippy.js/border.css"><link rel="stylesheet" href="lib/tippy.js/svg-arrow.css"><div id="container"><header><img class="${this.layer.
|
|
17
|
+
<link rel="stylesheet" href="lib/tippy.js/tippy.css"><link rel="stylesheet" href="lib/tippy.js/backdrop.css"><link rel="stylesheet" href="lib/tippy.js/border.css"><link rel="stylesheet" href="lib/tippy.js/svg-arrow.css"><div id="container"><header><div class="gg-spacer gg-small"><img class="${this.layer.restricted ? 'gg-small gg-lock gg-opacity' : 'hidden'}" alt="Protected layer" src="icons/protected.svg"></div><button class="${this.layer.active ? 'gg-icon-button gg-small gg-selected' : 'gg-icon-button gg-small gg-opacity'}" tip="Activate / Deactivate" onclick="${() => this.toggle()}"><img class="${this.layer.active ? 'gg-checkbox' : 'hidden'}" alt="Expand/Collapse button" src="icons/checked-full.svg"> <img class="${!this.layer.active ? 'gg-checkbox' : 'hidden'}" alt="Expand/Collapse button" src="icons/checked-no.svg"></button> <button class="${this.layer.hasError ? 'gg-icon-button gg-small gg-opacity' : 'hidden'}" tip="Error on layer"><img alt="Error on layer" src="icons/error.svg"></button><div class="${this.isVisibleInCurrentResolution() ? 'label-container' : 'label-container label-out-resolution'}"><button class="${this.layer.active ? 'gg-icon-button gg-small gg-selected' : 'gg-icon-button gg-small gg-opacity'}" onclick="${() => this.toggle()}"><span i18n="${this.layer.name}" class="gg-tree-label">${this.layer.name}</span></button> <button class="${this.layer.active && this.layer instanceof LayerWms && !this.isVisibleInCurrentResolution() ? 'gg-icon-button gg-small resolution-tool' : 'hidden'}" tip="Zoom to visible resolution" onclick="${() => this.zoomToVisibleResolution()}"><img alt="Zoom to visible resolution" src="icons/zoom.svg"></button> <img class="${this.layer.active && this.iconUrl ? 'legend-icon' : 'hidden'}" alt="${'Icon for ' + this.layer.name}" src="${this.iconUrl}" crossorigin="${this.getCrossOrigin(this.iconUrl)}"></div><button class="${this.layer.active && this.layer instanceof LayerLocalFile ? 'gg-icon-button gg-small gg-opacity tool' : 'hidden'}" tip="Zoom to full extent" onclick="${() => this.zoomToFullExtent()}"><img alt="Zoom to full extent" src="icons/zoom.svg"></button> <button class="${this.getButtonClass('swipedLeft')}" tip="Swipe layer to the left" onclick="${() => this.layer.swiped = (this.layer.swiped === 'left') ? 'no' : 'left'}"><img alt="Swipe layer to the left" src="icons/swipe-left.svg"></button> <button class="${this.getButtonClass('swipedRight')}" tip="Swipe layer to the right" onclick="${() => this.layer.swiped = (this.layer.swiped === 'right') ? 'no' : 'right'}"><img alt="Swipe layer to the right" src="icons/swipe-right.svg"></button> <button id="opacity" class="${this.getButtonClass('opacity')}" tip="Control opacity"><img alt="Control opacity" src="icons/opacity.svg"></button> <button id="filter" class="${this.getButtonClass('filter')}" tip="Filter layer"><img alt="Filter layer" src="icons/filter.svg"></button> <button id="timeRestriction" class="${this.getButtonClass('timeRestriction')}" tip="Define time restriction on layer"><img alt="Define time restriction on layer" src="icons/clock.svg"></button> <button class="${this.getButtonClass('snappable')}" onclick="${() => this.toggleSnap()}" tip="Snap to layer features"><img alt="Enable snapping" src="icons/snapping.svg"></button> <button class="${this.hasLegend ? (this.layer.isLegendExpanded ? 'gg-icon-button gg-small tool' : 'gg-icon-button gg-small gg-opacity tool') : 'hidden'}" tip="Toggle legend" onclick="${() => this.toggleLegend()}"><img alt="Toggle legend" src="icons/legend.svg" loading="lazy"></button> <button class="${this.layer.hasMetadata ? 'metadata gg-icon-button gg-small gg-opacity tool' : 'hidden'}" onclick="${() => this.showMetadata()}"><img alt="Metadata" src="icons/info.svg"></button> <button id="drag-button" class="gg-icon-button gg-small gg-grab gg-opacity tool" tip="Move"><img alt="Move layer" src="icons/drag.svg"></button> ${this.layer.isRemovable ? uHtml ` <button class="remove gg-icon-button gg-small gg-opacity tool" tip="Remove layer" onclick="${() => this.deleteLayer()}"><img alt="Remove layer" src="icons/trash.svg"></button> ` : ``}</header>${Object.keys(this.legendUrls).map((l) => uHtml `<div class="${this.isLegendExpanded ? 'legend' : 'hidden'}"><div class="gg-spacer gg-small"></div><img alt="${'Legend for ' + l}" src="${this.legendUrls[l]}" loading="lazy" crossorigin="${this.getCrossOrigin(this.legendUrls[l])}"></div>`)}<div class="${this.layer instanceof LayerLocalFile && this.isLegendExpanded ? 'legend-file' : 'legend-file hidden'}"><div class="gg-spacer gg-small"></div><div class="gg-spacer gg-small"></div><div><span i18n="File from">File from</span> <span>${this.layer.lastModifiedDate}</span> <span>[</span> <span>${this.layer._features?.length}</span> <span i18n="features">features</span> <span>]</span></div></div></div>`;
|
|
18
18
|
};
|
|
19
19
|
iconUrl = null;
|
|
20
20
|
legendUrls = {};
|
|
@@ -10,7 +10,7 @@ class TreeViewThemeComponent extends TreeViewGroupElement {
|
|
|
10
10
|
return uHtml `<style>
|
|
11
11
|
*{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-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}
|
|
12
12
|
</style><style>
|
|
13
|
-
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-
|
|
13
|
+
header{border-top:1px solid #ddd;align-items:center;height:2rem;display:flex}.tool{display:none!important}header:hover .tool{display:flex!important}.tool.active{order:100;opacity:1!important;display:flex!important}.label-container{flex-grow:1;align-items:center;display:flex;overflow:auto}.label-out-resolution span{font-style:italic}.resolution-tool{margin-left:.5rem}.legend{display:flex}.legend img{background:var(--svg-legend-bkg);height:fit-content;filter:var(--svg-map-filter)}.legend-icon{background:var(--svg-legend-bkg);max-height:1.5rem;filter:var(--svg-map-filter);margin-left:.5rem}.children{flex-basis:100%;order:10;padding-left:1.3rem}.dragAfter{border-bottom:1rem dashed #ccc}.dragBefore{border-top:1rem dashed #ccc}.gg-checkbox{width:1.2rem}.gg-caret,.gg-spacer{text-align:center;width:1.5rem;padding:0}.gg-caret{transform:scale(1.3)}.gg-caret.gg-rotate90{transform:scale(1.3)rotate(90deg)}.gg-small.gg-lock{min-width:1rem}.gg-tree-label{text-align:left;white-space:nowrap;text-overflow:ellipsis;padding-left:0;overflow:hidden}.gg-grab:hover{cursor:grab}.gg-selected{opacity:1}.legend-file{color:var(--text-color);font-style:italic;display:flex}
|
|
14
14
|
</style><style>
|
|
15
15
|
header{border:none;flex-direction:row-reverse;margin-top:.5rem;margin-bottom:.5rem;position:relative}.theme-button{font-size:1.2rem;font-weight:600}.theme-button span{margin-left:.5rem}.theme-button:hover{cursor:default;background-color:#0000;border:none}.children{padding-left:.5rem}.children:first-child{border:none}.label-container{position:absolute;inset:0}.label-container button{text-align:center;flex-grow:1}.tool{z-index:1}
|
|
16
16
|
</style>
|
package/models/gmf.d.ts
CHANGED
package/models/layers/layer.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type LayerOptions = {
|
|
|
6
6
|
disclaimer?: string;
|
|
7
7
|
metadataUrl?: string;
|
|
8
8
|
opacity?: number;
|
|
9
|
-
|
|
9
|
+
restricted?: boolean;
|
|
10
10
|
};
|
|
11
11
|
declare abstract class Layer extends BaseLayer {
|
|
12
12
|
/**
|
|
@@ -18,7 +18,7 @@ declare abstract class Layer extends BaseLayer {
|
|
|
18
18
|
*/
|
|
19
19
|
activeState: 'on' | 'off';
|
|
20
20
|
opacity: number;
|
|
21
|
-
|
|
21
|
+
restricted: boolean;
|
|
22
22
|
swiped: 'left' | 'right' | 'no';
|
|
23
23
|
isLegendExpanded: boolean;
|
|
24
24
|
parent: ThemeLayer | GroupLayer;
|
package/models/layers/layer.js
CHANGED
|
@@ -9,13 +9,13 @@ class Layer extends BaseLayer {
|
|
|
9
9
|
*/
|
|
10
10
|
activeState = 'off';
|
|
11
11
|
opacity;
|
|
12
|
-
|
|
12
|
+
restricted;
|
|
13
13
|
swiped = 'no';
|
|
14
14
|
isLegendExpanded = false;
|
|
15
15
|
constructor(id, name, order, options) {
|
|
16
16
|
super(id, name, order, options);
|
|
17
17
|
this.opacity = options?.opacity ?? 1;
|
|
18
|
-
this.
|
|
18
|
+
this.restricted = options?.restricted ?? false;
|
|
19
19
|
}
|
|
20
20
|
get isTransparent() {
|
|
21
21
|
return this.opacity !== 1;
|
|
@@ -20,7 +20,7 @@ class LayerCog extends Layer {
|
|
|
20
20
|
metadataUrl: this.metadataUrl,
|
|
21
21
|
disclaimer: this.disclaimer,
|
|
22
22
|
opacity: this.opacity,
|
|
23
|
-
|
|
23
|
+
restricted: this.restricted
|
|
24
24
|
};
|
|
25
25
|
const clonedObject = new LayerCog(this.id, this.name, this.order, this.source, options);
|
|
26
26
|
clonedObject.activeState = this.activeState;
|
|
@@ -35,7 +35,7 @@ class LayerCog extends Layer {
|
|
|
35
35
|
metadataUrl: options.metadata?.metadataUrl,
|
|
36
36
|
disclaimer: options.metadata?.disclaimer,
|
|
37
37
|
opacity: options.metadata?.opacity,
|
|
38
|
-
|
|
38
|
+
restricted: options.public === undefined ? (options.metadata?.protected ?? false) : !options.public
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -23,7 +23,7 @@ class LayerVectorTiles extends Layer {
|
|
|
23
23
|
metadataUrl: this.metadataUrl,
|
|
24
24
|
disclaimer: this.disclaimer,
|
|
25
25
|
opacity: this.opacity,
|
|
26
|
-
|
|
26
|
+
restricted: this.restricted
|
|
27
27
|
};
|
|
28
28
|
const clonedObject = new LayerVectorTiles(this.id, this.name, this.order, this.style, this.source, options);
|
|
29
29
|
clonedObject.activeState = this.activeState;
|
|
@@ -72,7 +72,7 @@ class LayerWms extends Layer {
|
|
|
72
72
|
metadataUrl: this.metadataUrl,
|
|
73
73
|
disclaimer: this.disclaimer,
|
|
74
74
|
opacity: this.opacity,
|
|
75
|
-
|
|
75
|
+
restricted: this.restricted,
|
|
76
76
|
minResolution: this.minResolution,
|
|
77
77
|
maxResolution: this.maxResolution,
|
|
78
78
|
layers: this.layers,
|
|
@@ -149,7 +149,7 @@ class LayerWms extends Layer {
|
|
|
149
149
|
metadataUrl: options.metadata?.metadataUrl,
|
|
150
150
|
disclaimer: options.metadata?.disclaimer,
|
|
151
151
|
opacity: options.metadata?.opacity,
|
|
152
|
-
|
|
152
|
+
restricted: options.public === undefined ? (options.metadata?.protected ?? false) : !options.public,
|
|
153
153
|
minResolution: options.minResolutionHint,
|
|
154
154
|
maxResolution: options.maxResolutionHint,
|
|
155
155
|
layers: options.layers,
|
|
@@ -54,7 +54,7 @@ class LayerWmts extends Layer {
|
|
|
54
54
|
metadataUrl: this.metadataUrl,
|
|
55
55
|
disclaimer: this.disclaimer,
|
|
56
56
|
opacity: this.opacity,
|
|
57
|
-
|
|
57
|
+
restricted: this.restricted,
|
|
58
58
|
dimensions: this.dimensions,
|
|
59
59
|
imageType: this.imageType,
|
|
60
60
|
style: this.style,
|
|
@@ -97,7 +97,7 @@ class LayerWmts extends Layer {
|
|
|
97
97
|
metadataUrl: options.metadata?.metadataUrl,
|
|
98
98
|
disclaimer: options.metadata?.disclaimer,
|
|
99
99
|
opacity: options.metadata?.opacity,
|
|
100
|
-
|
|
100
|
+
restricted: options.public === undefined ? (options.metadata?.protected ?? false) : !options.public,
|
|
101
101
|
dimensions: options.dimensions,
|
|
102
102
|
imageType: options.imageType,
|
|
103
103
|
style: options.style,
|
|
@@ -20,7 +20,7 @@ class LayerXYZ extends Layer {
|
|
|
20
20
|
metadataUrl: this.metadataUrl,
|
|
21
21
|
disclaimer: this.disclaimer,
|
|
22
22
|
opacity: this.opacity,
|
|
23
|
-
|
|
23
|
+
restricted: this.restricted
|
|
24
24
|
};
|
|
25
25
|
const clonedObject = new LayerXYZ(this.id, this.name, this.order, this.source, options);
|
|
26
26
|
clonedObject.activeState = this.activeState;
|
|
@@ -35,7 +35,7 @@ class LayerXYZ extends Layer {
|
|
|
35
35
|
metadataUrl: options.metadata?.metadataUrl,
|
|
36
36
|
disclaimer: options.metadata?.disclaimer,
|
|
37
37
|
opacity: options.metadata?.opacity,
|
|
38
|
-
|
|
38
|
+
restricted: options.public === undefined ? (options.metadata?.protected ?? false) : !options.public
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.2188794150", "build":"2188794150", "date":"01/12/2025"}
|
|
@@ -6,9 +6,9 @@ import StateManager from '../state/statemanager';
|
|
|
6
6
|
* then activities one will deactivate the others.
|
|
7
7
|
*/
|
|
8
8
|
export default class StateToggleManager {
|
|
9
|
-
private stateManager;
|
|
10
9
|
private readonly eventsCallbacks;
|
|
11
10
|
private togglePaths;
|
|
11
|
+
private readonly stateManager;
|
|
12
12
|
constructor(togglePaths: string[], stateManager: StateManager);
|
|
13
13
|
get state(): State;
|
|
14
14
|
/**
|
|
@@ -35,10 +35,4 @@ export default class StateToggleManager {
|
|
|
35
35
|
* @private
|
|
36
36
|
**/
|
|
37
37
|
private watchToggle;
|
|
38
|
-
/**
|
|
39
|
-
* Filters out invalid toggle paths from the given array of paths.
|
|
40
|
-
* Invalid path are path not leading to object in the state, or not leading to boolean value.
|
|
41
|
-
* @static
|
|
42
|
-
*/
|
|
43
|
-
static filterValidTogglePaths(stateManager: StateManager, paths: string[]): string[];
|
|
44
38
|
}
|
|
@@ -5,12 +5,12 @@ import { getPropertyByPath, setPropertyByPath } from '../utils/pathUtils';
|
|
|
5
5
|
* then activities one will deactivate the others.
|
|
6
6
|
*/
|
|
7
7
|
export default class StateToggleManager {
|
|
8
|
-
stateManager;
|
|
9
8
|
eventsCallbacks = [];
|
|
10
9
|
togglePaths;
|
|
10
|
+
stateManager;
|
|
11
11
|
constructor(togglePaths, stateManager) {
|
|
12
|
+
this.togglePaths = togglePaths;
|
|
12
13
|
this.stateManager = stateManager;
|
|
13
|
-
this.togglePaths = StateToggleManager.filterValidTogglePaths(this.stateManager, togglePaths);
|
|
14
14
|
this.initToggle();
|
|
15
15
|
this.watchToggle();
|
|
16
16
|
}
|
|
@@ -75,19 +75,4 @@ export default class StateToggleManager {
|
|
|
75
75
|
}));
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Filters out invalid toggle paths from the given array of paths.
|
|
80
|
-
* Invalid path are path not leading to object in the state, or not leading to boolean value.
|
|
81
|
-
* @static
|
|
82
|
-
*/
|
|
83
|
-
static filterValidTogglePaths(stateManager, paths) {
|
|
84
|
-
return paths.filter((path) => {
|
|
85
|
-
const result = getPropertyByPath(stateManager.state, path);
|
|
86
|
-
if (result.found && (result.object === true || result.object === false)) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
console.warn(`Configured state toggle path "${path}" doesn't lead to a boolean property. Skip it.`);
|
|
90
|
-
return false;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
78
|
}
|
|
@@ -55,9 +55,4 @@ describe('StateToggleManager class', () => {
|
|
|
55
55
|
expect(state.interface.sharePanelVisible).toBeFalsy();
|
|
56
56
|
expect(state.interface.userPreferencesPanelVisible).toBeFalsy();
|
|
57
57
|
});
|
|
58
|
-
it('filterValidTogglePaths', () => {
|
|
59
|
-
const filteredPaths = StateToggleManager.filterValidTogglePaths(stateManager, paths);
|
|
60
|
-
expect(filteredPaths).not.toContain(paths[3]);
|
|
61
|
-
expect(filteredPaths.length).toEqual(5);
|
|
62
|
-
});
|
|
63
58
|
});
|