Class: AbstractNumberUnitDisplay<F, P>
A component which displays a number with units.
Type parameters
Name | Type |
---|---|
F | extends string |
P | extends AbstractNumberUnitDisplayProps <F > = AbstractNumberUnitDisplayProps <F > |
Hierarchy
↳
AbstractNumberUnitDisplay
Constructors
constructor
• new AbstractNumberUnitDisplay<F
, P
>(props
): AbstractNumberUnitDisplay
<F
, P
>
Creates an instance of a DisplayComponent.
Type parameters
Name | Type |
---|---|
F | extends string |
P | extends AbstractNumberUnitDisplayProps <F > = AbstractNumberUnitDisplayProps <F > |
Parameters
Name | Type | Description |
---|---|---|
props | P | The propertis of the component. |
Returns
AbstractNumberUnitDisplay
<F
, P
>
Inherited from
Defined in
src/sdk/components/FSComponent.ts:73
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
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
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
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
Defined in
src/sdk/components/common/AbstractNumberUnitDisplay.tsx:57
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | 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
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
Name | Type | Description |
---|---|---|
displayUnit | null | 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
Name | Type | Description |
---|---|---|
value | NumberUnitInterface <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
Defined in
src/sdk/components/FSComponent.ts:93