UIListController

The UIListController component manages a list of views based on a list of components.

class UIListController

extends UIRenderableController<UIContainer>

Renderable wrapper that populates an encapsulated container with components, constructed using given view adapter (e.g. preset constructor for UIListCellAdapter components); each instance of the view adapter corresponds to exactly one value from a list.

Constructor

(content?: UIContainer): UIListController

.onFocusIn() protected

(e: ComponentEvent<Component>): boolean

Handle FocusIn events, saving the index of the focused item or restoring focus on the item that was focused last.

.onArrowUpKeyPress() protected

(): boolean

Handle ArrowUpKeyPress events, focusing the previous list item.

.onArrowDownKeyPress() protected

(): boolean

Handle ArrowDownKeyPress events, focusing the next list item.

.enableArrowKeyFocus

boolean

Set to true to enable selection (focus movement) using up/down arrow keys.

.items

ManagedList<ManagedObject>

List of objects, each object is used to construct one content component.

.firstIndex

number

Index of first item to be shown in the list (for e.g. pagination, or sliding window positioning), defaults to 0.

.maxItems

number

Maximum number of items to be shown in the list (for e.g. pagination, or sliding window positioning), defaults to undefined to show all items.

.lastFocusedIndex

number

Last focused index, if any.

.getIndexOfComponent()

(component?: Component): number

Returns the list index of given component, or of the component that it is contained in; or returns -1 if given component is not found in the list.

.restoreFocus()

(): void

Request input focus for the last focused list component, or the first item, if possible.

.focusPreviousItem()

(): boolean

Request input focus for the item before the currently focused item; returns true if such an item exists, false if the currently focused item is already the first item or there are no items in the list.

.focusNextItem()

(): boolean

Request input focus for the item after the currently focused item; returns true if such an item exists, false if the currently focused item is already the last item or if there are no items in the list.

.renderContext

UIRenderContext

Inherited from UIRenderableController.renderContext.

.content

TContent

Inherited from UIRenderableController.content.

.delegateEvent() protected

(e: ManagedEvent, propertyName: string): true

Inherited from UIRenderableController.delegateEvent.

.render()

(callback?: RenderCallback<Output<UIRenderable, any>>): void

Inherited from UIRenderableController.render.

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.getParentComponent()

<TParent extends Component = Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.

.getBoundParentComponent()

<TParent extends Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getBoundParentComponent.

.emitAction()

(name: string, inner?: ManagedEvent, context?: ManagedObject): void

Inherited from Component.emitAction.

.propagateComponentEvent() deprecated

(name: string, inner?: ManagedEvent): void

Inherited from Component.propagateComponentEvent.

.managedId

number

Inherited from ManagedObject.managedId.

.managedState

ManagedState

Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

<TParent extends ManagedObject = ManagedObject>(ParentClass?: ManagedObjectConstructor<TParent>): TParent

Inherited from ManagedObject.getManagedParent.

.emit()

<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this

Inherited from ManagedObject.emit.

.emitChange()

(name?: string): void

Inherited from ManagedObject.emitChange.

.propagateChildEvents() protected deprecated

(...types: ((new (...args: any[]) => ManagedEvent) | ((e: ManagedEvent) => any))[]): this

Inherited from ManagedObject.propagateChildEvents.

.activateManagedAsync() protected

(): Promise<any>

Inherited from ManagedObject.activateManagedAsync.

.deactivateManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.deactivateManagedAsync.

.destroyManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.destroyManagedAsync.

.onManagedStateActivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActivatingAsync.

.onManagedStateActiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActiveAsync.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateInactiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateInactiveAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


UIListController.Presets

UIListController presets type, for use with Component.with.

.items

Iterable<ManagedObject>

List of items: initial values, or a list binding.

.enableArrowKeyFocus

boolean

Set to true to enable selection (focus movement) using up/down arrow keys.

.firstIndex

number

Index of first item to be shown in the list (for e.g. pagination, or sliding window positioning), defaults to 0.

.maxItems

number

Maximum number of items to be shown in the list (for e.g. pagination, or sliding window positioning), defaults to undefined to show all items.

.onListItemsChange

ComponentEventHandler<UIListController, ComponentEvent<Component>>

Event handler for any change in displayed list items, and list initialization.