Skip to content

charton API


charton API / @chart-on/ui / index / FormInputBase

Interface: FormInputBase<V> ​

Defined in: ui/src/form-model.ts:21

Fields every input has; custom input types extend it.

Extended by ​

Type Parameters ​

V ​

V = unknown

Properties ​

default? ​

optional default?: V

Defined in: ui/src/form-model.ts:28

Value when the form opens without one, and after a reset.


disabled? ​

optional disabled?: FormCondition

Defined in: ui/src/form-model.ts:32

Default false. Disabled inputs keep their value and are not validated.


hint? ​

optional hint?: string

Defined in: ui/src/form-model.ts:26

Help text under the control.


id ​

id: string

Defined in: ui/src/form-model.ts:23

Key of this input's value in FormValues; unique within the schema.


label ​

label: string

Defined in: ui/src/form-model.ts:24


visible? ​

optional visible?: FormCondition

Defined in: ui/src/form-model.ts:30

Default true. Hidden inputs keep their value and are not validated.

Methods ​

validate()? ​

optional validate(value, values): string | null | undefined

Defined in: ui/src/form-model.ts:34

A message when value is not acceptable, else nothing. Runs after the built-in checks pass.

Parameters ​

value ​

V

values ​

Readonly<FormValues>

Returns ​

string | null | undefined