@freshworks/crayons
Version:
Crayons Web Components library
32 lines (28 loc) • 1.19 kB
JavaScript
import { r as registerInstance, h, e as Host, i as getElement } from './index-25bc21e4.js';
const tabPanelCss = ":host{font-family:var(--fw-font-family, -apple-system, blinkmacsystemfont, \"Segoe UI\", roboto, oxygen, ubuntu, cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-box-sizing:border-box;box-sizing:border-box}:host{display:block;padding:0;width:var(--fw-tab-panel-width, \"inherit\");height:var(--fw-tab-panel-height, \"inherit\")}";
let counter = 0;
let Panel = class {
constructor(hostRef) {
registerInstance(this, hostRef);
/**
* The panel name.
*/
this.name = '';
/**
* If true sets the panel display to block, none otherwise.
*/
this.active = false;
}
connectedCallback() {
if (!this.el.id) {
this.el.id = `fw-tab-panel-${counter++}`;
}
}
render() {
this.el.style.display = this.active ? 'block' : 'none';
return (h(Host, { role: 'tabpanel', "aria-hidden": this.active ? 'false' : 'true' }, h("slot", null)));
}
get el() { return getElement(this); }
};
Panel.style = tabPanelCss;
export { Panel as fw_tab_panel };