import { customElement, html, LitElement, property, TemplateResult } from 'lit-element'; import * as domtools from '@designestate/dees-domtools'; @customElement('dees-button') export class DeesButton extends LitElement { @property() text: string; @property() eventDetailData: string; @property() disabled = false; @property() isQuote = false; @property() isHidden = false; @property() public type: 'normal' | 'highlighted' | 'discreet' | 'big' = 'normal'; constructor() { super(); } public render(): TemplateResult { return html` ${domtools.elementBasic.styles}
${this.text ? this.text : this.textContent}
`; } public async dispatchClick() { if (this.disabled) { return; } this.dispatchEvent(new CustomEvent('clicked', { detail: { data: this.eventDetailData }, bubbles: true })); } public async firstUpdated () { if (!this.textContent) { this.textContent = 'Button'; this.performUpdate(); } } }