0.1.2 • Published 6 years ago
@catalyst-elements/catalyst-labelable-mixin v0.1.2
catalyst-labelable-mixin
<catalyst-labelable-mixin>
is a mixin that provides an element with toggle behavior.
Installation
Install with npm:
npm install --save @catalyst-elements/catalyst-labelable-mixin
Install with yarn:
yarn add @catalyst-elements/catalyst-labelable-mixin
Please note that this package is not compatible with Bower.
Usage
As a Module (Recommend)
import CatalystLabelableMixin from './node_modules/@catalyst-elements/catalyst-labelable-mixin/catalyst-labelable-mixin.js';
class MyLabelableElement extends CatalystLabelableMixin(HTMLElement) {
constructor() {
super();
// ...
}
// ...
}
As a Script
<script src="node_modules/@catalyst-elements/catalyst-labelable-mixin/catalyst-labelable-mixin.es5.min.js"></script>
<script>
var SuperClass = window.CatalystElements.CatalystLabelableMixin(HTMLElement);
function MyLabelableElement() {
SuperClass.call(this);
// ...
};
MyLabelableElement.prototype = Object.create(SuperClass.prototype);
MyLabelableElement.prototype.constructor = MyLabelableElement;
// ...
</script>
Please note that this script has been transpiled to es5 and thus use of custom-elements-es5-adapter.js
or an equivalent library is required. See es5 support on the Catalyst Elements wiki for details.
Contributions
Contributions are most welcome.
Please read our contribution guidelines.