UNPKG

1.2 kBJavaScriptView Raw
1import {
2 tab_panel_styles_default
3} from "./chunk.PRBD3VT7.js";
4import {
5 autoIncrement
6} from "./chunk.KFR7NC2M.js";
7import {
8 e,
9 n
10} from "./chunk.VKNZYXSO.js";
11import {
12 $,
13 s
14} from "./chunk.WWAD5WF4.js";
15import {
16 __decorateClass
17} from "./chunk.K2NRSETB.js";
18
19// src/components/tab-panel/tab-panel.ts
20var SlTabPanel = class extends s {
21 constructor() {
22 super(...arguments);
23 this.attrId = autoIncrement();
24 this.componentId = `sl-tab-panel-${this.attrId}`;
25 this.name = "";
26 this.active = false;
27 }
28 connectedCallback() {
29 super.connectedCallback();
30 this.id = this.id.length > 0 ? this.id : this.componentId;
31 }
32 render() {
33 this.style.display = this.active ? "block" : "none";
34 return $`
35 <div part="base" class="tab-panel" role="tabpanel" aria-hidden=${this.active ? "false" : "true"}>
36 <slot></slot>
37 </div>
38 `;
39 }
40};
41SlTabPanel.styles = tab_panel_styles_default;
42__decorateClass([
43 e({ reflect: true })
44], SlTabPanel.prototype, "name", 2);
45__decorateClass([
46 e({ type: Boolean, reflect: true })
47], SlTabPanel.prototype, "active", 2);
48SlTabPanel = __decorateClass([
49 n("sl-tab-panel")
50], SlTabPanel);
51
52export {
53 SlTabPanel
54};