Resolves from the generated Validators by checking the first for Condition.category = Require
Protected
servicesValue is setup by calling validate(). It does not run validate() itself. Returns false when instanceState.status is Invalid. Any other ValidationStatus return true. This follows an old style validation rule of everything is valid when not explicitly marked invalid. That means when it hasn't be run through validation or was undetermined as a result of validation. Recommend using doNotSave for more clarity.
Result from the latest validation, or an indication that validation has yet to occur.
It is changed internally and can influence how validation behaves the next time.
Prior to calling validate() (or setValue()'s validate option), it is NotAttempted. After setValue it is NeedsValidation. After validate, it may be Valid, Invalid or Undetermined. If ValueHost is disabled, it returns Disabled.
When true, an async Validator is running
Determines if a validator doesn't consider the ValueHost's value ready to save. True when ValidationStatus is Invalid or NeedsValidation.
Determines if an invalid entry has been corrected. Is true when the user has fixed all invalid validators. False otherwise, including if the status changes after this point.
Exposes the current validation state for the ValueHost. It combines other properties and issuesFound. The same value is delivered to the onValueHostValidationStateChanged callback.
Protected
businessexposes the Business Logic Errors list. If none, it is null.
Protected
configProtected
loggerProvides an API for logging, sending entries to the loggerService.
Determines how the validation system sees the Value in terms of editing. When true, it was changed. When false, it was not. The setValue()/setInputValue()/setValues() functions are the only ones to change this flag. They all set it to true automatically except set it to false when the option.Reset is true. The ValueHost.validate() function may skip validation of an InputValueHost when IsChanged is false, depending on the options for validate. For example, calling validate immediately after loading up the form, you want to avoid showing Category=Require validators. Those should appear only if the user edits, or when the user attempts to submit.
Protected
instanceConsuming system assigns the same value it assigns to the input field/element. In HTML, this is typically called by the onchanged event handler.
It can also be called by the oninput event handler so long as options.duringEdit=true. If runs validation when options.validate=true.
When setting the input value, it is important to also set the native value so the Data Type Check conditions to work. DataTypeCheckCondition itself reports an error if you set the native value to undefined.
To set the native value, you can do it manually, but also consider setting up a DataTypeParser on the inputValueOptionConfig.parserLookupKey to do it automatically. When setup, setInputValue() will run the parser and call setInput() or setInputAsUndefined() for you.
Optional
options: SetInputValueOptionsduringEdit - Set to true when handling an intermediate change activity, such as a keystroke changed a textbox but the user remains in the textbox. For example, on the HTMLInputElement.oninput event. This will involve only validators that make sense during such an edit. Specifically their Condition implements IEvaluateConditionDuringEdits. The IEvaluateConditionDuringEdits.evaluateDuringEdit() function is used instead of ICondition.evaluate().
Protected
tryDetermines if parsing is setup and the value is parsable (must be a string). If so, it determines the native value, and calls upon setValues() to handle it all. If the parser detects an error, the native value will be set to undefined and options.conversionErrorTokenValue gets set to the parser's reported error info. Supports config.parserDataType and config.parserCreator.
Set disableParser = true to prevent parsing. When duringEdit=true, parsing is not supported and this function returns false.
True used the parser and finished with setValues. No further work is needed. False means the parser is not used, and setInputValue should continue.
Sets both (native data type) Value and input field/element Value at the same time and optionally invokes validation. Use when the consuming system resolves both input and native values at the same time so there is one state change and attempt to validate.
NOTE: The DataTypeParser feature is not used by this function as you have already done the parsing to establish the native value.
Can be undefined to indicate the value could not be resolved from the input field/element's value, such as inability to convert a string to a date. All other values, including null and the empty string, are considered real data.
Can be undefined to indicate there is no value. All other values, including null and the empty string, are considered real data.
Optional
options: SetValueOptionsvalidate - Invoke validation after setting the value. Reset - Clears validation (except when validate=true) and sets IsChanged to false. ConversionErrorTokenValue - When setting the value to undefined, it means there was an error converting. Provide a string here that is a UI friendly error message. It will appear in the Category=Require validator within the {ConversionError} token.
Protected
additionalProtected
clearProtected
generateGenerates an array of all Validators from ValueHostConfig.validatorConfigs.
Protected
trySystem consumer assigns the native value to make it available to most Conditions during validation.
Optional
options: SetValueOptionsvalidate - Invoke validation after setting the value. Reset - Clears validation (except when validate=true) and sets IsChanged to false. ConversionErrorTokenValue - When setting the value to undefined, it means there was an error converting. Provide a string here that is a UI friendly error message. It will appear in the Category=Require validator within the {ConversionError} token.
Protected
processProtected
notifyWhen any value changes, all other ValidatableValueHosts get notified here so they can rerun validation when any of their Conditions specify the valueHostName that changed.
When the ValueHost is disabled, it clears any validation issues. A call to validate() will return null until the ValueHost is enabled again. If the Enabler condition changes the state to enabled, it remains up to the user to call validate() again to get the new state. While disabled, some validation activity can still happen:
Changes the validation state to itself initial: Undetermined with no error messages. It calls onValueHostValidationStateChanged if there was a changed to the state.
When valueHost is disabled, this still clears the validation state.
Optional
options: ValidateOptionsOnly supports the skipCallback and Group options.
true when there was something cleared
Protected
groupsDetermines if the group supplied is a match for the group setup on this ValueHost.
Source of this instance's group is either the original configuration or the value of the last validation. WHen true, from the last validation.
Removes any business logic errors. Generally called automatically by ValidationManager as calls are made to SetBusinessLogicErrors and clearValidation(). It calls onValueHostValidationStateChanged if there was a changed to the state.
Optional
options: ValidateOptionsOnly considers the skipCallback option.
true when a change was made to the known validation state.
Protected
invokeHelper to call onValueHostValidationStateChanged due to a change in the state associated with Validate itself or BusinessLogicErrors. It also asks ValidationManager to call onValidationStateChanged so observers that only watch for validation from a high level will be notified.
This may still be called when the ValueHost is disabled, so long as an underlying state has changed. The call to setEnabled(false) itself calls clearValidation() which usually triggers this event allow the UI to know to handle the discarded valuehost's validation data.
The results of validation specific to one condiiton Type.
same as ConditionType unless you set the ValidatorConfig.errorCode property
The issue or null if none.
Lists all issues found (error messages and supporting info) for a single Validatable ValueHost so the input field/element can show error messages and adjust its appearance.
Optional
group: stringAn array of issues found. When null, there are no issues and the data is valid. If there are issues, when all have severity = warning, the data is also valid. Anything else means invalid data. Each contains:
Adds or replaces all IssueFound items that are associated with this ValueHost. It ignores those with another ValueHost name, allowing for the same list to be culled by all ValueHosts. (As a result, it never changes the values sent in, or the array itself.) Replacement when the errorCode is the same. This call invokes the onValueHostValidationStateChanged callback if there were IssueFound items applied.
Use case: client-side getting server-side Jivs-generated IssuesFound, so the UI can incorporate it.
keep or omit an issueFound that does not have a matching validator based on the errorCode. Defaults to Keep.
Protected
setAdds or replaces an IssueFound. Replacement when the errorCode is the same. This does NOT invoke the onValueHostValidated callback.
Use case: client-side getting server-side Jivs-generated IssuesFound, so the UI can incorporate it.
Protected
handlesRuns validation against some of all validators. If at least one validator was NoMatch, it returns ValueHostValidateResult with all of the NoMatches in issuesFound. If all were Matched, it returns ValueHostValidateResult.Value and issuesFound=null. If there are no validators, or all validators were skipped (disabled), it returns ValidationStatus.Undetermined. Updates this ValueHost's InstanceState and notifies parent if changes were made.
When called an it is disabled, it clears existing data and returns null. If the enabled state changes, the user must call validate again to get the new state.
Optional
options: ValidateOptionsProvides guidance on which validators to include.
Non-null when there is something to report. null if there was nothing to evaluate which includes all existing validators reporting "Undetermined"
Protected
validatorsProvides the list of IValidator instances derived from the ValidatorConfigs. Lazy loads the instances.
Protected
orderValidators are sorted so category=Require comes first and category=DataTypeCheck second.
When Business Logic gathers data from the UI, it runs its own final validation. If its own business rule has been violated, it should be passed here where it becomes exposed to the Validation Summary (getIssuesFound) and optionally for an individual ValueHostName, by specifying that valueHostName in AssociatedValueHostName. Each time called, it adds to the existing list. Use clearBusinessLogicErrors() first if starting a fresh list. It calls onValueHostValidationStateChanged if there was a changed to the state.
In this class, we first see if the errorcode in the error matches an existing validator. If so, we use that validator, and add an IssueFound from that validator.
A business logic error to show. If it has an errorCode assigned and the same errorCode is already recorded here, the new entry replaces the old one.
Optional
options: ValidateOptionstrue when a change was made to the known validation state.
A service to provide all ValueHostNames that have been assigned to this Condition's Config.
Gets an Validator already assigned to this ValidatorsValueHostBase.
Same as ConditionType unless you set the ValidatorConfig.errorCode property
The Validator or null if the condition type does not match.
Protected
canFor setValue functions to check for disabled before trying to change.
Consuming system calls this when it attempts to resolve the input field/element value but cannot. It identifies that the native value is undefined. Note this does not reset IsChanged to false without explicitly specifying options.Reset = true;
Optional
options: SetValueOptionsvalidate - Invoke validation after setting the value. Reset - Clears validation (except when validate=true) and sets IsChanged to false. ConversionErrorTokenValue - When setting the value to undefined, it means there was an error converting. Provide a string here that is a UI friendly error message. It will appear in the Category=Require validator within the {ConversionError} token.
Protected
useA name of a data type used to lookup supporting services specific to the data type. See the LookupKey. Some examples: "String", "Number", "Date", "DateTime", "MonthYear"
Provides a localized name for the data type when it needs to be shown to the user. Since the ValueHostConfig.dataType is optional, this will end up returning the empty string, unless the native value has been assigned and the DataTypeIdentifierService can figure out its lookupKey.
Determines if the ValueHost is enabled for user interaction. It is enabled unless you explicilty set it to false using ValueHostConfig.initialEnabled : false, setup the EnablerCondition which determines when it is enabled, or the ValueHost's own setEnabled() function.
When disabled, the data values of the ValueHost do not get changed by setValue() and related functions. However, those functions offer the overrideDisabled option to force the change.
When disabled and the ValueHost have validators, all validation is disabled and its ValidationStatus reports ValidationState.Disabled.
Protected
getUse to change anything in ValueHostInstanceState without impacting the immutability of the current instance. Your callback will be passed a cloned instance. Change any desired properties and return that instance. It will become the new immutable value of the InstanceState property. If changes were made, the OnValueHostInstanceStateChanged event is fire.
true when the state did change. false when it did not.
Adds a custom entry into the ValueHost's state or removes it when value = undefined.
when undefined, it removes the value from the state
Use to retrieve a value from the state that was stored with saveIntoInstanceState().
the stored value or undefined if nothing is stored.
Generated using TypeDoc v0.25.12
Standard implementation of IInputValueHost. It owns a list of Validators which support its validate() function. Use ValueHostConfig.valueHostType = "Input" for the ValidationManager to use this class.
Each instance depends on a few things, all passed into the constructor: