aha-components 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Table.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import i,{createContext as o,useContext as r,useState as l,useMemo as a,useEffect as d,useRef as s,useCallback as c}from"react";var u=function(){return u=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},u.apply(this,arguments)};function p(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t}function h(e,n,t){if(t||2===arguments.length)for(var i,o=0,r=n.length;o<r;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var f={primaryColor:"#FB6011"},x=o(f),g=function(){var e=r(x);return e||f},m={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},v=function(i){var o=i.size,r=i.color;return e(t,{children:[n("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[n("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),n("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},y=function(t){var i,o=t.children,r=t.type,a=void 0===r?"default":r,d=t.size,s=void 0===d?"medium":d,c=t.disabled,h=void 0!==c&&c,f=t.loading,x=void 0!==f&&f,y=t.onClick,b=t.htmlType,w=void 0===b?"button":b,k=t.className,C=void 0===k?"":k,S=t.style,F=t.icon,A=t.iconPosition,z=void 0===A?"left":A,W=p(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=g().primaryColor,L=void 0===E?"#FB6011":E,j=l(!1),I=j[0],N=j[1],R=l(!1),D=R[0],M=R[1],B=m[s],H=h||x,P=function(){if(x){var e="primary"===a?"#FFFFFF":"#101828",t=parseInt(B.iconSize.replace("px",""));return n(v,{size:t,color:e})}return F?n("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:B.iconSize,height:B.iconSize,flexShrink:0},children:F}):null},T=(i=u({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:B.gap,height:B.height,paddingLeft:B.paddingLeft,paddingRight:B.paddingRight,fontSize:B.fontSize,lineHeight:B.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:H?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},S),"primary"===a?(i.color="#FFFFFF",i.backgroundColor=L,h?(i.opacity=.4,i.cursor="not-allowed"):x?i.backgroundColor=L:D?i.backgroundColor="#EC470A":I&&(i.backgroundColor="#FD843A")):h?(i.backgroundColor="#FAFAF9",i.color="#D6D3D1",i.border="1px solid #E7E5E4"):x?(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):D?(i.backgroundColor="#F5F5F4",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):I?(i.backgroundColor="#FAFAF9",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),i);return e("button",u({type:w,className:"aha-button aha-button--".concat(a," aha-button--").concat(s," ").concat(H?"aha-button--disabled":""," ").concat(x?"aha-button--loading":""," ").concat(C),disabled:H,onClick:function(e){H?e.preventDefault():null==y||y(e)},onMouseEnter:function(){return!H&&N(!0)},onMouseLeave:function(){N(!1),M(!1)},onMouseDown:function(){return!H&&M(!0)},onMouseUp:function(){return M(!1)},style:T},W,{children:[x&&P(),!x&&"left"===z&&P(),o&&n("span",{style:{display:"inline-block"},children:o}),!x&&"right"===z&&P()]}))};y.displayName="Button";var b=function(e){var t=e.className,i=e.style;return n("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},w=function(e){var t=e.className,i=e.style;return n("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},k=function(e){var t=e.className,i=e.style;return n("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},C=function(t){var i=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[n("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},S=function(t){var i=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[n("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},F=function(e){var t=e.className,i=e.style;return n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},A=function(e){var t=e.className,i=e.style;return n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},z=function(t){var i=t.current,o=t.defaultCurrent,r=void 0===o?1:o,s=t.total,c=void 0===s?0:s,p=t.pageSize,h=t.defaultPageSize,f=void 0===h?10:h,x=t.showSizeChanger,m=void 0!==x&&x,v=t.pageSizeOptions,b=void 0===v?["10","20","50","100"]:v,w=t.showQuickJumper,k=void 0!==w&&w,C=t.showTotal,S=t.onChange,z=t.onShowSizeChange,W=t.simple,E=void 0!==W&&W,L=t.disabled,j=void 0!==L&&L,I=t.hideOnSinglePage,N=void 0!==I&&I,R=t.className,D=void 0===R?"":R,M=t.style,B=t.size,H=void 0===B?"default":B,P=t.responsive,T=void 0!==P&&P;t.showLessItems;var O=t.itemRender,K=g().primaryColor,J=void 0===K?"#FB6011":K,Q=l(r),U=Q[0],X=Q[1],Y=l(f),_=Y[0],q=Y[1],G=l(""),V=G[0],Z=G[1],$=null!=i?i:U,ee=null!=p?p:_,ne=a(function(){return Math.ceil(c/ee)},[c,ee]);d(function(){void 0!==i&&X(i)},[i]),d(function(){void 0!==p&&q(p)},[p]);var te=function(e){e<1||e>ne||e===$||j||(void 0===i&&X(e),null==S||S(e,ee))},ie=function(){var e=parseInt(V,10);e>=1&&e<=ne&&(te(e),Z(""))};if(N&&ne<=1)return null;if(E)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(D),style:M,children:[n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[$," / ",ne]}),n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var oe=($-1)*ee+1,re=Math.min($*ee,c);return e("div",{className:"aha-pagination w-full ".concat(D),style:u({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},M),children:[C&&n("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(c,[oe,re])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[O?O($-1,"prev",n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n(F,{})," ",n("span",{children:"Previous"})]})})):n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n(F,{})," ",n("span",{children:"Previous"})]})}),n("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(ne<=7)return Array.from({length:ne},function(e,n){return n+1});var e=[];if($<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(ne)}else if($>=ne-3){e.push(1),e.push("jump-prev");for(n=ne-4;n<=ne;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=$-1;n<=$+1;n++)e.push(n);e.push("jump-next"),e.push(ne)}return e}().map(function(e,t){return function(e){if("number"==typeof e){var t=e===$,i=n(y,{onClick:function(){return te(e)},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:"none",background:t?"#FAFAF9":"white",backgroundColor:t?"#FAFAF9":"white",color:t?J:"#79716B",boxShadow:"none",borderRadius:"8px"},children:e},e);return O?O(e,"page",i):i}if("jump-prev"===e)return i=n(y,{onClick:function(){return te(Math.max(1,$-5))},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O($-5,"jump-prev",i):i;if("jump-next"===e)return i=n(y,{onClick:function(){return te(Math.min(ne,$+5))},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O($+5,"jump-next",i):i;return null}(e)})}),O?O($+1,"next",n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n("span",{children:"Next"})," ",n(A,{})]})})):n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n("span",{children:"Next"})," ",n(A,{})]})}),m&&n("select",{value:ee,onChange:function(e){return n=Number(e.target.value),t=Math.ceil(c/n),o=$>t?t:$,void 0===p&&q(n),void 0===i&&X(o),null==z||z(o,n),void(null==S||S(o,n));var n,t,o},disabled:j,style:{padding:"small"===H?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===H?"12px":"14px",lineHeight:"small"===H?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:j?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){j||(e.currentTarget.style.borderColor=J)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:b.map(function(n){return e("option",{value:n,children:[n," 条/页"]},n)})}),k&&e("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"跳至"}),n("input",{type:"number",min:"1",value:V,onChange:function(e){return Z(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ie()},disabled:j,style:{width:"56px",height:"small"===H?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=J},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof k&&k.goButton?n(y,{onClick:ie,disabled:j,type:"default",size:"default"===H?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:k.goButton}):n(y,{onClick:ie,disabled:j,type:"default",size:"default"===H?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},W=function(t){var i=t.checked,o=void 0!==i&&i,r=t.indeterminate,l=void 0!==r&&r,a=t.disabled,d=void 0!==a&&a,s=t.onChange,c=t.className,p=void 0===c?"":c,h=t.style,f=t.children,x=g().primaryColor,m=o||l,v=d?"#FAFAF9":m?x:"white",y=d?"#FAFAF9":m?x:"#D7D3D0";return e("div",{className:"aha-checkbox ".concat(p),style:u({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},h),onClick:function(e){d||(null==s||s({target:{checked:!o},currentTarget:{checked:!o}}))},children:[n("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(y),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:m?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:n(l?w:b,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&n("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),n("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=l)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};W.displayName="Checkbox";var E=function(e,n){return"string"==typeof n?null==e?void 0:e[n]:n.reduce(function(e,n){return null==e?void 0:e[n]},e)},L=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=E(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},j=function(e){var t=e.order,i=g().primaryColor;return"ascend"===t?n(S,{style:{color:i}}):"descend"===t?n(C,{style:{color:i}}):n(k,{})},I=function(t){var o,r,f,x,g=t.columns,m=void 0===g?[]:g,v=t.dataSource,y=void 0===v?[]:v,b=t.rowKey,w=void 0===b?"key":b,k=t.rowSelection,C=t.pagination,S=void 0!==C&&C,F=t.size,A=void 0===F?"middle":F,I=t.bordered,N=void 0!==I&&I;t.loading;var R=t.locale,D=t.showHeader,M=void 0===D||D,B=t.title,H=t.footer,P=t.summary,T=t.scroll,O=t.tableLayout,K=void 0===O?"auto":O,J=t.onChange,Q=t.onSorterChange,U=t.onPaginationChange,X=t.onRow,Y=t.className,_=void 0===Y?"":Y,q=t.style,G=t.expandable,V=t.rowClassName,Z=t.onHeaderRow;t.sticky;var $=p(t,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=l((null==k?void 0:k.selectedRowKeys)||(null==k?void 0:k.defaultSelectedRowKeys)||[]),ne=ee[0],te=ee[1];d(function(){void 0!==(null==k?void 0:k.selectedRowKeys)&&te(k.selectedRowKeys)},[null==k?void 0:k.selectedRowKeys]);var ie=l(new Map),oe=ie[0],re=ie[1],le=l((null==G?void 0:G.defaultExpandedRowKeys)||[]),ae=le[0],de=le[1],se=l(S&&"object"==typeof S&&(S.current||S.defaultCurrent)||1),ce=se[0],ue=se[1],pe=l(S&&"object"==typeof S&&(S.pageSize||S.defaultPageSize)||10),he=pe[0],fe=pe[1];d(function(){S&&"object"==typeof S&&(void 0!==S.current&&ue(S.current),void 0!==S.pageSize&&fe(S.pageSize))},[S]);var xe=l(null),ge=xe[0],me=xe[1],ve=l(null),ye=ve[0],be=ve[1],we=l(!1),ke=we[0],Ce=we[1],Se=s(null),Fe=s(null);d(function(){var e=function(){Ce(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Ae=c(function(e,n){var t,i,o,r=null===(t=null==k?void 0:k.getCheckboxProps)||void 0===t?void 0:t.call(k,e);if(!(null==r?void 0:r.disabled)){var l,a=L(e,w);l="radio"===(null==k?void 0:k.type)?n?[a]:[]:n?h(h([],ne,!0),[a],!1):ne.filter(function(e){return e!==a}),te(l);var d=y.filter(function(e){return l.includes(L(e,w))});null===(i=null==k?void 0:k.onChange)||void 0===i||i.call(k,l,d),null===(o=null==k?void 0:k.onSelect)||void 0===o||o.call(k,e,n,d,new Event("select"))}},[ne,w,k,y]),ze=c(function(e,n){var t,i,o=n.filter(function(e){var n;return!(null===(n=null==k?void 0:k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}).map(function(e){return L(e,w)}),r=e?o:[];te(r);var l=y.filter(function(e){return r.includes(L(e,w))}),a=e?n.filter(function(e){var n;return!(null===(n=null==k?void 0:k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}):[];null===(t=null==k?void 0:k.onChange)||void 0===t||t.call(k,r,l),null===(i=null==k?void 0:k.onSelectAll)||void 0===i||i.call(k,e,l,a)},[w,k,y]),We=c(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var i=new Map(oe);null===n?i.delete(t):i.set(t,n),re(i);var o=Array.from(i.entries()).map(function(n){var t=n[0],i=n[1];return{column:m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t})||e,order:i,field:t,columnKey:t}}),r={column:e,order:n,field:t,columnKey:t};e.onSorterChange&&e.onSorterChange(r),Q&&Q(1===o.length?o[0]:o),J&&J({current:ce,pageSize:he},{},1===o.length?o[0]:o,{currentDataSource:y,action:"sort"})}},[oe,J,Q,ce,he,y,m]);c(function(e,n){var t,i,o,r=L(e,w);o=n?h(h([],ae,!0),[r],!1):ae.filter(function(e){return e!==r}),de(o),null===(t=null==G?void 0:G.onExpand)||void 0===t||t.call(G,n,e),null===(i=null==G?void 0:G.onExpandedRowsChange)||void 0===i||i.call(G,o)},[ae,w,G]);var Ee=c(function(){var e=h([],y,!0);return oe.size>0&&e.sort(function(e,n){for(var t=function(t,i){var o=m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t});if(!o)return"continue";var r=0;if("function"==typeof o.sorter)r=o.sorter(e,n);else if(!0===o.sorter){var l=E(e,o.dataIndex||t),a=E(n,o.dataIndex||t);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===i?r:-r}:void 0},i=0,o=Array.from(oe.entries());i<o.length;i++){var r=o[i],l=t(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[y,oe,m]),Le=Ee(),je=a(function(){if(!1===S||!S)return Le;var e=(ce-1)*he,n=e+he;return Le.slice(e,n)},[Le,ce,he,S]),Ie=c(function(e,n){var t,i,o=null!=n?n:he;if(ue(e),n&&fe(n),U&&U(e,o),S&&"object"==typeof S&&(null===(t=S.onChange)||void 0===t||t.call(S,e,n),n&&(null===(i=S.onShowSizeChange)||void 0===i||i.call(S,e,n))),J){var r=Array.from(oe.entries()).map(function(e){var n=e[0],t=e[1];return{column:m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});J({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:Le,action:"paginate"})}},[S,U,J,he,oe,m,Le]),Ne=c(function(e,n,t){var i=E(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),Re=c(function(e,n,t){if(n){var i=!0===n?"left":n,o=0;if("left"===i){if(k&&("left"===k.fixed||!0===k.fixed))o+="number"==typeof k.columnWidth?k.columnWidth:"string"==typeof k.columnWidth?parseInt(k.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=m[r]).fixed||!0===l.fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return o}if("right"===i){for(r=e+1;r<m.length;r++){var l;if("right"===(l=m[r]).fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(k&&"right"===k.fixed)o+="number"==typeof k.columnWidth?k.columnWidth:"string"==typeof k.columnWidth?parseInt(k.columnWidth):60;return o}}},[m,k]),De=c(function(){if(!M)return null;var t,i,o,r,l=m.map(function(t,i){var o,r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,l=oe.get(r)||null,a=Re(i,t.fixed,!0),d=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return n("th",u({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:d,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:d||void 0,maxWidth:d,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===t.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[n("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:l,sortColumn:t}):t.title}),t.sorter&&n("button",{onClick:function(){We(t,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:n(j,{order:l||void 0})})]})}),r)});if(k){var a="number"==typeof k.columnWidth?"".concat(k.columnWidth,"px"):"string"==typeof k.columnWidth?k.columnWidth:"60px",d=n("th",{style:{width:a,position:k.fixed?"sticky":"relative",left:"left"===k.fixed||!0===k.fixed?"0px":void 0,right:"right"===k.fixed?"0px":void 0,zIndex:k.fixed?"left"===k.fixed||!0===k.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!k.hideSelectAll&&"radio"!==k.type&&(t=je.filter(function(e){var n;return!(null===(n=k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}),i=t.map(function(e){return L(e,w)}),o=t.length>0&&i.every(function(e){return ne.includes(e)}),r=i.some(function(e){return ne.includes(e)}),n(W,{checked:o,indeterminate:r&&!o,onChange:function(e){return ze(e.target.checked,je)}})),k.columnTitle&&n("span",{style:{marginLeft:k.hideSelectAll?0:"8px"},children:k.columnTitle})]})},"selection");l.unshift(d)}var s=null==Z?void 0:Z(m,0);return n("thead",{ref:Fe,children:n("tr",u({},s||{},{children:l}))})},[m,M,oe,k,ne,je,w,We,ze,R,Z,Re]),Me=c(function(e){me(e)},[]),Be=c(function(e,n){e.preventDefault(),be(n)},[]),He=c(function(e,n){if(e.preventDefault(),null===ge||ge===n)return me(null),void be(null);var t=h([],je,!0),i=t[ge];t.splice(ge,1),t.splice(n,0,i),me(null),be(null)},[ge,je]),Pe=c(function(){me(null),be(null)},[]),Te=c(function(){return je.map(function(t,o){var r,l=L(t,w),a=ne.includes(l),d=ae.includes(l),s=(null==X?void 0:X(t,o))||{},c=o===je.length-1;return e(i.Fragment,{children:[e("tr",u({className:"".concat("function"==typeof V?V(t,o):V||""," ").concat(ge===o?"dragging":""," ").concat(ye===o?"drag-over":""),draggable:!0,onDragStart:function(){return Me(o)},onDragOver:function(e){return Be(e,o)},onDrop:function(e){return He(e,o)},onDragEnd:Pe,style:u({cursor:"move",opacity:ge===o?.5:1,backgroundColor:ye===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){ge!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ge!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[k&&n("td",{style:{width:"number"==typeof k.columnWidth?"".concat(k.columnWidth,"px"):"string"==typeof k.columnWidth?k.columnWidth:"60px",position:k.fixed?"sticky":"relative",left:"left"===k.fixed||!0===k.fixed?"0px":void 0,right:"right"===k.fixed?"0px":void 0,zIndex:k.fixed?"left"===k.fixed||!0===k.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n(W,{checked:a,onChange:function(e){return Ae(t,e.target.checked)},disabled:null===(r=k.getCheckboxProps)||void 0===r?void 0:r.call(k,t).disabled})})}),m.map(function(e,i){var r,l=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex)||i,a=(null===(r=e.onCell)||void 0===r?void 0:r.call(e,t,o))||{},d=Re(i,e.fixed,!1),s=e.width?"number"==typeof e.width?"".concat(e.width,"px"):e.width:void 0;return n("td",u({className:"".concat(e.className||""," ").concat(e.align?"text-".concat(e.align):""),style:u({width:s,minWidth:e.minWidth?"number"==typeof e.minWidth?"".concat(e.minWidth,"px"):e.minWidth:s||void 0,maxWidth:s,position:e.fixed?"sticky":"relative",left:"left"===e.fixed||!0===e.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===e.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:e.fixed?"left"===e.fixed||!0===e.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===e.fixed||!0===e.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===e.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:e.align||"left"},a.style),colSpan:e.colSpan,rowSpan:e.rowSpan},a,{children:Ne(e,t,o)}),l)})]})),(null==G?void 0:G.expandedRowRender)&&d&&n("tr",{children:n("td",{colSpan:m.length+(k?1:0),children:G.expandedRowRender(t,o,0,!0)})})]},l)})},[je,w,ne,ae,k,m,X,V,Ae,Ne,G,ge,ye,Me,Be,He,Pe,Re]),Oe=function(){var e;if(!1===S||!S)return null;var t=null!==(e=S.total)&&void 0!==e?e:Le.length,i=S.position||"bottomRight";return n("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:n(z,{current:ce,total:t,pageSize:he,showSizeChanger:S.showSizeChanger,pageSizeOptions:S.pageSizeOptions,showQuickJumper:S.showQuickJumper,showTotal:S.showTotal,onChange:Ie,onShowSizeChange:Ie,simple:S.simple,responsive:S.responsive,size:"small"===A?"small":"default"})})},Ke=a(function(){return m.some(function(e){return e.fixed})||k&&k.fixed},[m,k]),Je=a(function(){return m.every(function(e){return e.width})&&(!k||k.columnWidth)},[m,k]),Qe=a(function(){if(null==T?void 0:T.x){if("number"==typeof T.x)return T.x;if(!0===T.x)return m.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(k?"number"==typeof k.columnWidth?k.columnWidth:parseInt(String(k.columnWidth||"60").replace("px",""))||60:0)}if(Ke)return m.reduce(function(e,n){return n.fixed&&n.width?e+("number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0):e},0)+(k&&k.fixed&&k.columnWidth?"number"==typeof k.columnWidth?k.columnWidth:parseInt(String(k.columnWidth).replace("px",""))||60:0)},[m,null==T?void 0:T.x,k,Ke]),Ue=a(function(){return"fixed"===K||Ke||Je||m.some(function(e){return e.width})?"fixed":K},[K,Ke,Je,m]),Xe={width:"100%",minWidth:Qe?"".concat(Qe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ue,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Ye=u({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"},q);if(ke)return e("div",u({ref:Se,className:"aha-table aha-table-mobile-wrapper ".concat(_),style:Ye},$,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Le)}),S&&"object"==typeof S&&(null===(o=S.position)||void 0===o?void 0:o.startsWith("top"))&&Oe(),n("div",{className:"aha-table-mobile",children:je.map(function(t,i){var o,r=L(t,w),l=ne.includes(r);return e("div",{className:"aha-table-mobile-row ".concat(l?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:l?"#e6f7ff":"white"},children:[k&&n("div",{style:{marginBottom:"8px"},children:n(W,{checked:l,onChange:function(e){return Ae(t,e.target.checked)},disabled:null===(o=k.getCheckboxProps)||void 0===o?void 0:o.call(k,t).disabled})}),m.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),l=E(t,o.dataIndex||""),a=o.render?o.render(l,t,i):l;return e("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),n("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})}),H&&n("div",{style:{marginTop:"16px"},children:H(Le)}),S&&("object"!=typeof S||!(null===(r=S.position)||void 0===r?void 0:r.startsWith("top")))&&Oe()]}));var _e={position:"relative",overflowX:(null==T?void 0:T.x)||Ke?"auto":"visible",overflowY:(null==T?void 0:T.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==T?void 0:T.x)?"100%":"number"==typeof(null==T?void 0:T.x)?"".concat(T.x,"px"):void 0,maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"};return e("div",u({ref:Se,className:"aha-table ".concat(_),style:Ye},$,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Le)}),S&&"object"==typeof S&&(null===(f=S.position)||void 0===f?void 0:f.startsWith("top"))&&Oe(),n("div",{style:_e,children:n("div",{style:{width:"100%",minWidth:Qe?"".concat(Qe,"px"):"100%",display:"block"},children:e("table",{style:Xe,className:N?"bordered":"",children:[De(),n("tbody",{children:Te()}),P&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:m.length+(k?1:0),children:P(Le)})})})]})})}),H&&n("div",{style:{marginTop:"16px"},children:H(Le)}),S&&("object"!=typeof S||!(null===(x=S.position)||void 0===x?void 0:x.startsWith("top")))&&Oe()]}))};export{I as default};
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import i,{createContext as o,useContext as r,useState as l,useMemo as a,useEffect as d,useRef as s,useCallback as c}from"react";var u=function(){return u=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},u.apply(this,arguments)};function p(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(t[i[o]]=e[i[o]])}return t}function h(e,n,t){if(t||2===arguments.length)for(var i,o=0,r=n.length;o<r;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var f={primaryColor:"#FB6011"},x=o(f),g=function(){var e=r(x);return e||f},m={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},v=function(i){var o=i.size,r=i.color;return e(t,{children:[n("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[n("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),n("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},y=function(t){var i,o=t.children,r=t.type,a=void 0===r?"default":r,d=t.size,s=void 0===d?"medium":d,c=t.disabled,h=void 0!==c&&c,f=t.loading,x=void 0!==f&&f,y=t.onClick,b=t.htmlType,w=void 0===b?"button":b,k=t.className,C=void 0===k?"":k,S=t.style,F=t.icon,A=t.iconPosition,z=void 0===A?"left":A,W=p(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=g().primaryColor,L=void 0===E?"#FB6011":E,j=l(!1),I=j[0],N=j[1],R=l(!1),D=R[0],M=R[1],B=m[s],H=h||x,P=function(){if(x){var e="primary"===a?"#FFFFFF":"#101828",t=parseInt(B.iconSize.replace("px",""));return n(v,{size:t,color:e})}return F?n("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:B.iconSize,height:B.iconSize,flexShrink:0},children:F}):null},T=(i=u({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:B.gap,height:B.height,paddingLeft:B.paddingLeft,paddingRight:B.paddingRight,fontSize:B.fontSize,lineHeight:B.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:H?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},S),"primary"===a?(i.color="#FFFFFF",i.backgroundColor=L,h?(i.opacity=.4,i.cursor="not-allowed"):x?i.backgroundColor=L:D?i.backgroundColor="#EC470A":I&&(i.backgroundColor="#FD843A")):h?(i.backgroundColor="#FAFAF9",i.color="#D6D3D1",i.border="1px solid #E7E5E4"):x?(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):D?(i.backgroundColor="#F5F5F4",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):I?(i.backgroundColor="#FAFAF9",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),i);return e("button",u({type:w,className:"aha-button aha-button--".concat(a," aha-button--").concat(s," ").concat(H?"aha-button--disabled":""," ").concat(x?"aha-button--loading":""," ").concat(C),disabled:H,onClick:function(e){H?e.preventDefault():null==y||y(e)},onMouseEnter:function(){return!H&&N(!0)},onMouseLeave:function(){N(!1),M(!1)},onMouseDown:function(){return!H&&M(!0)},onMouseUp:function(){return M(!1)},style:T},W,{children:[x&&P(),!x&&"left"===z&&P(),o&&n("span",{style:{display:"inline-block"},children:o}),!x&&"right"===z&&P()]}))};y.displayName="Button";var b=function(e){var t=e.className,i=e.style;return n("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},w=function(e){var t=e.className,i=e.style;return n("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},k=function(e){var t=e.className,i=e.style;return n("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},C=function(t){var i=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[n("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},S=function(t){var i=t.className,o=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[n("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},F=function(e){var t=e.className,i=e.style;return n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},A=function(e){var t=e.className,i=e.style;return n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:n("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},z=function(t){var i=t.current,o=t.defaultCurrent,r=void 0===o?1:o,s=t.total,c=void 0===s?0:s,p=t.pageSize,h=t.defaultPageSize,f=void 0===h?10:h,x=t.showSizeChanger,m=void 0!==x&&x,v=t.pageSizeOptions,b=void 0===v?["10","20","50","100"]:v,w=t.showQuickJumper,k=void 0!==w&&w,C=t.showTotal,S=t.onChange,z=t.onShowSizeChange,W=t.simple,E=void 0!==W&&W,L=t.disabled,j=void 0!==L&&L,I=t.hideOnSinglePage,N=void 0!==I&&I,R=t.className,D=void 0===R?"":R,M=t.style,B=t.size,H=void 0===B?"default":B,P=t.responsive,T=void 0!==P&&P;t.showLessItems;var O=t.itemRender,K=g().primaryColor,J=void 0===K?"#FB6011":K,Q=l(r),U=Q[0],X=Q[1],Y=l(f),_=Y[0],q=Y[1],G=l(""),V=G[0],Z=G[1],$=null!=i?i:U,ee=null!=p?p:_,ne=a(function(){return Math.ceil(c/ee)},[c,ee]);d(function(){void 0!==i&&X(i)},[i]),d(function(){void 0!==p&&q(p)},[p]);var te=function(e){e<1||e>ne||e===$||j||(void 0===i&&X(e),null==S||S(e,ee))},ie=function(){var e=parseInt(V,10);e>=1&&e<=ne&&(te(e),Z(""))};if(N&&ne<=1)return null;if(E)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(D),style:M,children:[n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[$," / ",ne]}),n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var oe=($-1)*ee+1,re=Math.min($*ee,c);return e("div",{className:"aha-pagination w-full ".concat(D),style:u({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},M),children:[C&&n("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(c,[oe,re])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[O?O($-1,"prev",n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n(F,{})," ",n("span",{children:"Previous"})]})})):n(y,{onClick:function(){return te($-1)},disabled:j||1===$,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n(F,{})," ",n("span",{children:"Previous"})]})}),n("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(ne<=7)return Array.from({length:ne},function(e,n){return n+1});var e=[];if($<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(ne)}else if($>=ne-3){e.push(1),e.push("jump-prev");for(n=ne-4;n<=ne;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=$-1;n<=$+1;n++)e.push(n);e.push("jump-next"),e.push(ne)}return e}().map(function(e,t){return function(e){if("number"==typeof e){var t=e===$,i=n(y,{onClick:function(){return te(e)},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:"none",background:t?"#FAFAF9":"white",backgroundColor:t?"#FAFAF9":"white",color:t?J:"#79716B",boxShadow:"none",borderRadius:"8px"},children:e},e);return O?O(e,"page",i):i}if("jump-prev"===e)return i=n(y,{onClick:function(){return te(Math.max(1,$-5))},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O($-5,"jump-prev",i):i;if("jump-next"===e)return i=n(y,{onClick:function(){return te(Math.min(ne,$+5))},disabled:j,type:"default",size:"default"===H?"medium":"small",style:{minWidth:"small"===H?"32px":"36px",height:"small"===H?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O($+5,"jump-next",i):i;return null}(e)})}),O?O($+1,"next",n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n("span",{children:"Next"})," ",n(A,{})]})})):n(y,{onClick:function(){return te($+1)},disabled:j||$===ne,type:"default",size:"default"===H?"medium":"small",style:{height:"small"===H?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e("div",{className:"flex items-center gap-1",children:[n("span",{children:"Next"})," ",n(A,{})]})}),m&&n("select",{value:ee,onChange:function(e){return n=Number(e.target.value),t=Math.ceil(c/n),o=$>t?t:$,void 0===p&&q(n),void 0===i&&X(o),null==z||z(o,n),void(null==S||S(o,n));var n,t,o},disabled:j,style:{padding:"small"===H?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===H?"12px":"14px",lineHeight:"small"===H?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:j?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){j||(e.currentTarget.style.borderColor=J)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:b.map(function(n){return e("option",{value:n,children:[n," 条/页"]},n)})}),k&&e("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"跳至"}),n("input",{type:"number",min:"1",value:V,onChange:function(e){return Z(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ie()},disabled:j,style:{width:"56px",height:"small"===H?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=J},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof k&&k.goButton?n(y,{onClick:ie,disabled:j,type:"default",size:"default"===H?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:k.goButton}):n(y,{onClick:ie,disabled:j,type:"default",size:"default"===H?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},W=function(t){var i=t.checked,o=void 0!==i&&i,r=t.indeterminate,l=void 0!==r&&r,a=t.disabled,d=void 0!==a&&a,s=t.onChange,c=t.className,p=void 0===c?"":c,h=t.style,f=t.children,x=g().primaryColor,m=o||l,v=d?"#FAFAF9":m?x:"white",y=d?"#FAFAF9":m?x:"#D7D3D0";return e("div",{className:"aha-checkbox ".concat(p),style:u({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},h),onClick:function(e){d||(null==s||s({target:{checked:!o},currentTarget:{checked:!o}}))},children:[n("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(y),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:m?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:n(l?w:b,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&n("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),n("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=l)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};W.displayName="Checkbox";var E=function(e,n){return"string"==typeof n?null==e?void 0:e[n]:n.reduce(function(e,n){return null==e?void 0:e[n]},e)},L=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=E(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},j=function(e){var t=e.order,i=g().primaryColor;return"ascend"===t?n(S,{style:{color:i}}):"descend"===t?n(C,{style:{color:i}}):n(k,{})},I=function(t){var o,r,f,x,g=t.columns,m=void 0===g?[]:g,v=t.dataSource,y=void 0===v?[]:v,b=t.rowKey,w=void 0===b?"key":b,k=t.rowSelection,C=t.pagination,S=void 0!==C&&C,F=t.size,A=void 0===F?"middle":F,I=t.bordered,N=void 0!==I&&I;t.loading;var R=t.locale,D=t.showHeader,M=void 0===D||D,B=t.title,H=t.footer,P=t.summary,T=t.scroll,O=t.tableLayout,K=void 0===O?"auto":O,J=t.onChange,Q=t.onSorterChange,U=t.onPaginationChange,X=t.onRow,Y=t.className,_=void 0===Y?"":Y,q=t.innerClassName,G=void 0===q?"":q,V=t.style,Z=t.expandable,$=t.rowClassName,ee=t.onHeaderRow;t.sticky;var ne=p(t,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),te=l((null==k?void 0:k.selectedRowKeys)||(null==k?void 0:k.defaultSelectedRowKeys)||[]),ie=te[0],oe=te[1];d(function(){void 0!==(null==k?void 0:k.selectedRowKeys)&&oe(k.selectedRowKeys)},[null==k?void 0:k.selectedRowKeys]);var re=l(new Map),le=re[0],ae=re[1],de=l((null==Z?void 0:Z.defaultExpandedRowKeys)||[]),se=de[0],ce=de[1],ue=l(S&&"object"==typeof S&&(S.current||S.defaultCurrent)||1),pe=ue[0],he=ue[1],fe=l(S&&"object"==typeof S&&(S.pageSize||S.defaultPageSize)||10),xe=fe[0],ge=fe[1];d(function(){S&&"object"==typeof S&&(void 0!==S.current&&he(S.current),void 0!==S.pageSize&&ge(S.pageSize))},[S]);var me=l(null),ve=me[0],ye=me[1],be=l(null),we=be[0],ke=be[1],Ce=l(!1),Se=Ce[0],Fe=Ce[1],Ae=s(null),ze=s(null);d(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var We=c(function(e,n){var t,i,o,r=null===(t=null==k?void 0:k.getCheckboxProps)||void 0===t?void 0:t.call(k,e);if(!(null==r?void 0:r.disabled)){var l,a=L(e,w);l="radio"===(null==k?void 0:k.type)?n?[a]:[]:n?h(h([],ie,!0),[a],!1):ie.filter(function(e){return e!==a}),oe(l);var d=y.filter(function(e){return l.includes(L(e,w))});null===(i=null==k?void 0:k.onChange)||void 0===i||i.call(k,l,d),null===(o=null==k?void 0:k.onSelect)||void 0===o||o.call(k,e,n,d,new Event("select"))}},[ie,w,k,y]),Ee=c(function(e,n){var t,i,o=n.filter(function(e){var n;return!(null===(n=null==k?void 0:k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}).map(function(e){return L(e,w)}),r=e?o:[];oe(r);var l=y.filter(function(e){return r.includes(L(e,w))}),a=e?n.filter(function(e){var n;return!(null===(n=null==k?void 0:k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}):[];null===(t=null==k?void 0:k.onChange)||void 0===t||t.call(k,r,l),null===(i=null==k?void 0:k.onSelectAll)||void 0===i||i.call(k,e,l,a)},[w,k,y]),Le=c(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var i=new Map(le);null===n?i.delete(t):i.set(t,n),ae(i);var o=Array.from(i.entries()).map(function(n){var t=n[0],i=n[1];return{column:m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t})||e,order:i,field:t,columnKey:t}}),r={column:e,order:n,field:t,columnKey:t};e.onSorterChange&&e.onSorterChange(r),Q&&Q(1===o.length?o[0]:o),J&&J({current:pe,pageSize:xe},{},1===o.length?o[0]:o,{currentDataSource:y,action:"sort"})}},[le,J,Q,pe,xe,y,m]);c(function(e,n){var t,i,o,r=L(e,w);o=n?h(h([],se,!0),[r],!1):se.filter(function(e){return e!==r}),ce(o),null===(t=null==Z?void 0:Z.onExpand)||void 0===t||t.call(Z,n,e),null===(i=null==Z?void 0:Z.onExpandedRowsChange)||void 0===i||i.call(Z,o)},[se,w,Z]);var je=c(function(){var e=h([],y,!0);return le.size>0&&e.sort(function(e,n){for(var t=function(t,i){var o=m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t});if(!o)return"continue";var r=0;if("function"==typeof o.sorter)r=o.sorter(e,n);else if(!0===o.sorter){var l=E(e,o.dataIndex||t),a=E(n,o.dataIndex||t);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===i?r:-r}:void 0},i=0,o=Array.from(le.entries());i<o.length;i++){var r=o[i],l=t(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[y,le,m]),Ie=je(),Ne=a(function(){if(!1===S||!S)return Ie;var e=(pe-1)*xe,n=e+xe;return Ie.slice(e,n)},[Ie,pe,xe,S]),Re=c(function(e,n){var t,i,o=null!=n?n:xe;if(he(e),n&&ge(n),U&&U(e,o),S&&"object"==typeof S&&(null===(t=S.onChange)||void 0===t||t.call(S,e,n),n&&(null===(i=S.onShowSizeChange)||void 0===i||i.call(S,e,n))),J){var r=Array.from(le.entries()).map(function(e){var n=e[0],t=e[1];return{column:m.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});J({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:Ie,action:"paginate"})}},[S,U,J,xe,le,m,Ie]),De=c(function(e,n,t){var i=E(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),Me=c(function(e,n,t){if(n){var i=!0===n?"left":n,o=0;if("left"===i){if(k&&("left"===k.fixed||!0===k.fixed))o+="number"==typeof k.columnWidth?k.columnWidth:"string"==typeof k.columnWidth?parseInt(k.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=m[r]).fixed||!0===l.fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return o}if("right"===i){for(r=e+1;r<m.length;r++){var l;if("right"===(l=m[r]).fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(k&&"right"===k.fixed)o+="number"==typeof k.columnWidth?k.columnWidth:"string"==typeof k.columnWidth?parseInt(k.columnWidth):60;return o}}},[m,k]),Be=c(function(){if(!M)return null;var t,i,o,r,l=m.map(function(t,i){var o,r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,l=le.get(r)||null,a=Me(i,t.fixed,!0),d=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return n("th",u({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:d,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:d||void 0,maxWidth:d,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===t.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[n("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:l,sortColumn:t}):t.title}),t.sorter&&n("button",{onClick:function(){Le(t,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:n(j,{order:l||void 0})})]})}),r)});if(k){var a="number"==typeof k.columnWidth?"".concat(k.columnWidth,"px"):"string"==typeof k.columnWidth?k.columnWidth:"60px",d=n("th",{style:{width:a,position:k.fixed?"sticky":"relative",left:"left"===k.fixed||!0===k.fixed?"0px":void 0,right:"right"===k.fixed?"0px":void 0,zIndex:k.fixed?"left"===k.fixed||!0===k.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!k.hideSelectAll&&"radio"!==k.type&&(t=Ne.filter(function(e){var n;return!(null===(n=k.getCheckboxProps)||void 0===n?void 0:n.call(k,e).disabled)}),i=t.map(function(e){return L(e,w)}),o=t.length>0&&i.every(function(e){return ie.includes(e)}),r=i.some(function(e){return ie.includes(e)}),n(W,{checked:o,indeterminate:r&&!o,onChange:function(e){return Ee(e.target.checked,Ne)}})),k.columnTitle&&n("span",{style:{marginLeft:k.hideSelectAll?0:"8px"},children:k.columnTitle})]})},"selection");l.unshift(d)}var s=null==ee?void 0:ee(m,0);return n("thead",{ref:ze,children:n("tr",u({},s||{},{children:l}))})},[m,M,le,k,ie,Ne,w,Le,Ee,R,ee,Me]),He=c(function(e){ye(e)},[]),Pe=c(function(e,n){e.preventDefault(),ke(n)},[]),Te=c(function(e,n){if(e.preventDefault(),null===ve||ve===n)return ye(null),void ke(null);var t=h([],Ne,!0),i=t[ve];t.splice(ve,1),t.splice(n,0,i),ye(null),ke(null)},[ve,Ne]),Oe=c(function(){ye(null),ke(null)},[]),Ke=c(function(){return Ne.map(function(t,o){var r,l=L(t,w),a=ie.includes(l),d=se.includes(l),s=(null==X?void 0:X(t,o))||{},c=o===Ne.length-1;return e(i.Fragment,{children:[e("tr",u({className:"".concat("function"==typeof $?$(t,o):$||""," ").concat(ve===o?"dragging":""," ").concat(we===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Pe(e,o)},onDrop:function(e){return Te(e,o)},onDragEnd:Oe,style:u({cursor:"move",opacity:ve===o?.5:1,backgroundColor:we===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){ve!==o&&we!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&we!==o&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[k&&n("td",{style:{width:"number"==typeof k.columnWidth?"".concat(k.columnWidth,"px"):"string"==typeof k.columnWidth?k.columnWidth:"60px",position:k.fixed?"sticky":"relative",left:"left"===k.fixed||!0===k.fixed?"0px":void 0,right:"right"===k.fixed?"0px":void 0,zIndex:k.fixed?"left"===k.fixed||!0===k.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n(W,{checked:a,onChange:function(e){return We(t,e.target.checked)},disabled:null===(r=k.getCheckboxProps)||void 0===r?void 0:r.call(k,t).disabled})})}),m.map(function(e,i){var r,l=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex)||i,a=(null===(r=e.onCell)||void 0===r?void 0:r.call(e,t,o))||{},d=Me(i,e.fixed,!1),s=e.width?"number"==typeof e.width?"".concat(e.width,"px"):e.width:void 0;return n("td",u({className:"".concat(e.className||""," ").concat(e.align?"text-".concat(e.align):""),style:u({width:s,minWidth:e.minWidth?"number"==typeof e.minWidth?"".concat(e.minWidth,"px"):e.minWidth:s||void 0,maxWidth:s,position:e.fixed?"sticky":"relative",left:"left"===e.fixed||!0===e.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===e.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:e.fixed?"left"===e.fixed||!0===e.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===e.fixed||!0===e.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===e.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:e.align||"left"},a.style),colSpan:e.colSpan,rowSpan:e.rowSpan},a,{children:De(e,t,o)}),l)})]})),(null==Z?void 0:Z.expandedRowRender)&&d&&n("tr",{children:n("td",{colSpan:m.length+(k?1:0),children:Z.expandedRowRender(t,o,0,!0)})})]},l)})},[Ne,w,ie,se,k,m,X,$,We,De,Z,ve,we,He,Pe,Te,Oe,Me]),Je=function(){var e;if(!1===S||!S)return null;var t=null!==(e=S.total)&&void 0!==e?e:Ie.length,i=S.position||"bottomRight";return n("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:n(z,{current:pe,total:t,pageSize:xe,showSizeChanger:S.showSizeChanger,pageSizeOptions:S.pageSizeOptions,showQuickJumper:S.showQuickJumper,showTotal:S.showTotal,onChange:Re,onShowSizeChange:Re,simple:S.simple,responsive:S.responsive,size:"small"===A?"small":"default"})})},Qe=a(function(){return m.some(function(e){return e.fixed})||k&&k.fixed},[m,k]),Ue=a(function(){return m.every(function(e){return e.width})&&(!k||k.columnWidth)},[m,k]),Xe=a(function(){if(null==T?void 0:T.x){if("number"==typeof T.x)return T.x;if(!0===T.x)return m.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(k?"number"==typeof k.columnWidth?k.columnWidth:parseInt(String(k.columnWidth||"60").replace("px",""))||60:0)}if(Qe)return m.reduce(function(e,n){return n.fixed&&n.width?e+("number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0):e},0)+(k&&k.fixed&&k.columnWidth?"number"==typeof k.columnWidth?k.columnWidth:parseInt(String(k.columnWidth).replace("px",""))||60:0)},[m,null==T?void 0:T.x,k,Qe]),Ye=a(function(){return"fixed"===K||Qe||Ue||m.some(function(e){return e.width})?"fixed":K},[K,Qe,Ue,m]),_e=u(u({width:"100%",minWidth:Xe?"".concat(Xe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ye,backgroundColor:"white"},N&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),qe=u({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"},V);if(Se)return e("div",u({ref:Ae,className:"aha-table aha-table-mobile-wrapper ".concat(_),style:qe},ne,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Ie)}),S&&"object"==typeof S&&(null===(o=S.position)||void 0===o?void 0:o.startsWith("top"))&&Je(),n("div",{className:"aha-table-mobile",children:Ne.map(function(t,i){var o,r=L(t,w),l=ie.includes(r);return e("div",{className:"aha-table-mobile-row ".concat(l?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:l?"#e6f7ff":"white"},children:[k&&n("div",{style:{marginBottom:"8px"},children:n(W,{checked:l,onChange:function(e){return We(t,e.target.checked)},disabled:null===(o=k.getCheckboxProps)||void 0===o?void 0:o.call(k,t).disabled})}),m.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),l=E(t,o.dataIndex||""),a=o.render?o.render(l,t,i):l;return e("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),n("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})}),H&&n("div",{style:{marginTop:"16px"},children:H(Ie)}),S&&("object"!=typeof S||!(null===(r=S.position)||void 0===r?void 0:r.startsWith("top")))&&Je()]}));var Ge={position:"relative",overflowX:(null==T?void 0:T.x)||Qe?"auto":"visible",overflowY:(null==T?void 0:T.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==T?void 0:T.x)?"100%":"number"==typeof(null==T?void 0:T.x)?"".concat(T.x,"px"):void 0,maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"};return e("div",u({ref:Ae,className:"aha-table ".concat(_),style:qe},ne,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Ie)}),S&&"object"==typeof S&&(null===(f=S.position)||void 0===f?void 0:f.startsWith("top"))&&Je(),n("div",{style:Ge,children:n("div",{style:{width:"100%",minWidth:Xe?"".concat(Xe,"px"):"100%",display:"block"},children:e("table",{style:_e,className:G,children:[Be(),n("tbody",{children:Ke()}),P&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:m.length+(k?1:0),children:P(Ie)})})})]})})}),H&&n("div",{style:{marginTop:"16px"},children:H(Ie)}),S&&("object"!=typeof S||!(null===(x=S.position)||void 0===x?void 0:x.startsWith("top")))&&Je()]}))};export{I as default};
2
2
  //# sourceMappingURL=Table.esm.js.map