| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |     import type {Feature} from "geojson"; | 
					
						
							|  |  |  |     import {UIEventSource} from "../../Logic/UIEventSource"; | 
					
						
							|  |  |  |     import LayerConfig from "../../Models/ThemeConfig/LayerConfig"; | 
					
						
							|  |  |  |     import type {SpecialVisualizationState} from "../SpecialVisualization"; | 
					
						
							|  |  |  |     import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte"; | 
					
						
							|  |  |  |     import {onDestroy} from "svelte"; | 
					
						
							|  |  |  |     import Translations from "../i18n/Translations"; | 
					
						
							|  |  |  |     import Tr from "../Base/Tr.svelte"; | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |     export let state: SpecialVisualizationState; | 
					
						
							|  |  |  |     export let layer: LayerConfig; | 
					
						
							|  |  |  |     export let selectedElement: Feature; | 
					
						
							|  |  |  |     export let tags: UIEventSource<Record<string, string>>; | 
					
						
							|  |  |  |     export let highlightedRendering: UIEventSource<string> = undefined; | 
					
						
							| 
									
										
										
										
											2023-04-07 02:13:57 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |     let _tags: Record<string, string>; | 
					
						
							|  |  |  |     onDestroy(tags.addCallbackAndRun(tags => { | 
					
						
							|  |  |  |         _tags = tags; | 
					
						
							|  |  |  |     })); | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |     let _metatags: Record<string, string>; | 
					
						
							|  |  |  |     onDestroy(state.userRelatedState.preferencesAsTags.addCallbackAndRun(tags => { | 
					
						
							|  |  |  |         _metatags = tags; | 
					
						
							|  |  |  |     })); | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | {#if _tags._deleted === "yes"} | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |     <Tr t={ Translations.t.delete.isDeleted}/> | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | {:else} | 
					
						
							| 
									
										
										
										
											2023-05-11 17:29:25 +02:00
										 |  |  |         <div class="flex flex-col overflow-y-auto p-1 px-2 gap-y-2"> | 
					
						
							| 
									
										
										
										
											2023-05-06 01:23:55 +02:00
										 |  |  |             {#each layer.tagRenderings as config (config.id)} | 
					
						
							|  |  |  |                 {#if (config.condition === undefined || config.condition.matchesProperties(_tags)) && (config.metacondition === undefined || config.metacondition.matchesProperties({..._tags, ..._metatags}))} | 
					
						
							|  |  |  |                     {#if config.IsKnown(_tags)} | 
					
						
							|  |  |  |                         <TagRenderingEditable {tags} {config} {state} {selectedElement} {layer} | 
					
						
							|  |  |  |                                               {highlightedRendering}></TagRenderingEditable> | 
					
						
							|  |  |  |                     {/if} | 
					
						
							|  |  |  |                 {/if} | 
					
						
							|  |  |  |             {/each} | 
					
						
							|  |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | {/if} |