Reference Source
public class | source

Rendering

Constructor Summary

Public Constructor
public

constructor(arg_component: Component, arg_dom_id: string): nothing

Creates an instance of Rendering.

Member Summary

Public Members
public
Private Members
private
private
private

_dom_id: *

private
private

Method Summary

Public Methods
public

get_dom_element(): Element

Get DOM element.

public

Get DOM id.

public

get_dom_vnode(): VNode

Get DOM Virtual Node.

public

has_child_element(arg_parent_element: *, arg_child_element: *): boolean

public

Test DOM Element instance.

public

Test DOM Virtual Node.

public

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

Mount dom event handler.

public

process_rendering_vnode(arg_vnode: VNode): Promise

Process rendered VNode: Create or update DOM element.

public

Render component VNode.

public

save_rendering(): nothing

Save rendering virtul node.

public

set_dom_element(arg_element: Element): nothing

Set DOM element.

public

set_dom_vnode(arg_vnode: VNode): nothing

Set DOM Virtual Node.

Public Constructors

public constructor(arg_component: Component, arg_dom_id: string): nothing source

Creates an instance of Rendering.

Params:

NameTypeAttributeDescription
arg_component Component

component instance.

arg_dom_id string

component dom element id

Return:

nothing

Public Members

public is_rendering: boolean source

Private Members

private _component: * source

private _dom_element: * source

private _dom_id: * source

private _dom_vnode: * source

private _event_delegator: * source

Public Methods

public get_dom_element(): Element source

Get DOM element.

Return:

Element

DOM Element instance.

public get_dom_id(): string source

Get DOM id.

Return:

string

component DOM id.

public get_dom_vnode(): VNode source

Get DOM Virtual Node.

Return:

VNode

public has_child_element(arg_parent_element: *, arg_child_element: *): boolean source

Params:

NameTypeAttributeDescription
arg_parent_element *
arg_child_element *

Return:

boolean

public has_dom_element(): boolean source

Test DOM Element instance.

Return:

boolean

public has_dom_vnode(): boolean source

Test DOM Virtual Node.

Return:

boolean

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

Mount dom event handler.

@{string} arg_dom_event - dom event name. @{string} arg_dom_selector - dom selector string ('tag_name.class1.class2'). @{function} arg_handler - handler function f(component, event name, selection, event, target). @{any} arg_data - handler datas, default undefined (optional). @{boolean} arg_debug - trace flag, default true (optional).

Params:

NameTypeAttributeDescription
arg_dom_event *
arg_dom_selector *
arg_handler *
arg_data *
  • optional
  • default: undefined
arg_debug boolean
  • optional
  • default: true

Return:

boolean

public process_rendering_vnode(arg_vnode: VNode): Promise source

Process rendered VNode: Create or update DOM element.

Params:

NameTypeAttributeDescription
arg_vnode VNode

rendered virtual node.

Return:

Promise

Promise of this component to chain promises.

public render(): Promise source

Render component VNode.

Return:

Promise

Promise of this component to chain promises.

public save_rendering(): nothing source

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

Return:

nothing

public set_dom_element(arg_element: Element): nothing source

Set DOM element.

Params:

NameTypeAttributeDescription
arg_element Element

element instance.

Return:

nothing

public set_dom_vnode(arg_vnode: VNode): nothing source

Set DOM Virtual Node.

Params:

NameTypeAttributeDescription
arg_vnode VNode

VNode instance.

Return:

nothing