import { BaseView } from "../../Views/BaseView.js";
import { Tab } from "./Tab.js";
export class TabStrip extends BaseView {
    get tabsNode() {
        return this.node.children("[role=tabs]");
    }
    get tabs() {
        return this.controls.getByType(Tab).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 Tab({
                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();
        }
    }
}
