ensemble.Compo
#
ensemble- ensemble
- ~Compo โ
_composition
- instance
- .node โ
Element
- .parent โ
ensemble.Compo
- .previous โ
ensemble.Compo
- .next โ
ensemble.Compo
- .classList โ
DOMTokenList
- ._Symbol.toStringTag โ
string
- ._element(ns, tag, name, props, [options], [elementNS])
- .hasAttr(attr) โ
boolean
- .getAttr(attr) โ
string
- .setAttr(attr, value)
- .delAttr(attr)
- .getStyle(prop) โ
mixed
- .show()
- .hide()
- .enable()
- .disable()
- .node โ
- static
- .isCompo() โ
boolean
- .isCompo() โ
- instance
- ~DENIED_PROPS :
RegExp
- ~Compo โ
_composition
#
ensemble~Compo โ 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 โ
_composition
- instance
- .node โ
Element
- .parent โ
ensemble.Compo
- .previous โ
ensemble.Compo
- .next โ
ensemble.Compo
- .classList โ
DOMTokenList
- ._Symbol.toStringTag โ
string
- ._element(ns, tag, name, props, [options], [elementNS])
- .hasAttr(attr) โ
boolean
- .getAttr(attr) โ
string
- .setAttr(attr, value)
- .delAttr(attr)
- .getStyle(prop) โ
mixed
- .show()
- .hide()
- .enable()
- .disable()
- .node โ
- static
- .isCompo() โ
boolean
- .isCompo() โ
- instance
Element
#
compo.node โ 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
ensemble.Compo
#
compo.parent โ Getter for parent property, intended as the parent compo of this composition.
Kind: instance property of Compo
ensemble.Compo
#
compo.previous โ Getter for previous property, intended as the previous sibling of this composition.
Kind: instance property of Compo
ensemble.Compo
#
compo.next โ Getter for next property, intended as the next sibling of this composition.
Kind: instance property of Compo
DOMTokenList
#
compo.classList โ Getter for classList property, intended as the classList of the Element node inside this composition.
Kind: instance property of Compo
See: DOMTokenList
string
#
compo._Symbol.toStringTag โ 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()
Param | Type | Description |
---|---|---|
ns | string | Component namespace |
tag | string | The element Node tag -or- component name |
name | string | Name for composition, used for CSS className |
props | object | Properties for composition |
[options] | object | An optional ElementCreationOptions object [DOM] |
[elementNS] | object | Options for namespaced Element node [DOM] |
[elementNS.namespaceURI] | string | A valid namespace URI |
[elementNS.qualifiedName] | string | A valid qualified name |
boolean
#
compo.hasAttr(attr) โ Check for an attribute of this composition.
Kind: instance method of Compo
See: Element.hasAttribute()
Param | Type | Description |
---|---|---|
attr | string | An attribute |
string
#
compo.getAttr(attr) โ Gets an attribute from this composition.
Kind: instance method of Compo
See: Element.getAttribute()
Param | Type | Description |
---|---|---|
attr | string | An attribute |
#
compo.setAttr(attr, value)Sets an attribute in this composition.
Kind: instance method of Compo
See: Element.setAttribute()
Param | Type | Description |
---|---|---|
attr | string | An attribute |
value | string | The value |
#
compo.delAttr(attr)Removes an attribute from this composition.
Kind: instance method of Compo
See: Element.removeAttribute()
Param | Type | Description |
---|---|---|
attr | string | An attribute |
mixed
#
compo.getStyle(prop) โ Gets a current style property.
Kind: instance method of Compo
See: window.getComputedStyle()
Param | Type | Description |
---|---|---|
prop | string | A 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
boolean
#
Compo.isCompo() โ Check if passed object is an ensemble.Compo instance.
Kind: static method of Compo
Todo
- backward compatibility
RegExp
#
ensemble~DENIED_PROPS : Constructor method.
Kind: inner constant of ensemble
Todo
- props.dataset
Param | Type | Default | Description |
---|---|---|---|
ns | string | Component namespace | |
[tag] | string | "'div'" | The [DOM] Element node tag -or- component name |
[name] | string | Array.<string> | The composition name, used for CSS className | |
[props] | object | Properties for composition | |
[options] | object | An optional ElementCreationOptions object [DOM] | |
[elementNS] | object | Options for namespaced Element node [DOM] | |
[elementNS.namespaceURI] | string | A valid namespace URI | |
[elementNS.qualifiedName] | string | A valid qualified name |