Reference Source
public class | source

UIFactory

Extends:

../node_modules/devapt-core-common/dist/js/base/loggable.js~Loggable → UIFactory

Constructor Summary

Public Constructor
public

constructor(arg_runtime: object, arg_store: object): nothing

Create a UI factory instance.

Member Summary

Public Members
public
Private Members
private

_cache: {}

private
private
private

_store: *

Method Summary

Public Methods
public

create(arg_component_name: string): Promise

Create a UI component.

public

create_instance(arg_component_name: string, arg_component_desc: object, arg_state_path: array): Component | undefined

Create a UI component.

public

create_instance_mix(arg_component_name: string, arg_component_desc: object, arg_state_path: array): object

Create a UI component.

public

create_instance_promise(arg_component_name: string, arg_component_desc: object, arg_state_path: array): Promise

Create a UI component.

public

create_local(arg_component_name: string, arg_component_desc: object): Component

Create a UI component with local cache and state.

public

find_component_desc(arg_state: Immutable.Map, arg_name: string, arg_state_path: array): Immutable.Map | undefined

Find UI component description.

public

get(arg_name: string): Component

Get a UI component by its name.

public

Create a UI component.

public

has(arg_name: string): boolean

Test a UI component by its name.

public

request_component_desc(arg_component_name: *): *

Public Constructors

public constructor(arg_runtime: object, arg_store: object): nothing source

Create a UI factory instance.

API:
    ->constructor(arg_runtime, arg_store)
    ->get(arg_name):Component - Get a UI component by its name.
    ->create(arg_name):Component - Create a UI component.
    ->find_component_desc(arg_state, arg_name, arg_state_path = []):Immutable.Map|undefined - Find a UI component state.

Params:

NameTypeAttributeDescription
arg_runtime object

client runtime.

arg_store object

UI components state store.

Return:

nothing

Public Members

public is_ui_factory: boolean source

Private Members

private _cache: {} source

private _runtime: * source

private _state_by_path: {} source

private _store: * source

Public Methods

public create(arg_component_name: string): Promise source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_component_name string

component name.

Return:

Promise

promise of Component instance

public create_instance(arg_component_name: string, arg_component_desc: object, arg_state_path: array): Component | undefined source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_component_name string

component name.

arg_component_desc object

component description.

arg_state_path array

component state path.

Return:

Component | undefined

Component instance

public create_instance_mix(arg_component_name: string, arg_component_desc: object, arg_state_path: array): object source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_component_name string

component name.

arg_component_desc object

component description.

arg_state_path array

component state path.

Return:

object

{ component:Component, promise:Promise}

public create_instance_promise(arg_component_name: string, arg_component_desc: object, arg_state_path: array): Promise source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_component_name string

component name.

arg_component_desc object

component description.

arg_state_path array

component state path.

Return:

Promise

Component instance

public create_local(arg_component_name: string, arg_component_desc: object): Component source

Create a UI component with local cache and state.

Params:

NameTypeAttributeDescription
arg_component_name string

component name.

arg_component_desc object

component description (optional, default:undefined).

Return:

Component

Component instance

public find_component_desc(arg_state: Immutable.Map, arg_name: string, arg_state_path: array): Immutable.Map | undefined source

Find UI component description.

Params:

NameTypeAttributeDescription
arg_state Immutable.Map

registry global state object.

arg_name string

component name.

arg_state_path array

state path (optional, default=[])

Return:

Immutable.Map | undefined

component state object.

public get(arg_name: string): Component source

Get a UI component by its name.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

Component

public get_component_class(arg_name: string): Component source

Create a UI component.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

Component

public has(arg_name: string): boolean source

Test a UI component by its name.

Params:

NameTypeAttributeDescription
arg_name string

component name.

Return:

boolean

public request_component_desc(arg_component_name: *): * source

Params:

NameTypeAttributeDescription
arg_component_name *

Return:

*