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