Releases: Nashorn/od-cocoon
v6.0.1
v6.0.0
v5.4.0
v5.3.0
v5.2.2
v5.2.1
v5.2.0
v5.1.0
This version has support for themes. Components may now implement a getter theme() that returns the name of a theme:
Example:
namespace ui.components ( class Knob extends WebComponent { get theme(){ return "metal" } } )
This will force the component to use the theme named "metal" located at
src/ui/components/Knob/skins/metal/index.css
instead of the default index.css asset that is normally loaded.
Alternatively, the can be enforced globally in the HEAD tag using:
Config.THEME = "metal";
Components that inherit from a themed component will inherit the new theme
and will also attempt to load it's own theme named "metal", since the getter
is inherited. You may want to inherit the parents skin but not want to load
a them for the child, this can be overridden:
get theme(){ return null }
Which will load the sub-classed components default index.css.
v5.0.2
v5.0.0
Breaking addEventListener change. New e.matchedTarget added to event signal. This new prop attached to the event object on callbacks will give you the real captured target that was clicked if it matches 4th argument of arc's overloaded addEventListener(). In previous versions of Arc/cocoon, e.target was attached to a pseudo event object via cherry picking of event props.
Now, the real event is handed back with a new 'matchedTarget' property. Example:
Given this HTML in your component:
<template>
<button>
<i class="fa fa-edit"></i>
</button>
</template>
You may matched clicks at the button level, even if the real click occured deep in the icon:
addEventListener('click, e=> this.onDoSomething(e), false, 'button');
e.matchedTarget returns button as the intended target, not the icon inside the button that was clicked, which is e.target
onDoSomething(e) {
alert(e.matchedTarget)
}