UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

2 lines (1 loc) 34.2 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),pt=require("../spin/index.cjs"),oe=require("../empty/index.cjs"),Ge=require("../scrollbar/index.cjs"),ne=require("../checkbox/index.cjs"),Xe=require("../radio/index.cjs"),je=require("../tooltip/index.cjs"),T=require("../ellipsis/index.cjs"),vt=require("../pagination/index.cjs"),Je=require("../utils/index.cjs"),ht={key:0,class:"table-header"},yt={key:1,class:"table-content-container"},kt=["rowspan"],gt=["rowspan"],mt={key:1,class:"table-selection"},St=["rowspan","colspan","colstart","colend","onMouseenter","onMouseleave","onClick"],bt={class:"table-cell-sorter"},Ct={class:"table-cell-title"},wt={key:0},Bt=["colspan"],xt=["data-row-key","onMouseenter","onClick"],Et=["onClick"],Nt={class:"table-selection"},Vt={key:0},Pt=["colspan"],Rt={key:2,class:"table-content-container"},zt=["rowspan"],$t=["rowspan"],Tt={key:1,class:"table-selection"},Ft=["rowspan","colspan","colstart","colend","onMouseenter","onMouseleave","onClick"],Dt={class:"table-cell-sorter"},_t={class:"table-cell-title"},Lt={key:0},Mt=["colspan"],Wt=["data-row-key","onMouseenter","onClick"],Kt=["onClick"],At={class:"table-selection"},Ht={key:0},Ot=["colspan"],qt={key:3,class:"table-footer"},Ut=e.defineComponent({__name:"Table",props:{header:{default:void 0},footer:{default:void 0},columns:{default:()=>[]},dataSource:{default:()=>[]},bordered:{type:Boolean,default:!1},rowClassName:{type:[String,Function],default:void 0},size:{default:"large"},striped:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},spinProps:{default:()=>({})},emptyProps:{default:()=>({})},ellipsisProps:{default:()=>({})},showSorterTooltip:{type:Boolean,default:!0},sortDirections:{default:()=>["ascend","descend"]},sortTooltipProps:{default:()=>({})},sticky:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!0},pagination:{default:()=>({})},rowKey:{type:[String,Function],default:"key"},rowSelection:{default:void 0},scroll:{default:void 0},scrollbarProps:{default:()=>({})},tableLayout:{default:void 0},showExpandColumn:{type:Boolean,default:!1},expandColumnTitle:{default:void 0},expandColumnWidth:{default:48},expandCell:{type:Function,default:void 0},expandedRowRender:{type:Function,default:void 0},expandFixed:{type:Boolean,default:!1},expandedRowKeys:{default:()=>[]},expandRowByClick:{type:Boolean,default:!1}},emits:["expand","expandedRowsChange","update:expandedRowKeys","sortChange","change"],setup(Qe,{emit:Ye}){const r=Qe,Se=e.ref(),V=e.ref(1),P=e.ref(10),B=e.ref(),re=e.ref([]),h=e.ref([]),d=e.ref([]),F=e.ref(!1),se=e.ref(!1),i=e.ref([]),p=e.ref([]),A=e.ref([]),y=e.ref([]),H=e.ref([]),O=e.ref(),x=e.ref(),R=e.ref(),C=e.ref(0),D=e.ref(0),ie=e.ref(0),E=e.ref(0),ue=e.ref(0),ce=e.ref(0),_=e.ref(),de=e.ref(),N=e.ref(),S=e.ref([]),q=e.ref(!1),be=e.ref(null),u=e.ref(null),w=e.ref(null),f=e.ref(null),U=e.ref(null),fe=e.ref(!1),Ce=Je.useSlotsExist(["header","footer"]),L=Ye,G=e.computed(()=>typeof r.rowKey=="function"?r.rowKey:(t,o)=>{const a=t&&t[r.rowKey];return a===void 0?o:a}),b=e.computed(()=>r.rowSelection!==void 0),we=e.computed(()=>r.rowSelection?.columnTitle),Be=e.computed(()=>!r.rowSelection?.hideSelectAll&&r.rowSelection?.type!=="radio"),pe=e.computed(()=>r.scroll?.x!==void 0),M=e.computed(()=>pe.value&&D.value>E.value),W=e.computed(()=>r.scroll?.y!==void 0),xe=e.computed(()=>W.value&&ie.value>ue.value),Ze=e.computed(()=>C.value>0),Ie=e.computed(()=>D.value-E.value>Math.round(C.value)),et=e.computed(()=>{const t=r.columns.some(o=>o.fixed==="left");return v.value||k.value||t}),tt=e.computed(()=>r.columns.some(o=>o.fixed==="right")),Ee=e.computed(()=>Ce.header||r.header),lt=e.computed(()=>{if(r.tableLayout===void 0){const t=r.columns.some(a=>a.ellipsis),o=r.columns.some(a=>a.fixed);return t||o||v.value||k.value||W.value?"fixed":"auto"}return r.tableLayout}),ve=e.computed(()=>{const t={minWidth:"100%"},o=r.scroll;return pe.value&&(typeof o?.x=="boolean"?t.width="auto":t.width=typeof o?.x=="number"?`${o.x}px`:o?.x),t.tableLayout=lt.value,t}),Ne=e.computed(()=>({width:`${E.value}px`,position:"sticky",left:"0px",overflow:"hidden"})),he=e.computed(()=>({width:typeof r.expandColumnWidth=="number"?`${r.expandColumnWidth}px`:r.expandColumnWidth})),ye=e.computed(()=>{const t={width:"32px"};return r.rowSelection?.columnWidth!==void 0&&(typeof r.rowSelection.columnWidth=="number"?t.width=`${r.rowSelection.columnWidth}px`:t.width=r.rowSelection.columnWidth),t}),X=e.computed(()=>r.columns.filter(t=>t.colSpan!==0)),ke=e.computed(()=>ut(r.columns)),j=e.computed(()=>ke.value[0][0].fixed==="left"),k=e.computed(()=>!!(r.rowSelection!==void 0&&(r.rowSelection.fixed||j.value))),J=e.computed(()=>k.value&&!j.value),v=e.computed(()=>r.showExpandColumn&&(r.expandFixed||k.value||!b.value&&j.value)),Q=e.computed(()=>v.value&&b.value&&!k.value||v.value&&!b.value&&!j.value),Ve=e.computed(()=>({width:`${E.value+(r.bordered?1:0)}px`,position:"sticky",left:"0px",overflow:"hidden"})),at=e.computed(()=>({position:"relative",left:`${-C.value}px`})),ot=e.computed(()=>{const t={};if(W.value){const o=r.scroll;t.maxHeight=typeof o?.y=="number"?`${o.y}px`:o?.y}return t}),nt=e.computed(()=>Ce.footer||r.footer),Pe=e.computed(()=>{let t=r.dataSource.length;return r.showPagination&&"total"in r.pagination&&(t=r.pagination.total),t}),Re=e.computed(()=>r.showPagination&&Pe.value===r.dataSource.length);e.watch(()=>[r.dataSource,Re.value,V.value,P.value,u.value,w.value,f.value],()=>{if(Re.value){let t;u.value===null?t=[...r.dataSource]:(t=[...r.dataSource].sort(w.value),f.value==="descend"&&t.reverse()),h.value=t.slice((V.value-1)*P.value,V.value*P.value)}else{let t;u.value===null?t=[...r.dataSource]:(t=[...r.dataSource].sort(w.value),f.value==="descend"&&t.reverse()),h.value=t}},{immediate:!0,deep:!0}),e.watch(h,t=>{i.value=new Array(t.length).fill(!1);const o=t.length;for(let a=0;a<o;a++){const n=t[a];if(p.value.includes(n.key)&&(r.rowSelection?.type===void 0||r.rowSelection?.type==="checkbox"||r.rowSelection?.type==="radio"&&!i.value.includes(!0))){i.value[a]=!0;continue}i.value[a]=!1}fe.value&&(fe.value=!1,L("sortChange",be.value,t))}),e.watch(()=>[r.rowSelection?.selectedRowKeys,r.rowSelection?.type],()=>{p.value=[],y.value=[],h.value.forEach((t,o)=>{r.rowSelection?.type==="radio"?r.rowSelection?.selectedRowKeys&&r.rowSelection.selectedRowKeys[0]===t.key?(i.value[o]=!0,p.value.push(t.key),y.value.push(t)):i.value[o]=!1:r.rowSelection?.selectedRowKeys&&r.rowSelection.selectedRowKeys.includes(t.key)?(i.value[o]=!0,p.value.push(t.key),y.value.push(t)):i.value[o]=!1})},{immediate:!0,deep:!0}),e.watch(i,t=>{if(r.rowSelection?.type===void 0||r.rowSelection?.type==="checkbox"){const o=t.filter(n=>n);let a=0;h.value.forEach((n,l)=>{const s=r.rowSelection?.getSelectionProps&&r.rowSelection.getSelectionProps(n,l);s&&"disabled"in s&&s.disabled||a++}),se.value=0<o.length&&o.length<a,F.value=o.length===a}},{immediate:!0,deep:!0}),e.watchEffect(()=>{q.value||rt()}),e.watchEffect(()=>{r.showPagination&&("page"in r.pagination&&(V.value=r.pagination.page),"pageSize"in r.pagination&&(P.value=r.pagination.pageSize))}),e.watchEffect(()=>{d.value=r.expandedRowKeys}),e.onMounted(()=>{$e(),st(),it()}),Je.useResizeObserver(Se,()=>{$e()});function ze(t){A.value=[],H.value=[],h.value.forEach((o,a)=>{const n=r.rowSelection?.getSelectionProps&&r.rowSelection.getSelectionProps(o,a);n&&"disabled"in n&&n.disabled||(t?i.value[a]||(i.value[a]=!0,p.value.push(o.key),y.value.push(o),A.value.push(o.key),H.value.push(o)):(p.value=[],y.value=[],i.value[a]&&(i.value[a]=!1,A.value.push(o.key),H.value.push(o))))}),r.rowSelection?.onSelectAll&&r.rowSelection.onSelectAll(t,y.value,H.value,p.value,A.value),r.rowSelection?.onChange&&r.rowSelection.onChange(p.value,y.value)}function Y(t,o,a,n){t?r.rowSelection?.type==="radio"?(i.value.forEach((l,s)=>{s!==o&&l&&(i.value[s]=!1)}),p.value=[a],y.value=[n]):(p.value.push(a),y.value.push(n)):(p.value=p.value.filter(l=>l!==a),y.value=y.value.filter(l=>l.key!==a)),r.rowSelection?.onSelect&&r.rowSelection.onSelect(n,t,y.value,p.value),r.rowSelection?.onChange&&r.rowSelection.onChange(p.value,y.value)}function rt(){const t=S.value.filter(a=>a.colSpan!==0),o=t.length;for(let a=0;a<o;a++){const n=t[a];if(n.defaultSortOrder!==void 0){u.value=n.dataIndex,w.value=n.sorter,f.value=n.defaultSortOrder;return}}}function $e(){if(R.value){const t=R.value.getScrollData();pe.value&&(D.value=t.scrollWidth,E.value=t.clientWidth,ce.value=D.value-E.value),W.value&&(ie.value=t.scrollHeight,ue.value=t.clientHeight)}}async function st(){await e.nextTick(),O.value&&O.value.forEach(t=>t.observeScroll())}async function it(){await e.nextTick(),x.value&&x.value.forEach(t=>t.observeScroll())}function ge(t,o){if(t&&t.length){const a=t.length;for(let n=0;n<a;n++){const l=t[n];if(l.fixed&&l.fixed===o)return!0;if(ge(l.children,o))return!0}}return!1}function Te(t){let o=0;return t.forEach(a=>{a.children&&a.children.length>0?o+=Te(a.children):o+=1}),o}function z(t,o=1){let a=o;return t.forEach(n=>{if(n.children&&n.children.length>0){const l=z(n.children,o+1);l>a&&(a=l)}}),a}function ut(t){S.value=[];const o=z(t),a=[];for(let l=0;l<o;l++)a.push([]);function n(l,s,m){l.forEach(c=>{c.children&&c.children.length>0?(c.colSpan=Te(c.children),c.colStart=m,c.colEnd=m+c.colSpan-1,m+=c.colSpan,n(c.children,s+1,c.colStart)):(c.rowSpan=o-s,c.colStart=m,c.colEnd=m,m+=1,S.value.push(c)),ge(c.children,"left")&&(c.fixed="left"),ge(c.children,"right")&&(c.fixed="right"),a[s].push(c)})}return n(t,0,r.showExpandColumn?1:0),a}function $(t,o){return S.value.filter(a=>{if(a.customCell){const n=a.customCell(t,o,a);if(n&&("colSpan"in n&&n.colSpan===0||"rowSpan"in n&&n.rowSpan===0))return!1}return!0})}function g(t,o){let a=r[o];return t?.[o]!==void 0&&(a=t[o]),a}function Fe(t){const o={ascend:"点击升序",descend:"点击降序"},a=g(t,"sortDirections");return!q.value&&u.value===t.dataIndex?a.length===2&&t.defaultSortOrder===a[0]?o[a[1]]:"取消排序":u.value===t.dataIndex?f.value==="ascend"?a.length===1?"取消排序":a[0]==="ascend"?"点击降序":"取消排序":a.length===1||a[0]==="ascend"?"取消排序":"点击升序":a.length>0?o[a[0]]:void 0}function De(t){fe.value=!0,be.value=t,q.value||(q.value=!0);const o=g(t,"sortDirections");u.value===t.dataIndex?f.value==="ascend"?o.length===1?(u.value=null,w.value=null,f.value=null):o[0]==="ascend"?f.value="descend":(u.value=null,w.value=null,f.value=null):o.length===1||o[0]==="ascend"?(u.value=null,w.value=null,f.value=null):f.value="ascend":(u.value=t.dataIndex,w.value=t.sorter,o.length>0&&(f.value=o[0])),Ue()}function _e(t){U.value=t}function Le(){U.value=null}function Z(t,o,a){return o.fixed==="left"&&a<t.length-1&&t[a+1].fixed!=="left"}function I(t,o,a){return o.fixed==="right"&&a>0&&t[a-1].fixed!=="right"}function me(t){const o={};return t.width!==void 0&&(o.width=typeof t.width=="number"?`${t.width}px`:t.width),o}function K(t,o){return"dataIndex"in t&&t.dataIndex?t.dataIndex:t.key!==void 0?t.key:o}function Me(t){return t.map(K).join("-")}function ee(t){const o={};return t&&(o.position="sticky",o.left="0px"),o}function te(t){const o={};return t&&(o.position="sticky",o.left=r.showExpandColumn?`${_.value&&_.value.offsetWidth}px`:"0px"),o}function le(t){const o={};if(t.fixed&&N.value&&N.value.length){if(o.position="sticky",t.fixed==="left"){const a=t.colStart;let n=0;r.showExpandColumn&&(n+=_.value.offsetWidth),b.value&&(n+=de.value.offsetWidth);for(let l=0;l<(r.showExpandColumn?a-1:a);l++)n+=N.value[l].offsetWidth;return o.left=`${n}px`,o}if(t.fixed==="right"){const a=t.colEnd;let n=0;for(let l=N.value.length-1;l>(r.showExpandColumn?a-1:a);l--)n+=N.value[l].offsetWidth;return o.right=`${n}px`,o}}return o}function ct(t,o){const a=[];return r.columns.forEach((n,l)=>{if(n.customCell){const s=n.customCell(t,o,n);s&&"rowSpan"in s&&s.rowSpan===0&&a.push(l)}}),a}function We(t,o,a){if(a>=0){const n=o.customCell?.(t,a,o);return n&&"rowSpan"in n&&n.rowSpan>0?a:We(t,o,a-1)}}function Ke(t,o){return typeof r.rowClassName=="function"?r.rowClassName(t,o):r.rowClassName}function Ae(t,o){B.value=o;const a=ct(t,o);a.length&&a.forEach(n=>{const l=r.columns[n];re.value.push({row:We(h.value[o-1],l,o-1),col:n})})}function He(){B.value=null,re.value=[]}function Oe(t,o){return re.value.some(a=>a.row===t&&a.col===o)}function ae(t){const o=t.key;d.value.includes(o)?d.value=d.value.filter(a=>a!==o):d.value.push(o),L("expand",d.value.includes(o),t),L("expandedRowsChange",d.value),L("update:expandedRowKeys",d.value)}function qe(t,o){["left","right"].includes(o)&&(C.value=t.target.scrollLeft,D.value=t.target.scrollWidth,E.value=t.target.clientWidth),["top","bottom"].includes(o)&&(ie.value=t.target.scrollHeight,ue.value=t.target.clientHeight)}function dt(t){if(t.deltaX){const o=t.deltaX*1;C.value+o>ce.value?C.value=ce.value:C.value+o<0?C.value=0:(t.stopPropagation(),t.preventDefault(),C.value+=o),R.value.scrollTo({left:C.value,behavior:"instant"})}}function Ue(){r.scroll?.initialScrollPositionOnChange&&R.value.scrollTo({top:0,left:0,behavior:"smooth"})}function ft(t,o){V.value=t,P.value=o,L("change",t,o),Ue()}return(t,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableRef",ref:Se,class:"table-wrap"},[e.createVNode(e.unref(pt.default),e.mergeProps({size:"small",spinning:t.loading},t.spinProps),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["table-container",{"table-shadow-left":Ze.value,"table-shadow-right":Ie.value,"table-has-fix-left":et.value,"table-has-fix-right":tt.value,"table-small":t.size==="small","table-middle":t.size==="middle","table-striped":t.striped,"table-bordered":t.bordered}])},[Ee.value?(e.openBlock(),e.createElementBlock("div",ht,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.header),1)],!0)])):e.createCommentVNode("",!0),!W.value&&!t.sticky?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(e.unref(Ge.default),e.mergeProps({ref_key:"scrollbarRef",ref:R,style:Ee.value?{}:{borderRadius:"8px 8px 0 0"},"x-scrollable":M.value,"y-scrollable":xe.value,"auto-hide":!1,onScroll:qe},t.scrollbarProps),{default:e.withCtx(()=>[e.createElementVNode("table",{style:e.normalizeStyle(ve.value)},[e.createElementVNode("colgroup",null,[t.showExpandColumn?(e.openBlock(),e.createElementBlock("col",{key:0,ref_key:"colExpandRef",ref:_,style:e.normalizeStyle(he.value)},null,4)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("col",{key:1,ref_key:"colSelectionRef",ref:de,style:e.normalizeStyle(ye.value)},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(a,n)=>(e.openBlock(),e.createElementBlock("col",{ref_for:!0,ref_key:"colRef",ref:N,style:e.normalizeStyle(me(a)),key:n},null,4))),128))]),e.createElementVNode("thead",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{key:Me(a)},[n===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showExpandColumn?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["table-th",{"table-cell-fix-left":v.value,"table-cell-fix-left-last":Q.value}]),style:e.normalizeStyle(ee(v.value)),rowspan:z(X.value),colstart:0,colend:0},[e.renderSlot(t.$slots,"expandColumnTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.expandColumnTitle),1)],!0)],14,kt)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["table-th table-th-selection",{"table-cell-fix-left":k.value,"table-cell-fix-left-last":J.value}]),style:e.normalizeStyle(te(k.value)),rowspan:z(X.value),colstart:0,colend:0},[we.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.isVNode(t.rowSelection?.columnTitle)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.rowSelection?.columnTitle),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.rowSelection?.columnTitle),1)],64))],64)):Be.value?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(ne.default),{indeterminate:se.value,checked:F.value,"onUpdate:checked":o[0]||(o[0]=l=>F.value=l),onChange:ze},null,8,["indeterminate","checked"])])):e.createCommentVNode("",!0)],14,gt)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K(l,s)},[l.colSpan!==0?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["table-th",[l.className,{"table-cell-has-sorter":l.sorter,"table-cell-sort":u.value===l.dataIndex,"table-cell-align-left":l.align==="left","table-cell-align-center":l.align==="center","table-cell-align-right":l.align==="right","table-cell-fix-left":l.fixed==="left","table-cell-fix-left-last":Z(a,l,s),"table-cell-fix-right":l.fixed==="right","table-cell-fix-right-first":I(a,l,s)}]]),style:e.normalizeStyle(le(l)),rowspan:l.rowSpan,colspan:l.colSpan,colstart:l.colStart,colend:l.colEnd,onMouseenter:m=>l.sorter?_e(l.dataIndex):()=>!1,onMouseleave:m=>l.sorter?Le():()=>!1,onClick:m=>l.sorter?De(l):()=>!1},[l.sorter?(e.openBlock(),e.createBlock(e.unref(je.default),e.mergeProps({key:0,ref_for:!0,ref_key:"tooltipRef",ref:O,style:{width:"100%"},"show-control":"",show:U.value===l.dataIndex,"content-style":{width:"100%"},tooltip:g(l,"showSorterTooltip")?Fe(l):void 0,"tooltip-style":{fontWeight:"normal"}},{ref_for:!0},g(l,"sortTooltipProps")),{default:e.withCtx(()=>[e.createElementVNode("div",bt,[e.createElementVNode("span",Ct,[l.ellipsis?e.renderSlot(t.$slots,"headerCell",{key:0,column:l,title:l.title},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"headerCell",{key:1,column:l,title:l.title},()=>[e.createTextVNode(e.toDisplayString(l.title),1)],!0)]),e.createElementVNode("span",{class:e.normalizeClass(["table-cell-arrow",{"ascend-arrow":u.value===l.dataIndex&&f.value==="ascend","descend-arrow":u.value===l.dataIndex&&f.value==="descend"}])},[...o[3]||(o[3]=[e.createElementVNode("svg",{width:"1.25em",height:"1.25em",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 16 16"},[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M8 14a.75.75 0 0 1-.75-.75V4.463L4.309 7.75a.75.75 0 0 1-1.118-1L7.441 2A.75.75 0 0 1 8.56 2l4.25 4.75a.75.75 0 1 1-1.118 1L8.75 4.463v8.787A.75.75 0 0 1 8 14z",fill:"currentColor"})])],-1)])],2)])]),_:2},1040,["show","tooltip"])):l.ellipsis?e.renderSlot(t.$slots,"headerCell",{key:1,column:l,title:l.title},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"headerCell",{key:2,column:l,title:l.title},()=>[e.createTextVNode(e.toDisplayString(l.title),1)],!0)],46,St)):e.createCommentVNode("",!0)],64))),128))]))),128))]),e.createElementVNode("tbody",null,[h.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",wt,[e.createElementVNode("td",{class:"table-empty",colspan:S.value.length},[M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-empty-fixed",style:e.normalizeStyle(Ne.value)},[e.createVNode(e.unref(oe.default),e.mergeProps({class:"empty",image:"outlined"},t.emptyProps),null,16)],4)):(e.openBlock(),e.createBlock(e.unref(oe.default),e.mergeProps({key:1,class:"empty",image:"outlined"},t.emptyProps),null,16))],8,Bt)])),h.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:G.value(a,n)},[e.createElementVNode("tr",{"data-row-key":G.value(a,n),class:e.normalizeClass(Ke(a,n)),onMouseenter:l=>Ae(a,n),onMouseleave:He,onClick:l=>t.expandRowByClick?ae(a):()=>!1},[t.showExpandColumn?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["table-td table-td-expand",{"table-cell-fix-left":v.value,"table-cell-fix-left-last":Q.value,"table-td-hover":B.value===n}]),style:e.normalizeStyle(ee(v.value)),onClick:e.withModifiers(l=>ae(a),["stop"])},[e.renderSlot(t.$slots,"expandCell",{record:a,index:n,expanded:d.value.includes(a.key)},()=>[e.createElementVNode("button",{class:e.normalizeClass(["expand-btn",{"expand-btn-collapsed":!d.value.includes(a.key)}])},null,2)],!0)],14,Et)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["table-td table-td-selection",{"table-cell-fix-left":k.value,"table-cell-fix-left-last":J.value,"table-td-hover":B.value===n}]),style:e.normalizeStyle(te(k.value))},[e.createElementVNode("div",Nt,[t.rowSelection?.type==="radio"?(e.openBlock(),e.createBlock(e.unref(Xe.default),e.mergeProps({key:0,checked:i.value[n],"onUpdate:checked":l=>i.value[n]=l,onChange:l=>Y(l,n,a.key,a)},{ref_for:!0},t.rowSelection?.getSelectionProps&&t.rowSelection.getSelectionProps(a,n)),null,16,["checked","onUpdate:checked","onChange"])):(e.openBlock(),e.createBlock(e.unref(ne.default),e.mergeProps({key:1,checked:i.value[n],"onUpdate:checked":l=>i.value[n]=l,onChange:l=>Y(l,n,a.key,a)},{ref_for:!0},t.rowSelection?.getSelectionProps&&t.rowSelection.getSelectionProps(a,n)),null,16,["checked","onUpdate:checked","onChange"]))])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($(a,n),(l,s)=>(e.openBlock(),e.createElementBlock("td",e.mergeProps({class:["table-td",[l.className,{"table-cell-sort":u.value===l.dataIndex,"table-cell-align-left":l.align==="left","table-cell-align-center":l.align==="center","table-cell-align-right":l.align==="right","table-cell-fix-left":l.fixed==="left","table-cell-fix-left-last":Z($(a,n),l,s),"table-cell-fix-right":l.fixed==="right","table-cell-fix-right-first":I($(a,n),l,s),"table-td-hover":B.value===n||Oe(n,s)}]],style:le(l),key:K(l,s)},{ref_for:!0},l.customCell&&l.customCell(a,n,l)),[l.ellipsis?e.renderSlot(t.$slots,"bodyCell",{key:0,column:l,record:a,text:a[l.dataIndex],index:n},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a[l.dataIndex]),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"bodyCell",{key:1,column:l,record:a,text:a[l.dataIndex],index:n},()=>[e.createTextVNode(e.toDisplayString(a[l.dataIndex]),1)],!0)],16))),128))],42,xt),t.showExpandColumn?e.withDirectives((e.openBlock(),e.createElementBlock("tr",Vt,[e.createElementVNode("td",{class:"table-td table-td-expand-row",colspan:S.value.length+1},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-expand-row-fixed",style:e.normalizeStyle(Ve.value)},[e.renderSlot(t.$slots,"expandedRowRender",{record:a,index:n,expanded:d.value.includes(a.key)},void 0,!0)],4)):e.renderSlot(t.$slots,"expandedRowRender",{key:1,record:a,index:n,expanded:d.value.includes(a.key)},void 0,!0)],8,Pt)],512)),[[e.vShow,d.value.includes(a.key)]]):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)])],4)]),_:3},16,["style","x-scrollable","y-scrollable"])])):(e.openBlock(),e.createElementBlock("div",Rt,[e.createElementVNode("div",{class:e.normalizeClass(["table-head",{"table-head-sticky":t.sticky}])},[e.createElementVNode("table",{style:e.normalizeStyle([ve.value,at.value]),onWheel:o[2]||(o[2]=a=>M.value?dt(a):()=>!1)},[e.createElementVNode("colgroup",null,[t.showExpandColumn?(e.openBlock(),e.createElementBlock("col",{key:0,ref_key:"colExpandRef",ref:_,style:e.normalizeStyle(he.value)},null,4)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("col",{key:1,ref_key:"colSelectionRef",ref:de,style:e.normalizeStyle(ye.value)},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(a,n)=>(e.openBlock(),e.createElementBlock("col",{ref_for:!0,ref_key:"colRef",ref:N,style:e.normalizeStyle(me(a)),key:n},null,4))),128))]),e.createElementVNode("thead",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{key:Me(a)},[n===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showExpandColumn?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["table-th",{"table-cell-fix-left":v.value,"table-cell-fix-left-last":Q.value}]),style:e.normalizeStyle(ee(v.value)),rowspan:z(X.value),colstart:0,colend:0},[e.renderSlot(t.$slots,"expandColumnTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.expandColumnTitle),1)],!0)],14,zt)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["table-th table-th-selection",{"table-cell-fix-left":k.value,"table-cell-fix-left-last":J.value}]),style:e.normalizeStyle(te(k.value)),rowspan:z(X.value),colstart:0,colend:0},[we.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.isVNode(t.rowSelection?.columnTitle)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.rowSelection?.columnTitle),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.rowSelection?.columnTitle),1)],64))],64)):Be.value?(e.openBlock(),e.createElementBlock("div",Tt,[e.createVNode(e.unref(ne.default),{indeterminate:se.value,checked:F.value,"onUpdate:checked":o[1]||(o[1]=l=>F.value=l),onChange:ze},null,8,["indeterminate","checked"])])):e.createCommentVNode("",!0)],14,$t)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K(l,s)},[l.colSpan!==0?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["table-th",[l.className,{"table-cell-has-sorter":l.sorter,"table-cell-sort":u.value===l.dataIndex,"table-cell-align-left":l.align==="left","table-cell-align-center":l.align==="center","table-cell-align-right":l.align==="right","table-cell-fix-left":l.fixed==="left","table-cell-fix-left-last":Z(a,l,s),"table-cell-fix-right":l.fixed==="right","table-cell-fix-right-first":I(a,l,s)}]]),style:e.normalizeStyle(le(l)),rowspan:l.rowSpan,colspan:l.colSpan,colstart:l.colStart,colend:l.colEnd,onMouseenter:m=>l.sorter?_e(l.dataIndex):()=>!1,onMouseleave:m=>l.sorter?Le():()=>!1,onClick:m=>l.sorter?De(l):()=>!1},[l.sorter?(e.openBlock(),e.createBlock(e.unref(je.default),e.mergeProps({key:0,ref_for:!0,ref_key:"tooltipRef",ref:O,style:{width:"100%"},"show-control":"",show:U.value===l.dataIndex,"content-style":{width:"100%"},tooltip:g(l,"showSorterTooltip")?Fe(l):void 0,"tooltip-style":{fontWeight:"normal"}},{ref_for:!0},g(l,"sortTooltipProps")),{default:e.withCtx(()=>[e.createElementVNode("div",Dt,[e.createElementVNode("span",_t,[l.ellipsis?e.renderSlot(t.$slots,"headerCell",{key:0,column:l,title:l.title},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"headerCell",{key:1,column:l,title:l.title},()=>[e.createTextVNode(e.toDisplayString(l.title),1)],!0)]),e.createElementVNode("span",{class:e.normalizeClass(["table-cell-arrow",{"ascend-arrow":u.value===l.dataIndex&&f.value==="ascend","descend-arrow":u.value===l.dataIndex&&f.value==="descend"}])},[...o[4]||(o[4]=[e.createElementVNode("svg",{width:"1.25em",height:"1.25em",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 16 16"},[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{d:"M8 14a.75.75 0 0 1-.75-.75V4.463L4.309 7.75a.75.75 0 0 1-1.118-1L7.441 2A.75.75 0 0 1 8.56 2l4.25 4.75a.75.75 0 1 1-1.118 1L8.75 4.463v8.787A.75.75 0 0 1 8 14z",fill:"currentColor"})])],-1)])],2)])]),_:2},1040,["show","tooltip"])):l.ellipsis?e.renderSlot(t.$slots,"headerCell",{key:1,column:l,title:l.title},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"headerCell",{key:2,column:l,title:l.title},()=>[e.createTextVNode(e.toDisplayString(l.title),1)],!0)],46,Ft)):e.createCommentVNode("",!0)],64))),128))]))),128))])],36)],2),e.createVNode(e.unref(Ge.default),e.mergeProps({ref_key:"scrollbarRef",ref:R,class:["table-body",{"table-x-scrollbar-sticky":t.sticky}],"x-scrollable":M.value,"y-scrollable":xe.value,"auto-hide":!1,style:ot.value,onScroll:qe},t.scrollbarProps),{default:e.withCtx(()=>[e.createElementVNode("table",{style:e.normalizeStyle(ve.value)},[e.createElementVNode("colgroup",null,[t.showExpandColumn?(e.openBlock(),e.createElementBlock("col",{key:0,style:e.normalizeStyle(he.value)},null,4)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("col",{key:1,style:e.normalizeStyle(ye.value)},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(a,n)=>(e.openBlock(),e.createElementBlock("col",{style:e.normalizeStyle(me(a)),key:n},null,4))),128))]),e.createElementVNode("tbody",null,[h.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",Lt,[e.createElementVNode("td",{class:"table-empty",colspan:S.value.length},[M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-empty-fixed",style:e.normalizeStyle(Ne.value)},[e.createVNode(e.unref(oe.default),e.mergeProps({class:"empty",image:"outlined"},t.emptyProps),null,16)],4)):(e.openBlock(),e.createBlock(e.unref(oe.default),e.mergeProps({key:1,class:"empty",image:"outlined"},t.emptyProps),null,16))],8,Mt)])),h.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:G.value(a,n)},[e.createElementVNode("tr",{"data-row-key":G.value(a,n),class:e.normalizeClass(Ke(a,n)),onMouseenter:l=>Ae(a,n),onMouseleave:He,onClick:l=>t.expandRowByClick?ae(a):()=>!1},[t.showExpandColumn?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["table-td table-td-expand",{"table-cell-fix-left":v.value,"table-cell-fix-left-last":Q.value,"table-td-hover":B.value===n}]),style:e.normalizeStyle(ee(v.value)),onClick:e.withModifiers(l=>ae(a),["stop"])},[e.renderSlot(t.$slots,"expandCell",{record:a,index:n,expanded:d.value.includes(a.key)},()=>[e.createElementVNode("button",{class:e.normalizeClass(["expand-btn",{"expand-btn-collapsed":!d.value.includes(a.key)}])},null,2)],!0)],14,Kt)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["table-td table-td-selection",{"table-cell-fix-left":k.value,"table-cell-fix-left-last":J.value,"table-td-hover":B.value===n}]),style:e.normalizeStyle(te(k.value))},[e.createElementVNode("div",At,[t.rowSelection?.type==="radio"?(e.openBlock(),e.createBlock(e.unref(Xe.default),e.mergeProps({key:0,checked:i.value[n],"onUpdate:checked":l=>i.value[n]=l,onChange:l=>Y(l,n,a.key,a)},{ref_for:!0},t.rowSelection?.getSelectionProps&&t.rowSelection.getSelectionProps(a,n)),null,16,["checked","onUpdate:checked","onChange"])):(e.openBlock(),e.createBlock(e.unref(ne.default),e.mergeProps({key:1,checked:i.value[n],"onUpdate:checked":l=>i.value[n]=l,onChange:l=>Y(l,n,a.key,a)},{ref_for:!0},t.rowSelection?.getSelectionProps&&t.rowSelection.getSelectionProps(a,n)),null,16,["checked","onUpdate:checked","onChange"]))])],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($(a,n),(l,s)=>(e.openBlock(),e.createElementBlock("td",e.mergeProps({class:["table-td",[l.className,{"table-cell-sort":u.value===l.dataIndex,"table-cell-align-left":l.align==="left","table-cell-align-center":l.align==="center","table-cell-align-right":l.align==="right","table-cell-fix-left":l.fixed==="left","table-cell-fix-left-last":Z($(a,n),l,s),"table-cell-fix-right":l.fixed==="right","table-cell-fix-right-first":I($(a,n),l,s),"table-td-hover":B.value===n||Oe(n,s)}]],style:le(l),key:K(l,s)},{ref_for:!0},l.customCell&&l.customCell(a,n,l)),[l.ellipsis?e.renderSlot(t.$slots,"bodyCell",{key:0,column:l,record:a,text:a[l.dataIndex],index:n},()=>[e.createVNode(e.unref(T.default),e.mergeProps({ref_for:!0,ref_key:"ellipsisRef",ref:x},{ref_for:!0},g(l,"ellipsisProps")),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a[l.dataIndex]),1)]),_:2},1040)],!0):e.renderSlot(t.$slots,"bodyCell",{key:1,column:l,record:a,text:a[l.dataIndex],index:n},()=>[e.createTextVNode(e.toDisplayString(a[l.dataIndex]),1)],!0)],16))),128))],42,Wt),t.showExpandColumn?e.withDirectives((e.openBlock(),e.createElementBlock("tr",Ht,[e.createElementVNode("td",{class:"table-td table-td-expand-row",colspan:S.value.length+1},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-expand-row-fixed",style:e.normalizeStyle(Ve.value)},[e.renderSlot(t.$slots,"expandedRowRender",{record:a,index:n,expanded:d.value.includes(a.key)},void 0,!0)],4)):e.renderSlot(t.$slots,"expandedRowRender",{key:1,record:a,index:n,expanded:d.value.includes(a.key)},void 0,!0)],8,Ot)],512)),[[e.vShow,d.value.includes(a.key)]]):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0)])],4)]),_:3},16,["class","x-scrollable","y-scrollable","style"])])),nt.value?(e.openBlock(),e.createElementBlock("div",qt,[e.renderSlot(t.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(t.footer),1)],!0)])):e.createCommentVNode("",!0)],2),t.showPagination?(e.openBlock(),e.createBlock(e.unref(vt.default),e.mergeProps({key:0,class:"table-pagination",placement:"right",size:t.size,onChange:ft},{...t.pagination,page:V.value,pageSize:P.value,total:Pe.value}),null,16,["size"])):e.createCommentVNode("",!0)]),_:3},16,["spinning"])],512))}});exports.default=Ut;