'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a0b63bee.js');
const index$1 = require('./index-ef15ef00.js');

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

const TabComponent = class {
    constructor(hostRef) {
        index.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 (index.h(index.Fragment, { key: '77fe597a248f75f8061885c00fb811a9c8b033b5' }, index.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 && (index.h("ul", { key: 'd52c304557fe9c84d24319c389b31c27910e1d17', class: "sidepanel__submenu-list", ref: el => (this.submenuElement = el) }, this.route.children.map((childRoute, index$1) => (index.h("submenu-component", { key: index$1, route: this.route, childRoute: childRoute, onChildExpanded: expanded => {
                if (expanded) {
                    this.submenuElement.style.maxHeight = 'fit-content';
                }
            } })))))));
    }
};

exports.side_panel_menu = SidePanelMenu;
exports.tab_component = TabComponent;

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