Readonly
servicesProvides access to ValidationServices (override IServices).
When true, the current state of validation does not know of any errors. However, there are other factors to consider: there may be warning issues found (in IssuesFound), an async validator is still running, validator evaluated as Undetermined. So check doNotSaveValueHosts as the ultimate guide to saving. When false, there is at least one validation error.
Determines if a validator doesn't consider the ValueHost's value ready to save based on the latest call to validate(). (It does not run validate().) True when at least one ValueHost's ValidationStatus is Invalid or NeedsValidation
Optional
asyncWhen true, an async Validator is running
Alternative to getValueHost() and companion functions that returns strongly typed valuehosts in a shortened syntax. Always throws exceptions if the value host requested is unknown or not the expected type.
If the user needs to abandon this instance, they should use this to clean up active resources (like timers) and to release memory that would stall the garbage collector from disposing this object. It should assign any object reference to undefined as a strong indicator that the object has been disposed.
Easier way to add or modify a ValueHostConfig than using addValueHost(), addOrUpdateValueHost(), or addOrMergeValueHost(). It returns an object whose methods allow adding ValueHosts and their validators. Upon calling its apply() method, your changes will be applied through the addOrMergeValueHost() function. Any ValueHost that gets updated will have its original instance disposed. Be sure to discard any reference to the ValueHost instance that you have.
Retrieves the IValidatorsValueHostBase of the identified by valueHostName
Matches to the ValidatorsValueHostBaseConfig.name property Returns the instance or null if not found or found a different type of value host.
Retrieves the InputValueHost of the identified by valueHostName
Matches to the InputValueHostConfig.name property Returns the instance or null if not found or found a different type of value host.
Retrieves the PropertyValueHost of the identified by valueHostName
Matches to the PropertyValueHostConfig.name property Returns the instance or null if not found or found a different type of value host.
Runs validation against all validatable ValueHosts, except those that do not match the validation group supplied in options. Updates this ValueHost's InstanceState and notifies parent if changes were made.
Optional
options: ValidateOptionsProvides guidance on which validators to include. Important to set options.BeforeSubmit to true if invoking validate() prior to submitting.
The ValidationState object, which packages several key pieces of information: isValid, doNotSave, and issues found.
Changes the validation state to itself initial: Undetermined with no error messages.
Optional
options: ValidateOptionstrue when there was something cleared
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 its called, all previous business logic errors are abandoned.
A list of business logic errors to show or null to indicate no errors.
Optional
options: ValidateOptionsOnly considers the skipCallback option.
when true, the validation snapshot has changed.
Lists all issues found (error messages and supporting info) for a single ValidatorsValueHostBase so the input field/element can show error messages and adjust its appearance.
An 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:
A list of all issues from all ValidatorsValueHostBases optionally for a given group. Use with a Validation Summary widget and when validating the Model itself.
Optional
group: stringOmit or null to ignore groups. Otherwise this will match to ValidatorsValueHostBases with the same group (case insensitive match).
An array of details 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 to the appropriate ValueHosts. Each ValueHost will invoke the onValueHostValidationStateChanged callback if needed.
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.
ValueHosts that validate should try to fire onValidationStateChanged, even though they also fire onValueHostValidationStateChanged. This allows systems that observe validation changes at the validationManager level to know. This function is optionally debounced with a delay in ms coming from ValidationManagerConfig.notifyValidationStateChangedDelay
Optional
options: ValidateOptionsOptional
force: booleanwhen true, override the debouncer and execute immediately.
Retrieves the ValueHost of the identified by valueHostName
Matches to the ValueHostBaseConfig.name property Returns the instance or null if not found.
Retrieves the CalcValueHost of the identified by valueHostName
Matches to the CalcValueHostConfig.name property Returns the instance or null if not found or found a different type of value host.
Retrieves the StaticValueHost of the identified by valueHostName
Matches to the StaticValueHostConfig.name property Returns the instance or null if not found or found a different type of value host.
Provides a way to enumerate through existing ValueHosts.
Optional
filter: ((valueHost) => boolean)A generator that yields ValueHosts
Adds a ValueHostConfig for a ValueHost not previously added. Does not trigger any notifications. Exception when the same ValueHostConfig.name already exists.
Can use builder.static(), builder.calc() or any ValueConfigHost. (builder is the Builder API)
When not null, this state object is used instead of an initial state. It overrides any state supplied by the ValueHostsManager constructor. It will be run through ValueHostFactory.cleanupInstanceState() first. When null, the state supplied in the ValueHostsManager constructor will be used if available. When neither state was supplied, a default state is created.
Replaces a ValueHostConfig for an already added ValueHost. It does not merge. If merging is required, use addOrMergeValueHost(). Does not trigger any notifications. If the name isn't found, it will be added. Any previous ValueHost and its config will be disposed. Be sure to discard any reference to the ValueHost instance that you have.
Can use builder.static(), builder.calc() or any ValueConfigHost. (builder is the Builder API)
When not null, this state object is used instead of an initial state. It overrides any state supplied by the ValueHostsManager constructor. It will be run through ValueHostFactory.cleanupInstanceState() first.
Replaces a ValueHostConfig for an already added ValueHost. It merges the new config with the existing one using the ValueHostConfigMergeService. The goal is to protect important business logic settings while allowing the UI to inject new property values where appropriate. Does not trigger any notifications. If the name isn't found, it will be added. Any previous ValueHost and its config will be disposed. Be sure to discard any reference to the ValueHost instance that you have.
Can use builder.static(), builder.calc() or any ValueConfigHost. (builder is the Builder API)
When not null, this state object is used instead of an initial state. It overrides any state supplied by the ValueHostsManager constructor. It will be run through ValueHostFactory.cleanupInstanceState() first.
Upon changing the value of a ValueHost, other ValueHosts need to know. They may have Conditions that take the changed ValueHost into account and will want to revalidate or set up a state to force revalidation. This goes through those ValueHosts and notifies them.
Report that a ValueHost had its instance state changed. Invokes onValueHostInstanceStateChanged if setup.
Generated using TypeDoc v0.25.12
Interface from which to implement a ValidationManager.