UNPKG

@synergy-design-system/components

Version:
68 lines (65 loc) 1.69 kB
import { tab_panel_custom_styles_default } from "./chunk.XHWYGYMQ.js"; import { tab_panel_styles_default } from "./chunk.6KIX3PER.js"; import { watch } from "./chunk.UR2E7Y2Q.js"; import { component_styles_default } from "./chunk.2NT3B5WJ.js"; import { SynergyElement } from "./chunk.L2IYPRPF.js"; import { __decorateClass } from "./chunk.VK2FVWOF.js"; // src/components/tab-panel/tab-panel.component.ts import { classMap } from "lit/directives/class-map.js"; import { html } from "lit"; import { property } from "lit/decorators.js"; var id = 0; var SynTabPanel = class extends SynergyElement { constructor() { super(...arguments); this.attrId = ++id; this.componentId = `syn-tab-panel-${this.attrId}`; this.name = ""; this.active = false; } connectedCallback() { super.connectedCallback(); this.id = this.id.length > 0 ? this.id : this.componentId; this.setAttribute("role", "tabpanel"); } handleActiveChange() { this.setAttribute("aria-hidden", this.active ? "false" : "true"); } render() { return html` <slot part="base" class=${classMap({ "tab-panel": true, "tab-panel--active": this.active })} ></slot> `; } }; SynTabPanel.styles = [component_styles_default, tab_panel_styles_default, tab_panel_custom_styles_default]; __decorateClass([ property({ reflect: true }) ], SynTabPanel.prototype, "name", 2); __decorateClass([ property({ type: Boolean, reflect: true }) ], SynTabPanel.prototype, "active", 2); __decorateClass([ watch("active") ], SynTabPanel.prototype, "handleActiveChange", 1); export { SynTabPanel }; //# sourceMappingURL=chunk.JBJXIMLM.js.map