Reference Source
public class | source

Component

Extends:

devapt-core-common/dist/js/base/stateable~StateableDom → Component

Constructor Summary

Public Constructor
public

constructor(arg_runtime: RuntimeBase, arg_state: Immutable.Map, arg_log_context: string): nothing

Creates an instance of Component.

Member Summary

Public Members
public
public
public
public

saved_dom: {"body_overflow": *, "className": *, "style": *}

public
Private Members
private
private
private

_bindings: {}

private
private
private
private
private

Method Summary

Public Methods
public

add_assets_dependancy(arg_asset_id: string): nothing

Add assets dependancy.

public

Clear component to initial values.

public

Collapse component from fullscreen to original size.

public

Destroy component DOM element.

public

dispatch_update_state_action(arg_new_state: Immutable.Map): nothing

Dispatch update state action.

public

dispatch_update_state_value_action(arg_path: array | string, arg_value: any): nothing

Dispatch update state action.

public

Expand component to fullscreen (inside browser window).

public

Get assets dependancies.

public

Get assets promises.

public

Get view children components.

public

get_named_stream(arg_stream_name: string): Stream | undefined

Get a named stream.

public

Get component content value object.

public

Get component content value string.

public

init_assets(): nothing

Init assets promises.

public

init_bindings(): nothing

Init bindings.

public

load(arg_state: Immutable.Map | undefined): nothing | Promise

Load and apply a component configuration.

public

process_rendering_vnode(arg_rendering_result: *, arg_credentials: *)

PROCESS RENDERING VNODE: CREATE OR UPDATE DOM ELEMENT.

public

Render a component inside this element from a json description.

public

register_from_json(arg_options: object): nothing

Register a component description from a json content.

public

render(arg_force: boolean): Promise

Render component DOM element.

public

render_inside_from_json(arg_name: string, arg_json_desc: object): nothing

Render a component inside this element from a json description.

public

resize(arg_width: any, arg_height: any): nothing

Resize component.

public

restore_(): nothing

Toggle component fullscreen mode.

public

save_(): nothing

Toggle component fullscreen mode.

public

save_rendering(): nothing

Save rendering virtul node.

public

set_object_value(arg_value: object): nothing

Set component content value object

public

set_text_value(arg_value: string): nothing

Set component content value string.

public

Toggle component fullscreen mode.

public

unload(): nothing

Unload a component configuration.

public

Update view with current state.

public

Update view with current state.

Private Methods
private

_render(arg_force: *): *

private

_update(): *

Inherited Summary

From class Dom
public
private
private

_name: *

private
private
public

clear_dom_text(): nothing

DOM element manipulation:clear dom element text value.

public

clear_dom_value(): nothing

DOM element manipulation:clear dom element value.

public

get_dom_attr(arg_attr_name: string): string

DOM element manipulation:get dom element attribute.

public

get_dom_element(): Element

Get DOM element.

public

Get DOM id.

public

get_dom_parent(): Element

Get parent element.

public

DOM element manipulation:get dom element text.

public

DOM element manipulation:get dom element value.

public

get_dom_vnode(): VNode

Get DOM Virtual Node.

public

Get name.

public

Test DOM Element instance.

public

has_dom_parent(arg_element: Element): boolean

Test if component element has given parent element.

public

Test DOM Virtual Node.

public

hide(): nothing

Hide component.

public

is_visible(arg_check: boolean): boolean

Get visibility.

public

on_dom_event(arg_dom_event: *, arg_dom_selector: *, arg_handler: *, arg_data: *, arg_debug: boolean): nothing

Mount dom event handler.

public

set_dom_attr(arg_attr_name: string, arg_attr_value: string): nothing

DOM element manipulation:set dom element attribute value.

public

set_dom_element(arg_element: Element): nothing

Set DOM element.

public

set_dom_parent(arg_parent_element: Element): nothing

Set given parent element.

public

set_dom_parent_of(arg_component: Component): nothing

Set given parent element.

public

set_dom_text(arg_text_value: string): nothing

DOM element manipulation:set dom element text value.

public

set_dom_value(arg_value: string): nothing

DOM element manipulation:set dom element value.

public

set_dom_vnode(arg_vnode: VNode): nothing

Set DOM Virtual Node.

public

show(): nothing

Show component.

public

toggle(): nothing

Toggle component visbility.

private

_get_dom_text(arg_element: *): *

Public Constructors

public constructor(arg_runtime: RuntimeBase, arg_state: Immutable.Map, arg_log_context: string): nothing source

Creates an instance of Component.

Override:

Dom#constructor

Params:

NameTypeAttributeDescription
arg_runtime RuntimeBase

client runtime.

arg_state Immutable.Map

component initial state.

arg_log_context string

context of traces of this instance (optional).

Return:

nothing

Public Members

