The contained field definitions.
InternalnameThe field name of this DataField instance. This is assigned by SchemaField#initialize.
The initially provided options which configure the data field
InternalparentA reference to the parent schema to which this DataField belongs. This is assigned by SchemaField#initialize.
Is a value of this field written to source data? A Non-persisted value is initialized (with its initial value), and ActiveEffects can use the field for change application.
StatichierarchicalWhether this field defines part of a Document/Embedded Document hierarchy.
StaticrecursiveA dot-separated string representation of the field path within the parent schema.
Static_Default parameters for this field type
StatichasDoes this form field class have defined form support?
Apply any cleaning logic specific to this DataField type.
A candidate value that has been cast to the appropriate type
Options for how the field is cleaned
Internal state variables which are used during recursion
The cleaned value
InternalUpdate the source data for a DataModel which includes this DataField. Updates are performed depth-first; validated and recorded from leaf-nodes upwards.
This method is responsible for preparing and validating the requested update.
If the update is valid, it is responsible for updating the pending source copy and recording the diff.
If the update is invalid it must avoid recording a diff or staging an update to the source copy.
If validation fails, this workflow may optionally permit fallback to a valid initial value.
a partial node of source data, relative to which this field belongs.
The name of this field within the context of the source data.
The candidate value that should be applied as an update.
Options which modify how this update workflow is performed.
Stateful data that is transacted throughout the model hierarchy during an update operation.
Apply an ActiveEffectChange to this field.
The field's current value.
The model instance.
The change to apply.
Additional options to configure the change application.
OptionalreplacementData?: Record<string, unknown>Data used to resolve "@" expressions.
The updated value.
Preprocess and clean source data to ensure that it conforms to the correct data type for this field and is ready to be used by data model construction or update operations. Data cleaning is synchronous and automatically applied as the first step of construction and update operations.
An initial requested value
Optionaloptions: Readonly<DataModelCleaningOptions> = {}Additional options for how the field is cleaned
Optional_state: data.types.DataModelUpdateState = {}Internal state variables which are used during recursion
The cleaned value
An array of [name, DataField] tuples which define the schema.
Extend this schema definition with additional fields.
The additional fields.
Get a DataField instance from the schema by name.
The field name
The DataField instance or undefined
Traverse the schema, obtaining the DataField definition for a particular field.
A field path or property key if options.source is given.
Examples: ["abilities", "strength"] or "abilities.strength".
Optionaloptions: { source?: object } = {}Additional options
Optionalsource?: objectThe source data of the field
The corresponding DataField definition for that field, or undefined
Test whether a certain field name belongs to this schema definition.
The field name
Does the named field exist in this schema?
An array of field names which are present in the schema.
Remove fields from this schema definition.
The fields to remove.
Render this DataField as a standardized form-group element.
Configuration options passed to the wrapping form-group
Input element configuration options passed to DataField#toInput
The rendered form group element
Render this DataField as an HTML element.
Form element configuration parameters
A rendered HTMLElement for the field
Validate candidate input for this field, ensuring it meets the field requirements.
This public method validates recursively, testing both the immediate value of this field as well as the validity of any child values for fields with hierarchical data types.
The candidate value to validate
Optionaloptions: DataFieldValidationOptions = {}Options which affect validation behavior
A failure that occurred if validation is non-strict. The failure may have been resolved by fallback or dropping invalid elements.
Iterate over validation functions applied to this field. Validation happens in a depth-first way, for example consider an outerSchema with an innerField:
An array of DataField instances which are present in the schema.
Protected_ProtectedApply a custom change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedApply a "downgrade" change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedApply a "multiply" change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedApply an "override" change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedApply a "subtract" change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedApply an "upgrade" change to this field.
The field's current value.
The change delta.
The model instance.
The original change data.
The updated value.
Protected_ProtectedCast a change delta into an appropriate type to be applied to this field.
The change delta.
Data used to resolve "@" expressions.
Protected_ProtectedInitialize and validate the structure of the provided field definitions.
The provided field definitions
The validated schema
Protected_ProtectedMigrate this field's candidate source data. This workflow occurs as a component step of DataField#clean.
Candidate source value for the field
Optionaloptions: Readonly<DataModelCleaningOptions>Options for how the field is cleaned
Optional_state: data.types.DataModelUpdateStateInternal state variables transacted during cleaning recursion.
A migrated value suitable for cleaning
Protected_ProtectedRecursively replace data references in a string change value.
An object providing replacements
Optionaloptions: { strict?: boolean } = {}Additional options to configure the data replacement
Optionalstrict?: booleanThrow an Error if data replacement fails
The expression with data references resolved
Protected_ProtectedRender this DataField as an HTML element. Subclasses should implement this method rather than the public toInput method which wraps it.
Form element configuration parameters
A rendered HTMLElement for the field
Protected_ProtectedSpecial validation rules which supersede regular field validation. This validator screens for certain values which are otherwise incompatible with this field like null or undefined.
The candidate value
A boolean to indicate with certainty whether the value is valid
Static_InternalAn internal helper function that attempts fallback to a valid initial value in the case of validation failure.
The child data field being handled
Data attempted for validation at the parent level
The key of this field being validated
The validation failure at the parent level
The validation failure at this field level
Handling options
StaticexpandExpand a transacted object.
The object.
Cleaning operation options.
Cleaning operation state.
A new state object.
StaticreconstructWhen iterating over the keys and values of an object, reconstruct serialized DataFieldOperator values.
A custom SchemaField for defining package compatibility versions.
Mixes
PackageCompatibilityData