siegel
Version:
Web application development ecosystem
1 lines • 1.4 kB
JavaScript
import e from"react";import t from"../_internals/resolve_tag_attributes.js";import n from"../_internals/apply_classname.js";import l from"../_internals/component.js";import r from"../_internals/children.js";import a from"../_internals/ref_apply.js";let i=void 0,o="-ui-tabs",s=e=>e?.constructor==Function?e():e,c=({content:e},t)=>e?t?`${e} ${t}`:e:t,m=l(o,{theme:{root:i,children:i,labels_wrapper:i,label:i,label__active:i,content:i,content__empty:i}},l=>{let{children:o,theme:m}=l,{activeTabContent:p,labels:_}=function(t){let l,{tabs:r,activeTab:a,onChange:o,theme:m,showEmpty:p}=t,_=r.find(({prerender:e})=>e),d=[],f=r.map(t=>{let{label:r,id:i,payload:p,content:f,contentClassName:u,labelClassName:b,prerender:v}=t,h=a==i;if(v||h){let t=s(f);if(_){let n={children:t,key:i};h?n.className=c(m,u):n.style={display:"none"},t=e.createElement("div",{...n})}d.push(t),h&&(l=u)}return e.createElement("div",{key:i,children:r,className:n(m.label,[[m.label__active,h],[b,b]]),onMouseDown:e=>{o(i,e,p)}})});return{activeTabContent:p||d.length?_?d:e.createElement("div",{className:c(m,l),children:d[0]}):i,labels:e.createElement("div",{className:m.labels_wrapper,children:f})}}(l);return e.createElement("div",{...function(e,l){let{theme:r,rootTagAttributes:i,className:o}=e,s={className:n(o,[[r.content__empty,!l]])};return a(s,e),s=t(s,i)}(l,p)},_,p,r(o,m))});export default m;export{o as componentID};