fix(core): update
This commit is contained in:
@ -20,7 +20,7 @@ export class DeesForm extends DeesElement {
|
||||
public static demo = () => html`
|
||||
<dees-form style="display: block; margin:auto; max-width: 500px; padding: 20px" @formData=${async (eventArg) => {
|
||||
const form: DeesForm = eventArg.currentTarget;
|
||||
form.setStatus('freeze', 'authenticating...');
|
||||
form.setStatus('pending', 'authenticating...');
|
||||
await domtools.plugins.smartdelay.delayFor(1000);
|
||||
form.setStatus('success', 'authenticated!');
|
||||
}}>
|
||||
@ -116,13 +116,21 @@ export class DeesForm extends DeesElement {
|
||||
console.log(valueObject);
|
||||
}
|
||||
|
||||
public setStatus (visualStateArg: 'normal' | 'freeze' | 'error' | 'success', textStateArg: string) {
|
||||
public setStatus (visualStateArg: 'normal' | 'pending' | 'error' | 'success', textStateArg: string) {
|
||||
const inputChildren = this.getFormChildren();
|
||||
const submitButton = this.getSubmitButton();
|
||||
|
||||
switch(visualStateArg) {
|
||||
case 'freeze':
|
||||
case 'pending':
|
||||
submitButton.disabled = true;
|
||||
submitButton.status = 'pending';
|
||||
for (const inputChild of inputChildren) {
|
||||
inputChild.disabled = true;
|
||||
}
|
||||
break;
|
||||
case 'success':
|
||||
submitButton.disabled = true;
|
||||
submitButton.status = 'success';
|
||||
for (const inputChild of inputChildren) {
|
||||
inputChild.disabled = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user