import {LitElement, html} from './lit-all.min.js'; import * as tfrpc from '/static/tfrpc.js'; class TfPasswordFormElement extends LitElement { static get properties() { return { //selected: {type: String}, }; } constructor() { super(); } /** * Checks a password against different requirements * @param {string} password the password to validate * @returns */ validatePassword(password) { // TODO(tasiaiso) return true; } submitPassword() { const currentPwd = this.shadowRoot.getElementById('current').value; const newPwd = this.shadowRoot.getElementById('new').value; const repeatPwd = this.shadowRoot.getElementById('Repeat').value; if (!(newPwd === repeatPwd)) { return; } // TODO // tfrpc.changePassword() } render() { return html`
`; } } customElements.define('tf-password-form', TfPasswordFormElement);