| 
									
										
										
										
											2023-06-22 00:27:27 +00:00
										 |  |  | import {LitElement, html, unsafeHTML} from './lit-all.min.js'; | 
					
						
							| 
									
										
										
										
											2025-10-22 19:39:20 -04:00
										 |  |  | import {styles, generate_theme} from './tf-styles.js'; | 
					
						
							| 
									
										
										
										
											2023-06-22 00:27:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class TfTagElement extends LitElement { | 
					
						
							|  |  |  | 	static get properties() { | 
					
						
							|  |  |  | 		return { | 
					
						
							|  |  |  | 			tag: {type: String}, | 
					
						
							|  |  |  | 			count: {type: Number}, | 
					
						
							|  |  |  | 		}; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	static styles = styles; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	constructor() { | 
					
						
							|  |  |  | 		super(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	render() { | 
					
						
							|  |  |  | 		let number = this.count ? html` (${this.count})` : undefined; | 
					
						
							| 
									
										
										
										
											2025-10-22 19:39:20 -04:00
										 |  |  | 		return html`
 | 
					
						
							|  |  |  | 			<style> | 
					
						
							|  |  |  | 				${generate_theme()}</style | 
					
						
							|  |  |  | 			><a | 
					
						
							|  |  |  | 				href=${'#' + encodeURIComponent(this.tag)} | 
					
						
							|  |  |  | 				class="w3-tag w3-theme-d1 w3-round-4 w3-button" | 
					
						
							|  |  |  | 				>${this.tag}${number}</a | 
					
						
							|  |  |  | 			> | 
					
						
							|  |  |  | 		`;
 | 
					
						
							| 
									
										
										
										
											2023-06-22 00:27:27 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-24 11:09:34 -05:00
										 |  |  | customElements.define('tf-tag', TfTagElement); |