import { customElement, property, html, TemplateResult, DeesElement } from '@designestate/dees-element'; import * as domtools from '@designestate/dees-domtools'; @customElement('dees-input-quantityselector') export class DeesInputQuantitySelector extends DeesElement { public static demo = () => html``; @property() public key: string; @property({ type: Number }) public value: number = 1; public render(): TemplateResult { return html` ${domtools.elementBasic.styles}
-
${this.value}
+
`; } public increase () { this.value++; } public decrease () { if (this.value > 0) { this.value--; } else { // nothing to do here } } }