4 lines
33 KiB
JavaScript
4 lines
33 KiB
JavaScript
import{az as je,aA as nt,aB as ht,cg as mt,dd as gt,ao as $t,s as W,e as ke,b4 as me,d as le,r as J,k as H,C as h,aN as ie,cr as Z,b5 as Ce,aG as T,aP as F,aV as we,cv as O,o as Te,a0 as oe,bk as yt,bl as xt,de as he,aO as te,aU as ge,aY as _t,b8 as St,ba as Ct,bb as Tt,bc as ot,cx as wt,df as it,aI as lt,bR as Pt,aZ as Rt,b9 as It,dg as Et,cS as Oe,aJ as Bt,cC as Lt,bB as At,aR as xe,aQ as Ot,aS as Dt}from"./CwKn53hw.js";import{u as kt,E as Mt,M as Nt,_ as Wt}from"./DGKoACy0.js";import{D as Ht}from"./C3B7AeHq.js";import{R as Fe}from"./giHSQL8A.js";import{u as zt}from"./5FrA0FWU.js";import{h as Gt}from"./Dkg0Nt20.js";import{f as Kt}from"./BXySLQNU.js";import{i as Xt}from"./BbN7I0i_.js";import{u as Ve}from"./Di0iyUiR.js";import{i as Ye}from"./C8rLUGwo.js";function jt(e,t,a,i){if(!je(e))return e;t=nt(t,e);for(var o=-1,l=t.length,n=l-1,s=e;s!=null&&++o<l;){var v=ht(t[o]),c=a;if(v==="__proto__"||v==="constructor"||v==="prototype")return e;if(o!=n){var p=s[v];c=void 0,c===void 0&&(c=je(p)?p:mt(t[o+1])?[]:{})}gt(s,v,c),s=s[v]}return e}function Ft(e,t,a){for(var i=-1,o=t.length,l={};++i<o;){var n=t[i],s=$t(e,n);a(s,n)&&jt(l,nt(n,e),s)}return l}function Vt(e,t){return Ft(e,t,function(a,i){return Gt(e,i)})}var rt=Kt(function(e,t){return e==null?{}:Vt(e,t)});function Yt(e){const t=W(),a=W(!1);function i(){for(var o=arguments.length,l=new Array(o),n=0;n<o;n++)l[n]=arguments[n];a.value||(me.cancel(t.value),t.value=me(()=>{e(...l)}))}return ke(()=>{a.value=!0,me.cancel(t.value)}),i}function Ut(e){const t=W([]),a=W(typeof e=="function"?e():e),i=Yt(()=>{let l=a.value;t.value.forEach(n=>{l=n(l)}),t.value=[],a.value=l});function o(l){t.value.push(l),i()}return[a,o]}const qt=le({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:i}=t;const o=J();function l(v){var c;!((c=e.tab)===null||c===void 0)&&c.disabled||e.onClick(v)}a({domRef:o});function n(v){var c;v.preventDefault(),v.stopPropagation(),e.editable.onEdit("remove",{key:(c=e.tab)===null||c===void 0?void 0:c.key,event:v})}const s=H(()=>{var v;return e.editable&&e.closable!==!1&&!(!((v=e.tab)===null||v===void 0)&&v.disabled)});return()=>{var v;const{prefixCls:c,id:p,active:S,tab:{key:m,tab:d,disabled:y,closeIcon:x},renderWrapper:w,removeAriaLabel:C,editable:D,onFocus:G}=e,k=`${c}-tab`,r=h("div",{key:m,ref:o,class:ie(k,{[`${k}-with-remove`]:s.value,[`${k}-active`]:S,[`${k}-disabled`]:y}),style:i.style,onClick:l},[h("div",{role:"tab","aria-selected":S,id:p&&`${p}-tab-${m}`,class:`${k}-btn`,"aria-controls":p&&`${p}-panel-${m}`,"aria-disabled":y,tabindex:y?null:0,onClick:g=>{g.stopPropagation(),l(g)},onKeydown:g=>{[Z.SPACE,Z.ENTER].includes(g.which)&&(g.preventDefault(),l(g))},onFocus:G},[typeof d=="function"?d():d]),s.value&&h("button",{type:"button","aria-label":C||"remove",tabindex:0,class:`${k}-remove`,onClick:g=>{g.stopPropagation(),n(g)}},[(x==null?void 0:x())||((v=D.removeIcon)===null||v===void 0?void 0:v.call(D))||"×"])]);return w?w(r):r}}}),Ue={width:0,height:0,left:0,top:0};function Zt(e,t){const a=J(new Map);return Ce(()=>{var i,o;const l=new Map,n=e.value,s=t.value.get((i=n[0])===null||i===void 0?void 0:i.key)||Ue,v=s.left+s.width;for(let c=0;c<n.length;c+=1){const{key:p}=n[c];let S=t.value.get(p);S||(S=t.value.get((o=n[c-1])===null||o===void 0?void 0:o.key)||Ue);const m=l.get(p)||T({},S);m.right=v-m.left-m.width,l.set(p,m)}a.value=new Map(l)}),a}const st=le({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:i}=t;const o=J();return a({domRef:o}),()=>{const{prefixCls:l,editable:n,locale:s}=e;return!n||n.showAdd===!1?null:h("button",{ref:o,type:"button",class:`${l}-nav-add`,style:i.style,"aria-label":(s==null?void 0:s.addAriaLabel)||"Add ta
|
||||
|
|
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}}}}}},va=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`}}}}}},ba=e=>{const{componentCls:t,tabsActiveColor:a,tabsHoverColor:i,iconCls:o,tabsHorizontalGutter:l}=e,n=`${t}-tab`;return{[n]:{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}},it(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:i},[`&${n}-active ${n}-btn`]:{color:e.colorPrimary,textShadow:e.tabsActiveTextShadow},[`&${n}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-disabled ${n}-btn, &${n}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${n}-remove ${o}`]:{margin:0},[o]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${n} + ${n}`]:{margin:{_skip_check_:!0,value:`0 0 0 ${l}px`}}}},pa=e=>{const{componentCls:t,tabsHorizontalGutter:a,iconCls:i,tabsCardGutter:o}=e;return{[`${t}-rtl`]:{direction:"
|