import { r as registerInstance, h, F as Fragment } from './index-1acf58d3.js';
import { g as guid } from './index-3023b346.js';

const SidePanelMenu = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.routes = [];
    }
    render() {
        return (h("ul", { key: '1074d36ee2279a6aa4c415bfac4edcada5f98567', class: "sidepanel__menu-list" }, this.routes.map((route, index) => (h("li", { key: guid() }, h("tab-component", { route: route }), index < this.routes.length - 1 && (h("div", { class: "sidepanel__menu-tab-divider" })))))));
    }
};

const TabComponent = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        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';
                }
            } })))))));
    }
};

export { SidePanelMenu as side_panel_menu, TabComponent as tab_component };

//# sourceMappingURL=side-panel-menu_2.entry.js.map