Class: HardwareUiControlList<T, E, P>
A component that displays a collection of UiControls in a list format.
Type parameters
Name | Type |
---|---|
T | T |
E | extends Record <string , any > = Record <string , never > |
P | extends HardwareControlListProps <T > = HardwareControlListProps <T > |
Hierarchy
HardwareUiControl
<E
,P
>↳
HardwareUiControlList
Constructors
constructor
• new HardwareUiControlList<T
, E
, P
>(props
): HardwareUiControlList
<T
, E
, P
>
Creates an instance of a ControlList.
Type parameters
Name | Type |
---|---|
T | T |
E | extends Record <string , any > = Record <string , never > |
P | extends HardwareControlListProps <T > = HardwareControlListProps <T > |
Parameters
Name | Type | Description |
---|---|---|
props | P | The props on the ControlList component. |
Returns
HardwareUiControlList
<T
, E
, P
>
Overrides
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:64
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
focusedIndex
• Protected
focusedIndex: number
= -1
Inherited from
HardwareUiControl.focusedIndex
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:139
props
• props: P
& ComponentProps
The properties of the component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:61
registeredControls
• Protected
registeredControls: undefined
| HardwareUiControl
<E
, HardwareUiControlProps
>[]
Inherited from
HardwareUiControl.registeredControls
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:137
Accessors
isDisabled
• get
isDisabled(): boolean
Gets whether or not the control is currently disabled.
Returns
boolean
True if disabled, false otherwise.
Inherited from
HardwareUiControl.isDisabled
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:177
isFocused
• get
isFocused(): boolean
Gets whether or not the control is currently focused.
Returns
boolean
True if disabled, false otherwise.
Inherited from
HardwareUiControl.isFocused
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:185
isIsolated
• get
isIsolated(): boolean
Gets whether or not the control is currently in scroll isolation.
Returns
boolean
True if currently in scroll isolation, false otherwise.
Inherited from
HardwareUiControl.isIsolated
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:193
length
• get
length(): number
Gets the current number of registered child controls.
Returns
number
The current number of registered child controls.
Inherited from
HardwareUiControl.length
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:165
Methods
blur
▸ blur(): void
Blurs, or removes focus, from the component.
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:593
clearRegistered
▸ clearRegistered(): void
Clears the list of registered components.
Returns
void
Inherited from
HardwareUiControl.clearRegistered
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:793
destroy
▸ destroy(): void
Destroys this component.
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:923
ensureIndexInView
▸ ensureIndexInView(index
, pinDirection?
): void
Ensures an indexed list item is in view.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
index | number | undefined | The index of the list item. |
pinDirection | "top" | "none" | "bottom" | 'none' | The end of the container which the element should be pinned to. |
Returns
void
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:385
focus
▸ focus(focusPosition
): boolean
Brings focus to the control. Focusing the control will also blur the currently focused control, if any.
Parameters
Name | Type | Description |
---|---|---|
focusPosition | FocusPosition | The focus position to activate for descendents of this control. |
Returns
boolean
Whether this control was successfully focused.
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:410
getChild
▸ getChild(index
): undefined
| HardwareUiControl
<E
, HardwareUiControlProps
>
Gets a child control at the specified index.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the child control to get. |
Returns
undefined
| HardwareUiControl
<E
, HardwareUiControlProps
>
The specified child control.
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:859
getChildInstance
▸ getChildInstance<TControl
>(index
): null
| TControl
Gets the instance of the node at the specified index.
Type parameters
Name | Type |
---|---|
TControl | extends HardwareUiControl <E , HardwareUiControlProps > |
Parameters
Name | Type | Description |
---|---|---|
index | number | The index to get the instance for. |
Returns
null
| TControl
The node instance of specified type.
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:446
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
getData
▸ getData(index
): null
| T
Gets the data object related to the selected DOM element.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the data to get. |
Returns
null
| T
The selected item, if found.
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:407
getFocusPositionOnScroll
▸ getFocusPositionOnScroll(direction
): FocusPosition
Gets the focus position to apply when this control is focused from a scroll.
Parameters
Name | Type | Description |
---|---|---|
direction | ScrollDirection | The direction of the scroll. |
Returns
The focus position to apply when this control is focused from a scroll.
Inherited from
HardwareUiControl.getFocusPositionOnScroll
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:250
getFocusedIndex
▸ getFocusedIndex(): number
Gets the current focused index in the registered controls collection.
Returns
number
The index of the focused control in the collection of registered controls.
Inherited from
HardwareUiControl.getFocusedIndex
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:824
getMostRecentFocusedIndex
▸ getMostRecentFocusedIndex(): number
Gets the most recent focused index (including the current focused index, if one exists) in the registered controls collection.
Returns
number
The index of the most recently focused control in the collection of registered controls.
Inherited from
HardwareUiControl.getMostRecentFocusedIndex
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:833
getSelectedElement
▸ getSelectedElement(): null
| HTMLElement
Get the selected HTMLElement.
Returns
null
| HTMLElement
The selected element, if found.
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:425
getSelectedIndex
▸ getSelectedIndex(): number
Gets the index of the currently selected element.
Returns
number
Selected element index. Returns -1 if nothing found.
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:433
indexOf
▸ indexOf(child
): number
Gets the index of a specified child control within the registered child controls collection.
Parameters
Name | Type | Description |
---|---|---|
child | HardwareUiControl <E , HardwareUiControlProps > | The child to get the index of. |
Returns
number
The index of the child, or -1 if not found.
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:873
onAfterRender
▸ onAfterRender(node
): void
A callback that is called after the component is rendered.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | The component's VNode. |
Returns
void
Overrides
HardwareUiControl.onAfterRender
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:76
onAfterScroll
▸ onAfterScroll(control
, index
): void
An event called when a scroll operation has completed.
Parameters
Name | Type | Description |
---|---|---|
control | HardwareUiControl <E , HardwareUiControlProps > | The control that was scrolled to. |
index | number | The index of the control in the collection of registered controls. |
Returns
void
Inherited from
HardwareUiControl.onAfterScroll
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:284
onBeforeRender
▸ onBeforeRender(): void
A callback that is called before the component is rendered.
Returns
void
Inherited from
HardwareUiControl.onBeforeRender
Defined in
src/sdk/components/FSComponent.ts:80
onBlurred
▸ onBlurred(source
): void
An event called when the control is blurred.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , P > | The control that emitted this event. |
Returns
void
Overrides
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:456
onDisabled
▸ onDisabled(source
): void
An event called when the control is disabled.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , HardwareUiControlProps > | The control that emitted this event. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:225
onEnabled
▸ onEnabled(source
): void
An event called when the control is enabled.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , HardwareUiControlProps > | The control that emitted this event. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:217
onFocused
▸ onFocused(source
): void
An event called when the control receives focus.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , HardwareUiControlProps > | The control that emitted this event. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:201
onInteractionEvent
▸ onInteractionEvent(event
): boolean
A method which is called when this control receives an interaction event.
Parameters
Name | Type | Description |
---|---|---|
event | keyof E | The event. |
Returns
boolean
True if the event was handled, false otherwise.
Inherited from
HardwareUiControl.onInteractionEvent
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:337
onRegistered
▸ onRegistered(source
): void
An event called when a control is registered with this control.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , HardwareUiControlProps > | The control that emitted this event. |
Returns
void
Inherited from
HardwareUiControl.onRegistered
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:233
onScroll
▸ onScroll(direction
): boolean
An event called when the control is scrolled.
Parameters
Name | Type | Description |
---|---|---|
direction | ScrollDirection | The direction that is being requested to scroll. |
Returns
boolean
True if this control handled this event, false otherwise.
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:263
onUnregistered
▸ onUnregistered(source
): void
An event called when a control is unregistered from this control.
Parameters
Name | Type | Description |
---|---|---|
source | HardwareUiControl <E , HardwareUiControlProps > | The control that emitted this event. |
Returns
void
Inherited from
HardwareUiControl.onUnregistered
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:241
reconcileChildBlur
▸ reconcileChildBlur(index
, child
): number
| BlurReconciliation
Reconciles the focus state of this control's children when this control is focused with no focused children after a child has been blurred.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the child control that was blurred. If the child is no longer registered, then this is the index of the child prior to being unregistered. |
child | HardwareUiControl <E , HardwareUiControlProps > | The child control that was blurred. |
Returns
number
| BlurReconciliation
The index of the child control to focus.
Inherited from
HardwareUiControl.reconcileChildBlur
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:688
register
▸ register(control
, index?
): void
Registers a child control with this control.
Parameters
Name | Type | Description |
---|---|---|
control | HardwareUiControl <E , HardwareUiControlProps > | The control to register. |
index? | number | The index at which to register the control. If none is provided, the control will be registered at the end of the collection of child controls. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:722
render
▸ render(): VNode
Renders the control.
Returns
The component VNode.
Overrides
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:499
renderScrollbar
▸ renderScrollbar(): VNode
Renders the control list scroll bar.
Returns
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:496
scroll
▸ scroll(direction
): boolean
Scrolls the currently focused control in the supplied direction.
Parameters
Name | Type | Description |
---|---|---|
direction | ScrollDirection | The direction that is being requested to scroll. |
Returns
boolean
True if propagation should be stopped, false otherwise.
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:293
scrollToIndex
▸ scrollToIndex(index
, focusPosition?
): void
Scrolls to an item.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
index | number | undefined | is the index of the list item to scroll to. |
focusPosition | FocusPosition | FocusPosition.First | The focus position to apply to children of the item being scrolled to. |
Returns
void
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:373
setDisabled
▸ setDisabled(isDisabled
): void
Sets the component to be disabled, removing the ability for the component to scroll. Setting a component to disabled will also blur the component and its children, if necessary.
Parameters
Name | Type | Description |
---|---|---|
isDisabled | boolean | Whether or not the component is disabled. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:705
setFocusedIndex
▸ setFocusedIndex(index
, focusPosition?
): void
Sets the current most recently focused child control index. If this control is focused and has children that have focus, this will also switch child focus to the new index.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
index | number | undefined | The index of the child control to set most recent focus for. |
focusPosition | FocusPosition | FocusPosition.MostRecent | The focus position to focus the child for, if required. |
Returns
void
Inherited from
HardwareUiControl.setFocusedIndex
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:843
setIsolated
▸ setIsolated(isolated
): void
Sets whether or not this control is in scroll isolation. While scroll isolation is enabled, scroll events will not propagate to the control's parent when the control has focus.
Parameters
Name | Type | Description |
---|---|---|
isolated | boolean | Whether or not the control is isolated. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:895
setParent
▸ setParent(parent
): void
Sets the parent of this control.
Parameters
Name | Type | Description |
---|---|---|
parent | HardwareUiControl <E , HardwareUiControlProps > | The parent to set. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:885
triggerEvent
▸ triggerEvent(event
, source
, ...args
): boolean
Triggers an event on this control. The event will first be routed to the deepest focused descendent of this control and will propagate up the control tree until it is handled or there are no more controls to which to propagate.
Parameters
Name | Type | Description |
---|---|---|
event | keyof E | The event to trigger. |
source | HardwareUiControl <Record <string , any >, HardwareUiControlProps > | The source of the event. Defaults to this if not supplied. |
...args | any [] | Additional arguments to pass to the event handler. |
Returns
boolean
True if the event was handled, false otherwise.
Inherited from
HardwareUiControl.triggerEvent
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:348
unregister
▸ unregister(item
): void
Unregisters a child control with this control.
Parameters
Name | Type | Description |
---|---|---|
item | number | HardwareUiControl <E , HardwareUiControlProps > | The child control or index of a child control to unregister. If a child control is provided, it will attempt to be located in the control's child registry and then removed. If an index is provided, the child control at that registered index will be removed. |
Returns
void
Inherited from
Defined in
src/sdk/components/controls/HardwareUiControl.tsx:748
updateOrder
▸ updateOrder(): void
Updates the order of data items in the list by the props supplied comparison function, if one exists.
Returns
void
Defined in
src/sdk/components/controls/HardwareUiControlList.tsx:276