| 123 |
- import{bX as Ke,bY as tt,bZ as pt,b_ as ht,b$ as gt,c0 as mt,c1 as $t,c2 as yt,af as H,aj as Oe,a4 as ge,d as ae,r as V,K as W,f as h,ai as J,a8 as le,b as _e,a5 as T,az as O,ag as Ce,w as ie,a6 as Te,aO as F,ak as xt,ac as St,ao as _t,c3 as Ct,bv as he,aq as Xe,a7 as te,bz as me,ae as Tt,aA as wt,aJ as Pt,aH as Rt,aF as at,aG as It,bg as nt,an as ot,ar as Et,aw as Bt,aM as xe,aL as Lt,aN as At,ap as Ot,b1 as Dt,b4 as Mt,bq as Ae,aS as kt,aD as Nt}from"./index.932f1548.js";import{u as je}from"./index.f159ba9e.js";import{u as Ht,E as Wt,M as zt,a as Gt,D as Kt,i as Fe}from"./Menu.b368adf3.js";import{i as Xt}from"./isMobile.39a6fa85.js";function jt(e,t,a,n){if(!Ke(e))return e;t=tt(t,e);for(var i=-1,l=t.length,o=l-1,r=e;r!=null&&++i<l;){var d=pt(t[i]),c=a;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=o){var f=r[d];c=n?n(f,d,r):void 0,c===void 0&&(c=Ke(f)?f:ht(t[i+1])?[]:{})}gt(r,d,c),r=r[d]}return e}function Ft(e,t,a){for(var n=-1,i=t.length,l={};++n<i;){var o=t[n],r=mt(e,o);a(r,o)&&jt(l,tt(o,e),r)}return l}function Vt(e,t){return Ft(e,t,function(a,n){return $t(e,n)})}var Yt=yt(function(e,t){return e==null?{}:Vt(e,t)});const it=Yt;function qt(e){const t=H(),a=H(!1);function n(){for(var i=arguments.length,l=new Array(i),o=0;o<i;o++)l[o]=arguments[o];a.value||(ge.cancel(t.value),t.value=ge(()=>{e(...l)}))}return Oe(()=>{a.value=!0,ge.cancel(t.value)}),n}function Ut(e){const t=H([]),a=H(typeof e=="function"?e():e),n=qt(()=>{let l=a.value;t.value.forEach(o=>{l=o(l)}),t.value=[],a.value=l});function i(l){t.value.push(l),n()}return[a,i]}const Zt=ae({compatConfig:{MODE:3},name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup(e,t){let{expose:a,attrs:n}=t;const i=V();function l(d){var c;!((c=e.tab)===null||c===void 0)&&c.disabled||e.onClick(d)}a({domRef:i});function o(d){var c;d.preventDefault(),d.stopPropagation(),e.editable.onEdit("remove",{key:(c=e.tab)===null||c===void 0?void 0:c.key,event:d})}const r=W(()=>{var d;return e.editable&&e.closable!==!1&&!(!((d=e.tab)===null||d===void 0)&&d.disabled)});return()=>{var d;const{prefixCls:c,id:f,active:_,tab:{key:g,tab:u,disabled:y,closeIcon:x},renderWrapper:w,removeAriaLabel:C,editable:D,onFocus:G}=e,M=`${c}-tab`,s=h("div",{key:g,ref:i,class:le(M,{[`${M}-with-remove`]:r.value,[`${M}-active`]:_,[`${M}-disabled`]:y}),style:n.style,onClick:l},[h("div",{role:"tab","aria-selected":_,id:f&&`${f}-tab-${g}`,class:`${M}-btn`,"aria-controls":f&&`${f}-panel-${g}`,"aria-disabled":y,tabindex:y?null:0,onClick:m=>{m.stopPropagation(),l(m)},onKeydown:m=>{[J.SPACE,J.ENTER].includes(m.which)&&(m.preventDefault(),l(m))},onFocus:G},[typeof u=="function"?u():u]),r.value&&h("button",{type:"button","aria-label":C||"remove",tabindex:0,class:`${M}-remove`,onClick:m=>{m.stopPropagation(),o(m)}},[(x==null?void 0:x())||((d=D.removeIcon)===null||d===void 0?void 0:d.call(D))||"\xD7"])]);return w?w(s):s}}}),Ve={width:0,height:0,left:0,top:0};function Jt(e,t){const a=V(new Map);return _e(()=>{var n,i;const l=new Map,o=e.value,r=t.value.get((n=o[0])===null||n===void 0?void 0:n.key)||Ve,d=r.left+r.width;for(let c=0;c<o.length;c+=1){const{key:f}=o[c];let _=t.value.get(f);_||(_=t.value.get((i=o[c-1])===null||i===void 0?void 0:i.key)||Ve);const g=l.get(f)||T({},_);g.right=d-g.left-g.width,l.set(f,g)}a.value=new Map(l)}),a}const lt=ae({compatConfig:{MODE:3},name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup(e,t){let{expose:a,attrs:n}=t;const i=V();return a({domRef:i}),()=>{const{prefixCls:l,editable:o,locale:r}=e;return!o||o.showAdd===!1?null:h("button",{ref:i,type:"button",class:`${l}-nav-add`,style:n.style,"aria-label":(r==null?void 0:r.addAriaLabel)||"Add tab",onClick:d=>{o.onEdit("add",{event:d})}},[o.addIcon?o.addIcon():"+"])}}}),Qt={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:Te.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function},popupClassName:String,getPopupContainer:F()},ea=ae({compatConfig:{MODE:3},name:"OperationNode",inheritAttrs:!1,props:Qt,emits:["tabClick"],slots:Object,setup(e,t){let{attrs:a,slots:n}=t;const[i,l]=O(!1),[o,r]=O(null),d=u=>{const y=e.tabs.filter(C=>!C.disabled);let x=y.findIndex(C=>C.key===o.value)||0;const w=y.length;for(let C=0;C<w;C+=1){x=(x+u+w)%w;const D=y[x];if(!D.disabled){r(D.key);return}}},c=u=>{const{which:y}=u;if(!i.value){[J.DOWN,J.SPACE,J.ENTER].includes(y)&&(l(!0),u.preventDefault());return}switch(y){case J.UP:d(-1),u.preventDefault();break;case J.DOWN:d(1),u.preventDefault();break;case J.ESC:l(!1);break;case J.SPACE:case J.ENTER:o.value!==null&&e.onTabClick(o.value,u);break}},f=W(()=>`${e.id}-more-popup`),_=W(()=>o.value!==null?`${f.value}-${o.value}`:null),g=(u,y)=>{u.preventDefault(),u.stopPropagation(),e.editable.onEdit("remove",{key:y,event:u})};return Ce(()=>{ie(o,()=>{const u=document.getElementById(_.value);u&&u.scrollIntoView&&u.scrollIntoView(!1)},{flush:"post",immediate:!0})}),ie(i,()=>{i.value||r(null)}),Ht({}),()=>{var u;const{prefixCls:y,id:x,tabs:w,locale:C,mobile:D,moreIcon:G=((u=n.moreIcon)===null||u===void 0?void 0:u.call(n))||h(Wt,null,null),moreTransitionName:M,editable:s,tabBarGutter:m,rtl:v,onTabClick:$,popupClassName:E}=e;if(!w.length)return null;const R=`${y}-dropdown`,K=C==null?void 0:C.dropdownAriaLabel,re={[v?"marginRight":"marginLeft"]:m};w.length||(re.visibility="hidden",re.order=1);const se=le({[`${R}-rtl`]:v,[`${E}`]:!0}),ce=D?null:h(Kt,{prefixCls:R,trigger:["hover"],visible:i.value,transitionName:M,onVisibleChange:l,overlayClassName:se,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:e.getPopupContainer},{overlay:()=>h(zt,{onClick:I=>{let{key:Q,domEvent:k}=I;$(Q,k),l(!1)},id:f.value,tabindex:-1,role:"listbox","aria-activedescendant":_.value,selectedKeys:[o.value],"aria-label":K!==void 0?K:"expanded dropdown"},{default:()=>[w.map(I=>{var Q,k;const Y=s&&I.closable!==!1&&!I.disabled;return h(Gt,{key:I.key,id:`${f.value}-${I.key}`,role:"option","aria-controls":x&&`${x}-panel-${I.key}`,disabled:I.disabled},{default:()=>[h("span",null,[typeof I.tab=="function"?I.tab():I.tab]),Y&&h("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:`${R}-menu-item-remove`,onClick:q=>{q.stopPropagation(),g(q,I.key)}},[((Q=I.closeIcon)===null||Q===void 0?void 0:Q.call(I))||((k=s.removeIcon)===null||k===void 0?void 0:k.call(s))||"\xD7"])]})})]}),default:()=>h("button",{type:"button",class:`${y}-nav-more`,style:re,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":f.value,id:`${x}-more`,"aria-expanded":i.value,onKeydown:c},[G])});return h("div",{class:le(`${y}-nav-operations`,a.class),style:a.style},[ce,h(lt,{prefixCls:y,locale:C,editable:s},null)])}}}),rt=Symbol("tabsContextKey"),st=e=>{xt(rt,e)},dt=()=>St(rt,{tabs:V([]),prefixCls:V()});ae({compatConfig:{MODE:3},name:"TabsContextProvider",inheritAttrs:!1,props:{tabs:{type:Object,default:void 0},prefixCls:{type:String,default:void 0}},setup(e,t){let{slots:a}=t;return st(_t(e)),()=>{var n;return(n=a.default)===null||n===void 0?void 0:n.call(a)}}});const ta=.1,Ye=.01,Se=20,qe=Math.pow(.995,Se);function aa(e,t){const[a,n]=O(),[i,l]=O(0),[o,r]=O(0),[d,c]=O(),f=V();function _(s){const{screenX:m,screenY:v}=s.touches[0];n({x:m,y:v}),clearInterval(f.value)}function g(s){if(!a.value)return;s.preventDefault();const{screenX:m,screenY:v}=s.touches[0],$=m-a.value.x,E=v-a.value.y;t($,E),n({x:m,y:v});const R=Date.now();r(R-i.value),l(R),c({x:$,y:E})}function u(){if(!a.value)return;const s=d.value;if(n(null),c(null),s){const m=s.x/o.value,v=s.y/o.value,$=Math.abs(m),E=Math.abs(v);if(Math.max($,E)<ta)return;let R=m,K=v;f.value=setInterval(()=>{if(Math.abs(R)<Ye&&Math.abs(K)<Ye){clearInterval(f.value);return}R*=qe,K*=qe,t(R*Se,K*Se)},Se)}}const y=V();function x(s){const{deltaX:m,deltaY:v}=s;let $=0;const E=Math.abs(m),R=Math.abs(v);E===R?$=y.value==="x"?m:v:E>R?($=m,y.value="x"):($=v,y.value="y"),t(-$,-$)&&s.preventDefault()}const w=V({onTouchStart:_,onTouchMove:g,onTouchEnd:u,onWheel:x});function C(s){w.value.onTouchStart(s)}function D(s){w.value.onTouchMove(s)}function G(s){w.value.onTouchEnd(s)}function M(s){w.value.onWheel(s)}Ce(()=>{var s,m;document.addEventListener("touchmove",D,{passive:!1}),document.addEventListener("touchend",G,{passive:!1}),(s=e.value)===null||s===void 0||s.addEventListener("touchstart",C,{passive:!1}),(m=e.value)===null||m===void 0||m.addEventListener("wheel",M,{passive:!1})}),Oe(()=>{document.removeEventListener("touchmove",D),document.removeEventListener("touchend",G)})}function Ue(e,t){const a=V(e);function n(i){const l=typeof i=="function"?i(a.value):i;l!==a.value&&t(l,a.value),a.value=l}return[a,n]}const na=()=>{const e=V(new Map),t=a=>n=>{e.value.set(a,n)};return Ct(()=>{e.value=new Map}),[t,e]},oa=na,Ze={width:0,height:0,left:0,top:0,right:0},ia=()=>({id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:me(),editable:me(),moreIcon:Te.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:me(),popupClassName:String,getPopupContainer:F(),onTabClick:{type:Function},onTabScroll:{type:Function}}),la=(e,t)=>{const{offsetWidth:a,offsetHeight:n,offsetTop:i,offsetLeft:l}=e,{width:o,height:r,x:d,y:c}=e.getBoundingClientRect();return Math.abs(o-a)<1?[o,r,d-t.x,c-t.y]:[a,n,l,i]},Je=ae({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:ia(),slots:Object,emits:["tabClick","tabScroll"],setup(e,t){let{attrs:a,slots:n}=t;const{tabs:i,prefixCls:l}=dt(),o=H(),r=H(),d=H(),c=H(),[f,_]=oa(),g=W(()=>e.tabPosition==="top"||e.tabPosition==="bottom"),[u,y]=Ue(0,(p,b)=>{g.value&&e.onTabScroll&&e.onTabScroll({direction:p>b?"left":"right"})}),[x,w]=Ue(0,(p,b)=>{!g.value&&e.onTabScroll&&e.onTabScroll({direction:p>b?"top":"bottom"})}),[C,D]=O(0),[G,M]=O(0),[s,m]=O(null),[v,$]=O(null),[E,R]=O(0),[K,re]=O(0),[se,ce]=Ut(new Map),I=Jt(i,se),Q=W(()=>`${l.value}-nav-operations-hidden`),k=H(0),Y=H(0);_e(()=>{g.value?e.rtl?(k.value=0,Y.value=Math.max(0,C.value-s.value)):(k.value=Math.min(0,s.value-C.value),Y.value=0):(k.value=Math.min(0,v.value-G.value),Y.value=0)});const q=p=>p<k.value?k.value:p>Y.value?Y.value:p,ue=H(),[z,ve]=O(),be=()=>{ve(Date.now())},fe=()=>{clearTimeout(ue.value)},$e=(p,b)=>{p(S=>q(S+b))};aa(o,(p,b)=>{if(g.value){if(s.value>=C.value)return!1;$e(y,p)}else{if(v.value>=G.value)return!1;$e(w,b)}return fe(),be(),!0}),ie(z,()=>{fe(),z.value&&(ue.value=setTimeout(()=>{ve(0)},100))});const de=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey;const b=I.value.get(p)||{width:0,height:0,left:0,right:0,top:0};if(g.value){let S=u.value;e.rtl?b.right<u.value?S=b.right:b.right+b.width>u.value+s.value&&(S=b.right+b.width-s.value):b.left<-u.value?S=-b.left:b.left+b.width>-u.value+s.value&&(S=-(b.left+b.width-s.value)),w(0),y(q(S))}else{let S=x.value;b.top<-x.value?S=-b.top:b.top+b.height>-x.value+v.value&&(S=-(b.top+b.height-v.value)),y(0),w(q(S))}},we=H(0),Pe=H(0);_e(()=>{let p,b,S,P,L,B;const U=I.value;["top","bottom"].includes(e.tabPosition)?(p="width",P=s.value,L=C.value,B=E.value,b=e.rtl?"right":"left",S=Math.abs(u.value)):(p="height",P=v.value,L=C.value,B=K.value,b="top",S=-x.value);let N=P;L+B>P&&L<P&&(N=P-B);const j=i.value;if(!j.length)return[we.value,Pe.value]=[0,0];const Z=j.length;let oe=Z;for(let X=0;X<Z;X+=1){const ee=U.get(j[X].key)||Ze;if(ee[b]+ee[p]>S+N){oe=X-1;break}}let A=0;for(let X=Z-1;X>=0;X-=1)if((U.get(j[X].key)||Ze)[b]<S){A=X+1;break}return[we.value,Pe.value]=[A,oe]});const Me=()=>{ce(()=>{var p;const b=new Map,S=(p=r.value)===null||p===void 0?void 0:p.getBoundingClientRect();return i.value.forEach(P=>{let{key:L}=P;const B=_.value.get(L),U=(B==null?void 0:B.$el)||B;if(U){const[N,j,Z,oe]=la(U,S);b.set(L,{width:N,height:j,left:Z,top:oe})}}),b})};ie(()=>i.value.map(p=>p.key).join("%%"),()=>{Me()},{flush:"post"});const Re=()=>{var p,b,S,P,L;const B=((p=o.value)===null||p===void 0?void 0:p.offsetWidth)||0,U=((b=o.value)===null||b===void 0?void 0:b.offsetHeight)||0,N=((S=c.value)===null||S===void 0?void 0:S.$el)||{},j=N.offsetWidth||0,Z=N.offsetHeight||0;m(B),$(U),R(j),re(Z);const oe=(((P=r.value)===null||P===void 0?void 0:P.offsetWidth)||0)-j,A=(((L=r.value)===null||L===void 0?void 0:L.offsetHeight)||0)-Z;D(oe),M(A),Me()},ke=W(()=>[...i.value.slice(0,we.value),...i.value.slice(Pe.value+1)]),[ut,vt]=O(),ne=W(()=>I.value.get(e.activeKey)),Ne=H(),He=()=>{ge.cancel(Ne.value)};ie([ne,g,()=>e.rtl],()=>{const p={};ne.value&&(g.value?(e.rtl?p.right=he(ne.value.right):p.left=he(ne.value.left),p.width=he(ne.value.width)):(p.top=he(ne.value.top),p.height=he(ne.value.height))),He(),Ne.value=ge(()=>{vt(p)})}),ie([()=>e.activeKey,ne,I,g],()=>{de()},{flush:"post"}),ie([()=>e.rtl,()=>e.tabBarGutter,()=>e.activeKey,()=>i.value],()=>{Re()},{flush:"post"});const Ie=p=>{let{position:b,prefixCls:S,extra:P}=p;if(!P)return null;const L=P==null?void 0:P({position:b});return L?h("div",{class:`${S}-extra-content`},[L]):null};return Oe(()=>{fe(),He()}),()=>{const{id:p,animated:b,activeKey:S,rtl:P,editable:L,locale:B,tabPosition:U,tabBarGutter:N,onTabClick:j}=e,{class:Z,style:oe}=a,A=l.value,X=!!ke.value.length,ee=`${A}-nav-wrap`;let Ee,Be,We,ze;g.value?P?(Be=u.value>0,Ee=u.value+s.value<C.value):(Ee=u.value<0,Be=-u.value+s.value<C.value):(We=x.value<0,ze=-x.value+v.value<G.value);const ye={};U==="top"||U==="bottom"?ye[P?"marginRight":"marginLeft"]=typeof N=="number"?`${N}px`:N:ye.marginTop=typeof N=="number"?`${N}px`:N;const Ge=i.value.map((Le,bt)=>{const{key:pe}=Le;return h(Zt,{id:p,prefixCls:A,key:pe,tab:Le,style:bt===0?void 0:ye,closable:Le.closable,editable:L,active:pe===S,removeAriaLabel:B==null?void 0:B.removeAriaLabel,ref:f(pe),onClick:ft=>{j(pe,ft)},onFocus:()=>{de(pe),be(),o.value&&(P||(o.value.scrollLeft=0),o.value.scrollTop=0)}},n)});return h("div",{role:"tablist",class:le(`${A}-nav`,Z),style:oe,onKeydown:()=>{be()}},[h(Ie,{position:"left",prefixCls:A,extra:n.leftExtra},null),h(Xe,{onResize:Re},{default:()=>[h("div",{class:le(ee,{[`${ee}-ping-left`]:Ee,[`${ee}-ping-right`]:Be,[`${ee}-ping-top`]:We,[`${ee}-ping-bottom`]:ze}),ref:o},[h(Xe,{onResize:Re},{default:()=>[h("div",{ref:r,class:`${A}-nav-list`,style:{transform:`translate(${u.value}px, ${x.value}px)`,transition:z.value?"none":void 0}},[Ge,h(lt,{ref:c,prefixCls:A,locale:B,editable:L,style:T(T({},Ge.length===0?void 0:ye),{visibility:X?"hidden":null})},null),h("div",{class:le(`${A}-ink-bar`,{[`${A}-ink-bar-animated`]:b.inkBar}),style:ut.value},null)])]})])]}),h(ea,te(te({},e),{},{removeAriaLabel:B==null?void 0:B.removeAriaLabel,ref:d,prefixCls:A,tabs:ke.value,class:!X&&Q.value}),it(n,["moreIcon"])),h(Ie,{position:"right",prefixCls:A,extra:n.rightExtra},null),h(Ie,{position:"right",prefixCls:A,extra:n.tabBarExtraContent},null)])}}}),ra=ae({compatConfig:{MODE:3},name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup(e){const{tabs:t,prefixCls:a}=dt();return()=>{const{id:n,activeKey:i,animated:l,tabPosition:o,rtl:r,destroyInactiveTabPane:d}=e,c=l.tabPane,f=a.value,_=t.value.findIndex(g=>g.key===i);return h("div",{class:`${f}-content-holder`},[h("div",{class:[`${f}-content`,`${f}-content-${o}`,{[`${f}-content-animated`]:c}],style:_&&c?{[r?"marginRight":"marginLeft"]:`-${_}00%`}:null},[t.value.map(g=>Tt(g.node,{key:g.key,prefixCls:f,tabKey:g.key,id:n,animated:c,active:g.key===i,destroyInactiveTabPane:d}))])])}}});var sa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"};const da=sa;function Qe(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable}))),n.forEach(function(i){ca(e,i,a[i])})}return e}function ca(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var De=function(t,a){var n=Qe({},t,a.attrs);return h(wt,Qe({},n,{icon:da}),null)};De.displayName="PlusOutlined";De.inheritAttrs=!1;const ua=De,va=e=>{const{componentCls:t,motionDurationSlow:a}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${a}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${a}`}}}}},[Fe(e,"slide-up"),Fe(e,"slide-down")]]},ba=va,fa=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeadBackground:n,tabsCardGutter:i,colorSplit:l}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:a,background:n,border:`${e.lineWidth}px ${e.lineType} ${l}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:e.colorPrimary,background:e.colorBgContainer},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:`${i}px`}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:`${i}px`}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadiusLG}px 0 0 ${e.borderRadiusLG}px`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},pa=e=>{const{componentCls:t,tabsHoverColor:a,dropdownEdgeChildVerticalPadding:n}=e;return{[`${t}-dropdown`]:T(T({},at(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${n}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":T(T({},It),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${e.paddingXXS}px ${e.paddingSM}px`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:a}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},ha=e=>{const{componentCls:t,margin:a,colorSplit:n}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:`0 0 ${a}px 0`,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${e.lineWidth}px ${e.lineType} ${n}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow},
- right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
- > div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:`${a}px`,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:e.controlHeight*1.25,[`${t}-tab`]:{padding:`${e.paddingXS}px ${e.paddingLG}px`,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:`${e.margin}px 0 0 0`},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-e.lineWidth},borderRight:{_skip_check_:!0,value:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ga=e=>{const{componentCls:t,padding:a}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px 0`,fontSize:e.fontSize}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${a}px 0`,fontSize:e.fontSizeLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXXS*1.5}px ${a}px`}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${e.borderRadius}px ${e.borderRadius}px`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${e.borderRadius}px ${e.borderRadius}px 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${e.borderRadius}px 0 0 ${e.borderRadius}px`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:`${e.paddingXS}px ${a}px ${e.paddingXXS*1.5}px`}}}}}},ma=e=>{const{componentCls:t,tabsActiveColor:a,tabsHoverColor:n,iconCls:i,tabsHorizontalGutter:l}=e,o=`${t}-tab`;return{[o]:{position:"relative",display:"inline-flex",alignItems:"center",padding:`${e.paddingSM}px 0`,fontSize:`${e.fontSize}px`,background:"transparent",border:0,outline:"none",cursor:"pointer","&-btn, &-remove":T({"&:focus:not(:focus-visible), &:active":{color:a}},nt(e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-e.marginXXS},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},"&:hover":{color:n},[`&${o}-active ${o}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${o}-disabled ${o}-btn, &${o}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${o}-remove ${i}`]:{margin:0},[i]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${o} + ${o}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${l}px`}}}},$a=e=>{const{componentCls:t,tabsHorizontalGutter:a,iconCls:n,tabsCardGutter:i}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:`0 0 0 ${a}px`},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[n]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${e.marginSM}px`}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${e.marginXXS}px`},[n]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:`${i}px`},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},ya=e=>{const{componentCls:t,tabsCardHorizontalPadding:a,tabsCardHeight:n,tabsCardGutter:i,tabsHoverColor:l,tabsActiveColor:o,colorSplit:r}=e;return{[t]:T(T(T(T({},at(e)),{display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:a,background:"transparent",border:0,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:T({minWidth:`${n}px`,marginLeft:{_skip_check_:!0,value:`${i}px`},padding:`0 ${e.paddingXS}px`,background:"transparent",border:`${e.lineWidth}px ${e.lineType} ${r}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:l},"&:active, &:focus:not(:focus-visible)":{color:o}},nt(e))},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.colorPrimary,pointerEvents:"none"}}),ma(e)),{[`${t}-content`]:{position:"relative",display:"flex",width:"100%",["&-animated"]:{transition:"margin 0.3s"}},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:{outline:"none",flex:"none",width:"100%"}}),[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}},xa=Pt("Tabs",e=>{const t=e.controlHeightLG,a=Rt(e,{tabsHoverColor:e.colorPrimaryHover,tabsActiveColor:e.colorPrimaryActive,tabsCardHorizontalPadding:`${(t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth}px ${e.padding}px`,tabsCardHeight:t,tabsCardGutter:e.marginXXS/2,tabsHorizontalGutter:32,tabsCardHeadBackground:e.colorFillAlter,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120});return[ga(a),$a(a),ha(a),pa(a),fa(a),ya(a),ba(a)]},e=>({zIndexPopup:e.zIndexPopupBase+50}));let et=0;const ct=()=>({prefixCls:{type:String},id:{type:String},popupClassName:String,getPopupContainer:F(),activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:xe(),animated:Lt([Boolean,Object]),renderTabBar:F(),tabBarGutter:{type:Number},tabBarStyle:me(),tabPosition:xe(),destroyInactiveTabPane:At(),hideAdd:Boolean,type:xe(),size:xe(),centered:Boolean,onEdit:F(),onChange:F(),onTabClick:F(),onTabScroll:F(),"onUpdate:activeKey":F(),locale:me(),onPrevClick:F(),onNextClick:F(),tabBarExtraContent:Te.any});function Sa(e){return e.map(t=>{if(Ot(t)){const a=T({},t.props||{});for(const[g,u]of Object.entries(a))delete a[g],a[Dt(g)]=u;const n=t.children||{},i=t.key!==void 0?t.key:void 0,{tab:l=n.tab,disabled:o,forceRender:r,closable:d,animated:c,active:f,destroyInactiveTabPane:_}=a;return T(T({key:i},a),{node:t,closeIcon:n.closeIcon,tab:l,disabled:o===""||o,forceRender:r===""||r,closable:d===""||d,animated:c===""||c,active:f===""||f,destroyInactiveTabPane:_===""||_})}return null}).filter(t=>t)}const _a=ae({compatConfig:{MODE:3},name:"InternalTabs",inheritAttrs:!1,props:T(T({},ot(ct(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}})),{tabs:Mt()}),slots:Object,setup(e,t){let{attrs:a,slots:n}=t;Ae(e.onPrevClick===void 0&&e.onNextClick===void 0,"Tabs","`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),Ae(e.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),Ae(n.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");const{prefixCls:i,direction:l,size:o,rootPrefixCls:r,getPopupContainer:d}=kt("tabs",e),[c,f]=xa(i),_=W(()=>l.value==="rtl"),g=W(()=>{const{animated:v,tabPosition:$}=e;return v===!1||["left","right"].includes($)?{inkBar:!1,tabPane:!1}:v===!0?{inkBar:!0,tabPane:!0}:T({inkBar:!0,tabPane:!1},typeof v=="object"?v:{})}),[u,y]=O(!1);Ce(()=>{y(Xt())});const[x,w]=je(()=>{var v;return(v=e.tabs[0])===null||v===void 0?void 0:v.key},{value:W(()=>e.activeKey),defaultValue:e.defaultActiveKey}),[C,D]=O(()=>e.tabs.findIndex(v=>v.key===x.value));_e(()=>{var v;let $=e.tabs.findIndex(E=>E.key===x.value);$===-1&&($=Math.max(0,Math.min(C.value,e.tabs.length-1)),w((v=e.tabs[$])===null||v===void 0?void 0:v.key)),D($)});const[G,M]=je(null,{value:W(()=>e.id)}),s=W(()=>u.value&&!["left","right"].includes(e.tabPosition)?"top":e.tabPosition);Ce(()=>{e.id||(M(`rc-tabs-${et}`),et+=1)});const m=(v,$)=>{var E,R;(E=e.onTabClick)===null||E===void 0||E.call(e,v,$);const K=v!==x.value;w(v),K&&((R=e.onChange)===null||R===void 0||R.call(e,v))};return st({tabs:W(()=>e.tabs),prefixCls:i}),()=>{const{id:v,type:$,tabBarGutter:E,tabBarStyle:R,locale:K,destroyInactiveTabPane:re,renderTabBar:se=n.renderTabBar,onTabScroll:ce,hideAdd:I,centered:Q}=e,k={id:G.value,activeKey:x.value,animated:g.value,tabPosition:s.value,rtl:_.value,mobile:u.value};let Y;$==="editable-card"&&(Y={onEdit:(ve,be)=>{let{key:fe,event:$e}=be;var de;(de=e.onEdit)===null||de===void 0||de.call(e,ve==="add"?$e:fe,ve)},removeIcon:()=>h(Nt,null,null),addIcon:n.addIcon?n.addIcon:()=>h(ua,null,null),showAdd:I!==!0});let q;const ue=T(T({},k),{moreTransitionName:`${r.value}-slide-up`,editable:Y,locale:K,tabBarGutter:E,onTabClick:m,onTabScroll:ce,style:R,getPopupContainer:d.value,popupClassName:le(e.popupClassName,f.value)});se?q=se(T(T({},ue),{DefaultTabBar:Je})):q=h(Je,ue,it(n,["moreIcon","leftExtra","rightExtra","tabBarExtraContent"]));const z=i.value;return c(h("div",te(te({},a),{},{id:v,class:le(z,`${z}-${s.value}`,{[f.value]:!0,[`${z}-${o.value}`]:o.value,[`${z}-card`]:["card","editable-card"].includes($),[`${z}-editable-card`]:$==="editable-card",[`${z}-centered`]:Q,[`${z}-mobile`]:u.value,[`${z}-editable`]:$==="editable-card",[`${z}-rtl`]:_.value},a.class)}),[q,h(ra,te(te({destroyInactiveTabPane:re},k),{},{animated:g.value}),null)]))}}}),Ia=ae({compatConfig:{MODE:3},name:"ATabs",inheritAttrs:!1,props:ot(ct(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}}),slots:Object,setup(e,t){let{attrs:a,slots:n,emit:i}=t;const l=o=>{i("update:activeKey",o),i("change",o)};return()=>{var o;const r=Sa(Et((o=n.default)===null||o===void 0?void 0:o.call(n)));return h(_a,te(te(te({},Bt(e,["onUpdate:activeKey"])),a),{},{onChange:l,tabs:r}),n)}}}),Ca=()=>({tab:Te.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}}),Ea=ae({compatConfig:{MODE:3},name:"ATabPane",inheritAttrs:!1,__ANT_TAB_PANE:!0,props:Ca(),slots:Object,setup(e,t){let{attrs:a,slots:n}=t;const i=V(e.forceRender);ie([()=>e.active,()=>e.destroyInactiveTabPane],()=>{e.active?i.value=!0:e.destroyInactiveTabPane&&(i.value=!1)},{immediate:!0});const l=W(()=>e.active?{}:e.animated?{visibility:"hidden",height:0,overflowY:"hidden"}:{display:"none"});return()=>{var o;const{prefixCls:r,forceRender:d,id:c,active:f,tabKey:_}=e;return h("div",{id:c&&`${c}-panel-${_}`,role:"tabpanel",tabindex:f?0:-1,"aria-labelledby":c&&`${c}-tab-${_}`,"aria-hidden":!f,style:[l.value,a.style],class:[`${r}-tabpane`,f&&`${r}-tabpane-active`,a.class]},[(f||i.value||d)&&((o=n.default)===null||o===void 0?void 0:o.call(n))])}}});export{Ia as T,Ea as a};
|