| 
									
										
										
										
											2023-05-07 02:26:30 +02:00
										 |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2023-12-19 22:08:00 +01:00
										 |  |  |   import type { Feature } from "geojson" | 
					
						
							| 
									
										
										
										
											2024-11-25 23:44:26 +01:00
										 |  |  |   import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource" | 
					
						
							| 
									
										
										
										
											2023-12-19 22:08:00 +01:00
										 |  |  |   import LayerConfig from "../../Models/ThemeConfig/LayerConfig" | 
					
						
							|  |  |  |   import type { SpecialVisualizationState } from "../SpecialVisualization" | 
					
						
							|  |  |  |   import TagRenderingAnswer from "../Popup/TagRendering/TagRenderingAnswer.svelte" | 
					
						
							|  |  |  |   import Translations from "../i18n/Translations" | 
					
						
							|  |  |  |   import Tr from "../Base/Tr.svelte" | 
					
						
							| 
									
										
										
										
											2024-09-02 00:26:02 +02:00
										 |  |  |   import { CloseButton } from "flowbite-svelte" | 
					
						
							| 
									
										
										
										
											2023-05-07 02:26:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-19 22:08:00 +01:00
										 |  |  |   export let state: SpecialVisualizationState | 
					
						
							|  |  |  |   export let layer: LayerConfig | 
					
						
							|  |  |  |   export let selectedElement: Feature | 
					
						
							| 
									
										
										
										
											2024-11-25 23:44:26 +01:00
										 |  |  |   let tags: UIEventSource<Record<string, string>> = state?.featureProperties?.getStore( | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |     selectedElement.properties.id | 
					
						
							| 
									
										
										
										
											2023-12-19 22:08:00 +01:00
										 |  |  |   ) | 
					
						
							| 
									
										
										
										
											2023-12-06 17:27:30 +01:00
										 |  |  |   $: { | 
					
						
							| 
									
										
										
										
											2024-11-25 23:44:26 +01:00
										 |  |  |     tags = state?.featureProperties?.getStore(selectedElement.properties.id) | 
					
						
							| 
									
										
										
										
											2023-12-06 17:27:30 +01:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-05-07 02:26:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-04 13:47:00 +01:00
										 |  |  |   let isTesting = state.featureSwitchIsTesting | 
					
						
							|  |  |  |   let isDebugging = state.featureSwitches.featureSwitchIsDebugging | 
					
						
							| 
									
										
										
										
											2024-03-11 16:00:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-19 22:08:00 +01:00
										 |  |  |   let metatags: Store<Record<string, string>> = state.userRelatedState.preferencesAsTags | 
					
						
							| 
									
										
										
										
											2023-05-07 02:26:30 +02:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-11 16:00:22 +01:00
										 |  |  | <div class="low-interaction flex border-b-2 border-black px-3 drop-shadow-md"> | 
					
						
							|  |  |  |   <div class="h-fit w-full overflow-auto sm:p-2" style="max-height: 20vh;"> | 
					
						
							|  |  |  |     {#if $tags._deleted === "yes"} | 
					
						
							|  |  |  |       <h3 class="p-4"> | 
					
						
							|  |  |  |         <Tr t={Translations.t.delete.deletedTitle} /> | 
					
						
							|  |  |  |       </h3> | 
					
						
							|  |  |  |     {:else} | 
					
						
							| 
									
										
										
										
											2024-02-20 13:33:38 +01:00
										 |  |  |       <div class="flex h-full w-full flex-grow flex-col"> | 
					
						
							| 
									
										
										
										
											2024-01-10 12:24:44 +01:00
										 |  |  |         <!-- Title element and  title icons--> | 
					
						
							|  |  |  |         <h3 class="m-0"> | 
					
						
							|  |  |  |           <a href={`#${$tags.id}`}> | 
					
						
							|  |  |  |             <TagRenderingAnswer config={layer.title} {selectedElement} {state} {tags} {layer} /> | 
					
						
							|  |  |  |           </a> | 
					
						
							|  |  |  |         </h3> | 
					
						
							|  |  |  |         <div | 
					
						
							| 
									
										
										
										
											2024-01-22 14:19:22 +01:00
										 |  |  |           class="no-weblate title-icons links-as-button mr-2 flex flex-row flex-wrap items-center gap-x-0.5 pt-0.5 sm:pt-1" | 
					
						
							| 
									
										
										
										
											2024-01-10 12:24:44 +01:00
										 |  |  |         > | 
					
						
							|  |  |  |           {#each layer.titleIcons as titleIconConfig} | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |             {#if (titleIconConfig.condition?.matchesProperties($tags) ?? true) && (titleIconConfig.metacondition?.matchesProperties( { ...$metatags, ...$tags } ) ?? true) && titleIconConfig.IsKnown($tags)} | 
					
						
							| 
									
										
										
										
											2024-01-10 12:24:44 +01:00
										 |  |  |               <div class={titleIconConfig.renderIconClass ?? "flex h-8 w-8 items-center"}> | 
					
						
							|  |  |  |                 <TagRenderingAnswer | 
					
						
							|  |  |  |                   config={titleIconConfig} | 
					
						
							|  |  |  |                   {tags} | 
					
						
							|  |  |  |                   {selectedElement} | 
					
						
							|  |  |  |                   {state} | 
					
						
							|  |  |  |                   {layer} | 
					
						
							|  |  |  |                   extraClasses="h-full justify-center" | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             {/if} | 
					
						
							|  |  |  |           {/each} | 
					
						
							| 
									
										
										
										
											2024-03-04 13:47:00 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |           {#if $isTesting || $isDebugging} | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |             <a | 
					
						
							|  |  |  |               class="subtle" | 
					
						
							| 
									
										
										
										
											2025-04-07 19:10:11 +02:00
										 |  |  |               href="https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/Docs/Layers/{layer.id}.md" | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |               target="_blank" | 
					
						
							|  |  |  |               rel="noreferrer noopener " | 
					
						
							|  |  |  |             > | 
					
						
							|  |  |  |               {layer.id} | 
					
						
							|  |  |  |             </a> | 
					
						
							| 
									
										
										
										
											2024-03-04 13:47:00 +01:00
										 |  |  |           {/if} | 
					
						
							| 
									
										
										
										
											2024-01-10 12:24:44 +01:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2023-06-14 20:39:36 +02:00
										 |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2024-03-11 16:00:22 +01:00
										 |  |  |     {/if} | 
					
						
							| 
									
										
										
										
											2023-06-14 20:39:36 +02:00
										 |  |  |   </div> | 
					
						
							| 
									
										
										
										
											2024-04-12 15:03:45 +02:00
										 |  |  |   <slot name="close-button"> | 
					
						
							| 
									
										
										
										
											2024-09-02 00:26:02 +02:00
										 |  |  |     <div class="mt-4"> | 
					
						
							| 
									
										
										
										
											2024-09-02 12:48:15 +02:00
										 |  |  |       <CloseButton on:click={() => state.selectedElement.setData(undefined)} /> | 
					
						
							| 
									
										
										
										
											2024-09-02 00:26:02 +02:00
										 |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2024-04-12 15:03:45 +02:00
										 |  |  |   </slot> | 
					
						
							| 
									
										
										
										
											2024-03-11 16:00:22 +01:00
										 |  |  | </div> | 
					
						
							| 
									
										
										
										
											2023-05-11 17:29:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |   :global(.title-icons a) { | 
					
						
							|  |  |  |     display: block !important; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-05-11 17:29:25 +02:00
										 |  |  | </style> |