import * as plugins from '../wcctools.plugins.js'; import { DeesElement, property, html, customElement, type TemplateResult } from '@design.estate/dees-element'; import { WccDashboard } from './wcc-dashboard.js'; export type TElementType = 'element' | 'page'; @customElement('wcc-sidebar') export class WccSidebar extends DeesElement { @property({ attribute: false }) public selectedItem: DeesElement | (() => TemplateResult); @property({ attribute: false }) public selectedType: TElementType; @property() public dashboardRef: WccDashboard; public render(): TemplateResult { return html`
`; } public selectItem(typeArg: TElementType, itemNameArg: string, itemArg: (() => TemplateResult) | DeesElement) { console.log('selected item'); console.log(itemNameArg); console.log(itemArg); this.selectedItem = itemArg; this.selectedType = typeArg; this.dispatchEvent( new CustomEvent('selectedType', { detail: typeArg }) ); this.dispatchEvent( new CustomEvent('selectedItemName', { detail: itemNameArg }) ); this.dispatchEvent( new CustomEvent('selectedItem', { detail: itemArg }) ); this.dashboardRef.buildUrl(); } }