import { LitElement, html } from 'lit-element'; import { connect } from 'pwa-helpers/connect-mixin.js'; import { store } from '../store.js'; import '@polymer/paper-dialog/paper-dialog.js'; import '@polymer/paper-icon-button/paper-icon-button.js'; import './my-icons.js'; class InputElement extends connect(store)(LitElement) { static get properties() { return { task: { type: String }, text: { type: String} }; } constructor() { super(); this.task = ''; this.text=''; } render() { return html`
:


` } addToKey(value){ console.log('choose value:::',value); this.task+=value; } addToEnter(){ this.text=this.task; console.log('button enter>>>',this.text); this.shadowRoot.getElementById("actions").close(); } addToBack(){ this.task =this.shadowRoot.getElementById('task').value.replace(/.$/,''); } addToClear(){ this.task = ''; } showModal() { this.shadowRoot.getElementById("actions").open(); } closeModel(){ this.shadowRoot.getElementById("actions").close(); } updateTask(e){ this.task=e.target.value; } addToCarNo() { console.log('add car number:::', this.text); // store.dispatch(addTodo(this.task)); this.text=""; this.task=""; } } customElements.define('input-element', InputElement);