bkui-vue 0.0.2-beta.7 → 0.0.2-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +7 -3
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/table/index.d.ts +18 -0
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +8 -0
- package/lib/table/table.css +3 -0
- package/lib/table/table.d.ts +11 -0
- package/lib/table/table.less +4 -0
- package/lib/table/table.variable.css +3 -0
- package/lib/table-column/index.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -63,7 +63,7 @@ ${yo(n)}`),i}})}function N2(e){const t=Object.keys(e),n=t.filter(s=>{var o;retur
|
|
63
63
|
* @return {boolean} True if the event is supported.
|
64
64
|
* @internal
|
65
65
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
66
|
-
*/function fb(e,t){if(!F9.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&$9&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var hb=fb,gb=cb,mb=hb,G9=10,Z9=40,Y9=800;function U9(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*G9,s=n*G9,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=Z9,s*=Z9):(i*=Y9,s*=Y9)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}U9.getEventType=function(){return gb.firefox()?"DOMMouseScroll":mb("wheel")?"wheel":"mousewheel"};var pb=U9,yb=pb;const Cb=Kr(yb),bb=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,vb=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(bb?"DOMMouseScroll":"mousewheel",function(n){const i=Cb(n);t==null||t.apply(this,[n,i])})},wb={beforeMount(e,t){console.error(e,t),vb(e,t.value)}},qi=new Map,Ir={beforeMount(e,t){const n=K9(t),{trigger:i}=n,s=Mb(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{dd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ts(e)},100)}),e.addEventListener("click",()=>{Ts(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ts(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{dd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&Ts(e)});qi.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){qi.get(e).opts=K9(t)},unmounted(e){Ts(e),qi.delete(e)}};function Nb(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function K9(e){const t=Nb();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function Mb(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=ni.getPopperIndex(),u=document.createElement("div");if(u.className=`${$t("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=X9();u.appendChild(f)}return u}function X9(){const e=document.createElement("div");return e.className=$t("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function Ib(e,t){const{opts:n}=qi.get(e),{placement:i,distance:s,showOnInit:o}=n,c=f0(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&dd(e),c}function dd(e){const{popper:t,opts:n}=qi.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=X9();t.appendChild(f)}document.body.appendChild(t);const u=Ib(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),qi.get(e).popperInstance=u}function Ts(e){if(!qi.get(e))return;const{popper:t,popperInstance:n,opts:i}=qi.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const q9=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},fd=(e,t)=>{let n=null,i=null,s=null;const o=q9(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const y=q9(e,t);y.isShow=!0,y.content=y.content||e.innerHTML,y.allowHtml=!0,Object.assign(y,{onContentMouseenter:u,onContentMouseleave:f}),n=td(y)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:y=>{var C,b;h(),(C=y??e)==null||C.removeEventListener("mouseenter",d),(b=y??e)==null||b.removeEventListener("mouseleave",h)},instance:n}},Lb={mounted(e,t){fd(e,t)}},Tb={onContentScroll:Function},kb={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def($t("F-scroll-x")),scrollYName:p.string.def($t("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...Tb},Sb=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,y,C,b,v)=>{t.emit("content-scroll",[d,{translateY:C,translateX:b,pos:v}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,y,C,b,v,T;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((y=(m=t.slots).default)==null?void 0:y.call(m,{data:e.list}))??""]),[[o,c]]),((b=(C=t.slots).afterContent)==null?void 0:b.call(C))??"",((T=(v=t.slots).afterSection)==null?void 0:T.call(v))??""])}}};function e3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function t3(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:y}=n,{offsetHeight:C}=i;let b=0,v=0,T=0;if(typeof e=="number"&&(b=Math.floor(o/e),v=Math.ceil(C/e)+b,T=o%e),typeof e=="function"){const N=e3(f,o,d,e);b=N.startIndex>0?N.startIndex:0,T=N.diffHeight,v=e3(f,C,d,e).startIndex+b+1}if(o!==u||b!==h||v!==m||y!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,b,v,o,T,c,{bottom:N>=0?N:0})}}function xb(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const C=t.scrollTop,b=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,C,C,b,{bottom:v>=0?v:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:y}=o;t3(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:y},t,e)}const n3=(e=60)=>ot.throttle((t,n,i)=>xb(t,n,i),e),Db=(e,t,n,i=60)=>{Reflect.apply(n3(i),void 0,[e,t,n])},jb={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{Db(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",n3)}}},Lr=Ye(a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:jb},props:kb,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=Sb(e,t);return D}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(D,E,P,O,R,J,G)=>{c.startIndex=E,c.endIndex=P,c.scrollTop=O,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),y()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),y(),e.keepAlive&&x(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),y()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let O=0;O<d.value;O++){const R=e.lineHeight.call(this,O,D.slice(O*e.groupItemCount,e.groupItemCount));P+=typeof R=="number"?R:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},y=(D={left:0,top:0})=>{var P;const E=(P=o.value)==null?void 0:P.parentNode;t3(e.lineHeight,u,c,E,null),D&&o.value&&x(D)},C=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,E)=>({...D,$index:E}))),b=a.computed(()=>C.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),v=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?v.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:S}=Ce(),w=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),k=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},_=()=>{f(),y()},x=(D={left:0,top:0})=>{const{left:E,top:P}=D;o.value.scrollTo(E,P)};return t.expose({reset:_,scrollTo:x}),()=>{var D,E,P,O,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((E=(D=t.slots).beforeContent)==null?void 0:E.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...v.value,...e.contentStyle}},[((O=(P=t.slots).default)==null?void 0:O.call(P,{data:b.value}))??""]),[[k,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}));var i3=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(i3||{});const Ob=a.defineComponent({name:"Tag",props:{theme:wo(),closable:p.bool.def(!1),type:ze("tagStorkeType",{}).def(i3.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Pe({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(sn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Tr=Ye(Ob),Ab=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:wo(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),{proxy:i}=a.getCurrentInstance(),s=a.inject(ul,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},y=()=>{var N;(N=d.value)==null||N.focus()},C=N=>{t("update:modelValue",N.target.value)},b=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},v=N=>{const S=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?S[N]:S},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=v(),S=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=S>0?S:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:y,handleInput:C,handleKeydown:b,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Pe({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Pe({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((y,C)=>a.createVNode(Tr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&C>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(y.value)},{default:()=>{var b;return[(b=this.select)==null?void 0:b.handleGetLabelByValue(y.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Tr,{class:this.resolveClassName("select-overflow-tag")},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),Eb=a.defineComponent({name:"Select",directives:{clickoutside:oi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(ru.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:wo(),behavior:j0(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:x2()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:y,allowCreate:C,customContent:b,showSelectedIcon:v,inputSearch:T,enableVirtualRender:N,showSelectAll:S,scrollHeight:w,list:I,displayKey:k,idKey:L,collapseTags:_,autoHeight:x,popoverOptions:D,allowEmptyValues:E,autoFocus:P,keepSearchValue:O,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),ge=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),me=Fn(),B=a.ref(),Z=a.ref(),H=a.ref(),V=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),te=a.ref(new Map),oe=a.computed(()=>[...te.value.values()]),W=a.ref(new Map),Q=a.ref([]),$=a.computed(()=>Q.value.reduce((Ne,Oe)=>(Ne[Oe.value]=Oe.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,Oe)=>(Ne[Oe[L.value]]=Oe[k.value],Ne),{}));a.watch(s,()=>{var Ne;Xl(),e.withValidate&&((Ne=me==null?void 0:me.validate)==null||Ne.call(me,"change"))},{deep:!0}),a.watch(Q,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ut.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var Oe;return(Oe=Mr(String(Ne[k.value])))==null?void 0:Oe.includes(Mr(Ci.value))})),de=a.computed(()=>o.value||d.value),ve=a.computed(()=>Q.value.map(Ne=>{var Oe,He;return((He=(Oe=te.value)==null?void 0:Oe.get(Ne.value))==null?void 0:He.optionName)||fe.value[Ne.value]||Ne.label})),Le=a.computed(()=>{const Ne=oe.value.reduce((Oe,He)=>(He.disabled||Oe.push(He.optionID),Oe),[]);return Ne.length<=Q.value.length&&Ne.every(Oe=>Q.value.some(He=>He.value===Oe))}),De=a.computed(()=>!!W.value.size),Re=a.computed(()=>!oe.value.length),Ve=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Bs.value||Re.value||Ve.value)||b.value),Te=a.computed(()=>u.value&&S.value&&(!Ci.value||!c.value)),Je=a.computed(()=>w.value-12-(Te.value?32:0)),rt=a.computed(()=>Bs.value?ie.value:Re.value?J.value:Ve.value?G.value:""),it=a.computed(()=>x.value?_.value&&!yi.value:_.value),ut=a.computed(()=>ot.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:Ul.value,arrow:!1,placement:"bottom-start",isShow:yi.value,reference:Y.value,offset:6,popoverDelay:0,renderType:vo.AUTO},D.value)),{register:Be,unregister:Ee}=nd(te),{register:Fe,unregister:lt}=nd(W),{isHover:et,setHover:pt,cancelHover:Ue}=z9(),Wt=a.ref(!1),oa=()=>{Wt.value||(Wt.value=!0,t("focus"))},Yl=()=>{Wt.value&&(Wt.value=!1,t("blur"))},{popperWidth:Ul,isPopoverShow:yi,hidePopover:la,showPopover:Hs,togglePopover:df}=nb({popoverMinWidth:h.value},Z);a.watch(yi,()=>{t("toggle",yi.value)});const ff=a.computed(()=>(c.value&&T.value||C.value)&&yi.value);a.watch(yi,Ne=>{Ne?setTimeout(()=>{Wa(),Kl()},10):O.value||(Ci.value="")});const Kl=()=>{var He;const Ne=Q.value[0],Oe=te.value.get(Ne==null?void 0:Ne.value);Oe&&!Oe.disabled&&Oe.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(He=oe.value.find(Mn=>!Mn.disabled&&Mn.visible))==null?void 0:He.optionID},hf=Ne=>{c.value&&oe.value.forEach(Oe=>{var He;Oe.visible=(He=Mr(String(Oe.optionName)))==null?void 0:He.includes(Mr(Ne))})},{searchKey:Ci,searchLoading:Bs}=ib(ce.value?f.value:hf,Kl),bi=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},gf=()=>{de.value||(oa(),df())},Fs=Ne=>{c.value&&(Ci.value=Ne)},mf=(Ne,Oe)=>{const He=String(Ne);!C.value||!He||c.value&&oe.value.find(fn=>Mr(String(fn.optionName))===Mr(He))||te.value.get(He)||(Oe.stopPropagation(),u.value?(Q.value.push({value:He,label:He}),bi(Q.value.map(fn=>fn.value))):(Q.value=[{value:He,label:He}],bi(He),la()),Ci.value="")},_a=Ne=>{if(!(de.value||!Ne)){if(u.value){const Oe=Q.value.findIndex(He=>He.value===Ne.optionID);Oe>-1?Q.value.splice(Oe,1):Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),bi(Q.value.map(He=>He.value))}else Q.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],bi(Ne.optionID),la();Wa()}},Wa=()=>{setTimeout(()=>{var Ne,Oe,He;!T.value&&!C.value?(Ne=V.value)==null||Ne.focus():y.value==="tag"?(Oe=Y.value)==null||Oe.focus():(He=B.value)==null||He.focus()},0)},pf=Ne=>{Ne.stopPropagation(),Q.value=[],bi(u.value?[]:""),t("clear",u.value?[]:""),la()},yf=()=>{ee.value=""},Cf=()=>{Le.value?Q.value=[]:oe.value.forEach(Ne=>{Ne.disabled||Q.value.find(Oe=>Oe.value===Ne.optionID)||Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),bi(Q.value.map(Ne=>Ne.value)),Wa()},bf=Ne=>{const{scrollTop:Oe,clientHeight:He,scrollHeight:Mn}=Ne.target;Oe+He===Mn&&t("scroll-end")},vf=Ne=>{if(de.value)return;const Oe=Q.value.findIndex(He=>He.value===Ne);Oe>-1&&(Q.value.splice(Oe,1),bi(Q.value.map(He=>He.value)))},$s=Ne=>{var He,Mn;let Oe=Ne;if(typeof Oe=="object"){for(const fn of te.value.keys())if(ot.isEqual(fn,Oe)){Oe=fn;break}}return((Mn=(He=te.value)==null?void 0:He.get(Oe))==null?void 0:Mn.optionName)||fe.value[Oe]||$.value[Oe]||Oe},Xl=()=>{Array.isArray(s.value)?Q.value=[...s.value.map(Ne=>({value:Ne,label:$s(Ne)}))]:s.value!==void 0||E.value.includes(s.value)?Q.value=[{value:s.value,label:$s(s.value)}]:Q.value=[]},ql=Ne=>{var Mn,fn;if(!yi.value)return;const Oe=oe.value.filter(hn=>!hn.disabled&&hn.visible),He=Oe.findIndex(hn=>hn.optionID===ee.value);if(!(!Oe.length||He===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const hn=He>=Oe.length-1?0:He+1;ee.value=(Mn=Oe[hn])==null?void 0:Mn.optionID;break}case"ArrowUp":{Ne.preventDefault();const hn=He===0?Oe.length-1:He-1;ee.value=(fn=Oe[hn])==null?void 0:fn.optionID;break}case"Backspace":{if(!u.value||!Q.value.length||Ci.value.length||Ne.target===V.value)return;Q.value.pop(),bi(Q.value.map(hn=>hn.value));break}case"Enter":{const hn=te.value.get(ee.value);_a(hn);break}}},wf=({event:Ne})=>{var He;const{target:Oe}=Ne;(He=Z.value)!=null&&He.contains(Oe)||Z.value===Oe||(la(),Yl())},Nf=()=>{setTimeout(()=>{var Ne,Oe;N.value&&((Oe=(Ne=X.value)==null?void 0:Ne.reset)==null||Oe.call(Ne))})};return a.provide(ul,a.reactive({multiple:u,selected:Q,activeOptionValue:ee,showSelectedIcon:v,selectedStyle:R,register:Be,unregister:Ee,registerGroup:Fe,unregisterGroup:lt,handleOptionSelected:_a,handleGetLabelByValue:$s})),a.onMounted(()=>{Xl(),setTimeout(()=>{m.value&&Hs(),P.value&&Wa()})}),{selected:Q,isInput:ff,options:oe,isDisabled:de,selectedLabel:ve,isPopoverShow:yi,isHover:et,popperWidth:Ul,inputRef:B,triggerRef:Z,contentRef:H,searchRef:V,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Bs,isOptionsEmpty:Re,isSearchEmpty:Ve,isFocus:Wt,isShowSelectContent:be,curContentText:rt,isGroup:De,searchKey:Ci,isShowSelectAll:Te,virtualHeight:Je,virtualList:K,isCollapseTags:it,popoverConfig:ut,focusInput:Wa,setHover:pt,cancelHover:Ue,handleFocus:oa,handleBlur:Yl,handleTogglePopover:gf,handleClear:pf,hidePopover:la,showPopover:Hs,handleToggleAll:Cf,handleOptionSelected:_a,handleClickOutside:wf,handleScroll:bf,handleDeleteTag:vf,handleInputChange:Fs,handleInputEnter:mf,handleKeydown:ql,handleSelectedAllOptionMouseEnter:yf,handlePopoverShow:Nf,localLoadingText:ie,localPlaceholder:ge,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Pe({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode($i,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ia,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Ab,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(ka,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(La,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode($i,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Lr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(dl,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(dl,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode($i,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Gt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),hd=Ft(Eb,{Option:dl,Group:ab});function Pb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:zb}=Sa,gd=Object.assign({},zb);gd.width.default="400",gd.height.default="100%";const Vb=a.defineComponent({name:"Sideslider",components:{BkModal:Sa,BkButton:At},props:{...gd,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=Ce();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode(Sa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),Pb(u)?u:{default:()=>[u]})}}}),a3=Ye(Vb);var r3=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(r3||{});const s3={theme:p.theme().def(bo.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:S0(),status:ze("status",{}).def(r3.UNKNOWN),lineType:x0(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},o3=Ye(a.defineComponent({name:"Steps",props:s3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(y=>{typeof y=="string"?m.push(y):m.push({title:y.title,icon:y.icon,description:y.description,status:y.status,border:y.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{s3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,y)=>{const C=await e.beforeChange(h);C?m(C):y(C)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=Ce();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Pe({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:y}=m;return y?Object.prototype.toString.call(y)==="[object Object]":typeof m=="string"},u=(m,y)=>(y.icon||(y.icon=m),!isNaN(y.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,y)=>o(m)&&this.status==="loading"||f(y)?a.createVNode(us,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(y)?a.createVNode(sn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(Fi,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,y)?m+1:a.createVNode(y.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,y)=>{var C,b;return a.createVNode("div",{class:[this.resolveClassName("steps"),m.title?"":this.resolveClassName("step-no-content"),s(y)?"done":"",o(y)?"current":"",o(y)&&this.status==="error"?"isError":"",m.status&&o(y)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(y+1)}},[((b=(C=this.$slots)[y+1])==null?void 0:b.call(C))??h(y,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(y+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}})),Rb=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=Fn(),{resolveClassName:i}=Ce(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const y=`${i(`bswitcher-${e.size}`)}`;m[y]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const y=o.value?e.falseValue:e.trueValue,C=!o.value,b=()=>{t("update:modelValue",y),t("change",C)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(y),typeof v.then=="function"))return s.value=!0,v.then(()=>{b()}).finally(()=>{s.value=!1});v&&b()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(Bo,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),l3=Ye(Rb);var pl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(pl||{}),c3=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(c3||{});const Jb=["auto","highlight"],Qb=["none","row","col","outer","horizontal"];var Pn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Pn||{}),Dt=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(Dt||{});const Et=(...e)=>!0,_b={columnPick:Et,columnFilter:Et,columnSort:Et,colFilterSave:Et,rowClick:Et,rowDblclick:Et,rowExpand:Et,select:Et,selectAll:Et,selectionChange:Et,pageLimitChange:Et,pageValueChange:Et,settingChange:Et,scrollBottom:Et,cellClick:Et,cellDblclick:Et,rowMouseEnter:Et,rowMouseLeave:Et},$e={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Zn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},kr=6,ja=42,yl={large:78,medium:60,small:42},Wb=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:yl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:yl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:yl.large}],u3="InitColumns",d3="BKTableCahce",Hb="Bk_COlumn_Update_Define";var Pt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Pt||{});const Bb=["asc","desc","null","custom"],Sr=80;var f3=(e=>(e.CURRENT="current",e.ALL="all",e))(f3||{});const md=ze("showOverflowTooltipMode",{default:"auto"}),Fb=ze("columnType",{default:"none"}),pd=ze("columnType",{default:""}),$b=ze("full",{default:"full"});var h3=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(h3||{});const g3=ze("columnSize",{default:"small"}),Gb=an(),m3=ze("sortScope",{}).def("current");var p3=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(p3||{});const y3={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.oneOfType([p.string,p.func]),disabled:p.oneOfType([p.bool,p.func]),watchCellResize:p.bool.def(!0),mode:md})]).def(void 0),type:Fb,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,Gb]).def(!1),sort:p.oneOfType([p.shape({sortFn:p.func.def(void 0),sortScope:m3,value:p.string.def(Pt.NULL)}),p.bool,p.string]).def(!1),filter:p.oneOfType([p.shape({list:p.arrayOf(p.any).def([]),filterFn:p.func.def(void 0),match:$b,checked:p.arrayOf(p.any).def([]),filterScope:m3,btnSave:p.oneOfType([p.bool,p.string]).def("确定"),btnReset:p.oneOfType([p.bool,p.string]).def("重置")}),p.bool,p.string]).def(!1),colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:pd,className:p.oneOfType([p.string,p.func])},Zb={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(p.shape(y3).loose).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ze("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),minHeight:p.oneOfType([p.number,p.string]).def(ja*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(ja),headHeight:p.number.def(ja),showHead:p.bool.def(!0),thead:p.shape({height:p.number.def(ja),isShow:p.bool.def(!0),cellFn:p.func.def(void 0)}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ze("boderType",{})),p.string]).def([pl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(60),remotePagination:p.bool.def(!1),emptyText:p.string,settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:g3,sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def($e.ROW_INDEX),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:md})]).def(!1),asyncData:p.bool.def(!1),rowHover:p.oneOf(Jb).def(c3.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ze("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:pd,headerAlign:pd,prependStyle:p.style().def({})},Yb=a.defineComponent({name:"TableColumn",props:{...y3,prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},setup(e){const t=a.inject(u3,(s,o=!1)=>{},!1),n=a.inject(d3,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(Hb,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class Ub{constructor(){xe(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}const C3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},Kb=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=C3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(C,b,v)=>{typeof b=="function"&&C.sort((T,N)=>b(T,N,v[Zn.SORT_TYPE]))},d=(C,b)=>{if(typeof b=="function"){const v=C.filter((T,N)=>b(T,N,t));C.length=0,C.push(...v)}},h=(C,b,v)=>{const T=t.slice(),{sortScope:N}=(v==null?void 0:v.sort)??{};N===f3.ALL&&f(T,b,v),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,C),f(u,b,v)},m=(C,b,v)=>{s=C3(e.pagination,s),y(),c(),h(C,b,v)},y=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},Xb=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Ta.Normal,mode:Wu.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:y,indicator:C}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode($i,{loading:f,size:d,mode:h,title:m,inline:y,indicator:C},null)}}}};function qb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const ev=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=Ce();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(hd,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},qb(f=t.limitList.map((d,h)=>a.createVNode(dl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Oa=5,tv=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const b=[];if(e.totalPageNum<=Oa+2){for(let N=2;N<=e.totalPageNum-1;N++)b.push(N);return b}const v=Math.floor(Oa/2);e.totalPageNum>Oa&&(s.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Oa,Math.max(2,t.value-v));for(let N=T;N<T+Oa;N++)b.push(N);return b});a.watch(()=>e.modelValue,b=>{a.nextTick(()=>{b>=1&&b<=e.totalPageNum?t.value=b:b<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,b=>{t.value>b&&(t.value=b)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=b=>{b!==t.value&&(t.value=b)},h=()=>{t.value=Math.max(1,t.value-Oa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Oa)},{resolveClassName:y}=Ce();return{current:t,render:({isFirst:b,isLast:v})=>a.createVNode("div",{class:{[`${y("pagination-list")}`]:!0,"is-first":b,"is-last":v}},[a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(si,null,null)]),a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${y("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(gs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${y("pagination-list-next-batch")}`,onClick:m},[a.createVNode(gs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(An,null,null)])])}},nv=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let S=1;S<=e.totalPageNum;S++)N.push(S);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},y=N=>{const S=N.target,w=Number(S.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},C=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},b=N=>{c=N,m()},{resolveClassName:v}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${v("pagination-small-list")}`},[a.createVNode("div",{class:{[`${v("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(si,null,null)]),a.createVNode(Gt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${v("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${v("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:y,onKeydown:C},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${v("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${v("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>b(N)},[N]))])}),a.createVNode("div",{class:{[`${v("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(An,null,null)])])}},iv=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=Ce();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},av={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},yd=Ye(a.defineComponent({name:"Pagination",props:av,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=iv(n),{current:u,render:f}=tv(),{current:d,render:h}=nv(),{limit:m,render:y}=ev(n);a.watch([s,m,o],([b,v])=>{const T=Math.ceil(b/v);i.value=T<1?1:T},{immediate:!0}),a.watch(u,b=>{t.emit("update:modelValue",b),t.emit("change",b)}),a.watch(d,b=>{e.small&&(t.emit("update:modelValue",b),t.emit("change",b))}),a.watch(m,b=>{t.emit("limitChange",b)});const{resolveClassName:C}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:y,renderSmallList:h,resolveClassName:C}},render(){const e=Pe({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}));var b3=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),Cd=typeof window<"u"&&typeof document<"u"&&window.document===document,Cl=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),rv=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Cl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),sv=2;function ov(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){rv(o)}function u(){var f=Date.now();if(n){if(f-s<sv)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var lv=20,cv=["top","right","bottom","left","width","height","size","weight"],uv=typeof MutationObserver<"u",dv=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ov(this.refresh.bind(this),lv)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Cd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),uv?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cd||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=cv.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),v3=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},xr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Cl},w3=vl(0,0,0,0);function bl(e){return parseFloat(e)||0}function N3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+bl(o)},0)}function fv(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=bl(c)}return n}function hv(e){var t=e.getBBox();return vl(0,0,t.width,t.height)}function gv(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return w3;var i=xr(e).getComputedStyle(e),s=fv(i),o=s.left+s.right,c=s.top+s.bottom,u=bl(i.width),f=bl(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=N3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=N3(i,"top","bottom")+c)),!pv(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return vl(s.left,s.top,u,f)}var mv=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof xr(e).SVGGraphicsElement}:function(e){return e instanceof xr(e).SVGElement&&typeof e.getBBox=="function"}}();function pv(e){return e===xr(e).document.documentElement}function yv(e){return Cd?mv(e)?hv(e):gv(e):w3}function Cv(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return v3(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function vl(e,t,n,i){return{x:e,y:t,width:n,height:i}}var bv=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=vl(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=yv(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),vv=function(){function e(t,n){var i=Cv(n);v3(this,{target:t,contentRect:i})}return e}(),wv=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new b3,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof xr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new bv(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof xr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new vv(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),M3=typeof WeakMap<"u"?new WeakMap:new b3,I3=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=dv.getInstance(),i=new wv(t,n,this);M3.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){I3.prototype[e]=function(){var t;return(t=M3.get(this))[e].apply(t,arguments)}});var Nv=function(){return typeof Cl.ResizeObserver<"u"?Cl.ResizeObserver:I3}();const Rt=(e,t,n)=>{if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},bd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Mv=e=>L3(e,"auto"),L3=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},Iv=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Qb.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},ks=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],vd=(e,t,n=Sr,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:y=void 0}=h;if(y===void 0)return m<Sr?Sr:m;let C=m;return/^\d+\.?\d*$/.test(`${y}`)&&(C=Number(y)),/^\d+\.?\d*%$/.test(`${y}`)&&(C=Number(y)*o/100),/^\d+\.?\d*px$/i.test(`${y}`)&&(C=Number(`${y}`.replace(/px/i,""))),C},d=(h,m,y=!0)=>{const C=f(h,m),b=m<C?C:m;Object.assign(h,{calcWidth:b}),y&&(c=c-b,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const C=String(ks(h,["resizeWidth","width"]));let b=!0;if(/^\d+\.?\d*(px)?$/.test(C)){const v=Number(C.replace("px",""));d(h,v),b=!1}if(/^\d+\.?\d*%$/.test(C)){let v=n;if(c>0){const T=Number(C.replace("%",""));v=c*T/100}d(h,v),b=!1}b&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,y)=>{h=c/(u.length-y),d(t[m],h,!1);const{calcWidth:C}=t[m];c=c-C}):u.forEach(m=>{const y=f(t[m],Sr);Object.assign(t[m],{calcWidth:y})})}},T3=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?ot.debounce(o,n):ot.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new Nv(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},wd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},wl=(e,t,n)=>n.type==="index"?e[$e.ROW_INDEX]+1:ot.get(e,t),Ss=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ss(Reflect.apply(e,globalThis,t),t):[],k3=(e,t,n)=>{const i=S3(e,t,n);return i!==null?i:Mi.v4()},S3=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===$e.ROW_INDEX?`__ROW_INDEX_${n}`:ot.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,Lv=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},x3=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),D3=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,j3=(e,t,n,i)=>{const s=D3(e,t,n,i,"colspan"),o=D3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},O3=(e,t)=>{var c,u;const n=e.field,i=f=>wl(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Pt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Pt.DESC?-1:1)},A3=e=>{const t={[Pt.NULL]:0,[Pt.ASC]:1,[Pt.DESC]:2};return e===void 0?Pt.NULL:Object.keys(t)[(t[e]+1)%3]},E3=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Pt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Nl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,Tv=(e,t,n)=>{if(e[$e.ROW_UID]!==void 0)return e[$e.ROW_UID];const i=k3(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},xs=e=>a.unref(e[$e.ROW_SOURCE_DATA]||e),P3=e=>a.unref(e[Zn.COL_SOURCE_DATA]||e),z3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:md})]).def(void 0),title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ze("ResizerWay",{default:p3.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{let h=!0,{resizerWay:m}=e,y=n.value.innerText,C="auto",b=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",y=c.content||n.value.innerText,typeof c.content=="function"&&(y=c.content(e.column,e.row)),b=c.watchCellResize,C=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:y,mode:C,resizerWay:m,watchCellResize:b}},d=()=>{if(!n.value||!Ca(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=R4(n.value)),h==="static"&&(i.value=!0),i.value){const y=a.ref(f());u===null&&(u=fd(n.value,{disabled:y.value.disabled,content:y.value.content,mode:y.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:y}=f();if(!h&&(d(),y!==!1&&e.observerResize)){let C=T3(n.value,()=>{d()},60,!0,m);C.start(),a.onBeforeUnmount(()=>{C.disconnect(),C=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),Nd=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class kv{constructor(t,n){xe(this,"props",null);xe(this,"ctx",null);this.props=t,this.ctx=n}}const Sv=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ft("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(el,{scene:"part",type:i.value,description:n.value},null)}}),xv=a.defineComponent({name:"HeadFilter",props:{column:p.any.def({}),height:p.number.def(ja)},emits:["change","filterSave"],setup(e,{emit:t}){var P;const{resolveClassName:n}=Ce(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((P=o.value)==null?void 0:P.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Pe({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Pe({[n("table-head-filter")]:!0}),h=a.ref(null),m=O=>{u.isOpen=O,O&&setTimeout(()=>{h.value.reset()})},y=`light ${n("table-head-filter")}`,C=a.computed(()=>{const{list:O=[]}=o.value;return O}),b=(O,R="ig")=>new RegExp(`${O}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),v=(O,R)=>{const{match:J}=o.value,G=wl(R,Rt(s,"field",[s,R]),s);return J==="full"&&O.includes(G),O.some(ie=>b(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(O,R,J,G)=>o.value.filterFn(O,R,e.column,J,G):(O,R)=>O.length?v(O,R):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(O=!1)=>{const{disabled:R}=I(k,i.value.confirm);if(R||O){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(O,R)=>({disabled:O==="disabled"||O===!1,text:typeof O=="string"?O:R}),{btnSave:k,btnReset:L}=o.value,_=()=>{const{disabled:O,text:R}=I(k,i.value.confirm);return O?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},x=()=>{const{disabled:O,text:R}=I(L,i.value.reset);return O?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(O,R)=>{const J=new Set(u.checked);O?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),S()},E=O=>O.data.length?O.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode($n,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Gt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:vo.SHOWN,arrow:!1,offset:0},{theme:y},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Qo,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(qo,{class:"content-list"},{default:()=>[a.createVNode(Lr,{lineHeight:32,list:C.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:E})]}),a.createVNode("div",{class:"content-footer"},[_(),a.createVNode("span",{class:"btn-filter-split"},null),x()])])})}}),Dv=a.defineComponent({name:"HeadSort",props:{column:p.any.def({}),defaultSort:p.oneOf(Bb).def(Pt.NULL),active:p.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=Ce(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Pt.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Pt.NULL&&(h=A3(d)),s.value===d&&(h=Pt.NULL);const m=O3(e.column,h),y=E3(e.column.sort);if((y==null?void 0:y.value)==="custom"){t("change",(y==null?void 0:y.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Pt.NULL)},[a.createVNode(To,{class:["sort-action","sort-asc",e.active&&s.value===Pt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Pt.ASC)},null),a.createVNode(cs,{class:["sort-action","sort-desc",e.active&&s.value===Pt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Pt.DESC)},null)])}});function V3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const jv=a.defineComponent({name:"Settings",props:{settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:g3.def(h3.SMALL),sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),columns:p.array.def([]),rowHeight:p.number.def(ja)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ft("table"),s=Wb(i),o=(J,G)=>Rt(J,["field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),C=`light ${n("table-settings")}`,b=a.computed(()=>f.value.fields||e.columns||[]),v={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(v,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(b)}),u.value=!1},N=()=>{c.value=v.checkAll,d.value=v.activeSize,h.value=v.activeHeight,m.value=v.checkedFields,u.value=!1},S=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((ge,ue)=>ge.disabled&&m.value.includes(o(ge,ue))).map((ge,ue)=>o(ge,ue));if(c.value){const ge=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...ge,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),k=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),_=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),x=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),E={marginRight:"12px"},P=()=>k.map(J=>a.createVNode("span",{class:D(J),onClick:()=>x(J)},[J.label])),O=a.computed(()=>m.value.length>0&&!b.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&b.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Gt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:S},[a.createVNode(jo,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(ds,{class:"icon-close-action",onClick:N},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode($n,{label:i.value.setting.fields.selectAll,indeterminate:!!O.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(qo,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},V3(J=b.value.map((G,ie)=>{let ge;return a.createVNode("div",{class:"field-item"},[a.createVNode($n,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:_(G,ie)},V3(ge=Rt(G,"label",[G,ie]))?ge:{default:()=>[ge]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),P()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:E,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:E,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Md=(e,t,n)=>{const i=(y,C,b)=>({column_fixed:!!y.fixed,column_fixed_left:y.fixed!=="right",column_fixed_right:y.fixed==="right",shadow:y.fixed==="right"?b-C>2:C>0}),s=y=>y.fixed==="right"?"right":"left",o={left:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed&&C.fixed!=="right").reduce((C,b,v)=>y&&v===0?C:C+ks(b),0),right:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed==="right").reduce((C,b,v)=>y&&v===0?C:C+ks(b),n?kr:0)},c=(y,C,b=0)=>{const v=C[Zn.COL_UID],T=y==="right"?-1:1,N=t.filter(k=>!k.isHidden),{length:S}=N;let w=y==="right"?S*T:1,I=0;for(w;;){w=w+-1*T;const k=Math.abs(w),L=N[k],_=s(L),x=L[Zn.COL_UID];if(_===y&&v!==x){const D=ks(L);I=I+D}if(v===x)break}return I+b},u=(y,C=!1)=>{if(!y.fixed||y.isHidden)return{};const b={left:0,right:C?kr:-1},v=s(y);return b[v]=c(v,y,b[v]),{[v]:`${b[v]}px`}},f=y=>({width:`${o[y](!1)}px`,bottom:"0px"}),d=a.computed(()=>{const y={left:!1,right:!1};return t.filter(C=>!C.isHidden&&C.fixed).map(C=>{const b=s(C),v=y[b];return y[b]=!0,{isExist:v,colPos:b,column:C}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function R3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class Ov{constructor(t,n,i,s,o,c){xe(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});xe(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"}));xe(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new kv(t,n),this.uuid=Mi.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=wd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=x3(u,d,s)}),this.emitEvent(Pn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(jv,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(Sv,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(yd,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(Dt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Dt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Dt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=A3(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=O3(n,s);this.activeSortIndex.value=t,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(Dv,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Pn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(Dt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(xv,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=wd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const v=this.reactiveProp.rowActions.get($e.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[$e.ROW_SELECTION]:!!v},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const y=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[y]));const C=typeof y=="string"?y:void 0,b={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(z3,{class:b,title:C,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},R3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const y=m.split("_").slice(-1)[0];return Object.assign(h,{[y]:C=>{d.listeners.get(m).forEach(b=>Reflect.apply(b,this,[C,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Md(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${kr+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:u(d,this.styleRef.value.hasScrollY),onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=Md(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ss(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ss(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`];return[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:S3(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var S;const h=[n(f),...Ss(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:y,rowspan:C}=j3(f,d,s,o),b=$e.ROW_SKIP_CFG,v=f[Zn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((S=s[b])==null?void 0:S[v])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ss(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[$e.ROW_EXPAND],"is-last":o+C>=i}],k=(L,_)=>{const x={event:L,row:xs(s),column:P3(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(_,x)};return a.createVNode("td",{class:I,style:h,colspan:y,rowspan:C,onClick:L=>k(L,Dt.CELL_CLICK),onDblclick:L=>k(L,Dt.CELL_DBL_CLICK)},[a.createVNode(z3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},R3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[$e.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${Tv(t,i,this.props)}_expand`;return a.createVNode(Nd,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,xs(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Dt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Dt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Dt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Dt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[$e.ROW_EXPAND]?a.createVNode(fs,null,null):a.createVNode(Cs,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Pn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=wl(t,Rt(n,"field",[n,t]),n),c=t[$e.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Pn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get($e.ROW_SELECTION_INDETERMINATE),c=Nl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode($n,{onChange:s,disabled:!c,modelValue:t[$e.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=wl(t,Rt(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Pe({active:this.isColActive(n)}),s=`${Mv(ks(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const Ml=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),J3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:bd(e.activeColumn):Array.isArray(e.activeColumn)?bd(e.activeColumn[0]):bd(e.activeColumn):[],Av=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Ml(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(J3(e)),o=()=>i().map((c,u)=>({index:u,active:s.some(f=>f===u),_column:c}));return a.watchEffect(()=>{n=o();const c=J3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},Ev=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const k=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+k,_=Number(f.minWidth);f.resizeWidth=L>_?L:_,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",C),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},y=w=>ot.throttle(()=>{const I=w.clientX-u,k=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<k&&(h.value=w.clientX-u+d)},60),C=w=>{document.body.style.setProperty("cursor",""),y(w)()},b={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",C)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const k=w.target.closest("th");if(c&&k.style.setProperty("user-select","none"),!c){if(!k)return;const L=k.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,k.style.setProperty("cursor","col-resize")):(k.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const k=w.target;c||k.style.setProperty("cursor","")}},v=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(b).forEach(I=>{const k=v(I);w.listeners.has(k)||w.listeners.set(k,[]),w.listeners.get(k).push(b[I])})})},N=()=>{e.forEach(w=>{Object.keys(b).forEach(I=>{const k=v(I);if(w.listeners.has(k)){const L=w.listeners.get(k);L.length=0}})})};t&&T();const S=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:S}},Pv=(e,t,n,i,s)=>{const{getColumns:o}=Ml(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Pe({[$t("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},Iv(e.border))),m=Pe({[$t("table-head")]:!0,"has-settings":!!e.settings}),y=a.computed(()=>o()),C=wd(e),b=a.computed(()=>({"--row-height":`${Rt(C,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),v={[$t("table-body")]:!0},T=a.computed(()=>Pe({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),N=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",S=()=>{if(y.value.every(P=>/^\d+\.?\d*(px)?$/ig.test(`${P.width}`))){const P=y.value.reduce((R,J)=>R+Number(`${J.width}`.replace(/px/ig,"")),0),O=u.value?kr:0;return`${P+O}px`}return"100%"},w=a.computed(()=>({minHeight:L3(e.minHeight,"auto"),width:S(),maxWidth:"100%",height:N()})),I=(P,O)=>{const R=String(P);if(/^\d+\.?\d*$/.test(R))return Number(R);if(/^\d+\.?\d*px$/ig.test(R))return Number(R.replace("px",""));if(/^\d+\.?\d*%$/ig.test(R)&&typeof O=="number"){const J=Number(R.replace("%",""));return O*J/100}return O},k=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),L=()=>e.showHead?I(e.headHeight,ja):0,_=()=>{const P=I(e.height,c.value),O=L(),R=I(e.minHeight,c.value),J=e.pagination&&e.data.length?e.paginationHeight:0,G=P-O-J,ie=e.height!=="auto"?`${G}px`:!1,ge=R-O-J,ue=I(e.maxHeight,void 0),ae=typeof ue=="number"?`${ue-O-J}px`:!1;Object.assign(k,{display:s!=null&&s.length?"block":!1,"min-height":`${ge}px`,height:ie,maxHeight:ae})};a.onMounted(()=>{x(n==null?void 0:n.value)});const x=P=>{if(P){const{height:O}=P.parentElement.getBoundingClientRect();c.value=O,_(),D(P)}},D=P=>{if(!P)return;const O=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,R=P.querySelector(`.${$t("table-body")}`);u.value=Lv(R,O,0)};return{tableClass:h,headClass:m,contentClass:v,footerClass:T,wrapperStyle:w,contentStyle:k,headStyle:b,resetTableHeight:x,updateBorderClass:D,getColumnsWidthOffsetWidth:()=>{let P=0;return u.value&&(P=P+kr),e.border.includes(pl.OUTER)&&!e.border.includes(pl.NONE)&&(P=P+2),P},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},zv=(e,t)=>{var te,oe;const n=a.reactive([]),{getColumns:i}=Ml(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let Q=Sr;return W.sort&&(Q=Q+18),W.filter&&(Q=Q+28),Q},o=a.computed(()=>i()),c=W=>{var ee,fe;const Q=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:x3($,K,Q),[Zn.COL_UID]:Mi.v4(),[Zn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=Ev(n,!0),{activeColumns:m}=Av(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const y=ot.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{y()},{immediate:!0,deep:!0});const C=e.columns.reduce((W,Q,$)=>{const ee=Rt(Q,["field","type"],[Q,$]),fe=E3(Q.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),b=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(te=e.settings)==null?void 0:te.size,height:yl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:C||e.defaultSort}),v=W=>{var Q;return b.rowActions.has(W)?(Q=b.rowActions.get(W))==null?void 0:Q.isExpand:!1},T=()=>{Array.isArray(b.defaultSort)&&b.defaultSort.splice(0),b.defaultSort=C||e.defaultSort},N=(W,Q=void 0)=>{const $=W[$e.ROW_UID],ee=typeof Q=="boolean"?Q:!v($);b.rowActions.set($,Object.assign({},b.rowActions.get($)??{},{isExpand:ee})),ae()},S=()=>b.rowActions.has($e.ROW_SELECTION_ALL)?b.rowActions.get($e.ROW_SELECTION_ALL):e.selectionKey?O.every(W=>E(W)):!1,w=W=>{const Q=W[$e.ROW_UID],{isSelected:$=!1}=b.rowActions.get(Q)||{};return $},I=(W=w)=>{let Q=!1,$=!1;O.forEach(ee=>{const fe=W(ee);!Q&&!fe&&(Q=!0),!$&&fe&&($=!0)}),b.rowActions.set($e.ROW_SELECTION_INDETERMINATE,$&&Q),b.rowActions.set($e.ROW_SELECTION_ALL,$&&!Q)},k=()=>e.columns.some(W=>W.type==="selection"),L=()=>{k()&&I(W=>E(W))},_=(W=void 0)=>{const Q=typeof W=="boolean"?W:!S();b.rowActions.set($e.ROW_SELECTION_ALL,Q),b.rowActions.set($e.ROW_SELECTION_INDETERMINATE,!1),O.forEach(($,ee)=>{if(Nl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[$e.ROW_UID],K=Object.assign({},b.rowActions.get(fe)??{},{isSelected:Q});b.rowActions.set(fe,K)}}),I(),ae(Q),Z(null,W,!0)},x=()=>{_(!1)},D=(W,Q)=>{const $=W[$e.ROW_UID];if($){const ee=typeof Q=="boolean"?Q:!P(W,$),fe=Object.assign({},b.rowActions.get($)??{},{isSelected:ee});b.rowActions.set($,fe),Q||b.rowActions.set($e.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,Q,!1)}},E=(W,Q=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?ot.get(W,e.selectionKey):Q(W),P=(W,Q,$)=>E(W,()=>{var fe;const ee=Q===void 0?W[$e.ROW_UID]:Q;return Nl(e,{row:W,index:$,isCheckAll:!1})&&S()?!0:b.rowActions.has(ee)?(fe=b.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),O=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),ge=(W=!1)=>{let Q=null;const $={},ee=e.data.map(fe=>({[$e.ROW_UID]:Mi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const ve=k3(K,e,de);Q=ve;const Le={...K,[$e.ROW_UID]:K[$e.ROW_UID]||ve,[$e.ROW_SOURCE_DATA]:{...K}};if(R.value){const De=me(K,ve,de,$,Q);Object.assign(Le,{[$e.ROW_SKIP_CFG]:De})}return J.value&&Object.assign(Le,{[$e.ROW_SELECTION]:P(K,ve,de)}),ie.value&&Object.assign(Le,{[$e.ROW_INDEX]:de}),G.value&&Object.assign(Le,{[$e.ROW_EXPAND]:W?v(ve):!1}),Le});O.length=0,O.push(...fe),J.value&&L();return}O.length=0,O.push(...ee)},ue=(W,Q,$,ee)=>{const fe=P($,$[$e.ROW_UID],ee);return W&&typeof Q=="boolean"?Q:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let Q=null;const $={};O.forEach((ee,fe)=>{const K=ee[$e.ROW_UID];if(G.value&&Object.assign(ee,{[$e.ROW_EXPAND]:v(ee[$e.ROW_UID])}),R.value){const de=me(ee,K,fe,$,Q);Q=ee[$e.ROW_UID],Object.assign(ee,{[$e.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[$e.ROW_INDEX]:fe}),J.value){const de=Nl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[$e.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},me=(W,Q,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[Q]||(ee[Q]={}),n.forEach((ve,Le)=>{var Te;const{colspan:De,rowspan:Re}=j3(ve,Le,W,$),Ve=ve[Zn.COL_UID],ce=((Te=de[Ve])==null?void 0:Te.skipRowLen)??0,be={[Ve]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(be[Ve].skipColLen=K,be[Ve].skipCol=!0,K=K-1),ce>1?(be[Ve].skipRowLen=ce-1,be[Ve].skipRow=!0):Re>1&&(be[Ve].skipRowLen=Re,be[Ve].skipRow=!1),De>1&&(be[Ve].skipColLen=De,K=De-1),Object.assign(ee[Q],{...be})}),ee[Q]},B=ot.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,Q,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{ot.has(ee,e.selectionKey)&&ot.set(ee,e.selectionKey,!!Q)});else if(ot.has(W,e.selectionKey)){const ee=e.data.find(fe=>ot.get(fe,e.rowKey)===ot.get(W,e.rowKey));ot.set(ee,e.selectionKey,!!Q)}}},{fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,fixedWrapperClass:X}=Md(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:b,indexData:O,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,initIndexData:ge,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:x,toggleAllSelection:_,toggleRowSelection:D,getSelection:()=>O.filter(W=>P(W)),clearSort:T}},Q3=Ft(a.defineComponent({name:"Table",props:Zb,emits:_b,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new Ub,u=a.reactive([]),{initColumns:f}=Ml(e,u);a.provide(u3,f),a.provide(d3,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:y,dragOffsetXStyle:C,dragOffsetX:b,reactiveSchema:v,indexData:T,fixedColumns:N,resolveColumnStyle:S,resolveColumnClass:w,setRowExpand:I,initIndexData:k,fixedWrapperClass:L,clearSelection:_,toggleAllSelection:x,toggleRowSelection:D,getSelection:E,clearSort:P,updateColGroups:O}=zv(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=Kb(e,T),{tableClass:ge,headClass:ue,contentClass:ae,footerClass:me,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:V,updateBorderClass:Y,resetTableHeight:X,getColumnsWidthOffsetWidth:re,hasFooter:te}=Pv(e,u,d,v,R),{resolveClassName:oe}=Ce(),W=a.computed(()=>({hasScrollY:V.value})),Q=new Ov(e,t,v,y,W,n),$=()=>{const Be=d.value.querySelector(`.${oe("table-body-content")}`),Ee=Be.querySelector("table");if(Ee){const Fe=Ee.scrollWidth,lt=Be.clientWidth;m.value=Fe-lt}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{k(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{X(d.value),Y(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Be=re();vd(d.value,y,20,Be),$()}}),Q.on(Pn.ON_SORT_BY_CLICK,Be=>{const{sortFn:Ee,column:Fe,index:lt,type:et}=Be;typeof Ee=="function"&&(i=Ee,s=Fe,Object.assign(s,{[Zn.SORT_TYPE]:et}),G(o,i,s)),t.emit(Dt.COLUMN_SORT,{column:a.unref(Fe[Zn.COL_SOURCE_DATA]),index:lt,type:et})}).on(Pn.ON_FILTER_CLICK,Be=>{const{filterFn:Ee,checked:Fe,column:lt,index:et}=Be;typeof Ee=="function"&&(o=Ee,G(o,i,s)),t.emit(Dt.COLUMN_FILTER,{checked:Fe,column:a.unref(lt[Zn.COL_SOURCE_DATA]),index:et})}).on(Pn.ON_SETTING_CHANGE,Be=>{const{checked:Ee=[],size:Fe,height:lt,fields:et}=Be;a.nextTick(()=>{O({checked:Ee,fields:et}),Y(d.value);const pt=re();Ee.length&&vd(d.value,y,Sr,pt),t.emit(Dt.SETTING_CHANGE,{checked:Ee,size:Fe,height:lt,fields:et})})}).on(Pn.ON_ROW_EXPAND_CLICK,Be=>{const{row:Ee,column:Fe,index:lt,rows:et,e:pt}=Be;t.emit(Dt.ROW_EXPAND_CLICK,{row:xs(Ee),column:P3(Fe),index:lt,rows:et,e:pt}),I(Ee,!Ee[$e.ROW_EXPAND])}).on(Pn.ON_ROW_CHECK,({row:Be,isAll:Ee,index:Fe,value:lt})=>{Ee?(x(lt),t.emit(Dt.ROW_SELECT_ALL,{checked:lt,data:e.data})):(D(Be,lt),t.emit(Dt.ROW_SELECT,{row:xs(Be),index:Fe,checked:lt,data:e.data})),t.emit(Dt.ROW_SELECT_CHANGE,{row:xs(Be),isAll:Ee,index:Fe,checked:lt,data:e.data})});const ee=Be=>{const Ee=v.pos.bottom??0,Fe=Be[1],{translateX:lt,translateY:et,pos:pt={}}=Fe;v.scrollTranslateY=et,v.scrollTranslateX=lt,v.pos=pt;const{bottom:Ue}=pt;Ue<=2&&Ee>Ue&&os(60,()=>{t.emit(Dt.SCROLL_BOTTOM,{...pt,translateX:lt,translateY:et})},!0)(),$()},fe=(Be={left:0,top:0})=>{var Ee,Fe;(Fe=(Ee=h.value)==null?void 0:Ee.scrollTo)==null||Fe.call(Ee,Be)};a.onMounted(()=>{if(e.observerResize){let Be=T3(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&X(d.value),Y(d.value);const Ee=re();vd(d.value,y,20,Ee)},180,!0,e.resizerWay);Be.start(),a.onBeforeUnmount(()=>{Be.disconnect(),Be=null})}}),a.onBeforeUnmount(()=>{Q.destroy()});const K=()=>d.value;t.expose({setRowExpand:I,clearSelection:_,toggleAllSelection:x,toggleRowSelection:D,getSelection:E,clearSort:P,scrollTo:fe,getRoot:K});const de=a.computed(()=>({...ae,"__is-empty":!R.length})),ve=a.computed(()=>({[oe("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled})),Le={column_drag_line:!0,"offset-x":!0},De=a.computed(()=>({...C.value,left:`${b.value-v.scrollTranslateX}px`})),Re={"scroll-loading":!0,_bottom:!0},Ve=a.computed(()=>({[oe("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),ce={zIndex:-1,width:0,height:0,display:"none"},be=a.computed(()=>({"--footer-height":te.value?`${e.paginationHeight}px`:"0"})),Te=a.computed(()=>({right:V.value?`${kr}px`:0,...be.value})),{renderScrollLoading:Je}=Xb(e,t),rt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),it=a.computed(()=>({"--prepend-left":`${v.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ut=()=>t.slots.prepend?a.createVNode("div",{style:it.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Be,Ee;return a.createVNode("div",{class:ge.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[Q.renderTableHeadSchema()]),a.createVNode(Lr,a.mergeProps({ref:h,lineHeight:Q.getRowHeight,class:de.value,style:Z,list:R},rt.value,{contentClassName:ve.value,onContentScroll:ee,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ut(),default:Fe=>Q.renderTableBodySchema(Fe.data||R),afterSection:()=>a.createVNode("div",{class:Ve.value},null)}),a.createVNode("div",{class:L,style:Te.value},[N.value.map(({isExist:Fe,colPos:lt,column:et})=>Fe?"":a.createVNode("div",{class:w(et,v.scrollTranslateX,m.value),style:S(lt)},null)),a.createVNode("div",{class:Le,style:De.value},null),a.createVNode("div",{class:Re},[Je()])]),a.createVNode("div",{class:me.value,style:be.value},[te.value&&Q.renderTableFooter(J.value)]),a.createVNode("div",{style:ce},[(Ee=(Be=t.slots).default)==null?void 0:Ee.call(Be)])])}}}),{Column:Yb}),Dr=12;function Vv(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function Rv(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const _3=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},W3=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},H3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.string,tpl:{type:Function}},render(){const{resolveClassName:e}=Ce(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),Jv=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:ze("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),Qv=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ir},props:{node:p.object,displayKey:p.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=W4(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),_v=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ir},props:Jv(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=Fn(),i=ft("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=Ce(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=Vv(u),m=a.ref(""),y=a.ref(null),C=a.ref(null),b=a.ref(null),v=a.ref(null),T=a.ref(null),N=a.ref(null),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>x.selectedTagList.length===0&&m.value===""&&!s.isEdit),k=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&x.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),_=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),x=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>x.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:E,saveKeyMap:P}=Rv(e),O=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Te)=>{be.__index__=Te,ce[be.group.groupId]||(ce[be.group.groupId]={id:be.group.groupId,name:be.group.groupName,children:[]}),ce[be.group.groupId].children.push(be)}),Object.keys(ce).map(be=>ce[be])}return f.curPageList});a.watch([()=>E.value],()=>{a.nextTick(()=>{ge()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;me(D.value,ce)||(a.nextTick(()=>{ge()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,ot.debounce(()=>{const ce=f.curPageList.length!==0,{value:be}=m;be!==""&&ce||be===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{ge()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=v.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Te}=T.value;if(ce+be>=Te){const Je=f.curPage+1;Je<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Je)},500))}},G=()=>{var be;return Array.from(((be=b.value)==null?void 0:be.childNodes)||[]).filter(Te=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Te.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:be}=ce.target;(be.indexOf(`${c("tag-input-trigger")}`)>-1||be.indexOf("tag-list")>-1)&&b.value.appendChild(v.value)}clearTimeout(N.value),w.value&&D.value.length&&(x.tagListCache=[...D.value],x.selectedTagListCache=[...x.selectedTagList],m.value=x.selectedTagListCache[0][e.saveKey],De(x.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var be;(be=y.value)==null||be.focus(),e.trigger==="focus"&&x.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},ge=()=>{const{saveKey:ce,modelValue:be,displayKey:Te,allowCreate:Je,trigger:rt,isAsyncList:it}=e;if(x.selectedTagList=[],x.localList=E.value,be.length){const ut={};x.selectedTagList=be.map(Be=>{const Ee=P.value[Be];return ut[Be]=1,!Ee&&Je?{[ce]:Be,[Te]:Be}:Ee}).filter(Be=>Be),w.value||(x.localList=x.localList.filter(Be=>!ut[Be[ce]]))}if(it&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}rt==="focus"&&ue()},ue=(ce="")=>{const{searchKey:be,filterCallback:Te}=e,Je=ce.toLowerCase().trim();if(Je===""){d(x.localList);return}let rt=[];typeof Te=="function"?rt=Te(Je,be,x.localList)||[]:Array.isArray(be)?rt=x.localList.filter(it=>be.some(ut=>it[ut].toLowerCase().indexOf(Je)>-1)):rt=x.localList.filter(it=>it[be].toLowerCase().indexOf(Je)>-1),d(rt)},ae=(ce,be)=>{const Te={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Te[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Te[`${c("selector-actived")}`]=be===s.focusItemIndex,Te};function me(ce,be){return ce.length!==be.length?!1:be.every((Te,Je)=>ce[Je]===Te)}const B=()=>{x.tagListCache=[],x.selectedTagListCache=[],x.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const be=G().findIndex(({id:Te})=>Te==="tagInputItem");return be>=0?be:0},V=(ce,be,Te=!1)=>{if(!be||!ce)return;let Je=be;Te&&(Je=be.nextElementSibling||null),be.parentNode.insertBefore(ce,Je)},Y=ce=>{const{maxData:be,trigger:Te,allowCreate:Je}=e;if(be===-1||be>D.value.length){const{value:rt}=ce!=null&&ce.target?ce.target:m,it=_3(rt);it?(ue(rt),y.value.style.width=`${it*Dr}px`):Te==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Je?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=C.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Te]=x.tagListCache;ce&&ce===Te&&x.selectedTagListCache.length?Le(x.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Te=f.curPageList.find(Je=>Array.isArray(e.searchKey)?e.searchKey.map(it=>Je[it]).includes(ce):Je[e.searchKey]===ce);Te?te(Te,"select"):e.allowCreate&&te(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},te=(ce,be,Te)=>{Te==null||Te.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Le(ce,be),W("select"),Z(),o.isShow=!1)},oe=(ce,be,Te)=>{Te==null||Te.stopPropagation(),De(ce,be),Z(),W("remove",ce),y.value.style.width=`${Dr}px`},W=(ce,be)=>{t(ce,be),t("update:modelValue",D.value),t("change",D.value)},Q=ce=>{ce.stopPropagation();const be=x.selectedTagList;x.selectedTagList=[];const Te=be.filter(Je=>P.value[Je[e.saveKey]]);(e.allowCreate&&Te.length!==0||!e.allowCreate)&&!w.value&&x.localList.push(...Te),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const be=T.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Te={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Te.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Te.yAxis));const Je=Te.yAxis+Te.height-ce.yAxis;Je>ce.height&&(T.value.scrollTop=T.value.scrollTop+Je-ce.height)})},ee=(ce,be)=>{const Te=G();V(v.value,Te[ce-1]),x.selectedTagList.splice(ce-1,1),ie();const Je=P.value[be[e.saveKey]];(e.allowCreate&&Je||!e.allowCreate)&&!w.value&&x.localList.push(be),y.value=`${Dr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let be;const Te=ce.target.value,Je=_3(Te),rt=H(),it=G();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),$();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),$();break;case"ArrowLeft":if(s.isEdit=!0,!Je){if(rt<1)return;V(v.value,it[rt-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Je){if(rt===it.length-1)return;V(it[rt+1],v.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?te(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&te(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":rt!==0&&!m.value&&(be=x.selectedTagList[rt-1],ee(rt,be));break}},K=ce=>{const be=[],Te=ce.split(";"),Je=/^[a-zA-Z][a-zA-Z_]*/g;return Te.forEach(rt=>{const it=rt.match(Je);if(it){const ut=it.join("");be.push({[e.saveKey]:ut,[e.displayKey]:ut})}}),be},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:be,saveKey:Te,displayKey:Je,pasteFn:rt,allowCreate:it}=e,ut=ce.clipboardData.getData("text");let Ee=(rt?rt(ut):K(ut)).map(Fe=>Fe[Te]);if(Ee.length){const Fe=G(),lt=H(),et=x.localList.map(Ue=>Ue[Te]);if(Ee=Ee.filter(Ue=>{const Wt=(Ue==null?void 0:Ue.trim())&&!D.value.includes(Ue);return it?Wt:Wt&&et.includes(Ue)}),be!==-1){const Ue=x.selectedTagList.length;if(Ue<be){const Wt=be-Ue;Ee.length>Wt&&(Ee=[...Ee.slice(0,Wt)])}else Ee=[]}const pt=it?Ee.map(Ue=>x.localList.find(oa=>oa[Te]===Ue)??{[Te]:Ue,[Je]:Ue}):x.localList.filter(Ue=>Ee.includes(Ue[Te]));Ee.length&&(x.selectedTagList.splice(lt,0,...pt),V(v.value,Fe[lt]),y.value.style.width=`${Dr}px`,x.localList=x.localList.filter(Ue=>!Ee.includes(Ue[Te])),W("select"),ie())}},ve=ce=>{e.disabled||(V(v.value,ce.currentTarget,!0),y.value.style.width=`${Dr}px`,o.isShow&&R())},Le=(ce,be)=>{if(x.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Te,saveKey:Je,displayKey:rt,createTagValidator:it}=e,ut=H();let Be=1,Ee=!1,Fe;const lt=et=>typeof it=="function"?it(et):!0;if(be==="custom")if(Te){let et=ce.split(Te);et=et.filter(Ue=>(Ue==null?void 0:Ue.trim())&&!D.value.includes(Ue)&<(Ue));const pt=et.map(Ue=>P.value[Ue]||{[Je]:Ue,[rt]:Ue});et.length&&(x.selectedTagList.splice(ut,0,...pt),Be=pt.length,Ee=!0)}else{const et=typeof ce=="object";if(Fe=et?ce[Je]:ce.trim(),Fe=Fe.replace(/\s+/g,""),Fe!==void 0&&!D.value.includes(Fe)&<(Fe)){const pt=P.value[Fe]||(et?ce:{[Je]:Fe,[rt]:Fe});x.selectedTagList.splice(ut,0,pt),Ee=!0}}else ce&&(Fe=ce[Je],Fe!==void 0&&!D.value.includes(Fe)&&(x.selectedTagList.splice(ut,0,ce),Ee=!0));Ee&&a.nextTick(()=>{for(let et=1;et<=Be;et++){const Ue=G()[ut+et];V(Ue,v.value)}if(y.value.style.width=`${Dr}px`,!w.value){e.allowNextFocus&&ie();const et=D.value.reduce((pt,Ue)=>(pt[Ue]=1,pt),{});x.localList=x.localList.filter(pt=>!et[pt[Je]])}})},De=(ce,be)=>{x.selectedTagList.splice(be,1);const Te=P.value[ce[e.saveKey]];(e.allowCreate&&Te||!e.allowCreate)&&!w.value&&x.localList.push(ce)},Re=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Ve}=W3(C,Re,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(x),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:k,curInputValue:m,renderList:O,showTagClose:S,tagInputRef:y,bkTagSelectorRef:C,tagListRef:b,tagInputItemRef:v,selectorListRef:T,triggerClass:_,overflowTagIndex:Ve,localCollapseTags:Re,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:te,handleTagRemove:oe,handleClear:Q,tagFocus:ve,handleKeydown:fe,handlePaste:de,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Gt,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(Qv,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(sn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(H3,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(H3,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode($i,{theme:"primary",size:Ta.Small},null)]):null])])})])}}),B3=Ye(_v),Wv={direction:S0(),align:ou().def(Co.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:x0()},F3=Ye(a.defineComponent({name:"Divider",props:Wv,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=Ce();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}));var Il=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Il||{}),Ds=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Ds||{});const $3=ze("position",{}).def("top");var G3=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(G3||{});const Z3=ze("sortType",{}).def("replace"),Hv={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},Bv={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:su(),panel:p.string||p.func},Fv={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),tabPosition:$3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:Z3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},$v={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:$3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:Z3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...Hv},Y3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ir},props:$v,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Ds.LEFT,Ds.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:y}=t.value,C={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${y}px`,background:e.activeBarColor};return e.tabPosition===Ds.LEFT?C.right=0:C.left=0,C}if(e.type===Il.UNBORDER_CARD){const{clientWidth:m,offsetLeft:y}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${y}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((y,C)=>{if(!y.props)return null;const{name:b,label:v,closable:T,visible:N,disabled:S,sortable:w,tips:I}=y.props;if(!N)return!1;e.active===b&&(m=!0);const k=L=>y.slots.label?a.h(y.slots.label):[void 0,""].includes(L)?`选项卡${C+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:b,closable:T,visible:N,disabled:S,sortable:w,tips:I,tabLabel:k(v)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=Ce();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((v,T)=>{if(!v)return null;const{name:N,disabled:S,tabLabel:w}=v,I=()=>{const L=[this.resolveClassName("tab-header-item")];return S&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},k=(L,_)=>!S&&(L||_);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&this.handleTabChange(N),draggable:k(v.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),k(v.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,v)},[a.createVNode(rn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:v.tips,disabled:!v.tips}]])}),m=()=>{var T,N;const v=[];return typeof this.$slots.add=="function"?v.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&v.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(ys,{style:"display:flex;",width:26,height:26},null)])),v.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[v.map((S,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[S]))]):null},y=()=>this.type===Il.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",C=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,b=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),b||C?"tab-header-auto":""]},[y(),h()]),b,C])}}),U3=Ft(a.defineComponent({name:"Tab",components:{TabNav:Y3},props:Fv,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:y}=h;return(y||[]).forEach(C=>{let{type:b}=C;b=b.name||b,b==="TabPanel"&&C.component?m.push(C.component):(b===a.Fragment||b==="template")&&c(C,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],y=c(m);y.length!==s.value.length&&(s.value=y)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,y){const C=s.value;if(y===G3.INSERT)if(h<m)C.splice(m+1,0,s[h]),C.splice(h,1);else if(h>m)C.splice(m,0,s[h]),C.splice(h+1,1);else return!1;else{const b=C[m];C[m]=C[h],C[h]=b}s.value=[...C],n("sort",h,m,y),n("sort-change",h,m,y)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=Ce();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Ds.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Il.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:S,tabAdd:w,tabChange:I,tabRemove:k,tabSort:L,tabDrag:_}=this,x={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:S,tabAdd:w,tabChange:I,tabRemove:k,tabSort:L,tabDrag:_};return!s||!Array.isArray(s)?null:a.createVNode(Y3,x,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),{TabPanel:a.defineComponent({name:"TabPanel",props:Bv,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=Ce();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}})}),ea={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let K3=1;const X3=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;ea[i].forEach(y=>{c+=(y.el.offsetHeight||0)+u}),K3+=1;const f=`message_${K3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=y=>{Gv(y,i,u,s),a.render(null,d)},a.render(h,d),ea[i].push(h);let m;h.props.getContainer&&Ca(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function Gv(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ea[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ea[t][o].el.offsetHeight,f=ea[t].length;for(let d=o;d<f;d++){const h=parseInt(ea[t][d].el.style[s],10)-u-n;ea[t][d].component.props.offsetY=h}ea[t].splice(o,1)}var q3={exports:{}};/*!
|
66
|
+
*/function fb(e,t){if(!F9.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&$9&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var hb=fb,gb=cb,mb=hb,G9=10,Z9=40,Y9=800;function U9(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*G9,s=n*G9,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=Z9,s*=Z9):(i*=Y9,s*=Y9)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}U9.getEventType=function(){return gb.firefox()?"DOMMouseScroll":mb("wheel")?"wheel":"mousewheel"};var pb=U9,yb=pb;const Cb=Kr(yb),bb=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,vb=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(bb?"DOMMouseScroll":"mousewheel",function(n){const i=Cb(n);t==null||t.apply(this,[n,i])})},wb={beforeMount(e,t){console.error(e,t),vb(e,t.value)}},qi=new Map,Ir={beforeMount(e,t){const n=K9(t),{trigger:i}=n,s=Mb(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{dd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ts(e)},100)}),e.addEventListener("click",()=>{Ts(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ts(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{dd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&Ts(e)});qi.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){qi.get(e).opts=K9(t)},unmounted(e){Ts(e),qi.delete(e)}};function Nb(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function K9(e){const t=Nb();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function Mb(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=ni.getPopperIndex(),u=document.createElement("div");if(u.className=`${$t("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=X9();u.appendChild(f)}return u}function X9(){const e=document.createElement("div");return e.className=$t("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function Ib(e,t){const{opts:n}=qi.get(e),{placement:i,distance:s,showOnInit:o}=n,c=f0(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&dd(e),c}function dd(e){const{popper:t,opts:n}=qi.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=X9();t.appendChild(f)}document.body.appendChild(t);const u=Ib(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),qi.get(e).popperInstance=u}function Ts(e){if(!qi.get(e))return;const{popper:t,popperInstance:n,opts:i}=qi.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const q9=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},fd=(e,t)=>{let n=null,i=null,s=null;const o=q9(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const y=q9(e,t);y.isShow=!0,y.content=y.content||e.innerHTML,y.allowHtml=!0,Object.assign(y,{onContentMouseenter:u,onContentMouseleave:f}),n=td(y)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:y=>{var C,b;h(),(C=y??e)==null||C.removeEventListener("mouseenter",d),(b=y??e)==null||b.removeEventListener("mouseleave",h)},instance:n}},Lb={mounted(e,t){fd(e,t)}},Tb={onContentScroll:Function},kb={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def($t("F-scroll-x")),scrollYName:p.string.def($t("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...Tb},Sb=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,y,C,b,v)=>{t.emit("content-scroll",[d,{translateY:C,translateX:b,pos:v}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,y,C,b,v,T;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((y=(m=t.slots).default)==null?void 0:y.call(m,{data:e.list}))??""]),[[o,c]]),((b=(C=t.slots).afterContent)==null?void 0:b.call(C))??"",((T=(v=t.slots).afterSection)==null?void 0:T.call(v))??""])}}};function e3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function t3(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:y}=n,{offsetHeight:C}=i;let b=0,v=0,T=0;if(typeof e=="number"&&(b=Math.floor(o/e),v=Math.ceil(C/e)+b,T=o%e),typeof e=="function"){const N=e3(f,o,d,e);b=N.startIndex>0?N.startIndex:0,T=N.diffHeight,v=e3(f,C,d,e).startIndex+b+1}if(o!==u||b!==h||v!==m||y!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,b,v,o,T,c,{bottom:N>=0?N:0})}}function xb(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const C=t.scrollTop,b=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,C,C,b,{bottom:v>=0?v:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:y}=o;t3(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:y},t,e)}const n3=(e=60)=>ot.throttle((t,n,i)=>xb(t,n,i),e),Db=(e,t,n,i=60)=>{Reflect.apply(n3(i),void 0,[e,t,n])},jb={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{Db(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",n3)}}},Lr=Ye(a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:jb},props:kb,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=Sb(e,t);return D}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(D,E,P,O,R,J,G)=>{c.startIndex=E,c.endIndex=P,c.scrollTop=O,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),y()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),y(),e.keepAlive&&x(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),y()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let O=0;O<d.value;O++){const R=e.lineHeight.call(this,O,D.slice(O*e.groupItemCount,e.groupItemCount));P+=typeof R=="number"?R:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},y=(D={left:0,top:0})=>{var P;const E=(P=o.value)==null?void 0:P.parentNode;t3(e.lineHeight,u,c,E,null),D&&o.value&&x(D)},C=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,E)=>({...D,$index:E}))),b=a.computed(()=>C.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),v=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?v.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:S}=Ce(),w=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),k=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},_=()=>{f(),y()},x=(D={left:0,top:0})=>{const{left:E,top:P}=D;o.value.scrollTo(E,P)};return t.expose({reset:_,scrollTo:x}),()=>{var D,E,P,O,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((E=(D=t.slots).beforeContent)==null?void 0:E.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...v.value,...e.contentStyle}},[((O=(P=t.slots).default)==null?void 0:O.call(P,{data:b.value}))??""]),[[k,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}));var i3=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(i3||{});const Ob=a.defineComponent({name:"Tag",props:{theme:wo(),closable:p.bool.def(!1),type:ze("tagStorkeType",{}).def(i3.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Pe({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(sn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Tr=Ye(Ob),Ab=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:wo(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),{proxy:i}=a.getCurrentInstance(),s=a.inject(ul,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},y=()=>{var N;(N=d.value)==null||N.focus()},C=N=>{t("update:modelValue",N.target.value)},b=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},v=N=>{const S=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?S[N]:S},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=v(),S=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=S>0?S:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:y,handleInput:C,handleKeydown:b,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Pe({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Pe({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((y,C)=>a.createVNode(Tr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&C>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(y.value)},{default:()=>{var b;return[(b=this.select)==null?void 0:b.handleGetLabelByValue(y.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Tr,{class:this.resolveClassName("select-overflow-tag")},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),Eb=a.defineComponent({name:"Select",directives:{clickoutside:oi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(ru.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:wo(),behavior:j0(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:x2()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:y,allowCreate:C,customContent:b,showSelectedIcon:v,inputSearch:T,enableVirtualRender:N,showSelectAll:S,scrollHeight:w,list:I,displayKey:k,idKey:L,collapseTags:_,autoHeight:x,popoverOptions:D,allowEmptyValues:E,autoFocus:P,keepSearchValue:O,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),ge=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),me=Fn(),B=a.ref(),Z=a.ref(),H=a.ref(),V=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),te=a.ref(new Map),oe=a.computed(()=>[...te.value.values()]),W=a.ref(new Map),Q=a.ref([]),$=a.computed(()=>Q.value.reduce((Ne,Oe)=>(Ne[Oe.value]=Oe.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,Oe)=>(Ne[Oe[L.value]]=Oe[k.value],Ne),{}));a.watch(s,()=>{var Ne;Xl(),e.withValidate&&((Ne=me==null?void 0:me.validate)==null||Ne.call(me,"change"))},{deep:!0}),a.watch(Q,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ut.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var Oe;return(Oe=Mr(String(Ne[k.value])))==null?void 0:Oe.includes(Mr(Ci.value))})),de=a.computed(()=>o.value||d.value),ve=a.computed(()=>Q.value.map(Ne=>{var Oe,He;return((He=(Oe=te.value)==null?void 0:Oe.get(Ne.value))==null?void 0:He.optionName)||fe.value[Ne.value]||Ne.label})),Le=a.computed(()=>{const Ne=oe.value.reduce((Oe,He)=>(He.disabled||Oe.push(He.optionID),Oe),[]);return Ne.length<=Q.value.length&&Ne.every(Oe=>Q.value.some(He=>He.value===Oe))}),De=a.computed(()=>!!W.value.size),Re=a.computed(()=>!oe.value.length),Ve=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Bs.value||Re.value||Ve.value)||b.value),Te=a.computed(()=>u.value&&S.value&&(!Ci.value||!c.value)),Je=a.computed(()=>w.value-12-(Te.value?32:0)),rt=a.computed(()=>Bs.value?ie.value:Re.value?J.value:Ve.value?G.value:""),it=a.computed(()=>x.value?_.value&&!yi.value:_.value),ut=a.computed(()=>ot.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:Ul.value,arrow:!1,placement:"bottom-start",isShow:yi.value,reference:Y.value,offset:6,popoverDelay:0,renderType:vo.AUTO},D.value)),{register:Be,unregister:Ee}=nd(te),{register:Fe,unregister:lt}=nd(W),{isHover:et,setHover:pt,cancelHover:Ue}=z9(),Wt=a.ref(!1),oa=()=>{Wt.value||(Wt.value=!0,t("focus"))},Yl=()=>{Wt.value&&(Wt.value=!1,t("blur"))},{popperWidth:Ul,isPopoverShow:yi,hidePopover:la,showPopover:Hs,togglePopover:df}=nb({popoverMinWidth:h.value},Z);a.watch(yi,()=>{t("toggle",yi.value)});const ff=a.computed(()=>(c.value&&T.value||C.value)&&yi.value);a.watch(yi,Ne=>{Ne?setTimeout(()=>{Wa(),Kl()},10):O.value||(Ci.value="")});const Kl=()=>{var He;const Ne=Q.value[0],Oe=te.value.get(Ne==null?void 0:Ne.value);Oe&&!Oe.disabled&&Oe.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(He=oe.value.find(Mn=>!Mn.disabled&&Mn.visible))==null?void 0:He.optionID},hf=Ne=>{c.value&&oe.value.forEach(Oe=>{var He;Oe.visible=(He=Mr(String(Oe.optionName)))==null?void 0:He.includes(Mr(Ne))})},{searchKey:Ci,searchLoading:Bs}=ib(ce.value?f.value:hf,Kl),bi=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},gf=()=>{de.value||(oa(),df())},Fs=Ne=>{c.value&&(Ci.value=Ne)},mf=(Ne,Oe)=>{const He=String(Ne);!C.value||!He||c.value&&oe.value.find(fn=>Mr(String(fn.optionName))===Mr(He))||te.value.get(He)||(Oe.stopPropagation(),u.value?(Q.value.push({value:He,label:He}),bi(Q.value.map(fn=>fn.value))):(Q.value=[{value:He,label:He}],bi(He),la()),Ci.value="")},_a=Ne=>{if(!(de.value||!Ne)){if(u.value){const Oe=Q.value.findIndex(He=>He.value===Ne.optionID);Oe>-1?Q.value.splice(Oe,1):Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),bi(Q.value.map(He=>He.value))}else Q.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],bi(Ne.optionID),la();Wa()}},Wa=()=>{setTimeout(()=>{var Ne,Oe,He;!T.value&&!C.value?(Ne=V.value)==null||Ne.focus():y.value==="tag"?(Oe=Y.value)==null||Oe.focus():(He=B.value)==null||He.focus()},0)},pf=Ne=>{Ne.stopPropagation(),Q.value=[],bi(u.value?[]:""),t("clear",u.value?[]:""),la()},yf=()=>{ee.value=""},Cf=()=>{Le.value?Q.value=[]:oe.value.forEach(Ne=>{Ne.disabled||Q.value.find(Oe=>Oe.value===Ne.optionID)||Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),bi(Q.value.map(Ne=>Ne.value)),Wa()},bf=Ne=>{const{scrollTop:Oe,clientHeight:He,scrollHeight:Mn}=Ne.target;Oe+He===Mn&&t("scroll-end")},vf=Ne=>{if(de.value)return;const Oe=Q.value.findIndex(He=>He.value===Ne);Oe>-1&&(Q.value.splice(Oe,1),bi(Q.value.map(He=>He.value)))},$s=Ne=>{var He,Mn;let Oe=Ne;if(typeof Oe=="object"){for(const fn of te.value.keys())if(ot.isEqual(fn,Oe)){Oe=fn;break}}return((Mn=(He=te.value)==null?void 0:He.get(Oe))==null?void 0:Mn.optionName)||fe.value[Oe]||$.value[Oe]||Oe},Xl=()=>{Array.isArray(s.value)?Q.value=[...s.value.map(Ne=>({value:Ne,label:$s(Ne)}))]:s.value!==void 0||E.value.includes(s.value)?Q.value=[{value:s.value,label:$s(s.value)}]:Q.value=[]},ql=Ne=>{var Mn,fn;if(!yi.value)return;const Oe=oe.value.filter(hn=>!hn.disabled&&hn.visible),He=Oe.findIndex(hn=>hn.optionID===ee.value);if(!(!Oe.length||He===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const hn=He>=Oe.length-1?0:He+1;ee.value=(Mn=Oe[hn])==null?void 0:Mn.optionID;break}case"ArrowUp":{Ne.preventDefault();const hn=He===0?Oe.length-1:He-1;ee.value=(fn=Oe[hn])==null?void 0:fn.optionID;break}case"Backspace":{if(!u.value||!Q.value.length||Ci.value.length||Ne.target===V.value)return;Q.value.pop(),bi(Q.value.map(hn=>hn.value));break}case"Enter":{const hn=te.value.get(ee.value);_a(hn);break}}},wf=({event:Ne})=>{var He;const{target:Oe}=Ne;(He=Z.value)!=null&&He.contains(Oe)||Z.value===Oe||(la(),Yl())},Nf=()=>{setTimeout(()=>{var Ne,Oe;N.value&&((Oe=(Ne=X.value)==null?void 0:Ne.reset)==null||Oe.call(Ne))})};return a.provide(ul,a.reactive({multiple:u,selected:Q,activeOptionValue:ee,showSelectedIcon:v,selectedStyle:R,register:Be,unregister:Ee,registerGroup:Fe,unregisterGroup:lt,handleOptionSelected:_a,handleGetLabelByValue:$s})),a.onMounted(()=>{Xl(),setTimeout(()=>{m.value&&Hs(),P.value&&Wa()})}),{selected:Q,isInput:ff,options:oe,isDisabled:de,selectedLabel:ve,isPopoverShow:yi,isHover:et,popperWidth:Ul,inputRef:B,triggerRef:Z,contentRef:H,searchRef:V,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Bs,isOptionsEmpty:Re,isSearchEmpty:Ve,isFocus:Wt,isShowSelectContent:be,curContentText:rt,isGroup:De,searchKey:Ci,isShowSelectAll:Te,virtualHeight:Je,virtualList:K,isCollapseTags:it,popoverConfig:ut,focusInput:Wa,setHover:pt,cancelHover:Ue,handleFocus:oa,handleBlur:Yl,handleTogglePopover:gf,handleClear:pf,hidePopover:la,showPopover:Hs,handleToggleAll:Cf,handleOptionSelected:_a,handleClickOutside:wf,handleScroll:bf,handleDeleteTag:vf,handleInputChange:Fs,handleInputEnter:mf,handleKeydown:ql,handleSelectedAllOptionMouseEnter:yf,handlePopoverShow:Nf,localLoadingText:ie,localPlaceholder:ge,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Pe({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode($i,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ia,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Ab,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(ka,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(La,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode($i,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Lr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(dl,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(dl,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode($i,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Gt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),hd=Ft(Eb,{Option:dl,Group:ab});function Pb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:zb}=Sa,gd=Object.assign({},zb);gd.width.default="400",gd.height.default="100%";const Vb=a.defineComponent({name:"Sideslider",components:{BkModal:Sa,BkButton:At},props:{...gd,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=Ce();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode(Sa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),Pb(u)?u:{default:()=>[u]})}}}),a3=Ye(Vb);var r3=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(r3||{});const s3={theme:p.theme().def(bo.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:S0(),status:ze("status",{}).def(r3.UNKNOWN),lineType:x0(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},o3=Ye(a.defineComponent({name:"Steps",props:s3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(y=>{typeof y=="string"?m.push(y):m.push({title:y.title,icon:y.icon,description:y.description,status:y.status,border:y.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{s3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,y)=>{const C=await e.beforeChange(h);C?m(C):y(C)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=Ce();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Pe({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:y}=m;return y?Object.prototype.toString.call(y)==="[object Object]":typeof m=="string"},u=(m,y)=>(y.icon||(y.icon=m),!isNaN(y.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,y)=>o(m)&&this.status==="loading"||f(y)?a.createVNode(us,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(y)?a.createVNode(sn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(Fi,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,y)?m+1:a.createVNode(y.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,y)=>{var C,b;return a.createVNode("div",{class:[this.resolveClassName("steps"),m.title?"":this.resolveClassName("step-no-content"),s(y)?"done":"",o(y)?"current":"",o(y)&&this.status==="error"?"isError":"",m.status&&o(y)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(y+1)}},[((b=(C=this.$slots)[y+1])==null?void 0:b.call(C))??h(y,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(y+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}})),Rb=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=Fn(),{resolveClassName:i}=Ce(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const y=`${i(`bswitcher-${e.size}`)}`;m[y]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const y=o.value?e.falseValue:e.trueValue,C=!o.value,b=()=>{t("update:modelValue",y),t("change",C)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(y),typeof v.then=="function"))return s.value=!0,v.then(()=>{b()}).finally(()=>{s.value=!1});v&&b()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(Bo,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),l3=Ye(Rb);var pl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(pl||{}),c3=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(c3||{});const Jb=["auto","highlight"],Qb=["none","row","col","outer","horizontal"];var Pn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Pn||{}),Dt=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(Dt||{});const Et=(...e)=>!0,_b={columnPick:Et,columnFilter:Et,columnSort:Et,colFilterSave:Et,rowClick:Et,rowDblclick:Et,rowExpand:Et,select:Et,selectAll:Et,selectionChange:Et,pageLimitChange:Et,pageValueChange:Et,settingChange:Et,scrollBottom:Et,cellClick:Et,cellDblclick:Et,rowMouseEnter:Et,rowMouseLeave:Et},$e={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Zn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},kr=6,ja=42,yl={large:78,medium:60,small:42},Wb=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:yl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:yl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:yl.large}],u3="InitColumns",d3="BKTableCahce",Hb="Bk_COlumn_Update_Define";var Pt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Pt||{});const Bb=["asc","desc","null","custom"],Sr=80;var f3=(e=>(e.CURRENT="current",e.ALL="all",e))(f3||{});const md=ze("showOverflowTooltipMode",{default:"auto"}),Fb=ze("columnType",{default:"none"}),pd=ze("columnType",{default:""}),$b=ze("full",{default:"full"});var h3=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(h3||{});const g3=ze("columnSize",{default:"small"}),Gb=an(),m3=ze("sortScope",{}).def("current");var p3=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(p3||{});const y3={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.oneOfType([p.string,p.func]),disabled:p.oneOfType([p.bool,p.func]),watchCellResize:p.bool.def(!0),mode:md})]).def(void 0),type:Fb,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,Gb]).def(!1),sort:p.oneOfType([p.shape({sortFn:p.func.def(void 0),sortScope:m3,value:p.string.def(Pt.NULL)}),p.bool,p.string]).def(!1),filter:p.oneOfType([p.shape({list:p.arrayOf(p.any).def([]),filterFn:p.func.def(void 0),match:$b,checked:p.arrayOf(p.any).def([]),filterScope:m3,btnSave:p.oneOfType([p.bool,p.string]).def("确定"),btnReset:p.oneOfType([p.bool,p.string]).def("重置")}),p.bool,p.string]).def(!1),colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:pd,className:p.oneOfType([p.string,p.func])},Zb={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(p.shape(y3).loose).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ze("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),minHeight:p.oneOfType([p.number,p.string]).def(ja*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(ja),headHeight:p.number.def(ja),showHead:p.bool.def(!0),thead:p.shape({height:p.number.def(ja),isShow:p.bool.def(!0),cellFn:p.func.def(void 0)}),stripe:p.bool.def(!1),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ze("boderType",{})),p.string]).def([pl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(60),remotePagination:p.bool.def(!1),emptyText:p.string,settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:g3,sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def($e.ROW_INDEX),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:md})]).def(!1),asyncData:p.bool.def(!1),rowHover:p.oneOf(Jb).def(c3.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ze("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:pd,headerAlign:pd,prependStyle:p.style().def({})},Yb=a.defineComponent({name:"TableColumn",props:{...y3,prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},setup(e){const t=a.inject(u3,(s,o=!1)=>{},!1),n=a.inject(d3,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(Hb,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class Ub{constructor(){xe(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}const C3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},Kb=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=C3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(C,b,v)=>{typeof b=="function"&&C.sort((T,N)=>b(T,N,v[Zn.SORT_TYPE]))},d=(C,b)=>{if(typeof b=="function"){const v=C.filter((T,N)=>b(T,N,t));C.length=0,C.push(...v)}},h=(C,b,v)=>{const T=t.slice(),{sortScope:N}=(v==null?void 0:v.sort)??{};N===f3.ALL&&f(T,b,v),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,C),f(u,b,v)},m=(C,b,v)=>{s=C3(e.pagination,s),y(),c(),h(C,b,v)},y=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},Xb=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Ta.Normal,mode:Wu.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:y,indicator:C}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode($i,{loading:f,size:d,mode:h,title:m,inline:y,indicator:C},null)}}}};function qb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const ev=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=Ce();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(hd,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},qb(f=t.limitList.map((d,h)=>a.createVNode(dl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Oa=5,tv=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const b=[];if(e.totalPageNum<=Oa+2){for(let N=2;N<=e.totalPageNum-1;N++)b.push(N);return b}const v=Math.floor(Oa/2);e.totalPageNum>Oa&&(s.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Oa,Math.max(2,t.value-v));for(let N=T;N<T+Oa;N++)b.push(N);return b});a.watch(()=>e.modelValue,b=>{a.nextTick(()=>{b>=1&&b<=e.totalPageNum?t.value=b:b<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,b=>{t.value>b&&(t.value=b)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=b=>{b!==t.value&&(t.value=b)},h=()=>{t.value=Math.max(1,t.value-Oa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Oa)},{resolveClassName:y}=Ce();return{current:t,render:({isFirst:b,isLast:v})=>a.createVNode("div",{class:{[`${y("pagination-list")}`]:!0,"is-first":b,"is-last":v}},[a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(si,null,null)]),a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${y("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(gs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${y("pagination-list-next-batch")}`,onClick:m},[a.createVNode(gs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(An,null,null)])])}},nv=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let S=1;S<=e.totalPageNum;S++)N.push(S);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},y=N=>{const S=N.target,w=Number(S.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},C=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},b=N=>{c=N,m()},{resolveClassName:v}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${v("pagination-small-list")}`},[a.createVNode("div",{class:{[`${v("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(si,null,null)]),a.createVNode(Gt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${v("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${v("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:y,onKeydown:C},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${v("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${v("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>b(N)},[N]))])}),a.createVNode("div",{class:{[`${v("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(An,null,null)])])}},iv=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=Ce();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},av={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},yd=Ye(a.defineComponent({name:"Pagination",props:av,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=iv(n),{current:u,render:f}=tv(),{current:d,render:h}=nv(),{limit:m,render:y}=ev(n);a.watch([s,m,o],([b,v])=>{const T=Math.ceil(b/v);i.value=T<1?1:T},{immediate:!0}),a.watch(u,b=>{t.emit("update:modelValue",b),t.emit("change",b)}),a.watch(d,b=>{e.small&&(t.emit("update:modelValue",b),t.emit("change",b))}),a.watch(m,b=>{t.emit("limitChange",b)});const{resolveClassName:C}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:y,renderSmallList:h,resolveClassName:C}},render(){const e=Pe({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}));var b3=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),Cd=typeof window<"u"&&typeof document<"u"&&window.document===document,Cl=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),rv=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Cl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),sv=2;function ov(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){rv(o)}function u(){var f=Date.now();if(n){if(f-s<sv)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var lv=20,cv=["top","right","bottom","left","width","height","size","weight"],uv=typeof MutationObserver<"u",dv=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ov(this.refresh.bind(this),lv)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Cd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),uv?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Cd||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=cv.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),v3=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},xr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Cl},w3=vl(0,0,0,0);function bl(e){return parseFloat(e)||0}function N3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+bl(o)},0)}function fv(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=bl(c)}return n}function hv(e){var t=e.getBBox();return vl(0,0,t.width,t.height)}function gv(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return w3;var i=xr(e).getComputedStyle(e),s=fv(i),o=s.left+s.right,c=s.top+s.bottom,u=bl(i.width),f=bl(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=N3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=N3(i,"top","bottom")+c)),!pv(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return vl(s.left,s.top,u,f)}var mv=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof xr(e).SVGGraphicsElement}:function(e){return e instanceof xr(e).SVGElement&&typeof e.getBBox=="function"}}();function pv(e){return e===xr(e).document.documentElement}function yv(e){return Cd?mv(e)?hv(e):gv(e):w3}function Cv(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return v3(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function vl(e,t,n,i){return{x:e,y:t,width:n,height:i}}var bv=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=vl(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=yv(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),vv=function(){function e(t,n){var i=Cv(n);v3(this,{target:t,contentRect:i})}return e}(),wv=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new b3,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof xr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new bv(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof xr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new vv(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),M3=typeof WeakMap<"u"?new WeakMap:new b3,I3=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=dv.getInstance(),i=new wv(t,n,this);M3.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){I3.prototype[e]=function(){var t;return(t=M3.get(this))[e].apply(t,arguments)}});var Nv=function(){return typeof Cl.ResizeObserver<"u"?Cl.ResizeObserver:I3}();const Rt=(e,t,n)=>{if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},bd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Mv=e=>L3(e,"auto"),L3=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},Iv=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Qb.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},ks=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],vd=(e,t,n=Sr,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:y=void 0}=h;if(y===void 0)return m<Sr?Sr:m;let C=m;return/^\d+\.?\d*$/.test(`${y}`)&&(C=Number(y)),/^\d+\.?\d*%$/.test(`${y}`)&&(C=Number(y)*o/100),/^\d+\.?\d*px$/i.test(`${y}`)&&(C=Number(`${y}`.replace(/px/i,""))),C},d=(h,m,y=!0)=>{const C=f(h,m),b=m<C?C:m;Object.assign(h,{calcWidth:b}),y&&(c=c-b,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const C=String(ks(h,["resizeWidth","width"]));let b=!0;if(/^\d+\.?\d*(px)?$/.test(C)){const v=Number(C.replace("px",""));d(h,v),b=!1}if(/^\d+\.?\d*%$/.test(C)){let v=n;if(c>0){const T=Number(C.replace("%",""));v=c*T/100}d(h,v),b=!1}b&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,y)=>{h=c/(u.length-y),d(t[m],h,!1);const{calcWidth:C}=t[m];c=c-C}):u.forEach(m=>{const y=f(t[m],Sr);Object.assign(t[m],{calcWidth:y})})}},T3=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?ot.debounce(o,n):ot.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new Nv(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},wd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},wl=(e,t,n)=>n.type==="index"?e[$e.ROW_INDEX]+1:ot.get(e,t),Ss=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ss(Reflect.apply(e,globalThis,t),t):[],k3=(e,t,n)=>{const i=S3(e,t,n);return i!==null?i:Mi.v4()},S3=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===$e.ROW_INDEX?`__ROW_INDEX_${n}`:ot.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,Lv=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},x3=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),D3=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,j3=(e,t,n,i)=>{const s=D3(e,t,n,i,"colspan"),o=D3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},O3=(e,t)=>{var c,u;const n=e.field,i=f=>wl(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Pt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Pt.DESC?-1:1)},A3=e=>{const t={[Pt.NULL]:0,[Pt.ASC]:1,[Pt.DESC]:2};return e===void 0?Pt.NULL:Object.keys(t)[(t[e]+1)%3]},E3=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Pt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Nl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,Tv=(e,t,n)=>{if(e[$e.ROW_UID]!==void 0)return e[$e.ROW_UID];const i=k3(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},xs=e=>a.unref(e[$e.ROW_SOURCE_DATA]||e),P3=e=>a.unref(e[Zn.COL_SOURCE_DATA]||e),z3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:md})]).def(void 0),title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ze("ResizerWay",{default:p3.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{let h=!0,{resizerWay:m}=e,y=n.value.innerText,C="auto",b=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",y=c.content||n.value.innerText,typeof c.content=="function"&&(y=c.content(e.column,e.row)),b=c.watchCellResize,C=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:y,mode:C,resizerWay:m,watchCellResize:b}},d=()=>{if(!n.value||!Ca(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=R4(n.value)),h==="static"&&(i.value=!0),i.value){const y=a.ref(f());u===null&&(u=fd(n.value,{disabled:y.value.disabled,content:y.value.content,mode:y.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:y}=f();if(!h&&(d(),y!==!1&&e.observerResize)){let C=T3(n.value,()=>{d()},60,!0,m);C.start(),a.onBeforeUnmount(()=>{C.disconnect(),C=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),Nd=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class kv{constructor(t,n){xe(this,"props",null);xe(this,"ctx",null);this.props=t,this.ctx=n}}const Sv=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ft("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(el,{scene:"part",type:i.value,description:n.value},null)}}),xv=a.defineComponent({name:"HeadFilter",props:{column:p.any.def({}),height:p.number.def(ja)},emits:["change","filterSave"],setup(e,{emit:t}){var P;const{resolveClassName:n}=Ce(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((P=o.value)==null?void 0:P.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Pe({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Pe({[n("table-head-filter")]:!0}),h=a.ref(null),m=O=>{u.isOpen=O,O&&setTimeout(()=>{h.value.reset()})},y=`light ${n("table-head-filter")}`,C=a.computed(()=>{const{list:O=[]}=o.value;return O}),b=(O,R="ig")=>new RegExp(`${O}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),v=(O,R)=>{const{match:J}=o.value,G=wl(R,Rt(s,"field",[s,R]),s);return J==="full"&&O.includes(G),O.some(ie=>b(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(O,R,J,G)=>o.value.filterFn(O,R,e.column,J,G):(O,R)=>O.length?v(O,R):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(O=!1)=>{const{disabled:R}=I(k,i.value.confirm);if(R||O){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(O,R)=>({disabled:O==="disabled"||O===!1,text:typeof O=="string"?O:R}),{btnSave:k,btnReset:L}=o.value,_=()=>{const{disabled:O,text:R}=I(k,i.value.confirm);return O?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},x=()=>{const{disabled:O,text:R}=I(L,i.value.reset);return O?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(O,R)=>{const J=new Set(u.checked);O?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),S()},E=O=>O.data.length?O.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode($n,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Gt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:vo.SHOWN,arrow:!1,offset:0},{theme:y},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Qo,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(qo,{class:"content-list"},{default:()=>[a.createVNode(Lr,{lineHeight:32,list:C.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:E})]}),a.createVNode("div",{class:"content-footer"},[_(),a.createVNode("span",{class:"btn-filter-split"},null),x()])])})}}),Dv=a.defineComponent({name:"HeadSort",props:{column:p.any.def({}),defaultSort:p.oneOf(Bb).def(Pt.NULL),active:p.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=Ce(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Pt.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Pt.NULL&&(h=A3(d)),s.value===d&&(h=Pt.NULL);const m=O3(e.column,h),y=E3(e.column.sort);if((y==null?void 0:y.value)==="custom"){t("change",(y==null?void 0:y.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Pt.NULL)},[a.createVNode(To,{class:["sort-action","sort-asc",e.active&&s.value===Pt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Pt.ASC)},null),a.createVNode(cs,{class:["sort-action","sort-desc",e.active&&s.value===Pt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Pt.DESC)},null)])}});function V3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const jv=a.defineComponent({name:"Settings",props:{settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:g3.def(h3.SMALL),sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),columns:p.array.def([]),rowHeight:p.number.def(ja)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ft("table"),s=Wb(i),o=(J,G)=>Rt(J,["field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),C=`light ${n("table-settings")}`,b=a.computed(()=>f.value.fields||e.columns||[]),v={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(v,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(b)}),u.value=!1},N=()=>{c.value=v.checkAll,d.value=v.activeSize,h.value=v.activeHeight,m.value=v.checkedFields,u.value=!1},S=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((ge,ue)=>ge.disabled&&m.value.includes(o(ge,ue))).map((ge,ue)=>o(ge,ue));if(c.value){const ge=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...ge,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),k=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),_=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),x=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),E={marginRight:"12px"},P=()=>k.map(J=>a.createVNode("span",{class:D(J),onClick:()=>x(J)},[J.label])),O=a.computed(()=>m.value.length>0&&!b.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&b.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Gt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:S},[a.createVNode(jo,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(ds,{class:"icon-close-action",onClick:N},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode($n,{label:i.value.setting.fields.selectAll,indeterminate:!!O.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(qo,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},V3(J=b.value.map((G,ie)=>{let ge;return a.createVNode("div",{class:"field-item"},[a.createVNode($n,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:_(G,ie)},V3(ge=Rt(G,"label",[G,ie]))?ge:{default:()=>[ge]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),P()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:E,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:E,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Md=(e,t,n)=>{const i=(y,C,b)=>({column_fixed:!!y.fixed,column_fixed_left:y.fixed!=="right",column_fixed_right:y.fixed==="right",shadow:y.fixed==="right"?b-C>2:C>0}),s=y=>y.fixed==="right"?"right":"left",o={left:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed&&C.fixed!=="right").reduce((C,b,v)=>y&&v===0?C:C+ks(b),0),right:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed==="right").reduce((C,b,v)=>y&&v===0?C:C+ks(b),n?kr:0)},c=(y,C,b=0)=>{const v=C[Zn.COL_UID],T=y==="right"?-1:1,N=t.filter(k=>!k.isHidden),{length:S}=N;let w=y==="right"?S*T:1,I=0;for(w;;){w=w+-1*T;const k=Math.abs(w),L=N[k],_=s(L),x=L[Zn.COL_UID];if(_===y&&v!==x){const D=ks(L);I=I+D}if(v===x)break}return I+b},u=(y,C=!1)=>{if(!y.fixed||y.isHidden)return{};const b={left:0,right:C?kr:-1},v=s(y);return b[v]=c(v,y,b[v]),{[v]:`${b[v]}px`}},f=y=>({width:`${o[y](!1)}px`,bottom:"0px"}),d=a.computed(()=>{const y={left:!1,right:!1};return t.filter(C=>!C.isHidden&&C.fixed).map(C=>{const b=s(C),v=y[b];return y[b]=!0,{isExist:v,colPos:b,column:C}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function R3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class Ov{constructor(t,n,i,s,o,c){xe(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});xe(this,"getColumnClass",(t,n)=>[{[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"},t.className]);xe(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new kv(t,n),this.uuid=Mi.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=wd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=x3(u,d,s)}),this.emitEvent(Pn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(jv,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(Sv,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(yd,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(Dt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Dt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Dt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=A3(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=O3(n,s);this.activeSortIndex.value=t,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(Dv,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Pn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(Dt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(xv,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=wd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const v=this.reactiveProp.rowActions.get($e.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[$e.ROW_SELECTION]:!!v},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const y=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[y]));const C=typeof y=="string"?y:void 0,b={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(z3,{class:b,title:C,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},R3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const y=m.split("_").slice(-1)[0];return Object.assign(h,{[y]:C=>{d.listeners.get(m).forEach(b=>Reflect.apply(b,this,[C,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Md(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${kr+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:u(d,this.styleRef.value.hasScrollY),onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=Md(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ss(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ss(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:S3(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var S;const h=[n(f),...Ss(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:y,rowspan:C}=j3(f,d,s,o),b=$e.ROW_SKIP_CFG,v=f[Zn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((S=s[b])==null?void 0:S[v])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ss(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[$e.ROW_EXPAND],"is-last":o+C>=i}],k=(L,_)=>{const x={event:L,row:xs(s),column:P3(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(_,x)};return a.createVNode("td",{class:I,style:h,colspan:y,rowspan:C,onClick:L=>k(L,Dt.CELL_CLICK),onDblclick:L=>k(L,Dt.CELL_DBL_CLICK)},[a.createVNode(z3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},R3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[$e.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${Tv(t,i,this.props)}_expand`;return a.createVNode(Nd,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,xs(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Dt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Dt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Dt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Dt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[$e.ROW_EXPAND]?a.createVNode(fs,null,null):a.createVNode(Cs,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Pn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=wl(t,Rt(n,"field",[n,t]),n),c=t[$e.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Pn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get($e.ROW_SELECTION_INDETERMINATE),c=Nl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode($n,{onChange:s,disabled:!c,modelValue:t[$e.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=wl(t,Rt(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Pe({active:this.isColActive(n)}),s=`${Mv(ks(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const Ml=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),J3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:bd(e.activeColumn):Array.isArray(e.activeColumn)?bd(e.activeColumn[0]):bd(e.activeColumn):[],Av=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Ml(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(J3(e)),o=()=>i().map((c,u)=>({index:u,active:s.some(f=>f===u),_column:c}));return a.watchEffect(()=>{n=o();const c=J3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},Ev=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const k=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+k,_=Number(f.minWidth);f.resizeWidth=L>_?L:_,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",C),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},y=w=>ot.throttle(()=>{const I=w.clientX-u,k=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<k&&(h.value=w.clientX-u+d)},60),C=w=>{document.body.style.setProperty("cursor",""),y(w)()},b={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",C)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const k=w.target.closest("th");if(c&&k.style.setProperty("user-select","none"),!c){if(!k)return;const L=k.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,k.style.setProperty("cursor","col-resize")):(k.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const k=w.target;c||k.style.setProperty("cursor","")}},v=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(b).forEach(I=>{const k=v(I);w.listeners.has(k)||w.listeners.set(k,[]),w.listeners.get(k).push(b[I])})})},N=()=>{e.forEach(w=>{Object.keys(b).forEach(I=>{const k=v(I);if(w.listeners.has(k)){const L=w.listeners.get(k);L.length=0}})})};t&&T();const S=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:S}},Pv=(e,t,n,i,s)=>{const{getColumns:o}=Ml(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Pe({[$t("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},Iv(e.border))),m=Pe({[$t("table-head")]:!0,"has-settings":!!e.settings}),y=a.computed(()=>o()),C=wd(e),b=a.computed(()=>({"--row-height":`${Rt(C,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),v={[$t("table-body")]:!0},T=a.computed(()=>Pe({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),N=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",S=()=>{if(y.value.every(P=>/^\d+\.?\d*(px)?$/ig.test(`${P.width}`))){const P=y.value.reduce((R,J)=>R+Number(`${J.width}`.replace(/px/ig,"")),0),O=u.value?kr:0;return`${P+O}px`}return"100%"},w=a.computed(()=>({minHeight:L3(e.minHeight,"auto"),width:S(),maxWidth:"100%",height:N()})),I=(P,O)=>{const R=String(P);if(/^\d+\.?\d*$/.test(R))return Number(R);if(/^\d+\.?\d*px$/ig.test(R))return Number(R.replace("px",""));if(/^\d+\.?\d*%$/ig.test(R)&&typeof O=="number"){const J=Number(R.replace("%",""));return O*J/100}return O},k=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),L=()=>e.showHead?I(e.headHeight,ja):0,_=()=>{const P=I(e.height,c.value),O=L(),R=I(e.minHeight,c.value),J=e.pagination&&e.data.length?e.paginationHeight:0,G=P-O-J,ie=e.height!=="auto"?`${G}px`:!1,ge=R-O-J,ue=I(e.maxHeight,void 0),ae=typeof ue=="number"?`${ue-O-J}px`:!1;Object.assign(k,{display:s!=null&&s.length?"block":!1,"min-height":`${ge}px`,height:ie,maxHeight:ae})};a.onMounted(()=>{x(n==null?void 0:n.value)});const x=P=>{if(P){const{height:O}=P.parentElement.getBoundingClientRect();c.value=O,_(),D(P)}},D=P=>{if(!P)return;const O=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,R=P.querySelector(`.${$t("table-body")}`);u.value=Lv(R,O,0)};return{tableClass:h,headClass:m,contentClass:v,footerClass:T,wrapperStyle:w,contentStyle:k,headStyle:b,resetTableHeight:x,updateBorderClass:D,getColumnsWidthOffsetWidth:()=>{let P=0;return u.value&&(P=P+kr),e.border.includes(pl.OUTER)&&!e.border.includes(pl.NONE)&&(P=P+2),P},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},zv=(e,t)=>{var te,oe;const n=a.reactive([]),{getColumns:i}=Ml(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let Q=Sr;return W.sort&&(Q=Q+18),W.filter&&(Q=Q+28),Q},o=a.computed(()=>i()),c=W=>{var ee,fe;const Q=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:x3($,K,Q),[Zn.COL_UID]:Mi.v4(),[Zn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=Ev(n,!0),{activeColumns:m}=Av(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const y=ot.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{y()},{immediate:!0,deep:!0});const C=e.columns.reduce((W,Q,$)=>{const ee=Rt(Q,["field","type"],[Q,$]),fe=E3(Q.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),b=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(te=e.settings)==null?void 0:te.size,height:yl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:C||e.defaultSort}),v=W=>{var Q;return b.rowActions.has(W)?(Q=b.rowActions.get(W))==null?void 0:Q.isExpand:!1},T=()=>{Array.isArray(b.defaultSort)&&b.defaultSort.splice(0),b.defaultSort=C||e.defaultSort},N=(W,Q=void 0)=>{const $=W[$e.ROW_UID],ee=typeof Q=="boolean"?Q:!v($);b.rowActions.set($,Object.assign({},b.rowActions.get($)??{},{isExpand:ee})),ae()},S=()=>b.rowActions.has($e.ROW_SELECTION_ALL)?b.rowActions.get($e.ROW_SELECTION_ALL):e.selectionKey?O.every(W=>E(W)):!1,w=W=>{const Q=W[$e.ROW_UID],{isSelected:$=!1}=b.rowActions.get(Q)||{};return $},I=(W=w)=>{let Q=!1,$=!1;O.forEach(ee=>{const fe=W(ee);!Q&&!fe&&(Q=!0),!$&&fe&&($=!0)}),b.rowActions.set($e.ROW_SELECTION_INDETERMINATE,$&&Q),b.rowActions.set($e.ROW_SELECTION_ALL,$&&!Q)},k=()=>e.columns.some(W=>W.type==="selection"),L=()=>{k()&&I(W=>E(W))},_=(W=void 0)=>{const Q=typeof W=="boolean"?W:!S();b.rowActions.set($e.ROW_SELECTION_ALL,Q),b.rowActions.set($e.ROW_SELECTION_INDETERMINATE,!1),O.forEach(($,ee)=>{if(Nl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[$e.ROW_UID],K=Object.assign({},b.rowActions.get(fe)??{},{isSelected:Q});b.rowActions.set(fe,K)}}),I(),ae(Q),Z(null,W,!0)},x=()=>{_(!1)},D=(W,Q)=>{const $=W[$e.ROW_UID];if($){const ee=typeof Q=="boolean"?Q:!P(W,$),fe=Object.assign({},b.rowActions.get($)??{},{isSelected:ee});b.rowActions.set($,fe),Q||b.rowActions.set($e.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,Q,!1)}},E=(W,Q=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?ot.get(W,e.selectionKey):Q(W),P=(W,Q,$)=>E(W,()=>{var fe;const ee=Q===void 0?W[$e.ROW_UID]:Q;return Nl(e,{row:W,index:$,isCheckAll:!1})&&S()?!0:b.rowActions.has(ee)?(fe=b.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),O=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),ge=(W=!1)=>{let Q=null;const $={},ee=e.data.map(fe=>({[$e.ROW_UID]:Mi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const ve=k3(K,e,de);Q=ve;const Le={...K,[$e.ROW_UID]:K[$e.ROW_UID]||ve,[$e.ROW_SOURCE_DATA]:{...K}};if(R.value){const De=me(K,ve,de,$,Q);Object.assign(Le,{[$e.ROW_SKIP_CFG]:De})}return J.value&&Object.assign(Le,{[$e.ROW_SELECTION]:P(K,ve,de)}),ie.value&&Object.assign(Le,{[$e.ROW_INDEX]:de}),G.value&&Object.assign(Le,{[$e.ROW_EXPAND]:W?v(ve):!1}),Le});O.length=0,O.push(...fe),J.value&&L();return}O.length=0,O.push(...ee)},ue=(W,Q,$,ee)=>{const fe=P($,$[$e.ROW_UID],ee);return W&&typeof Q=="boolean"?Q:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let Q=null;const $={};O.forEach((ee,fe)=>{const K=ee[$e.ROW_UID];if(G.value&&Object.assign(ee,{[$e.ROW_EXPAND]:v(ee[$e.ROW_UID])}),R.value){const de=me(ee,K,fe,$,Q);Q=ee[$e.ROW_UID],Object.assign(ee,{[$e.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[$e.ROW_INDEX]:fe}),J.value){const de=Nl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[$e.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},me=(W,Q,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[Q]||(ee[Q]={}),n.forEach((ve,Le)=>{var Te;const{colspan:De,rowspan:Re}=j3(ve,Le,W,$),Ve=ve[Zn.COL_UID],ce=((Te=de[Ve])==null?void 0:Te.skipRowLen)??0,be={[Ve]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(be[Ve].skipColLen=K,be[Ve].skipCol=!0,K=K-1),ce>1?(be[Ve].skipRowLen=ce-1,be[Ve].skipRow=!0):Re>1&&(be[Ve].skipRowLen=Re,be[Ve].skipRow=!1),De>1&&(be[Ve].skipColLen=De,K=De-1),Object.assign(ee[Q],{...be})}),ee[Q]},B=ot.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,Q,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{ot.has(ee,e.selectionKey)&&ot.set(ee,e.selectionKey,!!Q)});else if(ot.has(W,e.selectionKey)){const ee=e.data.find(fe=>ot.get(fe,e.rowKey)===ot.get(W,e.rowKey));ot.set(ee,e.selectionKey,!!Q)}}},{fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,fixedWrapperClass:X}=Md(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:b,indexData:O,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,initIndexData:ge,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:x,toggleAllSelection:_,toggleRowSelection:D,getSelection:()=>O.filter(W=>P(W)),clearSort:T}},Q3=Ft(a.defineComponent({name:"Table",props:Zb,emits:_b,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new Ub,u=a.reactive([]),{initColumns:f}=Ml(e,u);a.provide(u3,f),a.provide(d3,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:y,dragOffsetXStyle:C,dragOffsetX:b,reactiveSchema:v,indexData:T,fixedColumns:N,resolveColumnStyle:S,resolveColumnClass:w,setRowExpand:I,initIndexData:k,fixedWrapperClass:L,clearSelection:_,toggleAllSelection:x,toggleRowSelection:D,getSelection:E,clearSort:P,updateColGroups:O}=zv(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=Kb(e,T),{tableClass:ge,headClass:ue,contentClass:ae,footerClass:me,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:V,updateBorderClass:Y,resetTableHeight:X,getColumnsWidthOffsetWidth:re,hasFooter:te}=Pv(e,u,d,v,R),{resolveClassName:oe}=Ce(),W=a.computed(()=>({hasScrollY:V.value})),Q=new Ov(e,t,v,y,W,n),$=()=>{const Be=d.value.querySelector(`.${oe("table-body-content")}`),Ee=Be.querySelector("table");if(Ee){const Fe=Ee.scrollWidth,lt=Be.clientWidth;m.value=Fe-lt}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{k(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{X(d.value),Y(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Be=re();vd(d.value,y,20,Be),$()}}),Q.on(Pn.ON_SORT_BY_CLICK,Be=>{const{sortFn:Ee,column:Fe,index:lt,type:et}=Be;typeof Ee=="function"&&(i=Ee,s=Fe,Object.assign(s,{[Zn.SORT_TYPE]:et}),G(o,i,s)),t.emit(Dt.COLUMN_SORT,{column:a.unref(Fe[Zn.COL_SOURCE_DATA]),index:lt,type:et})}).on(Pn.ON_FILTER_CLICK,Be=>{const{filterFn:Ee,checked:Fe,column:lt,index:et}=Be;typeof Ee=="function"&&(o=Ee,G(o,i,s)),t.emit(Dt.COLUMN_FILTER,{checked:Fe,column:a.unref(lt[Zn.COL_SOURCE_DATA]),index:et})}).on(Pn.ON_SETTING_CHANGE,Be=>{const{checked:Ee=[],size:Fe,height:lt,fields:et}=Be;a.nextTick(()=>{O({checked:Ee,fields:et}),Y(d.value);const pt=re();Ee.length&&vd(d.value,y,Sr,pt),t.emit(Dt.SETTING_CHANGE,{checked:Ee,size:Fe,height:lt,fields:et})})}).on(Pn.ON_ROW_EXPAND_CLICK,Be=>{const{row:Ee,column:Fe,index:lt,rows:et,e:pt}=Be;t.emit(Dt.ROW_EXPAND_CLICK,{row:xs(Ee),column:P3(Fe),index:lt,rows:et,e:pt}),I(Ee,!Ee[$e.ROW_EXPAND])}).on(Pn.ON_ROW_CHECK,({row:Be,isAll:Ee,index:Fe,value:lt})=>{Ee?(x(lt),t.emit(Dt.ROW_SELECT_ALL,{checked:lt,data:e.data})):(D(Be,lt),t.emit(Dt.ROW_SELECT,{row:xs(Be),index:Fe,checked:lt,data:e.data})),t.emit(Dt.ROW_SELECT_CHANGE,{row:xs(Be),isAll:Ee,index:Fe,checked:lt,data:e.data})});const ee=Be=>{const Ee=v.pos.bottom??0,Fe=Be[1],{translateX:lt,translateY:et,pos:pt={}}=Fe;v.scrollTranslateY=et,v.scrollTranslateX=lt,v.pos=pt;const{bottom:Ue}=pt;Ue<=2&&Ee>Ue&&os(60,()=>{t.emit(Dt.SCROLL_BOTTOM,{...pt,translateX:lt,translateY:et})},!0)(),$()},fe=(Be={left:0,top:0})=>{var Ee,Fe;(Fe=(Ee=h.value)==null?void 0:Ee.scrollTo)==null||Fe.call(Ee,Be)};a.onMounted(()=>{if(e.observerResize){let Be=T3(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&X(d.value),Y(d.value);const Ee=re();vd(d.value,y,20,Ee)},180,!0,e.resizerWay);Be.start(),a.onBeforeUnmount(()=>{Be.disconnect(),Be=null})}}),a.onBeforeUnmount(()=>{Q.destroy()});const K=()=>d.value;t.expose({setRowExpand:I,clearSelection:_,toggleAllSelection:x,toggleRowSelection:D,getSelection:E,clearSort:P,scrollTo:fe,getRoot:K});const de=a.computed(()=>({...ae,"__is-empty":!R.length})),ve=a.computed(()=>({[oe("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled})),Le={column_drag_line:!0,"offset-x":!0},De=a.computed(()=>({...C.value,left:`${b.value-v.scrollTranslateX}px`})),Re={"scroll-loading":!0,_bottom:!0},Ve=a.computed(()=>({[oe("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),ce={zIndex:-1,width:0,height:0,display:"none"},be=a.computed(()=>({"--footer-height":te.value?`${e.paginationHeight}px`:"0"})),Te=a.computed(()=>({right:V.value?`${kr}px`:0,...be.value})),{renderScrollLoading:Je}=Xb(e,t),rt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),it=a.computed(()=>({"--prepend-left":`${v.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ut=()=>t.slots.prepend?a.createVNode("div",{style:it.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Be,Ee;return a.createVNode("div",{class:ge.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[Q.renderTableHeadSchema()]),a.createVNode(Lr,a.mergeProps({ref:h,lineHeight:Q.getRowHeight,class:de.value,style:Z,list:R},rt.value,{contentClassName:ve.value,onContentScroll:ee,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ut(),default:Fe=>Q.renderTableBodySchema(Fe.data||R),afterSection:()=>a.createVNode("div",{class:Ve.value},null)}),a.createVNode("div",{class:L,style:Te.value},[N.value.map(({isExist:Fe,colPos:lt,column:et})=>Fe?"":a.createVNode("div",{class:w(et,v.scrollTranslateX,m.value),style:S(lt)},null)),a.createVNode("div",{class:Le,style:De.value},null),a.createVNode("div",{class:Re},[Je()])]),a.createVNode("div",{class:me.value,style:be.value},[te.value&&Q.renderTableFooter(J.value)]),a.createVNode("div",{style:ce},[(Ee=(Be=t.slots).default)==null?void 0:Ee.call(Be)])])}}}),{Column:Yb}),Dr=12;function Vv(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function Rv(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const _3=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},W3=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},H3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.string,tpl:{type:Function}},render(){const{resolveClassName:e}=Ce(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),Jv=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:ze("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),Qv=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ir},props:{node:p.object,displayKey:p.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=W4(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),_v=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ir},props:Jv(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=Fn(),i=ft("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=Ce(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=Vv(u),m=a.ref(""),y=a.ref(null),C=a.ref(null),b=a.ref(null),v=a.ref(null),T=a.ref(null),N=a.ref(null),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>x.selectedTagList.length===0&&m.value===""&&!s.isEdit),k=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&x.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),_=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),x=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>x.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:E,saveKeyMap:P}=Rv(e),O=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Te)=>{be.__index__=Te,ce[be.group.groupId]||(ce[be.group.groupId]={id:be.group.groupId,name:be.group.groupName,children:[]}),ce[be.group.groupId].children.push(be)}),Object.keys(ce).map(be=>ce[be])}return f.curPageList});a.watch([()=>E.value],()=>{a.nextTick(()=>{ge()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;me(D.value,ce)||(a.nextTick(()=>{ge()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,ot.debounce(()=>{const ce=f.curPageList.length!==0,{value:be}=m;be!==""&&ce||be===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{ge()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=v.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Te}=T.value;if(ce+be>=Te){const Je=f.curPage+1;Je<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Je)},500))}},G=()=>{var be;return Array.from(((be=b.value)==null?void 0:be.childNodes)||[]).filter(Te=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Te.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:be}=ce.target;(be.indexOf(`${c("tag-input-trigger")}`)>-1||be.indexOf("tag-list")>-1)&&b.value.appendChild(v.value)}clearTimeout(N.value),w.value&&D.value.length&&(x.tagListCache=[...D.value],x.selectedTagListCache=[...x.selectedTagList],m.value=x.selectedTagListCache[0][e.saveKey],De(x.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var be;(be=y.value)==null||be.focus(),e.trigger==="focus"&&x.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},ge=()=>{const{saveKey:ce,modelValue:be,displayKey:Te,allowCreate:Je,trigger:rt,isAsyncList:it}=e;if(x.selectedTagList=[],x.localList=E.value,be.length){const ut={};x.selectedTagList=be.map(Be=>{const Ee=P.value[Be];return ut[Be]=1,!Ee&&Je?{[ce]:Be,[Te]:Be}:Ee}).filter(Be=>Be),w.value||(x.localList=x.localList.filter(Be=>!ut[Be[ce]]))}if(it&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}rt==="focus"&&ue()},ue=(ce="")=>{const{searchKey:be,filterCallback:Te}=e,Je=ce.toLowerCase().trim();if(Je===""){d(x.localList);return}let rt=[];typeof Te=="function"?rt=Te(Je,be,x.localList)||[]:Array.isArray(be)?rt=x.localList.filter(it=>be.some(ut=>it[ut].toLowerCase().indexOf(Je)>-1)):rt=x.localList.filter(it=>it[be].toLowerCase().indexOf(Je)>-1),d(rt)},ae=(ce,be)=>{const Te={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Te[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Te[`${c("selector-actived")}`]=be===s.focusItemIndex,Te};function me(ce,be){return ce.length!==be.length?!1:be.every((Te,Je)=>ce[Je]===Te)}const B=()=>{x.tagListCache=[],x.selectedTagListCache=[],x.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const be=G().findIndex(({id:Te})=>Te==="tagInputItem");return be>=0?be:0},V=(ce,be,Te=!1)=>{if(!be||!ce)return;let Je=be;Te&&(Je=be.nextElementSibling||null),be.parentNode.insertBefore(ce,Je)},Y=ce=>{const{maxData:be,trigger:Te,allowCreate:Je}=e;if(be===-1||be>D.value.length){const{value:rt}=ce!=null&&ce.target?ce.target:m,it=_3(rt);it?(ue(rt),y.value.style.width=`${it*Dr}px`):Te==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Je?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=C.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Te]=x.tagListCache;ce&&ce===Te&&x.selectedTagListCache.length?Le(x.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Te=f.curPageList.find(Je=>Array.isArray(e.searchKey)?e.searchKey.map(it=>Je[it]).includes(ce):Je[e.searchKey]===ce);Te?te(Te,"select"):e.allowCreate&&te(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},te=(ce,be,Te)=>{Te==null||Te.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Le(ce,be),W("select"),Z(),o.isShow=!1)},oe=(ce,be,Te)=>{Te==null||Te.stopPropagation(),De(ce,be),Z(),W("remove",ce),y.value.style.width=`${Dr}px`},W=(ce,be)=>{t(ce,be),t("update:modelValue",D.value),t("change",D.value)},Q=ce=>{ce.stopPropagation();const be=x.selectedTagList;x.selectedTagList=[];const Te=be.filter(Je=>P.value[Je[e.saveKey]]);(e.allowCreate&&Te.length!==0||!e.allowCreate)&&!w.value&&x.localList.push(...Te),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const be=T.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Te={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Te.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Te.yAxis));const Je=Te.yAxis+Te.height-ce.yAxis;Je>ce.height&&(T.value.scrollTop=T.value.scrollTop+Je-ce.height)})},ee=(ce,be)=>{const Te=G();V(v.value,Te[ce-1]),x.selectedTagList.splice(ce-1,1),ie();const Je=P.value[be[e.saveKey]];(e.allowCreate&&Je||!e.allowCreate)&&!w.value&&x.localList.push(be),y.value=`${Dr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let be;const Te=ce.target.value,Je=_3(Te),rt=H(),it=G();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),$();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),$();break;case"ArrowLeft":if(s.isEdit=!0,!Je){if(rt<1)return;V(v.value,it[rt-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Je){if(rt===it.length-1)return;V(it[rt+1],v.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?te(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&te(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":rt!==0&&!m.value&&(be=x.selectedTagList[rt-1],ee(rt,be));break}},K=ce=>{const be=[],Te=ce.split(";"),Je=/^[a-zA-Z][a-zA-Z_]*/g;return Te.forEach(rt=>{const it=rt.match(Je);if(it){const ut=it.join("");be.push({[e.saveKey]:ut,[e.displayKey]:ut})}}),be},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:be,saveKey:Te,displayKey:Je,pasteFn:rt,allowCreate:it}=e,ut=ce.clipboardData.getData("text");let Ee=(rt?rt(ut):K(ut)).map(Fe=>Fe[Te]);if(Ee.length){const Fe=G(),lt=H(),et=x.localList.map(Ue=>Ue[Te]);if(Ee=Ee.filter(Ue=>{const Wt=(Ue==null?void 0:Ue.trim())&&!D.value.includes(Ue);return it?Wt:Wt&&et.includes(Ue)}),be!==-1){const Ue=x.selectedTagList.length;if(Ue<be){const Wt=be-Ue;Ee.length>Wt&&(Ee=[...Ee.slice(0,Wt)])}else Ee=[]}const pt=it?Ee.map(Ue=>x.localList.find(oa=>oa[Te]===Ue)??{[Te]:Ue,[Je]:Ue}):x.localList.filter(Ue=>Ee.includes(Ue[Te]));Ee.length&&(x.selectedTagList.splice(lt,0,...pt),V(v.value,Fe[lt]),y.value.style.width=`${Dr}px`,x.localList=x.localList.filter(Ue=>!Ee.includes(Ue[Te])),W("select"),ie())}},ve=ce=>{e.disabled||(V(v.value,ce.currentTarget,!0),y.value.style.width=`${Dr}px`,o.isShow&&R())},Le=(ce,be)=>{if(x.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Te,saveKey:Je,displayKey:rt,createTagValidator:it}=e,ut=H();let Be=1,Ee=!1,Fe;const lt=et=>typeof it=="function"?it(et):!0;if(be==="custom")if(Te){let et=ce.split(Te);et=et.filter(Ue=>(Ue==null?void 0:Ue.trim())&&!D.value.includes(Ue)&<(Ue));const pt=et.map(Ue=>P.value[Ue]||{[Je]:Ue,[rt]:Ue});et.length&&(x.selectedTagList.splice(ut,0,...pt),Be=pt.length,Ee=!0)}else{const et=typeof ce=="object";if(Fe=et?ce[Je]:ce.trim(),Fe=Fe.replace(/\s+/g,""),Fe!==void 0&&!D.value.includes(Fe)&<(Fe)){const pt=P.value[Fe]||(et?ce:{[Je]:Fe,[rt]:Fe});x.selectedTagList.splice(ut,0,pt),Ee=!0}}else ce&&(Fe=ce[Je],Fe!==void 0&&!D.value.includes(Fe)&&(x.selectedTagList.splice(ut,0,ce),Ee=!0));Ee&&a.nextTick(()=>{for(let et=1;et<=Be;et++){const Ue=G()[ut+et];V(Ue,v.value)}if(y.value.style.width=`${Dr}px`,!w.value){e.allowNextFocus&&ie();const et=D.value.reduce((pt,Ue)=>(pt[Ue]=1,pt),{});x.localList=x.localList.filter(pt=>!et[pt[Je]])}})},De=(ce,be)=>{x.selectedTagList.splice(be,1);const Te=P.value[ce[e.saveKey]];(e.allowCreate&&Te||!e.allowCreate)&&!w.value&&x.localList.push(ce)},Re=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Ve}=W3(C,Re,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(x),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:k,curInputValue:m,renderList:O,showTagClose:S,tagInputRef:y,bkTagSelectorRef:C,tagListRef:b,tagInputItemRef:v,selectorListRef:T,triggerClass:_,overflowTagIndex:Ve,localCollapseTags:Re,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:te,handleTagRemove:oe,handleClear:Q,tagFocus:ve,handleKeydown:fe,handlePaste:de,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Gt,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(Qv,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(sn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(H3,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(H3,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode($i,{theme:"primary",size:Ta.Small},null)]):null])])})])}}),B3=Ye(_v),Wv={direction:S0(),align:ou().def(Co.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:x0()},F3=Ye(a.defineComponent({name:"Divider",props:Wv,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=Ce();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}));var Il=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Il||{}),Ds=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Ds||{});const $3=ze("position",{}).def("top");var G3=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(G3||{});const Z3=ze("sortType",{}).def("replace"),Hv={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},Bv={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:su(),panel:p.string||p.func},Fv={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),tabPosition:$3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:Z3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},$v={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:$3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:Z3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...Hv},Y3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ir},props:$v,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Ds.LEFT,Ds.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:y}=t.value,C={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${y}px`,background:e.activeBarColor};return e.tabPosition===Ds.LEFT?C.right=0:C.left=0,C}if(e.type===Il.UNBORDER_CARD){const{clientWidth:m,offsetLeft:y}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${y}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((y,C)=>{if(!y.props)return null;const{name:b,label:v,closable:T,visible:N,disabled:S,sortable:w,tips:I}=y.props;if(!N)return!1;e.active===b&&(m=!0);const k=L=>y.slots.label?a.h(y.slots.label):[void 0,""].includes(L)?`选项卡${C+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:b,closable:T,visible:N,disabled:S,sortable:w,tips:I,tabLabel:k(v)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=Ce();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((v,T)=>{if(!v)return null;const{name:N,disabled:S,tabLabel:w}=v,I=()=>{const L=[this.resolveClassName("tab-header-item")];return S&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},k=(L,_)=>!S&&(L||_);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&this.handleTabChange(N),draggable:k(v.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),k(v.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,v)},[a.createVNode(rn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:v.tips,disabled:!v.tips}]])}),m=()=>{var T,N;const v=[];return typeof this.$slots.add=="function"?v.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&v.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(ys,{style:"display:flex;",width:26,height:26},null)])),v.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[v.map((S,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[S]))]):null},y=()=>this.type===Il.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",C=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,b=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),b||C?"tab-header-auto":""]},[y(),h()]),b,C])}}),U3=Ft(a.defineComponent({name:"Tab",components:{TabNav:Y3},props:Fv,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:y}=h;return(y||[]).forEach(C=>{let{type:b}=C;b=b.name||b,b==="TabPanel"&&C.component?m.push(C.component):(b===a.Fragment||b==="template")&&c(C,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],y=c(m);y.length!==s.value.length&&(s.value=y)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,y){const C=s.value;if(y===G3.INSERT)if(h<m)C.splice(m+1,0,s[h]),C.splice(h,1);else if(h>m)C.splice(m,0,s[h]),C.splice(h+1,1);else return!1;else{const b=C[m];C[m]=C[h],C[h]=b}s.value=[...C],n("sort",h,m,y),n("sort-change",h,m,y)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=Ce();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Ds.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Il.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:S,tabAdd:w,tabChange:I,tabRemove:k,tabSort:L,tabDrag:_}=this,x={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:S,tabAdd:w,tabChange:I,tabRemove:k,tabSort:L,tabDrag:_};return!s||!Array.isArray(s)?null:a.createVNode(Y3,x,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),{TabPanel:a.defineComponent({name:"TabPanel",props:Bv,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=Ce();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}})}),ea={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let K3=1;const X3=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;ea[i].forEach(y=>{c+=(y.el.offsetHeight||0)+u}),K3+=1;const f=`message_${K3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=y=>{Gv(y,i,u,s),a.render(null,d)},a.render(h,d),ea[i].push(h);let m;h.props.getContainer&&Ca(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function Gv(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ea[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ea[t][o].el.offsetHeight,f=ea[t].length;for(let d=o;d<f;d++){const h=parseInt(ea[t][d].el.style[s],10)-u-n;ea[t][d].component.props.offsetY=h}ea[t].splice(o,1)}var q3={exports:{}};/*!
|
67
67
|
* clipboard.js v2.0.11
|
68
68
|
* https://clipboardjs.com/
|
69
69
|
*
|