Skip to main content

ensemble.Compo

ensemble#

ensemble~Compo โ‡ _composition#

Compo is a composition element with shorthands method and utils.

It is a wrapper around an Element node [DOM]. It could be used as base for abstraction of a custom component element.

Kind: inner class of ensemble
Extends: _composition

compo.node โ‡’ Element#

Getter for node property, intended as the Element node inside this composition. Note that a direct access to the node is discouraged.

Kind: instance property of Compo

compo.parent โ‡’ ensemble.Compo#

Getter for parent property, intended as the parent compo of this composition.

Kind: instance property of Compo

compo.previous โ‡’ ensemble.Compo#

Getter for previous property, intended as the previous sibling of this composition.

Kind: instance property of Compo

compo.next โ‡’ ensemble.Compo#

Getter for next property, intended as the next sibling of this composition.

Kind: instance property of Compo

compo.classList โ‡’ DOMTokenList#

Getter for classList property, intended as the classList of the Element node inside this composition.

Kind: instance property of Compo
See: DOMTokenList

compo._Symbol.toStringTag โ‡’ string#

Getter for Symbol property, returns the symbolic name for ensemble.Compo class.

Kind: instance property of Compo
See: Symbol.toStringTag()
Todo

  • return undef
  • backward compatibility

compo._element(ns, tag, name, props, [options], [elementNS])#

Element wrapper.

Kind: instance method of Compo
See

  • document.createElement()
  • document.createElementNS()
ParamTypeDescription
nsstringComponent namespace
tagstringThe element Node tag -or- component name
namestringName for composition, used for CSS className
propsobjectProperties for composition
[options]objectAn optional ElementCreationOptions object [DOM]
[elementNS]objectOptions for namespaced Element node [DOM]
[elementNS.namespaceURI]stringA valid namespace URI
[elementNS.qualifiedName]stringA valid qualified name

compo.hasAttr(attr) โ‡’ boolean#

Check for an attribute of this composition.

Kind: instance method of Compo
See: Element.hasAttribute()

ParamTypeDescription
attrstringAn attribute

compo.getAttr(attr) โ‡’ string#

Gets an attribute from this composition.

Kind: instance method of Compo
See: Element.getAttribute()

ParamTypeDescription
attrstringAn attribute

compo.setAttr(attr, value)#

Sets an attribute in this composition.

Kind: instance method of Compo
See: Element.setAttribute()

ParamTypeDescription
attrstringAn attribute
valuestringThe value

compo.delAttr(attr)#

Removes an attribute from this composition.

Kind: instance method of Compo
See: Element.removeAttribute()

ParamTypeDescription
attrstringAn attribute

compo.getStyle(prop) โ‡’ mixed#

Gets a current style property.

Kind: instance method of Compo
See: window.getComputedStyle()

ParamTypeDescription
propstringA style property

compo.show()#

Time to show this composition.

Kind: instance method of Compo

compo.hide()#

Time to hide this composition.

Kind: instance method of Compo

compo.enable()#

Util to set attribute disabled to true

Kind: instance method of Compo

compo.disable()#

Util to set attribute disabled to false

Kind: instance method of Compo

Compo.isCompo() โ‡’ boolean#

Check if passed object is an ensemble.Compo instance.

Kind: static method of Compo
Todo

  • backward compatibility

ensemble~DENIED_PROPS : RegExp#

Constructor method.

Kind: inner constant of ensemble
Todo

  • props.dataset
ParamTypeDefaultDescription
nsstringComponent namespace
[tag]string"'div'"The [DOM] Element node tag -or- component name
[name]string | Array.<string>The composition name, used for CSS className
[props]objectProperties for composition
[options]objectAn optional ElementCreationOptions object [DOM]
[elementNS]objectOptions for namespaced Element node [DOM]
[elementNS.namespaceURI]stringA valid namespace URI
[elementNS.qualifiedName]stringA valid qualified name