Skip to main content

Abstract Class: AbstractGtcNumberDialog<Input, Output, InputDef, P>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:57

An abstract implementation of a GTC dialog view which allows the user to select an arbitrary numeric value. The dialog includes a 0-9 number pad and backspace button by default. Subclasses can register an arbitrary number of NumberInput components. The different inputs may be used to allow the user to input numbers with different formatting, number of digits, etc. However, only one input is active and visible at a time. Subclasses may also choose to render additional dialog content by overriding the renderOtherNumberPadContents() and renderOtherContents() methods.

Extends​

Extended by​

Type Parameters​

Type ParameterDefault type
Input extends GtcNumberDialogInputGtcNumberDialogInput
Outputnumber
InputDef extends GtcNumberDialogInputDefinitionGtcNumberDialogInputDefinition
P extends GtcViewPropsGtcViewProps

Implements​

Constructors​

Constructor​

new AbstractGtcNumberDialog<Input, Output, InputDef, P>(props): AbstractGtcNumberDialog<Input, Output, InputDef, P>

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

Creates an instance of a DisplayComponent.

Parameters​

ParameterTypeDescription
propsPThe propertis of the component.

Returns​

AbstractGtcNumberDialog<Input, Output, InputDef, P>

Inherited from​

GtcView.constructor

Properties​

_activeComponent​

protected readonly _activeComponent: Subject<GtcInteractionHandler | null>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:34

Inherited from​

GtcView._activeComponent


_sidebarState​

protected readonly _sidebarState: GtcSidebarState

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:36

Inherited from​

GtcView._sidebarState


_title​

protected readonly _title: Subject<string | undefined>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:40

Inherited from​

GtcView._title


activeInputDef?​

protected optional activeInputDef: InputDef

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:74


backspaceRef​

protected readonly backspaceRef: NodeReference<ImgTouchButton>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:68


bus​

protected readonly bus: EventBus

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:31

Inherited from​

GtcView.bus


context?​

optional context: [] = undefined

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

The context on this component, if any.

Inherited from​

GtcView.context


contextType?​

readonly optional contextType: readonly [] = undefined

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

The type of context for this component, if any.

Inherited from​

GtcView.contextType


gtcService​

protected readonly gtcService: GtcService

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:32

Inherited from​

GtcView.gtcService


inputContainerRef​

protected readonly inputContainerRef: NodeReference<HTMLDivElement>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:66


inputDefinitions​

protected readonly inputDefinitions: Map<string, InputDef>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:72


isAlive​

protected isAlive: boolean = true

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:81


numpadRef​

protected readonly numpadRef: NodeReference<NumberPad>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:67


props​

props: P & ComponentProps

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

The properties of the component.

Inherited from​

GtcView.props


resolveFunction()?​

protected optional resolveFunction: (value) => void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:76

Parameters​

ParameterType
valueany

Returns​

void


resultObject​

protected resultObject: GtcDialogResult<Output>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:77


rootCssClass​

protected readonly rootCssClass: SetSubject<string>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:70


showDecimalButton​

protected readonly showDecimalButton: Subject<boolean>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:87

Whether the decimal button is shown. Defaults to false.


showSignButton​

protected readonly showSignButton: Subject<boolean>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:84

Whether the sign button is shown. Defaults to false.


sidebarState​

readonly sidebarState: SidebarStateReadonly

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:38

The GTC sidebar state (labels and buttons) requested by this view.

Inherited from​

GtcView.sidebarState


title​

readonly title: Subscribable<string | undefined>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:42

This view's title.

Inherited from​

GtcView.title

Methods​

cleanupRequest()​

