aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/releases/_artifacts/v1.0.5/missing-js/tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'releases/_artifacts/v1.0.5/missing-js/tabs.js')
-rw-r--r--releases/_artifacts/v1.0.5/missing-js/tabs.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/releases/_artifacts/v1.0.5/missing-js/tabs.js b/releases/_artifacts/v1.0.5/missing-js/tabs.js
new file mode 100644
index 0000000..a5fc714
--- /dev/null
+++ b/releases/_artifacts/v1.0.5/missing-js/tabs.js
@@ -0,0 +1,3 @@
+import{$ as h,$$ as m,on as t,attr as s,next as p,prev as x,asHtml as r,hotkey as b,behavior as k,makelogger as w}from"./19.js";const E=w("tabs"),c=e=>m(e,"[role=tab]"),u=e=>h(e,"[role=tab][aria-selected=true]"),i=(e,n)=>{const o=s(e,"aria-controls");return o===null?(E("Tab",e,"has no associated tabpanel"),null):n.getElementById(o)},f=(e,n,o)=>{if(!o)return;const a=u(n);if(a){s(a,{ariaSelected:!1,tabindex:-1});const l=i(a,e);l&&(l.hidden=!0)}s(o,{ariaSelected:!0,tabindex:0});const d=i(o,e);d&&(d.hidden=!1),o.focus()},g=k("[role=tablist]",(e,{root:n})=>{e instanceof HTMLElement&&(e.tabIndex=0,c(e).forEach(o=>o.tabIndex=-1),f(n,e,u(e)),t(e,"focus",o=>u(e)?.focus()),t(e,"click",o=>f(n,e,r(r(o.target)?.closest("[role=tab]")))),t(e,"focusin",o=>f(n,e,r(r(o.target)?.closest("[role=tab]")))),t(e,"keydown",b({ArrowRight:o=>r(p(e,"[role=tab]",r(o.target)))?.focus(),ArrowLeft:o=>r(x(e,"[role=tab]",r(o.target)))?.focus(),Home:o=>c(e).at(0)?.focus(),End:o=>c(e).at(-1)?.focus()})))});g(document);var y=g;export{y as default,g as tablist};
+
+/*# sourceMappingURL=./tabs.js.map */ \ No newline at end of file