123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- import{d as V,bH as ge,f as B,bI as ht,bJ as gt,k as l,bK as mt,bL as J,bM as xt,U as h,T as o,Z as i,V as $,ax as yt,ay as wt,W as Se,ae as Ct,$ as Z,bN as Rt,aZ as Te,ab as H,C as N,a1 as _e,be as Pe,aU as le,ba as We,aI as zt,F as $t,aj as St,bO as Tt,aJ as _t,bF as Pt,Y as Wt,bq as me,bn as te,ac as Lt,L as re,bP as kt,aW as Bt,a5 as j,aH as Y,ag as xe,bl as ye,bQ as At,al as q,D as ae,E as Et,G as jt,aD as It,bo as Ot}from"./index-e497b666.js";import{A as Ht}from"./Add-f2559956.js";const Dt=ge(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[ge("&::-webkit-scrollbar",{width:0,height:0})]),Ft=V({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const e=B(null);function r(d){!(d.currentTarget.offsetWidth<d.currentTarget.scrollWidth)||d.deltaY===0||(d.currentTarget.scrollLeft+=d.deltaY+d.deltaX,d.preventDefault())}const n=ht();return Dt.mount({id:"vueuc/x-scroll",head:!0,anchorMetaName:gt,ssr:n}),Object.assign({selfRef:e,handleWheel:r},{scrollTo(...d){var g;(g=e.value)===null||g===void 0||g.scrollTo(...d)}})},render(){return l("div",{ref:"selfRef",onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:"v-x-scroll"},this.$slots)}});var Mt=/\s/;function Vt(e){for(var r=e.length;r--&&Mt.test(e.charAt(r)););return r}var Nt=/^\s+/;function Ut(e){return e&&e.slice(0,Vt(e)+1).replace(Nt,"")}var we=0/0,Xt=/^[-+]0x[0-9a-f]+$/i,Gt=/^0b[01]+$/i,Kt=/^0o[0-7]+$/i,Yt=parseInt;function Ce(e){if(typeof e=="number")return e;if(mt(e))return we;if(J(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=J(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Ut(e);var n=Gt.test(e);return n||Kt.test(e)?Yt(e.slice(2),n?2:8):Xt.test(e)?we:+e}var qt=function(){return xt.Date.now()};const oe=qt;var Jt="Expected a function",Zt=Math.max,Qt=Math.min;function er(e,r,n){var p,d,g,u,f,m,x=0,w=!1,C=!1,y=!0;if(typeof e!="function")throw new TypeError(Jt);r=Ce(r)||0,J(n)&&(w=!!n.leading,C="maxWait"in n,g=C?Zt(Ce(n.maxWait)||0,r):g,y="trailing"in n?!!n.trailing:y);function R(b){var P=p,I=d;return p=d=void 0,x=b,u=e.apply(I,P),u}function z(b){return x=b,f=setTimeout(W,r),w?R(b):u}function _(b){var P=b-m,I=b-x,D=r-P;return C?Qt(D,g-I):D}function T(b){var P=b-m,I=b-x;return m===void 0||P>=r||P<0||C&&I>=g}function W(){var b=oe();if(T(b))return S(b);f=setTimeout(W,_(b))}function S(b){return f=void 0,y&&p?R(b):(p=d=void 0,u)}function L(){f!==void 0&&clearTimeout(f),x=0,p=m=d=f=void 0}function A(){return f===void 0?u:S(oe())}function v(){var b=oe(),P=T(b);if(p=arguments,d=this,m=b,P){if(f===void 0)return z(m);if(C)return clearTimeout(f),f=setTimeout(W,r),R(m)}return f===void 0&&(f=setTimeout(W,r)),u}return v.cancel=L,v.flush=A,v}var tr="Expected a function";function ne(e,r,n){var p=!0,d=!0;if(typeof e!="function")throw new TypeError(tr);return J(n)&&(p="leading"in n?!!n.leading:p,d="trailing"in n?!!n.trailing:d),er(e,r,{leading:p,maxWait:r,trailing:d})}const rr=h([o("list",`
- --n-merged-border-color: var(--n-border-color);
- --n-merged-color: var(--n-color);
- --n-merged-color-hover: var(--n-color-hover);
- margin: 0;
- font-size: var(--n-font-size);
- transition:
- background-color .3s var(--n-bezier),
- color .3s var(--n-bezier),
- border-color .3s var(--n-bezier);
- padding: 0;
- list-style-type: none;
- color: var(--n-text-color);
- background-color: var(--n-merged-color);
- `,[i("show-divider",[o("list-item",[h("&:not(:last-child)",[$("divider",`
- background-color: var(--n-merged-border-color);
- `)])])]),i("clickable",[o("list-item",`
- cursor: pointer;
- `)]),i("bordered",`
- border: 1px solid var(--n-merged-border-color);
- border-radius: var(--n-border-radius);
- `),i("hoverable",[o("list-item",`
- border-radius: var(--n-border-radius);
- `,[h("&:hover",`
- background-color: var(--n-merged-color-hover);
- `,[$("divider",`
- background-color: transparent;
- `)])])]),i("bordered, hoverable",[o("list-item",`
- padding: 12px 20px;
- `),$("header, footer",`
- padding: 12px 20px;
- `)]),$("header, footer",`
- padding: 12px 0;
- box-sizing: border-box;
- transition: border-color .3s var(--n-bezier);
- `,[h("&:not(:last-child)",`
- border-bottom: 1px solid var(--n-merged-border-color);
- `)]),o("list-item",`
- position: relative;
- padding: 12px 0;
- box-sizing: border-box;
- display: flex;
- flex-wrap: nowrap;
- align-items: center;
- transition:
- background-color .3s var(--n-bezier),
- border-color .3s var(--n-bezier);
- `,[$("prefix",`
- margin-right: 20px;
- flex: 0;
- `),$("suffix",`
- margin-left: 20px;
- flex: 0;
- `),$("main",`
- flex: 1;
- `),$("divider",`
- height: 1px;
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: transparent;
- transition: background-color .3s var(--n-bezier);
- pointer-events: none;
- `)])]),yt(o("list",`
- --n-merged-color-hover: var(--n-color-hover-modal);
- --n-merged-color: var(--n-color-modal);
- --n-merged-border-color: var(--n-border-color-modal);
- `)),wt(o("list",`
- --n-merged-color-hover: var(--n-color-hover-popover);
- --n-merged-color: var(--n-color-popover);
- --n-merged-border-color: var(--n-border-color-popover);
- `))]),ar=Object.assign(Object.assign({},Z.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),Le=Pe("n-list"),dr=V({name:"List",props:ar,setup(e){const{mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:p}=Se(e),d=Ct("List",p,r),g=Z("List","-list",rr,Rt,e,r);Te(Le,{showDividerRef:H(e,"showDivider"),mergedClsPrefixRef:r});const u=N(()=>{const{common:{cubicBezierEaseInOut:m},self:{fontSize:x,textColor:w,color:C,colorModal:y,colorPopover:R,borderColor:z,borderColorModal:_,borderColorPopover:T,borderRadius:W,colorHover:S,colorHoverModal:L,colorHoverPopover:A}}=g.value;return{"--n-font-size":x,"--n-bezier":m,"--n-text-color":w,"--n-color":C,"--n-border-radius":W,"--n-border-color":z,"--n-border-color-modal":_,"--n-border-color-popover":T,"--n-color-modal":y,"--n-color-popover":R,"--n-color-hover":S,"--n-color-hover-modal":L,"--n-color-hover-popover":A}}),f=n?_e("list",void 0,u,e):void 0;return{mergedClsPrefix:r,rtlEnabled:d,cssVars:n?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;const{$slots:r,mergedClsPrefix:n,onRender:p}=this;return p==null||p(),l("ul",{class:[`${n}-list`,this.rtlEnabled&&`${n}-list--rtl`,this.bordered&&`${n}-list--bordered`,this.showDivider&&`${n}-list--show-divider`,this.hoverable&&`${n}-list--hoverable`,this.clickable&&`${n}-list--clickable`,this.themeClass],style:this.cssVars},r.header?l("div",{class:`${n}-list__header`},r.header()):null,(e=r.default)===null||e===void 0?void 0:e.call(r),r.footer?l("div",{class:`${n}-list__footer`},r.footer()):null)}}),cr=V({name:"ListItem",setup(){const e=le(Le,null);return e||We("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:r}=this;return l("li",{class:`${r}-list-item`},e.prefix?l("div",{class:`${r}-list-item__prefix`},e.prefix()):null,e.default?l("div",{class:`${r}-list-item__main`},e):null,e.suffix?l("div",{class:`${r}-list-item__suffix`},e.suffix()):null,this.showDivider&&l("div",{class:`${r}-list-item__divider`}))}}),de=Pe("n-tabs"),ke={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},br=V({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:ke,setup(e){const r=le(de,null);return r||We("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:r.paneStyleRef,class:r.paneClassRef,mergedClsPrefix:r.mergedClsPrefixRef}},render(){return l("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),or=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Pt(ke,["displayDirective"])),se=V({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:or,setup(e){const{mergedClsPrefixRef:r,valueRef:n,typeRef:p,closableRef:d,tabStyleRef:g,tabChangeIdRef:u,onBeforeLeaveRef:f,triggerRef:m,handleAdd:x,activateTab:w,handleClose:C}=le(de);return{trigger:m,mergedClosable:N(()=>{if(e.internalAddable)return!1;const{closable:y}=e;return y===void 0?d.value:y}),style:g,clsPrefix:r,value:n,type:p,handleClose(y){y.stopPropagation(),!e.disabled&&C(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){x();return}const{name:y}=e,R=++u.id;if(y!==n.value){const{value:z}=f;z?Promise.resolve(z(e.name,n.value)).then(_=>{_&&u.id===R&&w(y)}):w(y)}}}},render(){const{internalAddable:e,clsPrefix:r,name:n,disabled:p,label:d,tab:g,value:u,mergedClosable:f,style:m,trigger:x,$slots:{default:w}}=this,C=d??g;return l("div",{class:`${r}-tabs-tab-wrapper`},this.internalLeftPadded?l("div",{class:`${r}-tabs-tab-pad`}):null,l("div",Object.assign({key:n,"data-name":n,"data-disabled":p?!0:void 0},zt({class:[`${r}-tabs-tab`,u===n&&`${r}-tabs-tab--active`,p&&`${r}-tabs-tab--disabled`,f&&`${r}-tabs-tab--closable`,e&&`${r}-tabs-tab--addable`],onClick:x==="click"?this.activateTab:void 0,onMouseenter:x==="hover"?this.activateTab:void 0,style:e?void 0:m},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),l("span",{class:`${r}-tabs-tab__label`},e?l($t,null,l("div",{class:`${r}-tabs-tab__height-placeholder`}," "),l(St,{clsPrefix:r},{default:()=>l(Ht,null)})):w?w():typeof C=="object"?C:Tt(C??n)),f&&this.type==="card"?l(_t,{clsPrefix:r,class:`${r}-tabs-tab__close`,onClick:this.handleClose,disabled:p}):null))}}),nr=o("tabs",`
- box-sizing: border-box;
- width: 100%;
- display: flex;
- flex-direction: column;
- transition:
- background-color .3s var(--n-bezier),
- border-color .3s var(--n-bezier);
- `,[i("segment-type",[o("tabs-rail",[h("&.transition-disabled","color: red;",[o("tabs-tab",`
- transition: none;
- `)])])]),i("top",[o("tab-pane",`
- padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left);
- `)]),i("left",[o("tab-pane",`
- padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top);
- `)]),i("left, right",`
- flex-direction: row;
- `,[o("tabs-bar",`
- width: 2px;
- right: 0;
- transition:
- top .2s var(--n-bezier),
- max-height .2s var(--n-bezier),
- background-color .3s var(--n-bezier);
- `),o("tabs-tab",`
- padding: var(--n-tab-padding-vertical);
- `)]),i("right",`
- flex-direction: row-reverse;
- `,[o("tab-pane",`
- padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom);
- `),o("tabs-bar",`
- left: 0;
- `)]),i("bottom",`
- flex-direction: column-reverse;
- justify-content: flex-end;
- `,[o("tab-pane",`
- padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left);
- `),o("tabs-bar",`
- top: 0;
- `)]),o("tabs-rail",`
- padding: 3px;
- border-radius: var(--n-tab-border-radius);
- width: 100%;
- background-color: var(--n-color-segment);
- transition: background-color .3s var(--n-bezier);
- display: flex;
- align-items: center;
- `,[o("tabs-tab-wrapper",`
- flex-basis: 0;
- flex-grow: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- `,[o("tabs-tab",`
- overflow: hidden;
- border-radius: var(--n-tab-border-radius);
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- `,[i("active",`
- font-weight: var(--n-font-weight-strong);
- color: var(--n-tab-text-color-active);
- background-color: var(--n-tab-color-segment);
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
- `),h("&:hover",`
- color: var(--n-tab-text-color-hover);
- `)])])]),i("flex",[o("tabs-nav",{width:"100%"},[o("tabs-wrapper",{width:"100%"},[o("tabs-tab",{marginRight:0})])])]),o("tabs-nav",`
- box-sizing: border-box;
- line-height: 1.5;
- display: flex;
- transition: border-color .3s var(--n-bezier);
- `,[$("prefix, suffix",`
- display: flex;
- align-items: center;
- `),$("prefix","padding-right: 16px;"),$("suffix","padding-left: 16px;")]),i("top, bottom",[o("tabs-nav-scroll-wrapper",[h("&::before",`
- top: 0;
- bottom: 0;
- left: 0;
- width: 20px;
- `),h("&::after",`
- top: 0;
- bottom: 0;
- right: 0;
- width: 20px;
- `),i("shadow-start",[h("&::before",`
- box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
- `)]),i("shadow-end",[h("&::after",`
- box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
- `)])])]),i("left, right",[o("tabs-nav-scroll-wrapper",[h("&::before",`
- top: 0;
- left: 0;
- right: 0;
- height: 20px;
- `),h("&::after",`
- bottom: 0;
- left: 0;
- right: 0;
- height: 20px;
- `),i("shadow-start",[h("&::before",`
- box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
- `)]),i("shadow-end",[h("&::after",`
- box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12);
- `)])])]),o("tabs-nav-scroll-wrapper",`
- flex: 1;
- position: relative;
- overflow: hidden;
- `,[o("tabs-nav-y-scroll",`
- height: 100%;
- width: 100%;
- overflow-y: auto;
- scrollbar-width: none;
- `,[h("&::-webkit-scrollbar",`
- width: 0;
- height: 0;
- `)]),h("&::before, &::after",`
- transition: box-shadow .3s var(--n-bezier);
- pointer-events: none;
- content: "";
- position: absolute;
- z-index: 1;
- `)]),o("tabs-nav-scroll-content",`
- display: flex;
- position: relative;
- min-width: 100%;
- width: fit-content;
- box-sizing: border-box;
- `),o("tabs-wrapper",`
- display: inline-flex;
- flex-wrap: nowrap;
- position: relative;
- `),o("tabs-tab-wrapper",`
- display: flex;
- flex-wrap: nowrap;
- flex-shrink: 0;
- flex-grow: 0;
- `),o("tabs-tab",`
- cursor: pointer;
- white-space: nowrap;
- flex-wrap: nowrap;
- display: inline-flex;
- align-items: center;
- color: var(--n-tab-text-color);
- font-size: var(--n-tab-font-size);
- background-clip: padding-box;
- padding: var(--n-tab-padding);
- transition:
- box-shadow .3s var(--n-bezier),
- color .3s var(--n-bezier),
- background-color .3s var(--n-bezier),
- border-color .3s var(--n-bezier);
- `,[i("disabled",{cursor:"not-allowed"}),$("close",`
- margin-left: 6px;
- transition:
- background-color .3s var(--n-bezier),
- color .3s var(--n-bezier);
- `),$("label",`
- display: flex;
- align-items: center;
- `)]),o("tabs-bar",`
- position: absolute;
- bottom: 0;
- height: 2px;
- border-radius: 1px;
- background-color: var(--n-bar-color);
- transition:
- left .2s var(--n-bezier),
- max-width .2s var(--n-bezier),
- background-color .3s var(--n-bezier);
- `,[h("&.transition-disabled",`
- transition: none;
- `),i("disabled",`
- background-color: var(--n-tab-text-color-disabled)
- `)]),o("tabs-pane-wrapper",`
- position: relative;
- overflow: hidden;
- transition: max-height .2s var(--n-bezier);
- `),o("tab-pane",`
- color: var(--n-pane-text-color);
- width: 100%;
- transition:
- color .3s var(--n-bezier),
- background-color .3s var(--n-bezier),
- opacity .2s var(--n-bezier);
- left: 0;
- right: 0;
- top: 0;
- `,[h("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",`
- transition:
- color .3s var(--n-bezier),
- background-color .3s var(--n-bezier),
- transform .2s var(--n-bezier),
- opacity .2s var(--n-bezier);
- `),h("&.next-transition-leave-active, &.prev-transition-leave-active",`
- position: absolute;
- `),h("&.next-transition-enter-from, &.prev-transition-leave-to",`
- transform: translateX(32px);
- opacity: 0;
- `),h("&.next-transition-leave-to, &.prev-transition-enter-from",`
- transform: translateX(-32px);
- opacity: 0;
- `),h("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",`
- transform: translateX(0);
- opacity: 1;
- `)]),o("tabs-tab-pad",`
- box-sizing: border-box;
- width: var(--n-tab-gap);
- flex-grow: 0;
- flex-shrink: 0;
- `),i("line-type, bar-type",[o("tabs-tab",`
- font-weight: var(--n-tab-font-weight);
- box-sizing: border-box;
- vertical-align: bottom;
- `,[h("&:hover",{color:"var(--n-tab-text-color-hover)"}),i("active",`
- color: var(--n-tab-text-color-active);
- font-weight: var(--n-tab-font-weight-active);
- `),i("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),o("tabs-nav",[i("line-type",[i("top",[$("prefix, suffix",`
- border-bottom: 1px solid var(--n-tab-border-color);
- `),o("tabs-nav-scroll-content",`
- border-bottom: 1px solid var(--n-tab-border-color);
- `),o("tabs-bar",`
- bottom: -1px;
- `)]),i("left",[$("prefix, suffix",`
- border-right: 1px solid var(--n-tab-border-color);
- `),o("tabs-nav-scroll-content",`
- border-right: 1px solid var(--n-tab-border-color);
- `),o("tabs-bar",`
- right: -1px;
- `)]),i("right",[$("prefix, suffix",`
- border-left: 1px solid var(--n-tab-border-color);
- `),o("tabs-nav-scroll-content",`
- border-left: 1px solid var(--n-tab-border-color);
- `),o("tabs-bar",`
- left: -1px;
- `)]),i("bottom",[$("prefix, suffix",`
- border-top: 1px solid var(--n-tab-border-color);
- `),o("tabs-nav-scroll-content",`
- border-top: 1px solid var(--n-tab-border-color);
- `),o("tabs-bar",`
- top: -1px;
- `)]),$("prefix, suffix",`
- transition: border-color .3s var(--n-bezier);
- `),o("tabs-nav-scroll-content",`
- transition: border-color .3s var(--n-bezier);
- `),o("tabs-bar",`
- border-radius: 0;
- `)]),i("card-type",[$("prefix, suffix",`
- transition: border-color .3s var(--n-bezier);
- border-bottom: 1px solid var(--n-tab-border-color);
- `),o("tabs-pad",`
- flex-grow: 1;
- transition: border-color .3s var(--n-bezier);
- border-bottom: 1px solid var(--n-tab-border-color);
- `),o("tabs-tab-pad",`
- transition: border-color .3s var(--n-bezier);
- `),o("tabs-tab",`
- font-weight: var(--n-tab-font-weight);
- border: 1px solid var(--n-tab-border-color);
- background-color: var(--n-tab-color);
- box-sizing: border-box;
- position: relative;
- vertical-align: bottom;
- display: flex;
- justify-content: space-between;
- font-size: var(--n-tab-font-size);
- color: var(--n-tab-text-color);
- `,[i("addable",`
- padding-left: 8px;
- padding-right: 8px;
- font-size: 16px;
- `,[$("height-placeholder",`
- width: 0;
- font-size: var(--n-tab-font-size);
- `),Wt("disabled",[h("&:hover",`
- color: var(--n-tab-text-color-hover);
- `)])]),i("closable","padding-right: 8px;"),i("active",`
- background-color: #0000;
- font-weight: var(--n-tab-font-weight-active);
- color: var(--n-tab-text-color-active);
- `),i("disabled","color: var(--n-tab-text-color-disabled);")]),o("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),i("left, right",[o("tabs-wrapper",`
- flex-direction: column;
- `,[o("tabs-tab-wrapper",`
- flex-direction: column;
- `,[o("tabs-tab-pad",`
- height: var(--n-tab-gap-vertical);
- width: 100%;
- `)])])]),i("top",[i("card-type",[o("tabs-tab",`
- border-top-left-radius: var(--n-tab-border-radius);
- border-top-right-radius: var(--n-tab-border-radius);
- `,[i("active",`
- border-bottom: 1px solid #0000;
- `)]),o("tabs-tab-pad",`
- border-bottom: 1px solid var(--n-tab-border-color);
- `)])]),i("left",[i("card-type",[o("tabs-tab",`
- border-top-left-radius: var(--n-tab-border-radius);
- border-bottom-left-radius: var(--n-tab-border-radius);
- `,[i("active",`
- border-right: 1px solid #0000;
- `)]),o("tabs-tab-pad",`
- border-right: 1px solid var(--n-tab-border-color);
- `)])]),i("right",[i("card-type",[o("tabs-tab",`
- border-top-right-radius: var(--n-tab-border-radius);
- border-bottom-right-radius: var(--n-tab-border-radius);
- `,[i("active",`
- border-left: 1px solid #0000;
- `)]),o("tabs-tab-pad",`
- border-left: 1px solid var(--n-tab-border-color);
- `)])]),i("bottom",[i("card-type",[o("tabs-tab",`
- border-bottom-left-radius: var(--n-tab-border-radius);
- border-bottom-right-radius: var(--n-tab-border-radius);
- `,[i("active",`
- border-top: 1px solid #0000;
- `)]),o("tabs-tab-pad",`
- border-top: 1px solid var(--n-tab-border-color);
- `)])])])]),ir=Object.assign(Object.assign({},Z.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),fr=V({name:"Tabs",props:ir,setup(e,{slots:r}){var n,p,d,g;const{mergedClsPrefixRef:u,inlineThemeDisabled:f}=Se(e),m=Z("Tabs","-tabs",nr,At,e,u),x=B(null),w=B(null),C=B(null),y=B(null),R=B(null),z=B(!0),_=B(!0),T=me(e,["labelSize","size"]),W=me(e,["activeName","value"]),S=B((p=(n=W.value)!==null&&n!==void 0?n:e.defaultValue)!==null&&p!==void 0?p:r.default?(g=(d=te(r.default())[0])===null||d===void 0?void 0:d.props)===null||g===void 0?void 0:g.name:null),L=Lt(W,S),A={id:0},v=N(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});re(L,()=>{A.id=0,D(),ce()});function b(){var t;const{value:a}=L;return a===null?null:(t=x.value)===null||t===void 0?void 0:t.querySelector(`[data-name="${a}"]`)}function P(t){if(e.type==="card")return;const{value:a}=w;if(a&&t){const s=`${u.value}-tabs-bar--disabled`,{barWidth:c,placement:k}=e;if(t.dataset.disabled==="true"?a.classList.add(s):a.classList.remove(s),["top","bottom"].includes(k)){if(I(["top","maxHeight","height"]),typeof c=="number"&&t.offsetWidth>=c){const E=Math.floor((t.offsetWidth-c)/2)+t.offsetLeft;a.style.left=`${E}px`,a.style.maxWidth=`${c}px`}else a.style.left=`${t.offsetLeft}px`,a.style.maxWidth=`${t.offsetWidth}px`;a.style.width="8192px",a.offsetWidth}else{if(I(["left","maxWidth","width"]),typeof c=="number"&&t.offsetHeight>=c){const E=Math.floor((t.offsetHeight-c)/2)+t.offsetTop;a.style.top=`${E}px`,a.style.maxHeight=`${c}px`}else a.style.top=`${t.offsetTop}px`,a.style.maxHeight=`${t.offsetHeight}px`;a.style.height="8192px",a.offsetHeight}}}function I(t){const{value:a}=w;if(a)for(const s of t)a.style[s]=""}function D(){if(e.type==="card")return;const t=b();t&&P(t)}function ce(t){var a;const s=(a=R.value)===null||a===void 0?void 0:a.$el;if(!s)return;const c=b();if(!c)return;const{scrollLeft:k,offsetWidth:E}=s,{offsetLeft:M,offsetWidth:G}=c;k>M?s.scrollTo({top:0,left:M,behavior:"smooth"}):M+G>k+E&&s.scrollTo({top:0,left:M+G-E,behavior:"smooth"})}const U=B(null);let Q=0,O=null;function Be(t){const a=U.value;if(a){Q=t.getBoundingClientRect().height;const s=`${Q}px`,c=()=>{a.style.height=s,a.style.maxHeight=s};O?(c(),O(),O=null):O=c}}function Ae(t){const a=U.value;if(a){const s=t.getBoundingClientRect().height,c=()=>{document.body.offsetHeight,a.style.maxHeight=`${s}px`,a.style.height=`${Math.max(Q,s)}px`};O?(O(),O=null,c()):O=c}}function Ee(){const t=U.value;t&&(t.style.maxHeight="",t.style.height="")}const be={value:[]},fe=B("next");function je(t){const a=L.value;let s="next";for(const c of be.value){if(c===a)break;if(c===t){s="prev";break}}fe.value=s,Ie(t)}function Ie(t){const{onActiveNameChange:a,onUpdateValue:s,"onUpdate:value":c}=e;a&&q(a,t),s&&q(s,t),c&&q(c,t),S.value=t}function Oe(t){const{onClose:a}=e;a&&q(a,t)}function pe(){const{value:t}=w;if(!t)return;const a="transition-disabled";t.classList.add(a),D(),t.classList.remove(a)}let ue=0;function He(t){var a;if(t.contentRect.width===0&&t.contentRect.height===0||ue===t.contentRect.width)return;ue=t.contentRect.width;const{type:s}=e;(s==="line"||s==="bar")&&pe(),s!=="segment"&&ee((a=R.value)===null||a===void 0?void 0:a.$el)}const De=ne(He,64);re([()=>e.justifyContent,()=>e.size],()=>{ae(()=>{const{type:t}=e;(t==="line"||t==="bar")&&pe()})});const X=B(!1);function Fe(t){var a;const{target:s,contentRect:{width:c}}=t,k=s.parentElement.offsetWidth;if(!X.value)k<c&&(X.value=!0);else{const{value:E}=y;if(!E)return;k-c>E.$el.offsetWidth&&(X.value=!1)}ee((a=R.value)===null||a===void 0?void 0:a.$el)}const Me=ne(Fe,64);function Ve(){const{onAdd:t}=e;t&&t(),ae(()=>{const a=b(),{value:s}=R;!a||!s||s.scrollTo({left:a.offsetLeft,top:0,behavior:"smooth"})})}function ee(t){if(!t)return;const{placement:a}=e;if(a==="top"||a==="bottom"){const{scrollLeft:s,scrollWidth:c,offsetWidth:k}=t;z.value=s<=0,_.value=s+k>=c}else{const{scrollTop:s,scrollHeight:c,offsetHeight:k}=t;z.value=s<=0,_.value=s+k>=c}}const Ne=ne(t=>{ee(t.target)},64);Te(de,{triggerRef:H(e,"trigger"),tabStyleRef:H(e,"tabStyle"),paneClassRef:H(e,"paneClass"),paneStyleRef:H(e,"paneStyle"),mergedClsPrefixRef:u,typeRef:H(e,"type"),closableRef:H(e,"closable"),valueRef:L,tabChangeIdRef:A,onBeforeLeaveRef:H(e,"onBeforeLeave"),activateTab:je,handleClose:Oe,handleAdd:Ve}),kt(()=>{D(),ce()}),Bt(()=>{const{value:t}=C;if(!t)return;const{value:a}=u,s=`${a}-tabs-nav-scroll-wrapper--shadow-start`,c=`${a}-tabs-nav-scroll-wrapper--shadow-end`;z.value?t.classList.remove(s):t.classList.add(s),_.value?t.classList.remove(c):t.classList.add(c)});const ve=B(null);re(L,()=>{if(e.type==="segment"){const t=ve.value;t&&ae(()=>{t.classList.add("transition-disabled"),t.offsetWidth,t.classList.remove("transition-disabled")})}});const Ue={syncBarPosition:()=>{D()}},he=N(()=>{const{value:t}=T,{type:a}=e,s={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[a],c=`${t}${s}`,{self:{barColor:k,closeIconColor:E,closeIconColorHover:M,closeIconColorPressed:G,tabColor:Xe,tabBorderColor:Ge,paneTextColor:Ke,tabFontWeight:Ye,tabBorderRadius:qe,tabFontWeightActive:Je,colorSegment:Ze,fontWeightStrong:Qe,tabColorSegment:et,closeSize:tt,closeIconSize:rt,closeColorHover:at,closeColorPressed:ot,closeBorderRadius:nt,[j("panePadding",t)]:K,[j("tabPadding",c)]:it,[j("tabPaddingVertical",c)]:st,[j("tabGap",c)]:lt,[j("tabGap",`${c}Vertical`)]:dt,[j("tabTextColor",a)]:ct,[j("tabTextColorActive",a)]:bt,[j("tabTextColorHover",a)]:ft,[j("tabTextColorDisabled",a)]:pt,[j("tabFontSize",t)]:ut},common:{cubicBezierEaseInOut:vt}}=m.value;return{"--n-bezier":vt,"--n-color-segment":Ze,"--n-bar-color":k,"--n-tab-font-size":ut,"--n-tab-text-color":ct,"--n-tab-text-color-active":bt,"--n-tab-text-color-disabled":pt,"--n-tab-text-color-hover":ft,"--n-pane-text-color":Ke,"--n-tab-border-color":Ge,"--n-tab-border-radius":qe,"--n-close-size":tt,"--n-close-icon-size":rt,"--n-close-color-hover":at,"--n-close-color-pressed":ot,"--n-close-border-radius":nt,"--n-close-icon-color":E,"--n-close-icon-color-hover":M,"--n-close-icon-color-pressed":G,"--n-tab-color":Xe,"--n-tab-font-weight":Ye,"--n-tab-font-weight-active":Je,"--n-tab-padding":it,"--n-tab-padding-vertical":st,"--n-tab-gap":lt,"--n-tab-gap-vertical":dt,"--n-pane-padding-left":Y(K,"left"),"--n-pane-padding-right":Y(K,"right"),"--n-pane-padding-top":Y(K,"top"),"--n-pane-padding-bottom":Y(K,"bottom"),"--n-font-weight-strong":Qe,"--n-tab-color-segment":et}}),F=f?_e("tabs",N(()=>`${T.value[0]}${e.type[0]}`),he,e):void 0;return Object.assign({mergedClsPrefix:u,mergedValue:L,renderedNames:new Set,tabsRailElRef:ve,tabsPaneWrapperRef:U,tabsElRef:x,barElRef:w,addTabInstRef:y,xScrollInstRef:R,scrollWrapperElRef:C,addTabFixed:X,tabWrapperStyle:v,handleNavResize:De,mergedSize:T,handleScroll:Ne,handleTabsResize:Me,cssVars:f?void 0:he,themeClass:F==null?void 0:F.themeClass,animationDirection:fe,renderNameListRef:be,onAnimationBeforeLeave:Be,onAnimationEnter:Ae,onAnimationAfterEnter:Ee,onRender:F==null?void 0:F.onRender},Ue)},render(){const{mergedClsPrefix:e,type:r,placement:n,addTabFixed:p,addable:d,mergedSize:g,renderNameListRef:u,onRender:f,paneWrapperClass:m,paneWrapperStyle:x,$slots:{default:w,prefix:C,suffix:y}}=this;f==null||f();const R=w?te(w()).filter(v=>v.type.__TAB_PANE__===!0):[],z=w?te(w()).filter(v=>v.type.__TAB__===!0):[],_=!z.length,T=r==="card",W=r==="segment",S=!T&&!W&&this.justifyContent;u.value=[];const L=()=>{const v=l("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},S?null:l("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),_?R.map((b,P)=>(u.value.push(b.props.name),ie(l(se,Object.assign({},b.props,{internalCreatedByPane:!0,internalLeftPadded:P!==0&&(!S||S==="center"||S==="start"||S==="end")}),b.children?{default:b.children.tab}:void 0)))):z.map((b,P)=>(u.value.push(b.props.name),ie(P!==0&&!S?$e(b):b))),!p&&d&&T?ze(d,(_?R.length:z.length)!==0):null,S?null:l("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return l("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},T&&d?l(ye,{onResize:this.handleTabsResize},{default:()=>v}):v,T?l("div",{class:`${e}-tabs-pad`}):null,T?null:l("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},A=W?"top":n;return l("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${r}-type`,`${e}-tabs--${g}-size`,S&&`${e}-tabs--flex`,`${e}-tabs--${A}`],style:this.cssVars},l("div",{class:[`${e}-tabs-nav--${r}-type`,`${e}-tabs-nav--${A}`,`${e}-tabs-nav`]},xe(C,v=>v&&l("div",{class:`${e}-tabs-nav__prefix`},v)),W?l("div",{class:`${e}-tabs-rail`,ref:"tabsRailElRef"},_?R.map((v,b)=>(u.value.push(v.props.name),l(se,Object.assign({},v.props,{internalCreatedByPane:!0,internalLeftPadded:b!==0}),v.children?{default:v.children.tab}:void 0))):z.map((v,b)=>(u.value.push(v.props.name),b===0?v:$e(v)))):l(ye,{onResize:this.handleNavResize},{default:()=>l("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(A)?l(Ft,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:L}):l("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll},L()))}),p&&d&&T?ze(d,!0):null,xe(y,v=>v&&l("div",{class:`${e}-tabs-nav__suffix`},v))),_&&(this.animated&&(A==="top"||A==="bottom")?l("div",{ref:"tabsPaneWrapperRef",style:x,class:[`${e}-tabs-pane-wrapper`,m]},Re(R,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):Re(R,this.mergedValue,this.renderedNames)))}});function Re(e,r,n,p,d,g,u){const f=[];return e.forEach(m=>{const{name:x,displayDirective:w,"display-directive":C}=m.props,y=z=>w===z||C===z,R=r===x;if(m.key!==void 0&&(m.key=x),R||y("show")||y("show:lazy")&&n.has(x)){n.has(x)||n.add(x);const z=!y("if");f.push(z?Et(m,[[jt,R]]):m)}}),u?l(It,{name:`${u}-transition`,onBeforeLeave:p,onEnter:d,onAfterEnter:g},{default:()=>f}):f}function ze(e,r){return l(se,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:r,disabled:typeof e=="object"&&e.disabled})}function $e(e){const r=Ot(e);return r.props?r.props.internalLeftPadded=!0:r.props={internalLeftPadded:!0},r}function ie(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}export{br as _,fr as a,dr as b,cr as c};
|