Skip to main content

Interface: InputBoxProps<T>

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:13

The properties for the InputBox component.

Extends​

  • ComponentProps

Type Parameters​

Type Parameter
T

Properties​

bind​

readonly bind: Subscribable<null | T> | MutableSubscribable<null | T, null | T>

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:23

The value to bind to the field. If the bind value is not mutable and no onModified handler is provided the input will be read-only.


blurOnEnter?​

readonly optional blurOnEnter: boolean

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:57

Whether this InputBox should be blurred when Enter key is pressed on the physical keyboard, or when ENTER/NEXT button is pressed on the TSC keyboard. This property should only be used when an InputBox is connected to the TSC keyboard, but is not managed by a InputFocusManager (and therefore its blurring on Enter or on ENTER/NEXT is not automatic).


bus​

readonly bus: EventBus

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:18

The event bus. Required for the input to respond appropriately to the mouse leaving the virtual cockpit instrument screen while the user is dragging the control.


children?​

optional children: DisplayChildren[]

Defined in: sdk/components/FSComponent.ts:122

The children of the display component.

Inherited from​

ComponentProps.children


dragConfig?​

readonly optional dragConfig: object

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:73

Displays draggable icon to change the value of the input.

bus​

readonly bus: EventBus

The event bus. Required for the input to respond appropriately to the mouse leaving the virtual cockpit instrument screen while the user is dragging the control.

increment​

readonly increment: number

Unit of change per tick.

max​

readonly max: number

Max value.

min​

readonly min: number

Minimum value.


formatter​

readonly formatter: Formatter<T, string> & Validator<T>

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:63

Formats the bind for display. If no validator is provided the input will be read-only.


isEnabled?​

readonly optional isEnabled: boolean | Subscribable<boolean>

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:66

Whether the input is enabled, or a subscribable which provides it. Defaults to true.


maxLength?​

readonly optional maxLength: number

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:69

The maximum number of chacters the input box will accept. Defaults to 5.


onBlur()?​

readonly optional onBlur: () => void

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:48

Callback when the InputBox is blurred. This property should only be used when an InputBox is connected to the TSC keyboard, but is not managed by a InputFocusManager (and therefore its blurring on Enter or on ENTER/NEXT is not automatic).

Returns​

void


onModified()?​

readonly optional onModified: (newValue) => Promise<boolean>

Defined in: workingtitle-instruments-epic2/shared/Components/Inputs/InputBox.tsx:40

Optional callback fired when the bound value is about to be modified. This is only called when a value is successfully validated.

This should be used when there is no appropriate way of using a modifiable data source to accept modifications from this input field.

An example of this is a complex process like inserting a flight plan leg, or something calling a distant modification process with a very indirect relationship to the input data.

If the bind value is not mutable and a onMondified handler is provided, it must always return true (handling the modification itself).

If the return value is:

  • true -> the handler is considered to have handled the call, and any bound data is not modified.
  • false -> the handler is not considered to have handled the call itself, and any bound data is modified.
  • error -> the error is thrown and needs to be handled upstream (e.g. FMC message).

Parameters​

ParameterType
newValueT

Returns​

Promise<boolean>


ref?​

optional ref: NodeReference<any>

Defined in: sdk/components/FSComponent.ts:125

A reference to the display component.

Inherited from​

ComponentProps.ref