码桶

发现社区成员的开源项目

geekssl /

wstats

公开
main
wstats/public/assets/index-Bpyda4LF.js
index-Bpyda4LF.js20.3 KB
import{Y as m,Z as X,aa as J,an as V,r as u,R as l,aV as Q,a5 as g,aS as R,aq as ee,B as L,G as E,bm as te,a6 as se,aB as ae,aU as ne,aD as H,aO as oe,at as re,a8 as r,bk as ie,ac as le,aK as ce,ae as z,a9 as de}from"./index-GWuvg2UH.js";import{I as he}from"./slice-B6jKCnyX.js";const c={TABS:`${m}-tabs`,TABS_BAR:`${m}-tabs-bar`,TABS_BAR_LINE:`${m}-tabs-bar-line`,TABS_BAR_CARD:`${m}-tabs-bar-card`,TABS_BAR_BUTTON:`${m}-tabs-bar-button`,TABS_BAR_SLASH:`${m}-tabs-bar-slash`,TABS_BAR_EXTRA:`${m}-tabs-bar-extra`,TABS_TAB:`${m}-tabs-tab`,TABS_TAB_ACTIVE:`${m}-tabs-tab-active`,TABS_TAB_DISABLED:`${m}-tabs-tab-disabled`,TABS_CONTENT:`${m}-tabs-content`,TABS_PANE:`${m}-tabs-pane`,TABS_PANE_INACTIVE:`${m}-tabs-pane-inactive`,TABS_PANE_ACTIVE:`${m}-tabs-pane-active`,TABS_PANE_MOTION_OVERLAY:`${m}-tabs-pane-motion-overlay`,TABS_PANE_ANIMATE_LEFT_SHOW:`${m}-tabs-pane-animate-leftShow`,TABS_PANE_ANIMATE_RIGHT_SHOW:`${m}-tabs-pane-animate-rightShow`,TABS_PANE_ANIMATE_TOP_SHOW:`${m}-tabs-pane-animate-topShow`,TABS_PANE_ANIMATE_BOTTOM_SHOW:`${m}-tabs-pane-animate-bottomShow`},I={TYPE_MAP:["line","card","button","slash"],SIZE:["small","medium","large"],POSITION_MAP:["top","left"]};class pe extends X{constructor(s){super(Object.assign({},s)),this.destroy=J,this.handlePrevent=a=>{a.stopPropagation(),a.preventDefault()},this.handleKeyDown=(a,e,t)=>{const{preventScroll:n}=this.getProps(),o=[...a.target.parentNode.childNodes].filter(d=>V(d,"attributes.data-tabkey.value","").includes("semiTab")&&V(d,"attributes.aria-disabled.value","")!=="true");switch(a.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.determineOrientation(a,o);break;case"Backspace":case"Delete":this.handleDeleteKeyDown(a,o,e,t);break;case"Enter":case" ":this.handleTabClick(e,a),this.handlePrevent(a);break;case"Home":o[0].focus({preventScroll:n}),this.handlePrevent(a);break;case"End":o[o.length-1].focus({preventScroll:n}),this.handlePrevent(a);break}}}init(){this._adapter.collectPane()}_notifyChange(s){const{activeKey:a}=this.getStates();a!==s&&this._adapter.notifyChange(s)}handleTabClick(s,a){this._isInProps("activeKey")?this._notifyChange(s):(this._notifyChange(s),this.handleNewActiveKey(s)),this._adapter.notifyTabClick(s,a)}handleNewActiveKey(s){const{activeKey:a}=this.getStates();a!==s&&this._adapter.setNewActiveKey(s)}getDefaultActiveKey(){let s;const a=this.getProps();return"activeKey"in a?s=a.activeKey:"defaultActiveKey"in a?s=a.defaultActiveKey:s=this._adapter.getDefaultActiveKeyFromChildren(),s}handleTabListChange(){this._adapter.collectPane()}handleTabPanesChange(){this._adapter.collectPane(),this._adapter.collectActiveKey()}handleTabDelete(s){this._adapter.notifyTabDelete(s)}determineOrientation(s,a){const{tabPosition:e}=this.getProps();e==="left"?(s.key==="ArrowUp"||s.key==="ArrowDown")&&(this.switchTabOnArrowPress(s,a),this.handlePrevent(s)):(s.key==="ArrowLeft"||s.key==="ArrowRight")&&(this.switchTabOnArrowPress(s,a),this.handlePrevent(s))}handleDeleteKeyDown(s,a,e,t){const{preventScroll:n}=this.getProps();if(t){this.handleTabDelete(e);const o=a.indexOf(s.target);a.length!==1&&a[o+1>=a.length?o-1:o+1].focus({preventScroll:n})}}switchTabOnArrowPress(s,a){const{preventScroll:e}=this.getProps(),t=a.indexOf(s.target),n={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1};n[s.key]&&t!==void 0&&(a[t+n[s.key]]?a[t+n[s.key]].focus({preventScroll:e}):s.key==="ArrowLeft"||s.key==="ArrowUp"?a[a.length-1].focus({preventScroll:e}):(s.key==="ArrowRight"||s.key=="ArrowDown")&&a[0].focus({preventScroll:e}))}}var be=function(h,s){var a={};for(var e in h)Object.prototype.hasOwnProperty.call(h,e)&&s.indexOf(e)<0&&(a[e]=h[e]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(h);t<e.length;t++)s.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(h,e[t])&&(a[e[t]]=h[e[t]]);return a};const me=(h,s)=>{const{tab:a,size:e,type:t,icon:n,selected:o,closable:d,disabled:i,itemKey:p,deleteTabItem:b,tabPosition:y,handleKeyDown:B,onClick:A}=h,v=be(h,["tab","size","type","icon","selected","closable","disabled","itemKey","deleteTabItem","tabPosition","handleKeyDown","onClick"]),S=u.useMemo(()=>d?l.createElement(Q,{"aria-label":"Close",role:"button",className:`${c.TABS_TAB}-icon-close`,onClick:f=>b(p,f)}):null,[t,d,b,p]),T=u.useCallback(f=>l.createElement("span",{className:`${c.TABS_BAR}-icon`},f),[]),_=u.useCallback(f=>{B&&B(f,p,d)},[B,p,d]),w=u.useCallback(f=>{!i&&A&&A(p,f)},[p,i,A]),C=n?T(n):null,O=g(c.TABS_TAB,`${c.TABS_TAB}-${t}`,`${c.TABS_TAB}-${y}`,`${c.TABS_TAB}-single`,{[c.TABS_TAB_ACTIVE]:o,[c.TABS_TAB_DISABLED]:i,[`${c.TABS_TAB}-small`]:e==="small",[`${c.TABS_TAB}-medium`]:e==="medium"});return l.createElement("div",Object.assign({role:"tab",id:`semiTab${p}`,"data-tabkey":`semiTab${p}`,"aria-controls":`semiTabPanel${p}`,"aria-disabled":i?"true":"false","aria-selected":o?"true":"false",tabIndex:o?0:-1,onKeyDown:_,onClick:w,className:O},v,{ref:s}),C,a,S)},D=u.forwardRef(me);D.elementType="Tabs.TabItem";var ye=function(h,s){var a={};for(var e in h)Object.prototype.hasOwnProperty.call(h,e)&&s.indexOf(e)<0&&(a[e]=h[e]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(h);t<e.length;t++)s.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(h,e[t])&&(a[e[t]]=h[e[t]]);return a};class $ extends l.Component{constructor(s){var a;super(s),a=this,this.getEffectiveCollapsible=()=>{const{collapsible:e}=this.props;return e==="auto"?this.state.shouldCollapse:e||!1},this.checkOverflow=()=>{if(this.props.collapsible!=="auto"||this.state.shouldCollapse)return;const e=this.tabBarRef.current;if(!e)return;const t=this.isTabsWrapped(e)||e.scrollWidth>e.clientWidth+1;t!==this.state.shouldCollapse&&this.setState({shouldCollapse:t})},this.isTabsWrapped=e=>{var t;if(this.props.tabPosition==="left")return!1;const n=Array.from(e.querySelectorAll(`.${c.TABS_TAB}`));if(n.length<=1)return!1;const o=(t=n[0])===null||t===void 0?void 0:t.offsetTop;return typeof o!="number"?!1:n.some(d=>d.offsetTop!==o)},this.handleResize=()=>{this.props.collapsible==="auto"&&this.checkOverflow()},this.handleItemClick=(e,t)=>{this.props.onTabClick(e,t)},this.handleKeyDown=(e,t,n)=>{this.props.handleKeyDown(e,t,n)},this.renderTabItem=e=>{const{size:t,type:n,deleteTabItem:o,handleKeyDown:d,tabPosition:i}=this.props,p=this._isActive(e.itemKey);return l.createElement(D,Object.assign({},R(e,["disabled","icon","itemKey","tab","closable"]),{key:this._getBarItemKeyByItemKey(e.itemKey),selected:p,size:t,type:n,tabPosition:i,handleKeyDown:d,deleteTabItem:o,onClick:this.handleItemClick}))},this.scrollTabItemIntoViewByKey=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"nearest",n=arguments.length>2?arguments[2]:void 0;const o=document.querySelector(`[data-uuid="${a.state.uuid}"] .${c.TABS_TAB}[data-scrollkey="${e}"]`);o==null||o.scrollIntoView({behavior:n||"smooth",block:t,inline:t})},this.scrollActiveTabItemIntoView=(e,t)=>{const n=this._getBarItemKeyByItemKey(this.props.activeKey);this.scrollTabItemIntoViewByKey(n,e,t)},this.renderTabComponents=e=>e.map(t=>this.renderTabItem(t)),this.handleArrowClick=(e,t)=>{const n=t==="start"?e.pop():e.shift();if(!n)return;const o=this._getBarItemKeyByItemKey(n.itemKey);this.scrollTabItemIntoViewByKey(o)},this.renderCollapse=(e,t,n)=>{var o;const d=g({[`${c.TABS_BAR}-arrow-${n}`]:n,[`${c.TABS_BAR}-arrow`]:!0});if(ee(e))return l.createElement("div",{role:"presentation",className:d},l.createElement(L,{disabled:!0,icon:t,theme:"borderless"}));const{dropdownClassName:i,dropdownStyle:p,showRestInDropdown:b,dropdownProps:y}=this.props,{rePosKey:B}=this.state,A=!e.length,v=l.createElement(E.Menu,null,e.map(w=>{const{icon:C,tab:O,itemKey:f}=w,N=C?this.renderIcon(w.icon):null;return l.createElement(E.Item,{key:f,onClick:k=>this.handleItemClick(f,k),active:this._isActive(f)},N,O)})),S=l.createElement("div",{role:"presentation",className:d,onClick:w=>this.handleArrowClick(e,n)},l.createElement(L,{disabled:A,icon:t,theme:"borderless"})),T=g(i,{[`${c.TABS_BAR}-dropdown`]:!0}),_=(o=y==null?void 0:y[n])!==null&&o!==void 0?o:{};return l.createElement(l.Fragment,null,b?l.createElement(E,Object.assign({className:T,clickToHide:!0,clickTriggerToHide:!0,key:`${B}-${n}`,position:n==="start"?"bottomLeft":"bottomRight",render:A?null:v,showTick:!0,style:p,trigger:"hover",disableFocusListener:!0},_),S):S)},this.renderOverflow=e=>e.map((t,n)=>{const o=n===0?"start":"end",d=n===0?l.createElement(he,null):l.createElement(re,null),i=this.renderCollapse(t,d,o);return this.props.renderArrow?this.props.renderArrow(t,o,()=>this.handleArrowClick(t,o),i):i}),this.renderCollapsedTab=()=>{const{list:e}=this.props,t=e.map(n=>{const{itemKey:o}=n;return Object.assign({key:this._getBarItemKeyByItemKey(o),active:this._isActive(o)},n)});return l.createElement(te,{items:t,overflowRenderDirection:this.props.arrowPosition,wrapperStyle:this.props.visibleTabsStyle,overflowRenderer:this.renderOverflow,renderMode:"scroll",className:`${c.TABS_BAR}-overflow-list`,visibleItemRenderer:this.renderTabItem,onVisibleStateChange:n=>{var o,d;const i=new Map;if(n.forEach((p,b)=>{i.set(this._getItemKeyByBarItemKey(b),p)}),this.isFirstShowInViewport&&Array.from(i.values()).some(b=>b)&&(this.scrollActiveTabItemIntoView("nearest","auto"),this.isFirstShowInViewport=!1),this.props.collapsible==="auto"&&Array.from(i.values()).some(b=>b)){const b=Array.from(i.values()).some(y=>!y);b!==this.state.shouldCollapse&&this.setState({shouldCollapse:b})}(d=(o=this.props).onVisibleTabsChange)===null||d===void 0||d.call(o,i)}})},this.renderWithMoreTrigger=()=>{const{list:e,more:t}=this.props;let n=[],o=l.createElement("div",{className:g({[`${c.TABS_BAR}-more-trigger`]:!0,[`${c.TABS_BAR}-more-trigger-${this.props.type}`]:!0})},l.createElement(se,{componentName:"Tabs"},(i,p)=>l.createElement("div",{className:`${c.TABS_BAR}-more-trigger-content`},l.createElement("div",null,i.more),l.createElement(ae,{className:`${c.TABS_BAR}-more-trigger-content-icon`})))),d;if(typeof t=="number")d=e.length-Math.min(t,e.length),n=e.slice(0,d).map(i=>this.renderTabItem(i));else if(typeof t=="object")d=e.length-Math.min(t.count,e.length),n=e.slice(0,d).map(i=>this.renderTabItem(i)),t.render&&(o=t.render());else if(t!==void 0)throw new Error("[Semi Tabs]: invalid tab props format: more");return l.createElement(l.Fragment,null,n,this.renderMoreDropdown(e.slice(d),t==null?void 0:t.dropdownProps,o))},this.renderMoreDropdown=(e,t,n)=>l.createElement(E,Object.assign({trigger:"hover",showTick:!0,position:"bottomLeft",className:`${c.TABS_BAR}-more-dropdown-${this.props.type}`,clickToHide:!0,menu:e.map(o=>({node:"item",name:o.tab,icon:o.icon,onClick:d=>this.props.onTabClick(o.itemKey,d),active:this.props.activeKey===o.itemKey}))},t),n),this._isActive=e=>e===this.props.activeKey,this._getBarItemKeyByItemKey=e=>`${e}-bar`,this._getItemKeyByBarItemKey=e=>e.replace(/-bar$/,""),this.state={endInd:s.list.length,rePosKey:0,startInd:0,uuid:"",currentVisibleItems:[],shouldCollapse:!1},this.isFirstShowInViewport=!0,this.tabBarRef=u.createRef()}componentDidMount(){this.setState({uuid:ne()}),this.props.collapsible==="auto"&&requestAnimationFrame(()=>this.checkOverflow())}componentDidUpdate(s){s.activeKey!==this.props.activeKey&&this.getEffectiveCollapsible()&&this.scrollActiveTabItemIntoView(),this.props.collapsible==="auto"&&s.list!==this.props.list&&this.checkOverflow()}renderIcon(s){return l.createElement("span",null,s)}renderExtra(){const{tabBarExtraContent:s,type:a,size:e}=this.props,t={float:"right"},n=s&&s.props?s.props.style:{},o=g(c.TABS_BAR_EXTRA,{[`${c.TABS_BAR}-${a}-extra`]:a,[`${c.TABS_BAR}-${a}-extra-${e}`]:e});if(s){const d=Object.assign(Object.assign({},t),n);return l.createElement("div",{className:o,style:d,"x-semi-prop":"tabBarExtraContent"},s)}return null}render(){const s=this.props,{type:a,style:e,className:t,list:n,tabPosition:o,more:d,collapsible:i}=s,p=ye(s,["type","style","className","list","tabPosition","more","collapsible"]),b=this.getEffectiveCollapsible(),y=g(t,{[c.TABS_BAR]:!0,[c.TABS_BAR_LINE]:a==="line",[c.TABS_BAR_CARD]:a==="card",[c.TABS_BAR_BUTTON]:a==="button",[c.TABS_BAR_SLASH]:a==="slash",[`${c.TABS_BAR}-${o}`]:o,[`${c.TABS_BAR}-collapse`]:b}),B=this.renderExtra(),A=b?this.renderCollapsedTab():d?this.renderWithMoreTrigger():this.renderTabComponents(n),v=l.createElement("div",Object.assign({role:"tablist","aria-orientation":o==="left"?"vertical":"horizontal",className:y,style:e},H(p),{"data-uuid":this.state.uuid,ref:this.tabBarRef}),A,B);return i==="auto"?l.createElement(oe,{onResize:this.handleResize},v):v}}$.propTypes={activeKey:r.string,className:r.string,collapsible:r.oneOfType([r.bool,r.oneOf(["auto"])]),list:r.array,onTabClick:r.func,size:r.oneOf(I.SIZE),style:r.object,tabBarExtraContent:r.node,tabPosition:r.oneOf(I.POSITION_MAP),type:r.oneOf(I.TYPE_MAP),closable:r.bool,deleteTabItem:r.func,more:r.oneOfType([r.number,r.object])};const W=l.createContext({});var fe=function(h,s){var a={};for(var e in h)Object.prototype.hasOwnProperty.call(h,e)&&s.indexOf(e)<0&&(a[e]=h[e]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(h);t<e.length;t++)s.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(h,e[t])&&(a[e[t]]=h[e[t]]);return a};class K extends u.PureComponent{constructor(){super(...arguments),this.ref=u.createRef(),this.getDirection=(s,a,e,t)=>{if(a!==null&&s!==null&&Array.isArray(e)&&e.length){const n=e.findIndex(i=>i.itemKey===s),o=e.findIndex(i=>i.itemKey===a),d=e.findIndex(i=>i.itemKey===t);return n===o?d>n:o<n}return!1},this.shouldRender=()=>{const{itemKey:s}=this.props,{activeKey:a,lazyRender:e}=this.context,t=a===s;return this._active=this._active||t,e?this._active:!0}}render(){const{tabPaneMotion:s,tabPosition:a,prevActiveKey:e}=this.context,t=this.props,{className:n,style:o,children:d,itemKey:i,tabIndex:p}=t,b=fe(t,["className","style","children","itemKey","tabIndex"]),y=this.context.activeKey===i,B=g(n,{[c.TABS_PANE_INACTIVE]:!y,[c.TABS_PANE_ACTIVE]:y,[c.TABS_PANE]:!0}),A=this.shouldRender(),v=(()=>{const _=this.getDirection(this.context.activeKey,i,this.context.panes,e);return a==="top"?_?c.TABS_PANE_ANIMATE_RIGHT_SHOW:c.TABS_PANE_ANIMATE_LEFT_SHOW:_?c.TABS_PANE_ANIMATE_BOTTOM_SHOW:c.TABS_PANE_ANIMATE_TOP_SHOW})(),S=!this.context.panes.find(_=>_.itemKey===e),T=s&&y&&!S&&!this.context.forceDisableMotion;return l.createElement("div",Object.assign({ref:this.ref,role:"tabpanel",id:`semiTabPanel${i}`,"aria-labelledby":`semiTab${i}`,className:B,style:o,"aria-hidden":y?"false":"true",tabIndex:p||0},H(b),{"x-semi-prop":"children"}),l.createElement(ie,{motion:T,animationState:y?"enter":"leave",startClassName:v},_=>{let{animationClassName:w,animationEventsNeedBind:C}=_;return l.createElement("div",Object.assign({className:g(c.TABS_PANE_MOTION_OVERLAY,w),"x-semi-prop":"children"},C),A?d:null)}))}}K.isTabPane=!0;K.contextType=W;K.propTypes={className:r.string,style:r.object,children:r.node,disabled:r.bool,itemKey:r.string,tab:r.node,icon:r.node,closable:r.bool};var ue=function(h,s){var a={};for(var e in h)Object.prototype.hasOwnProperty.call(h,e)&&s.indexOf(e)<0&&(a[e]=h[e]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(h);t<e.length;t++)s.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(h,e[t])&&(a[e[t]]=h[e[t]]);return a};const F=["className","style","disabled","itemKey","tab","icon"];class P extends le{constructor(s){super(s),this.setContentRef=a=>{this.contentRef={current:a}},this.getPanes=()=>{const{tabList:a,children:e}=this.props;return Array.isArray(a)&&a.length?a:l.Children.map(e,t=>{if(t){const{tab:n,icon:o,disabled:d,itemKey:i,closable:p}=t.props;return{tab:n,icon:o,disabled:d,itemKey:i,closable:p}}})},this.onTabClick=(a,e)=>{this.foundation.handleTabClick(a,e)},this.rePosChildren=(a,e)=>{const t=[],n=l.Children.toArray(a);return a.length&&(t.push(...n.filter(o=>o.props&&o.props.itemKey===e)),t.push(...n.filter(o=>o.props&&o.props.itemKey!==e))),t},this.getActiveItem=()=>{const{activeKey:a}=this.state,{children:e,tabList:t}=this.props;return t||!Array.isArray(e)?e:l.Children.toArray(e).filter(n=>u.isValidElement(n)&&n.type&&n.type.isTabPane?n.props.itemKey===a:!0)},this.deleteTabItem=(a,e)=>{e.stopPropagation(),this.foundation.handleTabDelete(a)},this.foundation=new pe(this.adapter),this.state={activeKey:this.foundation.getDefaultActiveKey(),panes:this.getPanes(),prevActiveKey:null,forceDisableMotion:!1},this.contentRef=u.createRef(),this.contentHeight="auto"}get adapter(){return Object.assign(Object.assign({},super.adapter),{collectPane:()=>{const s=this.getPanes();this.setState({panes:s})},collectActiveKey:()=>{const{tabList:s,children:a,activeKey:e}=this.props;if(typeof e<"u")return;const{activeKey:t}=this.state,n=this.getPanes();n.findIndex(o=>o.itemKey===t)===-1&&(n.length>0?this.setState({activeKey:n[0].itemKey}):this.setState({activeKey:""}))},notifyTabClick:(s,a)=>{this.props.onTabClick(s,a)},notifyChange:s=>{this.props.onChange(s)},setNewActiveKey:s=>{this.setState({activeKey:s})},getDefaultActiveKeyFromChildren:()=>{const{tabList:s,children:a}=this.props;let e="";return(s||l.Children.toArray(a).map(n=>u.isValidElement(n)?n.props:null)).forEach(n=>{n&&!e&&!n.disabled&&(e=n.itemKey)}),e},notifyTabDelete:s=>{this.props.onTabClose&&this.props.onTabClose(s)}})}static getDerivedStateFromProps(s,a){const e={};return!ce(s.activeKey)&&s.activeKey!==a.activeKey&&(a.prevActiveKey=a.activeKey,e.activeKey=s.activeKey),e}componentDidUpdate(s,a){const e=l.Children.toArray(s.children).map(o=>R(u.isValidElement(o)?o.props:null,F)),t=l.Children.toArray(this.props.children).map(o=>R(u.isValidElement(o)?o.props:null,F)),n=this.props.tabList||s.tabList;if(z(this.props.tabList,s.tabList)||this.foundation.handleTabListChange(),a.activeKey!==this.state.activeKey&&a.activeKey!==this.state.prevActiveKey&&this.setState({prevActiveKey:a.activeKey}),s.activeKey!==this.props.activeKey){const o=(()=>{const d=new Set(e.map(i=>i.itemKey));return t.map(i=>i.itemKey).filter(i=>!d.has(i))})();this.setState({forceDisableMotion:o.includes(this.props.activeKey)})}!z(e,t)&&!n&&this.foundation.handleTabPanesChange()}render(){const s=this.props,{children:a,className:e,collapsible:t,contentStyle:n,keepDOM:o,lazyRender:d,renderTabBar:i,showRestInDropdown:p,size:b,style:y,tabBarClassName:B,tabBarExtraContent:A,tabBarStyle:v,tabPaneMotion:S,tabPosition:T,type:_,more:w,onVisibleTabsChange:C,visibleTabsStyle:O,arrowPosition:f,renderArrow:N,dropdownProps:k}=s,U=ue(s,["children","className","collapsible","contentStyle","keepDOM","lazyRender","renderTabBar","showRestInDropdown","size","style","tabBarClassName","tabBarExtraContent","tabBarStyle","tabPaneMotion","tabPosition","type","more","onVisibleTabsChange","visibleTabsStyle","arrowPosition","renderArrow","dropdownProps"]),{panes:x,activeKey:M}=this.state,Y=g(e,{[c.TABS]:!0,[`${c.TABS}-${T}`]:T}),q=g({[c.TABS_CONTENT]:!0,[`${c.TABS_CONTENT}-${T}`]:T}),j={activeKey:M,className:B,collapsible:t,list:x,onTabClick:this.onTabClick,showRestInDropdown:p,size:b,style:v,tabBarExtraContent:A,tabPosition:T,type:_,deleteTabItem:this.deleteTabItem,handleKeyDown:this.foundation.handleKeyDown,more:w,onVisibleTabsChange:C,visibleTabsStyle:O,arrowPosition:f,renderArrow:N,dropdownProps:k},G=i?i(j,$):l.createElement($,Object.assign({},j)),Z=o?a:this.getActiveItem();return l.createElement("div",Object.assign({className:Y,style:y},this.getDataAttr(U)),G,l.createElement(W.Provider,{value:{activeKey:M,lazyRender:d,panes:x,tabPaneMotion:S,tabPosition:T,prevActiveKey:this.state.prevActiveKey,forceDisableMotion:this.state.forceDisableMotion}},l.createElement("div",{ref:this.setContentRef,className:q,style:Object.assign({},n)},Z)))}}P.TabPane=K;P.TabItem=D;P.propTypes={activeKey:r.string,className:r.string,collapsible:r.oneOfType([r.bool,r.oneOf(["auto"])]),contentStyle:r.oneOfType([r.object]),defaultActiveKey:r.string,keepDOM:r.bool,lazyRender:r.bool,onChange:r.func,onTabClick:r.func,renderTabBar:r.func,showRestInDropdown:r.bool,size:r.oneOf(I.SIZE),style:r.object,tabBarClassName:r.string,tabBarExtraContent:r.node,tabBarStyle:r.object,tabList:r.array,tabPaneMotion:r.bool,tabPosition:r.oneOf(I.POSITION_MAP),type:r.oneOf(I.TYPE_MAP),onTabClose:r.func,preventScroll:r.bool,more:r.oneOfType([r.number,r.object]),arrowPosition:r.string,renderArrow:r.func,dropdownProps:r.object};P.__SemiComponentName__="Tabs";P.defaultProps=de(P.__SemiComponentName__,{children:[],collapsible:!1,keepDOM:!0,lazyRender:!1,onChange:()=>{},onTabClick:()=>{},size:"large",tabPaneMotion:!0,tabPosition:"top",type:"line",onTabClose:()=>{},showRestInDropdown:!0,arrowPosition:"both"});export{P as T};