Configuration options for TJSDataField.

interface TJSDataFieldOptions<T = unknown> {
    datafield?: DataField;
    enabled?: boolean;
    groupConfig?: FormGroupConfig;
    inputConfig?: FormInputConfig<T>;
    onValidationFailure?: TJSDataFieldValidationCallback;
    resetInitial?: boolean;
    store?: MinimalWritable<unknown>;
}

Type Parameters

Index
datafield?: DataField

The associated Foundry DataField.

enabled?: boolean

Whether the associated input is enabled.

true

groupConfig?: FormGroupConfig

Optional configuration used when constructing a DataField form group.

inputConfig?: FormInputConfig<T>

Optional configuration used when constructing the associated DataField input element.

onValidationFailure?: TJSDataFieldValidationCallback

Callback invoked when DataField validation fails while processing user input or synchronizing an existing store value with a changed DataField.

resetInitial?: boolean

When true and the effective DataField changes, synchronize the store to that field’s initial value. When no valid DataField is available, synchronize the store to undefined.

When false, the existing store value is preserved across DataField changes whenever it remains compatible with the new DataField. Otherwise, the store is synchronized to the initial value of the new DataField.

false

store?: MinimalWritable<unknown>

Writable store synchronized with the DataField value.

The component automatically updates the store when user input changes and reacts to external store updates by synchronizing with the hosted DataField.