Skip to main content

Type Alias: FieldConfig<Value>

FieldConfig<Value> = object

Defined in: lib/forms/fields.ts:48

Type definition for a field configuration.

Type Parameters

Value

Value

Properties

decrementDisabled()?

optional decrementDisabled: () => boolean

Defined in: lib/forms/fields.ts:56

Custom hook to disable a control decreasing the field's value.

Returns

boolean


disabled()?

optional disabled: () => boolean

Defined in: lib/forms/fields.ts:51

Custom hook to provide a dynamic value for the disabled tag.

Returns

boolean


effects?

optional effects: () => void[]

Defined in: lib/forms/fields.ts:52

Array of useEffect functions to apply.

Returns

void


fieldAtom

fieldAtom: FieldAtom<Value>

Defined in: lib/forms/fields.ts:49

The embedded field to enrich with additional functionality.


incrementDisabled()?

optional incrementDisabled: () => boolean

Defined in: lib/forms/fields.ts:57

Custom hook to disable a control increasing the field's value.

Returns

boolean


mandatory?

optional mandatory: boolean | () => boolean

Defined in: lib/forms/fields.ts:61

Indicates if a non-empty value is expected.


max?

optional max: number

Defined in: lib/forms/fields.ts:54

A maximum value for a numeric field; a maximum length for a string field.


min?

optional min: number

Defined in: lib/forms/fields.ts:53

A minimum value for a numeric field; a minimum length for a string field.


options?

optional options: FieldConfigOption[]

Defined in: lib/forms/fields.ts:58

Options for a select field.


optionsInfos?

optional optionsInfos: Map<number, FieldConfigOptionInfos>

Defined in: lib/forms/fields.ts:60

Configuring additional behaviours on options passed to a select field.


optionsOnly?

optional optionsOnly: number[]

Defined in: lib/forms/fields.ts:59

Amongst the given options, which values to allow.


step?

optional step: number

Defined in: lib/forms/fields.ts:55

A step value for a numeric field.


valid()?

optional valid: () => null | FieldValueError

Defined in: lib/forms/fields.ts:62

Custom hook to provide a way to tell if the field's value is valid.

Returns

null | FieldValueError


visible()?

optional visible: () => boolean

Defined in: lib/forms/fields.ts:50

Custom hook to condition the rendering of the field.

Returns

boolean