Class: NumberUnitDisplay<F>
Defined in: src/garminsdk/components/common/NumberUnitDisplay.tsx:33
A component which displays a number with units.
Extends
AbstractNumberUnitDisplay
<F
,NumberUnitDisplayProps
<F
>>
Type Parameters
Type Parameter |
---|
F extends string |
Constructors
Constructor
new NumberUnitDisplay<
F
>(props
):NumberUnitDisplay
<F
>
Defined in: src/sdk/components/FSComponent.ts:73
Creates an instance of a DisplayComponent.
Parameters
Parameter | Type | Description |
---|---|---|
props | NumberUnitDisplayProps | The propertis of the component. |
Returns
NumberUnitDisplay
<F
>
Inherited from
AbstractNumberUnitDisplay<F, NumberUnitDisplayProps<F>>.constructor
Properties
context?
optional
context: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
AbstractNumberUnitDisplay.context
contextType?
readonly
optional
contextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
AbstractNumberUnitDisplay.contextType
displayUnit
protected
readonly
displayUnit:Subscribable
<null
|Unit
<F
>>
Defined in: src/sdk/components/common/AbstractNumberUnitDisplay.tsx:31
A subscribable which provides the unit type in which to display the value.
Inherited from
AbstractNumberUnitDisplay.displayUnit
props
props:
NumberUnitDisplayProps
<F
> &ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
AbstractNumberUnitDisplay.props
value
protected
readonly
value:Subscribable
<NumberUnitInterface
<F
,Unit
<F
>>>
Defined in: src/sdk/components/common/AbstractNumberUnitDisplay.tsx:26
A subscribable which provides the value to display.
Inherited from
AbstractNumberUnitDisplay.value
Methods
destroy()
destroy():
void
Defined in: src/sdk/components/common/AbstractNumberUnitDisplay.tsx:57
Returns
void
Inherit Doc
Inherited from
AbstractNumberUnitDisplay.destroy
getContext()
protected
getContext(context
):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
Parameter | Type | Description |
---|---|---|
context | never | The 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
AbstractNumberUnitDisplay.getContext
onAfterRender()
onAfterRender():
void
Defined in: src/sdk/components/common/AbstractNumberUnitDisplay.tsx:39
Returns
void
Inherit Doc
Inherited from
AbstractNumberUnitDisplay.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
AbstractNumberUnitDisplay.onBeforeRender
onDisplayUnitChanged()
protected
onDisplayUnitChanged(displayUnit
):void
Defined in: src/garminsdk/components/common/NumberUnitDisplay.tsx:70
Parameters
Parameter | Type |
---|---|
displayUnit | null | Unit <F > |
Returns
void
Inherit Doc
Overrides
AbstractNumberUnitDisplay.onDisplayUnitChanged
onValueChanged()
protected
onValueChanged(value
):void
Defined in: src/garminsdk/components/common/NumberUnitDisplay.tsx:65
Parameters
Parameter | Type |
---|---|
value | NumberUnitInterface <F > |
Returns
void
Inherit Doc
Overrides
AbstractNumberUnitDisplay.onValueChanged
render()
render():
VNode
Defined in: src/garminsdk/components/common/NumberUnitDisplay.tsx:119
Returns
VNode
Inherit Doc
Overrides
AbstractNumberUnitDisplay.render
DEFAULT_UNIT_FORMATTER()
readonly
static
DEFAULT_UNIT_FORMATTER(out
,unit
):void
Defined in: src/garminsdk/components/common/NumberUnitDisplay.tsx:44
A function which formats units to default text for NumberUnitDisplay.
Parameters
Parameter | Type | Description |
---|---|---|
out | [string , string ] | The 2-tuple to which to write the formatted text, as [bigText, smallText] . |
unit | Unit <any > | The unit to format. |
Returns
void