The base document class which belongs in this field
Optionaloptions: DataFieldOptions = {}Options which configure the behavior of the field
Optionalcontext: DataFieldContext = {}Additional context which describes the field
The canonical document name of the document type which belongs in this 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.
StatichierarchicalWhether this field defines part of a Document/Embedded Document hierarchy.
StaticrecursiveA convenience accessor for the name of the document type associated with this TypeDataField
A 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.
Apply a function to this DataField which propagates through recursively to any contained data schema.
The function to apply
The current value of this field
Optionaloptions: object = {}Additional options passed to the applied function
The results object
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
Additional options for how the field is cleaned
Internal state variables which are used during recursion
The cleaned value
Get the DataModel definition that should be used for this type of document.
The Document instance type
The DataModel class or null
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 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_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
StaticgetReturn the package that provides the sub-type for the given model.
The model instance created for this sub-type.
A subclass of foundry.data.fields.ObjectField which supports a type-specific data object.