| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | import { demoFunc } from './dees-simple-appdash.demo.js'; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | import { | 
					
						
							|  |  |  |   customElement, | 
					
						
							|  |  |  |   html, | 
					
						
							|  |  |  |   DeesElement, | 
					
						
							|  |  |  |   property, | 
					
						
							|  |  |  |   type TemplateResult, | 
					
						
							|  |  |  |   cssManager, | 
					
						
							|  |  |  |   css, | 
					
						
							|  |  |  |   unsafeCSS, | 
					
						
							|  |  |  |   type CSSResult, | 
					
						
							|  |  |  |   state, | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |   domtools, | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | } from '@design.estate/dees-element'; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  | import './dees-icon.js'; | 
					
						
							|  |  |  | import type { DeesTerminal } from './dees-terminal.js'; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | declare global { | 
					
						
							|  |  |  |   interface HTMLElementTagNameMap { | 
					
						
							|  |  |  |     'dees-simple-appdash': DeesSimpleAppDash; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  | export interface IView { | 
					
						
							|  |  |  |   name: string; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |   iconName?: string; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |   element: DeesElement['constructor']['prototype']; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | @customElement('dees-simple-appdash') | 
					
						
							|  |  |  | export class DeesSimpleAppDash extends DeesElement { | 
					
						
							|  |  |  |   // STATIC
 | 
					
						
							|  |  |  |   public static demo = demoFunc; | 
					
						
							|  |  |  |   // INSTANCE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   @property() | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |   public name: string = 'Application Dashboard'; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |   @property({ type: Array }) | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |   public viewTabs: IView[] = []; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |    | 
					
						
							|  |  |  |   @property({ type: String }) | 
					
						
							|  |  |  |   public terminalSetupCommand: string = `echo "Terminal ready"`; | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |   @state() | 
					
						
							|  |  |  |   private selectedView: IView; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |   public static styles = [ | 
					
						
							|  |  |  |     cssManager.defaultStyles, | 
					
						
							|  |  |  |     css`
 | 
					
						
							|  |  |  |       :host { | 
					
						
							| 
									
										
										
										
											2024-01-22 01:26:13 +01:00
										 |  |  |         color: ${cssManager.bdTheme('#333', '#ccc')}; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |         user-select: none; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:25:55 +01:00
										 |  |  |         display: block; | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |         overflow: hidden; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:25:55 +01:00
										 |  |  |         position: relative; | 
					
						
							|  |  |  |         height: 100%; | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |         width: 100%; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |       .maincontainer { | 
					
						
							|  |  |  |         position: absolute; | 
					
						
							|  |  |  |         top: 0px; | 
					
						
							|  |  |  |         left: 0px; | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |         right: 0px; | 
					
						
							|  |  |  |         bottom: 0px; | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |         overflow: hidden; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |       .appbar { | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |         position: absolute; | 
					
						
							|  |  |  |         top: 0px; | 
					
						
							|  |  |  |         left: 0px; | 
					
						
							| 
									
										
										
										
											2024-09-02 22:07:42 +02:00
										 |  |  |         height: calc(100% - 24px); | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         width: 240px; | 
					
						
							|  |  |  |         background: ${cssManager.bdTheme('#fafafa', '#000')}; | 
					
						
							|  |  |  |         border-right: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')}; | 
					
						
							|  |  |  |         font-size: 12px; | 
					
						
							| 
									
										
										
										
											2024-06-30 10:37:12 +02:00
										 |  |  |         font-family: 'Geist Sans', sans-serif; | 
					
						
							| 
									
										
										
										
											2024-01-22 01:11:28 +01:00
										 |  |  |         z-index: 2; | 
					
						
							|  |  |  |         display: grid; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         grid-template-rows: auto min-content; | 
					
						
							|  |  |  |         overflow: hidden; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       .sidebar-header { | 
					
						
							|  |  |  |         padding: 16px 12px; | 
					
						
							|  |  |  |         border-bottom: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')}; | 
					
						
							|  |  |  |         display: flex; | 
					
						
							|  |  |  |         align-items: center; | 
					
						
							|  |  |  |         gap: 8px; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .appName { | 
					
						
							|  |  |  |         font-size: 14px; | 
					
						
							|  |  |  |         font-weight: 600; | 
					
						
							|  |  |  |         color: ${cssManager.bdTheme('#000', '#fff')}; | 
					
						
							|  |  |  |         white-space: nowrap; | 
					
						
							|  |  |  |         overflow: hidden; | 
					
						
							|  |  |  |         text-overflow: ellipsis; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .viewTabs-container { | 
					
						
							|  |  |  |         flex: 1; | 
					
						
							|  |  |  |         overflow-y: auto; | 
					
						
							|  |  |  |         padding: 4px 0; | 
					
						
							| 
									
										
										
										
											2024-01-22 01:26:13 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |       .viewTabs { | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |         display: flex; | 
					
						
							| 
									
										
										
										
											2024-09-02 22:07:42 +02:00
										 |  |  |         flex-direction: column; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       .viewTab { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         display: flex; | 
					
						
							|  |  |  |         align-items: center; | 
					
						
							|  |  |  |         gap: 8px; | 
					
						
							|  |  |  |         padding: 8px 12px; | 
					
						
							|  |  |  |         cursor: default; | 
					
						
							|  |  |  |         transition: background 0.1s; | 
					
						
							|  |  |  |         color: ${cssManager.bdTheme('#333', '#ccc')}; | 
					
						
							|  |  |  |         user-select: none; | 
					
						
							|  |  |  |         position: relative; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       .viewTab:hover { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.04)', 'rgba(255, 255, 255, 0.08)')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       .viewTab:active { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.08)', 'rgba(255, 255, 255, 0.12)')}; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .viewTab.selected { | 
					
						
							|  |  |  |         background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.08)', 'rgba(255, 255, 255, 0.12)')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |         color: ${cssManager.bdTheme('#000', '#fff')}; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         font-weight: 500; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |        | 
					
						
							|  |  |  |       .viewTab.selected::before { | 
					
						
							|  |  |  |         content: ''; | 
					
						
							|  |  |  |         position: absolute; | 
					
						
							|  |  |  |         left: 0; | 
					
						
							|  |  |  |         top: 0; | 
					
						
							|  |  |  |         bottom: 0; | 
					
						
							|  |  |  |         width: 3px; | 
					
						
							|  |  |  |         background: ${cssManager.bdTheme('#26a69a', '#26a69a')}; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |        | 
					
						
							|  |  |  |       .viewTab dees-icon { | 
					
						
							|  |  |  |         font-size: 14px; | 
					
						
							|  |  |  |         opacity: 0.7; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-22 01:11:28 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |       .appActions { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         padding: 12px; | 
					
						
							|  |  |  |         border-top: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 01:11:28 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |       .action { | 
					
						
							|  |  |  |         display: flex; | 
					
						
							|  |  |  |         align-items: center; | 
					
						
							|  |  |  |         gap: 8px; | 
					
						
							|  |  |  |         padding: 8px; | 
					
						
							|  |  |  |         border-radius: 4px; | 
					
						
							|  |  |  |         cursor: default; | 
					
						
							|  |  |  |         transition: background 0.1s; | 
					
						
							|  |  |  |         color: ${cssManager.bdTheme('#333', '#ccc')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |        | 
					
						
							|  |  |  |       .action:hover { | 
					
						
							|  |  |  |         background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.04)', 'rgba(255, 255, 255, 0.08)')}; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .action dees-icon { | 
					
						
							|  |  |  |         font-size: 14px; | 
					
						
							|  |  |  |         opacity: 0.7; | 
					
						
							| 
									
										
										
										
											2024-01-22 01:26:13 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |       .appcontent { | 
					
						
							| 
									
										
										
										
											2024-01-22 01:11:28 +01:00
										 |  |  |         z-index: 1; | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |         position: absolute; | 
					
						
							| 
									
										
										
										
											2024-09-02 22:07:42 +02:00
										 |  |  |         top: 0px; | 
					
						
							|  |  |  |         right: 0px; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         height: calc(100% - 24px); | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |         bottom: 24px; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         width: calc(100% - 240px); | 
					
						
							| 
									
										
										
										
											2024-01-22 00:59:25 +01:00
										 |  |  |         overflow: auto; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         background: ${cssManager.bdTheme('#f5f5f5', '#000')}; | 
					
						
							| 
									
										
										
										
											2024-02-05 13:17:44 +01:00
										 |  |  |         overscroll-behavior: contain; | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |        | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |       .controlbar { | 
					
						
							|  |  |  |         color: #fff; | 
					
						
							|  |  |  |         position: absolute; | 
					
						
							|  |  |  |         bottom: 0px; | 
					
						
							|  |  |  |         left: 0px; | 
					
						
							|  |  |  |         width: 100%; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         border-top: 1px solid ${cssManager.bdTheme('#00000020', '#ffffff20')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |         height: 24px; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         background: ${cssManager.bdTheme('#2196f3', '#1565c0')}; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |         z-index: 2; | 
					
						
							|  |  |  |         display: flex; | 
					
						
							|  |  |  |         justify-content: flex-end; | 
					
						
							|  |  |  |         align-items: center; | 
					
						
							|  |  |  |         flex-direction: row; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         font-size: 12px; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       .control { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         display: flex; | 
					
						
							|  |  |  |         align-items: center; | 
					
						
							|  |  |  |         gap: 4px; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |         margin-right: 16px; | 
					
						
							|  |  |  |         white-space: nowrap; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |         cursor: default; | 
					
						
							|  |  |  |         opacity: 0.8; | 
					
						
							|  |  |  |         transition: opacity 0.2s; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .control:hover { | 
					
						
							|  |  |  |         opacity: 1; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |       .control dees-icon { | 
					
						
							|  |  |  |         font-size: 14px; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |     `,
 | 
					
						
							|  |  |  |   ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   public render(): TemplateResult { | 
					
						
							|  |  |  |     return html`
 | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |       <div class="maincontainer"> | 
					
						
							|  |  |  |         <div class="appbar"> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |           <div> | 
					
						
							|  |  |  |             <div class="sidebar-header"> | 
					
						
							| 
									
										
										
										
											2025-09-05 15:00:00 +00:00
										 |  |  |               <dees-icon .icon="${'lucide:grid3x3'}" style="font-size: 18px;"></dees-icon> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |               <div class="appName">${this.name}</div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <div class="viewTabs-container"> | 
					
						
							|  |  |  |               <div class="viewTabs"> | 
					
						
							|  |  |  |                 ${this.viewTabs.map( | 
					
						
							|  |  |  |                   (view) => html`
 | 
					
						
							|  |  |  |                     <div  | 
					
						
							|  |  |  |                       class="viewTab ${this.selectedView === view ? 'selected' : ''}"  | 
					
						
							|  |  |  |                       @click=${() => this.loadView(view)} | 
					
						
							|  |  |  |                     > | 
					
						
							|  |  |  |                       ${view.iconName ? html`
 | 
					
						
							| 
									
										
										
										
											2025-09-05 15:26:19 +00:00
										 |  |  |                         <dees-icon .icon="${`${view.iconName}`}"></dees-icon> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |                       ` : ''}
 | 
					
						
							|  |  |  |                       <span style="flex: 1;">${view.name}</span> | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |                   `
 | 
					
						
							|  |  |  |                 )} | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |           <div class="appActions"> | 
					
						
							| 
									
										
										
										
											2024-01-22 20:51:50 +01:00
										 |  |  |             <div class="action" @click=${() => { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |               this.dispatchEvent(new CustomEvent('logout', { bubbles: true, composed: true })); | 
					
						
							|  |  |  |             }}> | 
					
						
							| 
									
										
										
										
											2025-09-05 15:00:00 +00:00
										 |  |  |               <dees-icon .icon="${'lucide:logOut'}"></dees-icon> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |               <span>Logout</span> | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 01:11:28 +01:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |         <div class="appcontent"> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |           <!-- Content goes here --> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:27:30 +01:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |         <div class="controlbar"> | 
					
						
							|  |  |  |           <div class="control"> | 
					
						
							| 
									
										
										
										
											2025-09-05 15:00:00 +00:00
										 |  |  |             <dees-icon .icon="${'lucide:wifi'}"></dees-icon> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |             <span>Connected</span> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |           </div> | 
					
						
							|  |  |  |           <div class="control" @click=${this.launchTerminal}> | 
					
						
							| 
									
										
										
										
											2025-09-05 15:00:00 +00:00
										 |  |  |             <dees-icon .icon="${'lucide:terminal'}"></dees-icon> | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |             <span>Terminal</span> | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |     `;
 | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   public async firstUpdated(_changedProperties): Promise<void> { | 
					
						
							|  |  |  |     const domtools = await this.domtoolsPromise; | 
					
						
							|  |  |  |     super.firstUpdated(_changedProperties); | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     if (this.viewTabs && this.viewTabs.length > 0) { | 
					
						
							|  |  |  |       await this.loadView(this.viewTabs[0]); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |    | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |   public currentTerminal: DeesTerminal; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |   public async launchTerminal() { | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     const domtools = await this.domtoolsPromise; | 
					
						
							|  |  |  |     if (this.currentTerminal) { | 
					
						
							|  |  |  |       // If terminal already exists, remove it
 | 
					
						
							|  |  |  |       await this.closeTerminal(); | 
					
						
							|  |  |  |       return; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |     const maincontainer = this.shadowRoot.querySelector('.maincontainer'); | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     const { DeesTerminal } = await import('./dees-terminal.js'); | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |     const terminal = new DeesTerminal(); | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |     terminal.setupCommand = this.terminalSetupCommand; | 
					
						
							|  |  |  |     this.currentTerminal = terminal; | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |     maincontainer.appendChild(terminal); | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |     terminal.style.position = 'absolute'; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     terminal.style.zIndex = '10'; | 
					
						
							| 
									
										
										
										
											2024-09-02 22:07:42 +02:00
										 |  |  |     terminal.style.top = '0px'; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     terminal.style.left = '240px'; | 
					
						
							| 
									
										
										
										
											2024-01-22 18:39:31 +01:00
										 |  |  |     terminal.style.right = '0px'; | 
					
						
							| 
									
										
										
										
											2024-01-22 19:40:08 +01:00
										 |  |  |     terminal.style.bottom = '24px'; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |     terminal.style.opacity = '0'; | 
					
						
							|  |  |  |     terminal.style.transform = 'translateY(20px)'; | 
					
						
							|  |  |  |     terminal.style.transition = 'all 0.2s'; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     terminal.style.background = '#000'; | 
					
						
							|  |  |  |     terminal.style.boxShadow = '0 4px 20px rgba(0, 0, 0, 0.3)'; | 
					
						
							| 
									
										
										
										
											2025-09-05 15:00:00 +00:00
										 |  |  |     terminal.style.maxWidth = `calc(${maincontainer.clientWidth}px -240px)`; | 
					
						
							|  |  |  |     terminal.style.maxHeight = `calc(${maincontainer.clientHeight}px - 24px)`; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |      | 
					
						
							|  |  |  |     // Add close button to terminal
 | 
					
						
							|  |  |  |     terminal.addEventListener('close', () => this.closeTerminal()); | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     await domtools.convenience.smartdelay.delayFor(0); | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |     terminal.style.opacity = '1'; | 
					
						
							|  |  |  |     terminal.style.transform = 'translateY(0px)'; | 
					
						
							| 
									
										
										
										
											2024-11-07 01:14:36 +01:00
										 |  |  |     return terminal; | 
					
						
							| 
									
										
										
										
											2024-01-22 17:12:58 +01:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |    | 
					
						
							|  |  |  |   private async closeTerminal() { | 
					
						
							|  |  |  |     const domtools = await this.domtoolsPromise; | 
					
						
							|  |  |  |     if (this.currentTerminal) { | 
					
						
							|  |  |  |       this.currentTerminal.style.opacity = '0'; | 
					
						
							|  |  |  |       this.currentTerminal.style.transform = 'translateY(20px)'; | 
					
						
							|  |  |  |       await domtools.convenience.smartdelay.delayFor(200); | 
					
						
							|  |  |  |       this.currentTerminal.remove(); | 
					
						
							|  |  |  |       this.currentTerminal = null; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   private currentView: DeesElement; | 
					
						
							|  |  |  |   public async loadView(viewArg: IView) { | 
					
						
							|  |  |  |     const appcontent = this.shadowRoot.querySelector('.appcontent'); | 
					
						
							|  |  |  |     const view = new viewArg.element(); | 
					
						
							|  |  |  |     if (this.currentView) { | 
					
						
							|  |  |  |       this.currentView.remove(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     appcontent.appendChild(view); | 
					
						
							|  |  |  |     this.currentView = view; | 
					
						
							| 
									
										
										
										
											2025-06-17 11:45:25 +00:00
										 |  |  |     this.selectedView = viewArg; | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     // Emit view-select event
 | 
					
						
							|  |  |  |     this.dispatchEvent(new CustomEvent('view-select', { | 
					
						
							|  |  |  |       detail: { view: viewArg }, | 
					
						
							|  |  |  |       bubbles: true, | 
					
						
							|  |  |  |       composed: true | 
					
						
							|  |  |  |     })); | 
					
						
							| 
									
										
										
										
											2024-01-22 22:30:44 +01:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-09-09 13:34:46 +02:00
										 |  |  | } |