public is_breadcrumbs: boolean source

public is_component: boolean source

public is_menubar: boolean source

public saved_dom: {"body_overflow": *, "className": *, "style": *} source

public store_unsubscribe: * source

Private Members

private _assets_dependancies: *[] source

private _assets_promise: * source

private _bindings: {} source

private _children_components: * source

private _dom_element: * source

private _is_loaded: boolean source

private _is_visible: boolean source

Override:

Dom#_is_visible

private _ready_promise: * source

Public Methods

public add_assets_dependancy(arg_asset_id: string): nothing source

Add assets dependancy.

Params:

NameTypeAttributeDescription
arg_asset_id string

asset element id.

Return:

nothing

public clear(): Promise source

Clear component to initial values.

Return:

Promise

public collapse_from_fullscreen(): nothing source

Collapse component from fullscreen to original size.

Return:

nothing

public destroy(): Promise source

Destroy component DOM element.

Return:

Promise

public dispatch_update_state_action(arg_new_state: Immutable.Map): nothing source

Dispatch update state action.

Params:

NameTypeAttributeDescription
arg_new_state Immutable.Map

new state Immutable Map.

Return:

nothing

public dispatch_update_state_value_action(arg_path: array | string, arg_value: any): nothing source

Dispatch update state action.

Params:

NameTypeAttributeDescription
arg_path array | string

component state path.

arg_value any

component state value.

Return:

nothing

public expand_to_fullscreen(): nothing source

Expand component to fullscreen (inside browser window).

Return:

nothing

public get_assets_dependancies(): array source

Get assets dependancies.

Return:

array

public get_assets_promise(): Promise source

Get assets promises.

Return:

Promise

public get_children_component(): array source

Get view children components.

Return:

array

list of Component.

public get_named_stream(arg_stream_name: string): Stream | undefined source

Get a named stream.

Params:

NameTypeAttributeDescription
arg_stream_name string

stream name.

Return:

Stream | undefined

found stream.

public get_object_value(): object source

Get component content value object.

Return:

object

public get_text_value(): string source

Get component content value string.

Return:

string

public init_assets(): nothing source

Init assets promises.

Return:

nothing

public init_bindings(): nothing source

Init bindings.

Return:

nothing

public load(arg_state: Immutable.Map | undefined): nothing | Promise source

Load and apply a component configuration.

Params:

NameTypeAttributeDescription
arg_state Immutable.Map | undefined

component state to load (optional).

Return:

nothing | Promise

public process_rendering_vnode(arg_rendering_result: *, arg_credentials: *) source

PROCESS RENDERING VNODE: CREATE OR UPDATE DOM ELEMENT.

Params:

NameTypeAttributeDescription
arg_rendering_result *
arg_credentials *

public register_and_render_inside_from_json(arg_options: object): nothing source

Render a component inside this element from a json description.

Params:

NameTypeAttributeDescription
arg_options object

json source configuration.

Return:

nothing

public register_from_json(arg_options: object): nothing source

Register a component description from a json content.

Params:

NameTypeAttributeDescription
arg_options object

json source configuration.

Return:

nothing

public render(arg_force: boolean): Promise source

Render component DOM element.

Params:

NameTypeAttributeDescription
arg_force boolean

should force creation of a new VNode if a previous rendering exists.

Return:

Promise

Promise of this to chain promises.

public render_inside_from_json(arg_name: string, arg_json_desc: object): nothing source

Render a component inside this element from a json description.

Params:

NameTypeAttributeDescription
arg_name string

component name.

arg_json_desc object

component description.

Return:

nothing

public resize(arg_width: any, arg_height: any): nothing source

Resize component.

Params:

NameTypeAttributeDescription
arg_width any

css width value.

arg_height any

css height value.

Return:

nothing

public restore_(): nothing source

Toggle component fullscreen mode.

Return:

nothing

public save_(): nothing source

Toggle component fullscreen mode.

Return:

nothing

public save_rendering(): nothing source

Save rendering virtul node. Update component VNode with current component HTML.

Return:

nothing

public set_object_value(arg_value: object): nothing source

Set component content value object

Params:

NameTypeAttributeDescription
arg_value object

component values object.

Return:

nothing

public set_text_value(arg_value: string): nothing source

Set component content value string.

Params:

NameTypeAttributeDescription
arg_value string

component values string.

Return:

nothing

public toggle_from_fullscreen(): nothing source

Toggle component fullscreen mode.

Return:

nothing

public unload(): nothing source

Unload a component configuration.

Return:

nothing

public update(): Promise source

Update view with current state.

Return:

Promise

public update_children(): Promise source

Update view with current state.

Return:

Promise

Private Methods

private _render(arg_force: *): * source

Params:

NameTypeAttributeDescription
arg_force *

Return:

*

private _update(): * source

Return:

*