import { html, property } from '@skhemata/skhemata-base'; import { SkhemataFormInput } from './SkhemataFormInput'; export class SkhemataFormTime extends SkhemataFormInput { @property({ type: String }) min = ''; @property({ type: String }) max = ''; @property({ type: Boolean }) submitOnEnter = false; @property({ type: String }) type = 'text'; constructor() { super(); this.value = ''; } handleInput(event: any) { this.clearError(); this.setAttribute('value', event.target.value); } handleKeydown(event: any) { this.clearError(); if (event.keyCode === '13' && this.submitOnEnter) { this.validate(); if (!this.valid) { return; } this.dispatchEvent(new CustomEvent('submit')); event.preventDefault(); } } render() { const field = html`
${this.description}
` : null}${this.errorMessage}
` : ``}${this.description}
` : null}