Function
Static Public Summary | ||
public |
applyTemplate(el: HTMLElement, tpl: string) Apply the template given by the property cebTemplate. |
|
public |
attribute(attrName: string): AttributeBuilder Get a new attribute builder. |
|
public |
Get a new custom element builder. |
|
public |
Compile the given HTML template into a function factory. |
|
public |
delegate(builder: PropertyBuilder | AttributeBuilder | MethodBuilder): DelegateBuilder Get a new delegate builder. |
|
public |
Evaluate the string to return a JavaScript compliant syntax. |
|
public |
getAttValue(el: HTMLElement, attrName: string, isBoolean: boolean): string | boolean Get the value from an attribute. |
|
public |
instantiate(load: *): * |
|
public |
method(methName: string): MethodBuilder Get a new method builder. |
|
public |
Get a new on builder. |
|
public |
property(propName: string): PropertyBuilder Get a new property builder. |
|
public |
setAttValue(el: HTMLElement, attrName: string, isBoolean: boolean, value: string | boolean) Set the value of an attribute. |
|
public |
template(tpl: string | Function): TemplateBuilder Get a new template builder. |
|
public |
translate(load: *): * |
Static Public
public applyTemplate(el: HTMLElement, tpl: string) source
import {applyTemplate} from 'custom-elements-builder/lib/builder/TemplateBuilder.js'
Apply the template given by the property cebTemplate.
Params:
Name | Type | Attribute | Description |
el | HTMLElement |
|
the custom element |
tpl | string |
|
the template |
public attribute(attrName: string): AttributeBuilder source
import {attribute} from 'custom-elements-builder'
Get a new attribute builder.
Params:
Name | Type | Attribute | Description |
attrName | string |
|
the name of the attribute |
public ceb(): CustomElementBuilder source
import {ceb} from 'custom-elements-builder'
Get a new custom element builder.
public compile(html: string, options: Object): function(i: !IncrementalDOM, h: *) source
import {compile} from 'custom-elements-builder/lib/idomizer/idomizer.js'
Compile the given HTML template into a function factory.
If the incrementalDOM argument is provided, this function will return a render function. The render function is used with IncrementalDOM.patch.
If the incrementalDOM argument is not provided, this function will return a factory function. The factory function requires the IncrementalDOM library as argument and return the render function..
Basically, when the template is compiled at build time, the IncrementalDOM should not be given. When the template is compiled at runtime, the IncrementalDOM should be given.
public delegate(builder: PropertyBuilder | AttributeBuilder | MethodBuilder): DelegateBuilder source
import {delegate} from 'custom-elements-builder'
Get a new delegate builder.
Params:
Name | Type | Attribute | Description |
builder | PropertyBuilder | AttributeBuilder | MethodBuilder |
|
a property, attribute or method builder |
public evaluate(value: string, options: *, conf: *): string source
import {evaluate} from 'custom-elements-builder/lib/idomizer/idomizer.js'
Evaluate the string to return a JavaScript compliant syntax.
Params:
Name | Type | Attribute | Description |
value | string |
|
the value |
options | * | the options |
|
conf | * | the evaluator's configuration |
public getAttValue(el: HTMLElement, attrName: string, isBoolean: boolean): string | boolean source
import {getAttValue} from 'custom-elements-builder/lib/builder/AttributeBuilder.js'
Get the value from an attribute.
public instantiate(load: *): * source
import {instantiate} from 'custom-elements-builder/lib/idomizer/idomizer-plugin.js'
Params:
Name | Type | Attribute | Description |
load | * |
Return:
* |
public method(methName: string): MethodBuilder source
import {method} from 'custom-elements-builder'
Get a new method builder.
Params:
Name | Type | Attribute | Description |
methName | string |
|
the name of the method |
public on(events: string): OnBuilder source
import {on} from 'custom-elements-builder'
Get a new on builder.
Params:
Name | Type | Attribute | Description |
events | string |
|
a list of tuple 'event target' separated by comas, the target is optional |
public property(propName: string): PropertyBuilder source
import {property} from 'custom-elements-builder'
Get a new property builder.
Params:
Name | Type | Attribute | Description |
propName | string |
|
the name of the property |
public setAttValue(el: HTMLElement, attrName: string, isBoolean: boolean, value: string | boolean) source
import {setAttValue} from 'custom-elements-builder/lib/builder/AttributeBuilder.js'
Set the value of an attribute.
public template(tpl: string | Function): TemplateBuilder source
import {template} from 'custom-elements-builder'
Get a new template builder.
public translate(load: *): * source
import {translate} from 'custom-elements-builder/lib/idomizer/idomizer-plugin.js'
Params:
Name | Type | Attribute | Description |
load | * |
Return:
* |