import {Et2Tabs} from "./Et2Tabs";
import {html, TemplateResult} from "lit";
import {classMap} from "lit/directives/class-map.js";
import {repeat} from "lit/directives/repeat.js";
import {Et2Details} from "../Et2Details/Et2Details";
import {SlTab, SlTabPanel} from "@shoelace-style/shoelace";
/**
* Widget to render tabs in a mobile-friendly way
*
* We render tabs as a series of details instead of normal tabs.
* loadWebComponent() will load this component instead of Et2Tabs on mobile browsers
*/
export class Et2TabsMobile extends Et2Tabs
{
connectedCallback()
{
super.connectedCallback();
}
protected createTabs(tabData)
{
// "Tabs" are created in render()
this.tabData = tabData;
// Create tab panels here though
tabData.forEach((tab, index) =>
{
let panel = this.createPanel(tab, true);
panel.slot = tab.id;
});
}
/**
* Use the height of the first tab if height not set
* @protected
*/
protected _sizeTabs(tabDates : Array