import { BaseView } from "../../Views/BaseView.js";
import { PanelTab } from "./PanelTab.js";
export class PanelTabStrip extends BaseView {
    get tabsNode() {
        return this.node.children("[role=tabs]");
    }
    get tabs() {
        return this.controls.getByType(PanelTab).toArray();
    }
    template() {
        return `<div role="tabstrip">
                    <div role="tabs" data-controls></div>
                </div>`;
    }
    load(model) {
        model.context.featureSet.groups.forEach(group => {
            this.controls.add(new PanelTab({
                eventBus: this.eventBus,
                label: group.name,
                tabId: group.id,
                model: group
            }));
        });
        this.tabsNode.append("<div></div>");
        if (this.tabs.length > 0) {
            this.tabs[0].select();
        }
    }
}
