FieldValidation
Defined in: src/widgets/controls/validation.ts:139
Per-field validation state + behavior, embedded in a control widget. Keeps the
control’s invalid flag and resolved border/icon color in sync with the
latest result, and reports the message for the shared/inline display layers.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FieldValidation(
field):FieldValidation
Defined in: src/widgets/controls/validation.ts:151
Parameters
Section titled “Parameters”Returns
Section titled “Returns”FieldValidation
Properties
Section titled “Properties”onValidate?
Section titled “onValidate?”
optionalonValidate?: (result) =>void
Defined in: src/widgets/controls/validation.ts:147
Called after each validation with the normalized result.
Parameters
Section titled “Parameters”result
Section titled “result”Returns
Section titled “Returns”void
result
Section titled “result”result:
ValidationResult=VALID
Defined in: src/widgets/controls/validation.ts:145
The latest validation result.
touched
Section titled “touched”touched:
boolean=false
Defined in: src/widgets/controls/validation.ts:149
Becomes true after the field’s first validation, gating eager display.
validateOn
Section titled “validateOn”validateOn:
ValidateTrigger="blur"
Defined in: src/widgets/controls/validation.ts:143
When the field re-validates itself.
validators
Section titled “validators”validators:
Validator<any>[] =[]
Defined in: src/widgets/controls/validation.ts:141
Validators run against the field’s value, in order.
Accessors
Section titled “Accessors”invalid
Section titled “invalid”Get Signature
Section titled “Get Signature”get invalid():
boolean
Defined in: src/widgets/controls/validation.ts:154
True when the field has been validated and is currently invalid.
Returns
Section titled “Returns”boolean
message
Section titled “message”Get Signature
Section titled “Get Signature”get message():
string|undefined
Defined in: src/widgets/controls/validation.ts:159
The current error message when invalid, else undefined.
Returns
Section titled “Returns”string | undefined
severity
Section titled “severity”Get Signature
Section titled “Get Signature”get severity():
Severity|undefined
Defined in: src/widgets/controls/validation.ts:164
The current severity when invalid, else undefined.
Returns
Section titled “Returns”Severity | undefined
Methods
Section titled “Methods”maybeValidate()
Section titled “maybeValidate()”maybeValidate(
trigger):void
Defined in: src/widgets/controls/validation.ts:178
Re-validates only if the configured trigger matches the given event.
Parameters
Section titled “Parameters”trigger
Section titled “trigger”Returns
Section titled “Returns”void
resolveColor()
Section titled “resolveColor()”resolveColor():
string|null
Defined in: src/widgets/controls/validation.ts:187
Resolves the theme color for the current severity, or null when valid.
Returns
Section titled “Returns”string | null
validate()
Section titled “validate()”validate():
ValidationResult
Defined in: src/widgets/controls/validation.ts:169
Runs validators against the field’s current value and stores the result.