Skip to main content

Class: AbstractNumberUnitDisplay<F, P>

A component which displays a number with units.

Type parameters

NameType
Fextends string
Pextends AbstractNumberUnitDisplayProps<F> = AbstractNumberUnitDisplayProps<F>

Hierarchy

Constructors

constructor

new AbstractNumberUnitDisplay<F, P>(props): AbstractNumberUnitDisplay<F, P>

Creates an instance of a DisplayComponent.

Type parameters

NameType
Fextends string
Pextends AbstractNumberUnitDisplayProps<F> = AbstractNumberUnitDisplayProps<F>

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

AbstractNumberUnitDisplay<F, P>

Inherited from

DisplayComponent.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


displayUnit

Protected Readonly displayUnit: Subscribable<null | Unit<F>>

A subscribable which provides the unit type in which to display the value.

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:31


props

props: P & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61


value

Protected Readonly value: Subscribable<NumberUnitInterface<F, Unit<F>>>

A subscribable which provides the value to display.

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:26

Methods

destroy

destroy(): void

Destroys this component.

Returns

void

Overrides

DisplayComponent.destroy

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:57


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
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

DisplayComponent.getContext

Defined in

src/sdk/components/FSComponent.ts:106


onAfterRender

onAfterRender(): void

A callback that is called after the component is rendered.

Returns

void

Overrides

DisplayComponent.onAfterRender

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:39


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onDisplayUnitChanged

onDisplayUnitChanged(displayUnit): void

A callback which is called when this component's bound display unit changes.

Parameters

NameTypeDescription
displayUnitnull | Unit<F>The new display unit.

Returns

void

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:54


onValueChanged

onValueChanged(value): void

A callback which is called when this component's bound value changes.

Parameters

NameTypeDescription
valueNumberUnitInterface<F, Unit<F>>The new value.

Returns

void

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:48


render

render(): null | VNode

Renders the component.

Returns

null | VNode

A JSX element to be rendered.

Inherited from

DisplayComponent.render

Defined in

src/sdk/components/FSComponent.ts:93