Cat/elements/cat-control-section.html

30 lines
821 B
HTML

<cat-template>
<cat-caption><cat-inherits label='label'></cat-inherits></cat-caption>
<cat-hbox>
<cat-children></cat-children>
</cat-hbox>
</cat-template>
<script>
customElements.define('cat-control-section', class extends HTMLElement {
static get observedAttributes() {
return ['label'];
}
attributeChangedCallback(attr, oldValue, newValue) {
if (attr == 'label') {
this.label = newValue;
} else if (attr == 'closed') {
this.closed = newValue === null ? true : false;
}
}
constructor() {
super();
document.currentScript.ownerDocument.querySelector('cat-template').cloneTo(this);
if (this.hasAttribute('label')) {
this.label = this.getAttribute('label');
}
}
connectedCallback() {
}
});
</script>