UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

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