ConditionConfig for StringLengthCondition

interface StringLengthConditionConfig {
    minimum?: null | number;
    maximum?: null | number;
    valueHostName: null | string;
    supportsDuringEdit?: boolean;
    trim?: boolean;
    conditionType: string;
    category?: ConditionCategory;
}

Hierarchy (view full)

Properties

minimum?: null | number

Native data type representing the minimum of the range. When undefined or null, no minimum, like LessThanOrEqualConditon.

maximum?: null | number

Native data type representing the maximum of the range. When undefined or null, no maximum, like GreaterThanOrEqualConditon.

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.

supportsDuringEdit?: boolean

When true or undefined, this evaluates when ValidateOption.DuringEdit is true. Usually that means as the user is typing. Its not appropriate when the regular expression will not match until the input is finished, such as parsing a date. Its best for checking for valid or invalid (when Not=true) characters as the user types.

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.

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