import { h, Fragment } from "@stencil/core";
export class TabComponent {
    constructor() {
        this.isExpanded = false;
    }
    handleExpanded(expanded) {
        this.isExpanded = expanded;
        if (expanded) {
            this.submenuElement.style.maxHeight = 'fit-content';
        }
        else {
            this.submenuElement.style.maxHeight = '';
        }
    }
    render() {
        return (h(Fragment, { key: '77fe597a248f75f8061885c00fb811a9c8b033b5' }, h("tab-link", { key: '9301b3ac308c952c6d59df062b436935a51020e8', text: this.route.name, type: this.route.children && this.route.children.length > 0 ? 'parent' : 'child', icon: this.route.icon, link: this.route.path, onExpand: this.handleExpanded.bind(this), disabled: this.route.disabled }), this.route.children && this.route.children.length > 0 && (h("ul", { key: 'd52c304557fe9c84d24319c389b31c27910e1d17', class: "sidepanel__submenu-list", ref: el => (this.submenuElement = el) }, this.route.children.map((childRoute, index) => (h("submenu-component", { key: index, route: this.route, childRoute: childRoute, onChildExpanded: expanded => {
                if (expanded) {
                    this.submenuElement.style.maxHeight = 'fit-content';
                }
            } })))))));
    }
    static get is() { return "tab-component"; }
    static get properties() {
        return {
            "route": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IRoute",
                    "resolved": "IRoute",
                    "references": {
                        "IRoute": {
                            "location": "import",
                            "path": "./dga-drawer",
                            "id": "src/components/dga-drawer/dga-drawer.tsx::IRoute"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get states() {
        return {
            "isExpanded": {}
        };
    }
}
//# sourceMappingURL=tab-component.js.map
