ConditionConfig for RequireTextCondition

interface RequireTextConditionConfig {
    trim?: boolean;
    nullValueResult?: ConditionEvaluateResult;
    valueHostName: null | string;
    conditionType: string;
    category?: ConditionCategory;
}

Hierarchy (view full)

Properties

trim?: boolean

Removes leading and trailing whitespace before evaluating the string. Only used with ValidateOption.DuringEdit = true as the string comes from the Input value, which is actively being edited. Your parser that moves data from Input to Native values is expected to do its own trimming, leaving the DuringEdit = false no need to trim.

nullValueResult?: ConditionEvaluateResult

Normally a value of null is considered NoMatch so both an empty string and null are NoMatch. When this is set, it determines the value. If you want to consider null as valid, supply Match. If you don't want to evaluate null at all, supply Undetermined.

valueHostName: null | string

One source for the value to evaluate. By design, Condition.evaluate() takes a valueHost object, allowing the caller to simply pass in the value. Leave this null to use that valueHost object.

Assign this to a ValueHostName if you want to have it looked up in the ValueHostsManager.getValueHost().

Typically leave Validator.ConditionConfig.valueHostName null because Condition.evaluate() is passed the correct valueHost. However, Validator.EnablerConfig needs it assigned. Same with any Condition that is a child of another, like in ConditionWithChildrenBase.

Many conditions need two or more sources for values. They are expected to create more ValueHostName properties in their ConditionConfig, where the remaining Properties are identified.

conditionType: string

Identifies the class for ConditionFactory to create. It is also used as the Validator's errorCode when ValidatorConfig.errorCode was not assigned.

Most Condition classes have an official value for Category. This allows you to override that official value in special situations and supply a value when the Condition does not.

Generated using TypeDoc v0.25.12