@salla.sa/twilight-components
Version:
Salla Web Component
59 lines (55 loc) • 1.66 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
const sallaTabContentCss = "";
const SallaTabContent = /*@__PURE__*/ proxyCustomElement(class SallaTabContent extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.isSelected = false;
}
/**
* Expose self for the parent.
*/
async getChild() {
return {
selected: this.selected.bind(this),
unselect: this.unselect.bind(this),
name: this.name
};
}
unselect() {
this.isSelected = false;
}
selected() {
this.isSelected = true;
}
render() {
const classes = {
's-tabs-content': true,
's-tabs-content-selected': this.isSelected
};
return (h("div", { key: '6272014593c424e20e4fc9cc2c59dc5c4bd1abc1', class: classes }, h("slot", { key: 'd7a3c32021cc14da0d895b5830c0cf3c8a047529' })));
}
static get style() { return sallaTabContentCss; }
}, [4, "salla-tab-content", {
"name": [1],
"isSelected": [32],
"getChild": [64]
}]);
function defineCustomElement() {
if (typeof customElements === "undefined") {
return;
}
const components = ["salla-tab-content"];
components.forEach(tagName => { switch (tagName) {
case "salla-tab-content":
if (!customElements.get(tagName)) {
customElements.define(tagName, SallaTabContent);
}
break;
} });
}
defineCustomElement();
export { SallaTabContent as S, defineCustomElement as d };