Add missing validator variables

This commit is contained in:
nathan 2022-07-21 13:45:24 -06:00
parent 68849a2b79
commit 2b848622fb

View File

@ -3,7 +3,7 @@ import {Et2Widget} from "../Et2Widget/Et2Widget";
import {css, dedupeMixin, LitElement, PropertyValues} from "@lion/core"; import {css, dedupeMixin, LitElement, PropertyValues} from "@lion/core";
import {Required} from "../Validators/Required"; import {Required} from "../Validators/Required";
import {ManualMessage} from "../Validators/ManualMessage"; import {ManualMessage} from "../Validators/ManualMessage";
import {LionValidationFeedback} from "@lion/form-core"; import {LionValidationFeedback, Validator} from "@lion/form-core";
/** /**
* This mixin will allow any LitElement to become an Et2InputWidget * This mixin will allow any LitElement to become an Et2InputWidget
@ -48,6 +48,11 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
protected _oldValue : string | number | Object; protected _oldValue : string | number | Object;
protected node : HTMLElement; protected node : HTMLElement;
// Validators assigned to one specific instance of a widget
protected validators : Validator[];
// Validators for every instance of a type of widget
protected defaultValidators : Validator[];
/** WebComponent **/ /** WebComponent **/
static get styles() static get styles()
{ {
@ -129,6 +134,9 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
constructor(...args : any[]) constructor(...args : any[])
{ {
super(...args); super(...args);
this.validators = [];
this.defaultValidators = [];
} }
connectedCallback() connectedCallback()