protected cleanupRequest(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:312

Clears this dialog's pending request and fulfills the pending request Promise if one exists.

Returns​

void


destroy()​

destroy(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:451

Destroys this component.

Returns​

void

Overrides​

GtcView.destroy


getContext()​

protected getContext(context): never

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

Gets a context data subscription from the context collection.

Parameters​

ParameterTypeDescription
contextneverThe context to get the subscription for.

Returns​

never

The requested context.

Throws​

An error if no data for the specified context type could be found.

Inherited from​

GtcView.getContext


getDualConcentricKnobLabel()​

protected getDualConcentricKnobLabel(): string

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:116

Gets the label key or label string for the dual concentric knob while this dialog is active.

Returns​

string

The label key or label string for the dual concentric knob while this dialog is active.


getInvalidValueMessage()​

abstract protected getInvalidValueMessage(value, activeInputDef): string | VNode

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:291

Gets the message to display when attempting to return an invalid value.

Parameters​

ParameterTypeDescription
valuenumberThe invalid value.
activeInputDefInputDefThe input definition used to generate the invalid value.

Returns​

string | VNode

The message to display when attempting to return an invalid value.


getInvalidValueMessageDialogKey()​

protected getInvalidValueMessageDialogKey(): string

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:305

Gets the key of the message dialog to open to display the invalid value message.

Returns​

string

The key of the message dialog to open to display the invalid value message.


getPayload()​

abstract protected getPayload(value, activeInputDef): Output

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:299

Gets the payload for a completed request.

Parameters​

ParameterTypeDescription
valuenumberThe numeric value to return with the request.
activeInputDefInputDefThe active input definition at the time the request was completed.

Returns​

Output

The payload for a completed request.


getRootCssClassName()​

abstract protected getRootCssClassName(): string | undefined

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:387

Gets the CSS class name (singular) for this dialog's root element.

Returns​

string | undefined

The CSS class name (singular) for this dialog's root element.


isValueValid()​

abstract protected isValueValid(value, activeInputDef): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:283

Checks if a value is valid to be returned for a request.

Parameters​

ParameterTypeDescription
valuenumberThe value to check.
activeInputDefInputDefThe input definition used to generate the value to check.

Returns​

boolean

Whether the specified value is valid to be returned for a request.


onAfterRender()​

onAfterRender(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:107

A callback that is called after the component is rendered.

Returns​

void

Overrides​

GtcView.onAfterRender


onBackspacePressed()​

protected onBackspacePressed(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:355

Responds to when this dialog's backspace button is pressed.

Returns​

void


onBeforeRender()​

onBeforeRender(): void

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

A callback that is called before the component is rendered.

Returns​

void

Inherited from​

GtcView.onBeforeRender


onCleanupRequest()​

protected onCleanupRequest(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:326

A callback method which is called when this dialog cleans up a request. This method is called before the pending request Promise is fulfilled, if one exists.

Returns​

void


onClose()​

onClose(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:206

A method that is called when this view is closed. A view is closed when it does not appear in the most recent history state of its parent view stack.

Returns​

void

Overrides​

GtcView.onClose


onDecimalPressed()​

protected onDecimalPressed(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:348

Called when this dialog's decimal button is pressed.

Returns​

void


onEditingActiveChanged()​

protected onEditingActiveChanged(isEditingActive, activeInputDef): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:126

Responds to when the editing state of this dialog's active number input changes.

Parameters​

ParameterTypeDescription
isEditingActivebooleanWhether editing is active.
activeInputDefInputDefThe active input definition.

Returns​

void


onGtcInteractionEvent()​

onGtcInteractionEvent(event): boolean

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:216

Called when there is an interaction event when this is the active view.

Parameters​

ParameterTypeDescription
eventGtcInteractionEventThe event.

Returns​

boolean

Whether the event was handled or not.

Overrides​

GtcView.onGtcInteractionEvent


onInUse()​

onInUse(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:48

A method that is called when this view comes into use. A view is in-use when it appears in at least one history state of its parent view stack.

Returns​

void

Inherited from​

GtcView.onInUse


onNumberPressed()​

protected onNumberPressed(value): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:334

Responds to when one of this dialog's number pad buttons is pressed.

Parameters​

ParameterTypeDescription
valuenumberThe value of the button that was pressed.

Returns​

void


onOpen()​

onOpen(wasPreviouslyOpened): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:67

A method that is called when this view is opened. A view is open when it appears in the most recent history state of its parent view stack.

Parameters​

ParameterTypeDescription
wasPreviouslyOpenedbooleanTrue when this view was open in a previous view stack (like if the go back button was used to reach this page).

Returns​

void

Inherited from​

GtcView.onOpen


onOutOfUse()​

onOutOfUse(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:56

A method that is called when this view goes out of use. A view is out-of-use when it does not appear in any history states of its parent view stack.

Returns​

void

Inherited from​

GtcView.onOutOfUse


onPause()​

onPause(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/GtcService/GtcView.ts:89

A method that is called when this view is paused. A view is paused when it is not the active view.

Returns​

void

Inherited from​

GtcView.onPause


onRequest()​

abstract protected onRequest(input): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:154

A callback method which is called when this dialog receives a request.

Parameters​

ParameterTypeDescription
inputInputThe input for the request.

Returns​

void


onResume()​

onResume(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:211

A method that is called when this view is resumed. A view is resumed when it is the active view.

Returns​

void

Overrides​

GtcView.onResume


onSignPressed()​

protected onSignPressed(): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:341

Called when this dialog's sign button is pressed.

Returns​

void


registerInputDefinition()​

protected registerInputDefinition(key, def): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:96

Registers an input definition with this dialog. Definitions must be registered before this dialog is rendered in order to function properly.

Parameters​

ParameterTypeDescription
keystringThe key to register the definition under. If an existing definition is already registered under the same key, it will be replaced.
defInputDefThe definition to register.

Returns​

void


render()​

render(): VNode

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:360

Renders the component.

Returns​

VNode

A JSX element to be rendered.

Overrides​

GtcView.render


renderBackspaceButton()​

protected renderBackspaceButton(ref, rootCssClassName): VNode | null

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:427

Renders this dialog's backspace button.

Parameters​

ParameterTypeDescription
refNodeReference<DisplayComponent<any, []>>The reference to which to assign the rendered button.
rootCssClassNamestring | undefinedThe CSS class name for this dialog's root element.

Returns​

VNode | null

This dialog's backspace button, as a VNode, or null if this dialog does not have a backspace button.


renderInputToContainer()​

protected renderInputToContainer(def): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:195

Renders one of this dialog's registered inputs to the input container.

Parameters​

ParameterTypeDescription
defInputDefThe definition for the input to render.

Returns​

void


renderNumberPad()​

protected renderNumberPad(ref, rootCssClassName): VNode

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:395

Renders this dialog's number pad.

Parameters​

ParameterTypeDescription
refNodeReference<NumberPad>The reference to which to assign the rendered number pad.
rootCssClassNamestring | undefinedThe CSS class name for this dialog's root element.

Returns​

VNode

This dialog's number pad, as a VNode.


renderOtherContents()​

protected renderOtherContents(rootCssClassName): VNode | null

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:446

Renders additional contents in this dialog's root container.

Parameters​

ParameterTypeDescription
rootCssClassNamestring | undefinedThe CSS class name for this dialog's root element.

Returns​

VNode | null

Additional contents in this dialog's root container, as a VNode, or null if there are no additional contents.


renderOtherNumberPadContents()​

protected renderOtherNumberPadContents(rootCssClassName): VNode | null

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:417

Renders additional contents in this dialog's number pad container.

Parameters​

ParameterTypeDescription
rootCssClassNamestring | undefinedThe CSS class name for this dialog's root element.

Returns​

VNode | null

Additional contents in this dialog's number pad container, as a VNode, or null if there are no additional contents.


request()​

request(input): Promise<GtcDialogResult<Output>>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:133

Requests a value from this dialog.

Parameters​

ParameterTypeDescription
inputInputInput parameters defining the request.

Returns​

Promise<GtcDialogResult<Output>>

A Promise which is fulfilled with the result of the request. The result will indicate whether the request was cancelled, and if the request was not cancelled, it will also contain the requested value.

Implementation of​

GtcDialogView.request


resetActiveInput()​

protected resetActiveInput(key?, initialValue?, resetEditing?): void

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:164

Resets the active input. This will

Parameters​

ParameterTypeDefault valueDescription
key?stringundefinedThe key of the input to set as the active input. Defaults to the key of the current active input.
initialValue?numberundefinedThe initial value to set on the new active input. If not defined, the new active input will retain its current value.
resetEditing?booleanfalseWhether to reset the editing state of this dialog, in effect resetting the Back/Cancel button on the button bar to Back. Defaults to false.

Returns​

void


validateValueAndClose()​

protected validateValueAndClose(): Promise<void>

Defined in: workingtitle-instruments-g3000/html_ui/GTC/Dialog/AbstractGtcNumberDialog.tsx:248

Validates the currently selected value, and if valid sets the value to be returned for the currently pending request and closes this dialog.

Returns​

Promise<void>