UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

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