import { DeesElement, property, html, customElement, type TemplateResult, cssManager, css, } from '@design.estate/dees-element'; import * as domtools from '@design.estate/dees-domtools'; import { SioCombox } from './sio-combox.js'; import { SioIcon } from './sio-icon.js'; import { state } from '@design.estate/dees-element'; SioCombox; SioIcon; // Import design tokens import { colors, bdTheme } from './00colors.js'; import { spacing, radius, shadows, transitions, sizes } from './00tokens.js'; import { fontFamilies, typography } from './00fonts.js'; declare global { interface HTMLElementTagNameMap { 'sio-fab': SioFab; } } @customElement('sio-fab') export class SioFab extends DeesElement { @property({ type: Boolean }) public showCombox = false; @state() private hasShownOnce = false; public static demo = () => html` `; constructor() { super(); domtools.DomTools.setupDomTools(); } public render(): TemplateResult { return html` ${domtools.elementBasic.styles}
${this.showCombox || this.hasShownOnce ? html` this.showCombox = false}> ` : ''}
`; } /** * toggles the combox */ public async toggleCombox() { console.log('toggle combox'); this.showCombox = !this.showCombox; if (this.showCombox) { this.hasShownOnce = true; } } public async firstUpdated(args) { super.firstUpdated(args); const domtools = await this.domtoolsPromise; const sioCombox: SioCombox = this.shadowRoot.querySelector('sio-combox'); const mainBox: HTMLElement = this.shadowRoot.querySelector('#mainbox'); sioCombox.referenceObject = mainBox; domtools.keyboard .on([domtools.keyboard.keyEnum.Ctrl, domtools.keyboard.keyEnum.S]) .subscribe((event) => { this.toggleCombox(); }); } }