UIListCellAdapter

class UIListCellAdapter

extends UIListCellAdapter_base implements UIRenderable

Component that can be used as an adapter to render items in a UIListController. Instances are constructed using a single argument (a managed object from UIListController.items), and are activated when rendered to create the cell component. The static with method takes the same arguments as UICell itself along with additional properties to manage display of selected and focused cells. Encapsulated content can include bindings to the object and selected properties.

Example (preset)

UIListController.with(
  { items: "fooList" },
  UIListCellAdapter.with(
    {
      // ... (preset UICell properties)
    },

    // ...UICell content, can bind to "object":
    tl("Item: ${object.name}")
  )
)

Constructor

<TObject extends ManagedObject = ManagedObject>(object: TObject): UIListCellAdapter<TObject>

.renderContext

UIRenderContext

Application render context, propagated from the parent composite object.

.object

TObject

The encapsulated object.

.value

any

The value property of the encapsulated object (or the list value itself, if the list was bound to an array with non-managed object values).

.cell

UICell

The encapsulated cell, as a child component; only created when the UIListCellAdapter is rendered.

.onManagedStateActiveAsync()

(): Promise<void>

Callback invoked immediately after state has changed to ‘active’ and before any other state transitions, to be overridden.

.onManagedStateInactiveAsync()

(): Promise<void>

Callback invoked immediately after state has changed to ‘inactive’ and before any other state transitions, to be overridden.

.propagateComponentEvent()

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

Create and emit a UIListCellAdapterEvent with given name and a reference to this component and its cell and object; see Component.propagateComponentEvent.

.selected

boolean

True if the cell is currently selected (based on Select and Deselect events).

.hovered

boolean

True if the cell is currently hovered over using the mouse cursor (based on MouseEnter and MouseLeave events).

.requestFocus()

(): void

Request input focus on the current cell.

.requestFocusNext()

(): void

Request input focus for the next sibling cell.

.requestFocusPrevious()

(): void

Request input focus for the previous sibling cell.

.render()

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

Trigger asynchronous rendering for this component, and all contained components (if any).

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.getParentComponent()

[1]. (): Component
[2]. <TParent extends Component>(ParentClass: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.

.getCompositeParent()

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

Inherited from Component.getCompositeParent.

.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

[1]. (): ManagedObject
[2]. <TParent extends 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.

.propagateChildEvents() protected

[1]. (f?: (this: this, e: ManagedEvent, propertyName: string) => void | ManagedEvent | ManagedEvent[]): this
[2]. (...types: (ManagedEvent | (new (...args: any[]) => ManagedEvent))[]): 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.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


UIListCellAdapter.Presets

type Presets = Omit<UICell.Presets, keyof EventPresets> & EventPresets;

UICell presets type, for use with Component.with.