The different types this field can represent
Optionaloptions: DataFieldOptionsOptions for configuring the field
Optionalcontext: DataFieldContextAdditional context describing the field
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.
The types of this field.
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?
InternalCommit a prepared update to DataModel#_source.
The parent source object within which the key field exists
The named field in source to commit
The new value of the field which should be committed to source
The reported change to the field
Options which modify how this update workflow is performed.
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.
InternalCertain fields may declare joint data validation criteria. This method will only be called if the field is designated as recursive. This method should throw if any validation error occurred, even if resolved by fallback or dropping.
Candidate data for joint model validation
Options which modify joint model validation
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
Attempt to retrieve a valid initial value for the DataField.
Model source data object within which an initial value is required for this field
A proposed initial value
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:
Protected_ProtectedApply an "add" 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 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_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_ProtectedFor fields which have hierarchical data structures, define how their inner fields should be validated. This method is called after _validateSpecial and _validateType. It can be assumed that those tests passed. This method should throw if any validation error occurred, even if resolved by fallback or dropping.
The candidate value
Optionaloptions: DataFieldValidationOptionsOptions which affect validation behavior
A boolean to indicate with certainty whether the value is valid
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
A subclass of foundry.data.fields.DataField that defines a union of schema-constrained objects discriminable via a
typeproperty.