export abstract class AbstractFormComponent{

    passwordInputs: Map<String, boolean> = new Map<String, boolean>();
    previouslyFocusedInput: Element = null;

    constructor(){ }

    togglePasswordVisbility(input: Element, visible: boolean){
        this.passwordInputs[input.id] = visible;
    }

    doNotRemoveFocus(event: MouseEvent, input: Element){
        this.previouslyFocusedInput = document.activeElement;
        if (input !== this.previouslyFocusedInput){
            event.preventDefault();
        }
    }

    doNotPropagateClick(event: MouseEvent, input: Element){
        if (input !== this.previouslyFocusedInput){
            event.stopPropagation();
        }
        this.previouslyFocusedInput = null;
    }


}