1class Tabs{constructor(){this.tabsWrapperCounter=0,this.activeTab=1}setup(t,e,r){this.tabsWrapperCounter=e,"object"==typeof r&&"number"==typeof r.activeTab&&(this.activeTab=r.activeTab),t.classList.contains("vrtx-tabs")||t.classList.add("vrtx-tabs"),t.classList.add("vrtx-tabs-"+this.tabsWrapperCounter);let o=t.querySelector(":scope > ul");e=t.querySelectorAll(":scope > div"),r=o.querySelectorAll(":scope > li");let a=[...r],l=[...e];o.setAttribute("role","tablist"),r.forEach((t,e)=>{var r=e===this.activeTab-1,a=l.slice(e,e+1)[0].getAttribute("id"),r=(r?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"),t.setAttribute("role","tab"),t.setAttribute("aria-selected",""+r),t.setAttribute("aria-expanded",""+r),t.setAttribute("aria-controls",a),t.querySelector("a"));r.setAttribute("tabindex","-1");let s=r.id,i=(s||(s="vrtx-tabs-"+this.tabsWrapperCounter+"-item-"+(e+1),r.setAttribute("id",s)),t.setAttribute("aria-labelledby",s),this);t.addEventListener("click",function(t){i.tabChange(t,this)}),t.addEventListener("keydown",function(t){var e="ArrowRight"===t.key||"ArrowDown"===t.key,r="ArrowLeft"===t.key||"ArrowUp"===t.key;e?(e=this.nextElementSibling)&&!e.classList.contains("toggle-more-options-dropdown")?i.tabChange(t,e):(e=o.firstElementChild)&&i.tabChange(t,e):r&&((e=this.previousElementSibling)?i.tabChange(t,e):(r=o.querySelector(".toggle-more-options-dropdown"))?i.tabChange(t,r.previousElementSibling):(r=o.lastElementChild)&&i.tabChange(t,r))})}),e.forEach((t,e)=>{var r=e===this.activeTab-1,e=a.slice(e,e+1)[0].getAttribute("aria-labelledby");t.setAttribute("role","tabpanel"),t.setAttribute("aria-hidden",""+!r),t.setAttribute("aria-labelledby",e)}),this.tabsResponsive(t,o,r)}tabChange(t,e){var r=e.closest(".vrtx-tabs");r.querySelectorAll(":scope > ul > li").forEach(t=>{t.setAttribute("aria-selected","false"),t.setAttribute("aria-expanded","false"),t.setAttribute("tabindex","-1")}),e.setAttribute("aria-selected","true"),e.setAttribute("aria-expanded","true"),e.setAttribute("tabindex","0"),e.focus(),r.querySelectorAll(":scope > div").forEach(t=>{t.setAttribute("aria-hidden","true")}),e.querySelector("a");r.querySelector("#"+e.getAttribute("aria-controls")).setAttribute("aria-hidden","false"),t.preventDefault(),t.stopPropagation()}tabsResponsive(r,a,e){if(!(e.length<=1)){let t="Flere ...";document.querySelector("html[lang='en']")&&(t="More ..."),a.insertAdjacentHTML("beforeend",` 2 <li tabindex="0" role="tab" class="toggle-more-options-dropdown" aria-controls="vrtx-tabs-more-options-dropdown-${this.tabsWrapperCounter}" aria-expanded="false"> 3 <a tabindex="-1" href="#">${t}</a> 4 </li> 5 `);var s="";e.forEach(t=>{var e="true"===t.getAttribute("aria-selected")?" class='selected'":"",t=t.querySelector("a");s+=` 6 <li${e}> 7 <a class="more-options-tabs-select" href="#${t.getAttribute("name")}"> 8 ${t.innerHTML} 9 </a> 10 </li>`}),r.insertAdjacentHTML("beforeend",` 11 <div role="navigation" id="vrtx-tabs-more-options-dropdown-${this.tabsWrapperCounter}" class="more-options-dropdown" 12 aria-labelledby="vrtx-tabs-more-options-dropdown-title-${this.tabsWrapperCounter}" aria-hidden="true"> 13 <span id="vrtx-tabs-more-options-dropdown-title-${this.tabsWrapperCounter}" class="more-options-dropdown-title">${t}</span> 14 <ul>${s}</ul></div> 15 `),r.querySelector(".toggle-more-options-dropdown").addEventListener("click",function(t){var e=r.querySelector(".more-options-dropdown");e.classList.toggle("opened"),e.classList.contains("opened")?(this.setAttribute("aria-expanded","true"),e.setAttribute("aria-hidden","false")):(this.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true")),e.style.top=a.clientHeight+"px",e.style.left=this.parentElement.offsetLeft+"px",t.stopPropagation(),t.preventDefault()}),r.querySelectorAll(".more-options-tabs-select").forEach(t=>{t.addEventListener("click",function(t){var e=this,r=e.closest(".more-options-dropdown");r.classList.toggle("opened"),r.querySelector(".selected").classList.remove("selected"),e.parentElement.classList.add("selected"),e.closest(".vrtx-tabs").querySelector("a[name='"+e.getAttribute("href").substring(1)+"']").click(),t.stopPropagation(),t.preventDefault()})})}}}export default Tabs; 16//# sourceMappingURL=tabs.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.