aha-components 1.5.6 → 1.5.7

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,T=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},O=(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:O},W,{children:[x&&T(),!x&&"left"===z&&T(),o&&n("span",{style:{display:"inline-block"},children:o}),!x&&"right"===z&&T()]}))};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(i){var o=i.current,r=i.defaultCurrent,s=void 0===r?1:r,c=i.total,p=void 0===c?0:c,h=i.pageSize,f=i.defaultPageSize,x=void 0===f?10:f,m=i.showSizeChanger,v=void 0!==m&&m,b=i.pageSizeOptions,w=void 0===b?["10","20","50","100"]:b,k=i.showQuickJumper,C=void 0!==k&&k,S=i.showTotal,z=i.onChange,W=i.onShowSizeChange,E=i.simple,L=void 0!==E&&E,j=i.disabled,I=void 0!==j&&j,N=i.hideOnSinglePage,R=void 0!==N&&N,D=i.className,M=void 0===D?"":D,B=i.style,H=i.size,T=void 0===H?"default":H,O=i.responsive,P=void 0!==O&&O;i.showLessItems;var K=i.itemRender,J=g().primaryColor,Q=void 0===J?"#FB6011":J,U=l(s),X=U[0],Y=U[1],_=l(x),q=_[0],G=_[1],V=l(""),Z=V[0],$=V[1],ee=null!=o?o:X,ne=null!=h?h:q,te=a(function(){return Math.ceil(p/ne)},[p,ne]);d(function(){void 0!==o&&Y(o)},[o]),d(function(){void 0!==h&&G(h)},[h]);var ie=function(e){e<1||e>te||e===ee||I||(void 0===o&&Y(e),null==z||z(e,ne))},oe=function(){var e=parseInt(Z,10);e>=1&&e<=te&&(ie(e),$(""))};if(R&&te<=1)return null;if(L)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(M),style:B,children:[n(y,{onClick:function(){return ie(ee-1)},disabled:I||1===ee,type:"default",size:"default"===T?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(F,{})}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[ee," / ",te]}),n(y,{onClick:function(){return ie(ee+1)},disabled:I||ee===te,type:"default",size:"default"===T?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(A,{})})]});var re=(ee-1)*ne+1,le=Math.min(ee*ne,p);return e("div",{className:"aha-pagination w-full ".concat(M),style:u({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:P?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},B),children:[S&&n("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:S(p,[re,le])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[p>0&&n(t,{children:K?K(ee-1,"prev",n(y,{onClick:function(){return ie(ee-1)},disabled:I||1===ee,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(F,{})})):n(y,{onClick:function(){return ie(ee-1)},disabled:I||1===ee,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(F,{})})}),n("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(te<=7)return Array.from({length:te},function(e,n){return n+1});var e=[];if(ee<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(te)}else if(ee>=te-3){e.push(1),e.push("jump-prev");for(n=te-4;n<=te;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=ee-1;n<=ee+1;n++)e.push(n);e.push("jump-next"),e.push(te)}return e}().map(function(e,t){return function(e){if("number"==typeof e){var t=e===ee,i=n(y,{onClick:function(){return ie(e)},disabled:I,type:"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:"none",background:t?"#FAFAF9":"white",backgroundColor:t?"#FAFAF9":"white",color:t?Q:"#79716B",boxShadow:"none",borderRadius:"8px"},children:e},e);return K?K(e,"page",i):i}if("jump-prev"===e)return i=n(y,{onClick:function(){return ie(Math.max(1,ee-5))},disabled:I,type:"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),K?K(ee-5,"jump-prev",i):i;if("jump-next"===e)return i=n(y,{onClick:function(){return ie(Math.min(te,ee+5))},disabled:I,type:"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),K?K(ee+5,"jump-next",i):i;return null}(e)})}),p>0&&n(t,{children:K?K(ee+1,"next",n(y,{onClick:function(){return ie(ee+1)},disabled:I||ee===te,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(A,{})})):n(y,{onClick:function(){return ie(ee+1)},disabled:I||ee===te,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(A,{})})}),v&&n("select",{value:ne,onChange:function(e){return n=Number(e.target.value),t=Math.ceil(p/n),i=ee>t?t:ee,void 0===h&&G(n),void 0===o&&Y(i),null==W||W(i,n),void(null==z||z(i,n));var n,t,i},disabled:I,style:{padding:"small"===T?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===T?"12px":"14px",lineHeight:"small"===T?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:I?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){I||(e.currentTarget.style.borderColor=Q)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:w.map(function(n){return e("option",{value:n,children:[n," 条/页"]},n)})}),C&&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:Z,onChange:function(e){return $(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&oe()},disabled:I,style:{width:"56px",height:"small"===T?"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=Q},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof C&&C.goButton?n(y,{onClick:oe,disabled:I,type:"default",size:"default"===T?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:C.goButton}):n(y,{onClick:oe,disabled:I,type:"default",size:"default"===T?"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,T=t.summary,O=t.scroll,P=t.tableLayout,K=void 0===P?"auto":P,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,Ie=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]),Ne=Ie(),Re=Boolean(S&&"object"==typeof S&&void 0!==S.total),De=a(function(){if(!1===S||!S)return Ne;if(Re)return Ne;var e=(pe-1)*xe,n=e+xe;return Ne.slice(e,n)},[Ne,pe,xe,S,Re]),Me=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:Ne,action:"paginate"})}},[S,U,J,xe,le,m,Ne]),Be=c(function(e,n,t){var i=E(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),He=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]),Te=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=He(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=De.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,De)}})),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,De,w,Le,Ee,R,ee,He]),Oe=c(function(e){ye(e)},[]),Pe=c(function(e,n){e.preventDefault(),ke(n)},[]),Ke=c(function(e,n){if(e.preventDefault(),null===ve||ve===n)return ye(null),void ke(null);var t=h([],De,!0),i=t[ve];t.splice(ve,1),t.splice(n,0,i),ye(null),ke(null)},[ve,De]),Je=c(function(){ye(null),ke(null)},[]),Qe=c(function(){var e=null==R?void 0:R.emptyText,t="function"==typeof e?e():void 0!==e?e:"No data",i=m.length+(k?1:0);return n("tr",{className:"aha-table-placeholder",children:n("td",{colSpan:i,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:t})})},[null==R?void 0:R.emptyText,m.length,k]),Ue=c(function(){return 0===De.length?Qe():De.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===De.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 Oe(o)},onDragOver:function(e){return Pe(e,o)},onDrop:function(e){return Ke(e,o)},onDragEnd:Je,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=He(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:Be(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)})},[De,w,ie,se,k,m,X,$,We,Be,Z,ve,we,Oe,Pe,Ke,Je,He,Qe]),Xe=function(){var e;if(!1===S||!S)return null;var t=null!==(e=S.total)&&void 0!==e?e:Ne.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:Me,onShowSizeChange:Me,simple:S.simple,responsive:S.responsive,size:"small"===A?"small":"default"})})},Ye=a(function(){return m.some(function(e){return e.fixed})||k&&k.fixed},[m,k]),_e=a(function(){return m.every(function(e){return e.width})&&(!k||k.columnWidth)},[m,k]),qe=a(function(){if(null==O?void 0:O.x){if("number"==typeof O.x)return O.x;if(!0===O.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(Ye)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==O?void 0:O.x,k,Ye]),Ge=a(function(){return"fixed"===K||Ye||_e||m.some(function(e){return e.width})?"fixed":K},[K,Ye,_e,m]),Ve=u(u({width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},N&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ze=u({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==O?void 0:O.y)?"".concat(O.y,"px"):void 0,borderRadius:"8px"},V);if(Se)return e("div",u({ref:Ae,className:"aha-table aha-table-mobile-wrapper ".concat(_),style:Ze},ne,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Ne)}),S&&"object"==typeof S&&(null===(o=S.position)||void 0===o?void 0:o.startsWith("top"))&&Xe(),(je="function"==typeof(null==R?void 0:R.emptyText)?R.emptyText():void 0!==(null==R?void 0:R.emptyText)?R.emptyText:"No data",0===De.length?n("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:je}):n("div",{className:"aha-table-mobile",children:De.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(Ne)}),S&&("object"!=typeof S||!(null===(r=S.position)||void 0===r?void 0:r.startsWith("top")))&&Xe()]}));var $e={position:"relative",overflowX:(null==O?void 0:O.x)||Ye?"auto":"visible",overflowY:(null==O?void 0:O.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==O?void 0:O.x)?"100%":"number"==typeof(null==O?void 0:O.x)?"".concat(O.x,"px"):void 0,maxHeight:"number"==typeof(null==O?void 0:O.y)?"".concat(O.y,"px"):void 0,borderRadius:"8px"};return e("div",u({ref:Ae,className:"aha-table ".concat(_),style:Ze},ne,{children:[B&&n("div",{style:{marginBottom:"16px"},children:B(Ne)}),S&&"object"==typeof S&&(null===(f=S.position)||void 0===f?void 0:f.startsWith("top"))&&Xe(),n("div",{style:$e,children:n("div",{style:{width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",display:"block"},children:e("table",{style:Ve,className:G,children:[Te(),n("tbody",{children:Ue()}),T&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:m.length+(k?1:0),children:T(Ne)})})})]})})}),H&&n("div",{style:{marginTop:"16px"},children:H(Ne)}),S&&("object"!=typeof S||!(null===(x=S.position)||void 0===x?void 0:x.startsWith("top")))&&Xe()]}))};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,forwardRef as a,useRef as d,useEffect as s,useCallback as c,useMemo as u}from"react";import{createPortal as p}from"react-dom";var f=function(){return f=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},f.apply(this,arguments)};function h(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 x(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 g={primaryColor:"#FB6011"},v=o(g),m=function(){var e=r(v);return e||g},y={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"}},b=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"})]})]})},w=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,u=void 0!==c&&c,p=t.loading,x=void 0!==p&&p,g=t.onClick,v=t.htmlType,w=void 0===v?"button":v,k=t.className,C=void 0===k?"":k,S=t.style,F=t.icon,A=t.iconPosition,z=void 0===A?"left":A,W=h(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),L=m().primaryColor,E=void 0===L?"#FB6011":L,D=l(!1),I=D[0],B=D[1],j=l(!1),N=j[0],M=j[1],R=y[s],H=u||x,T=function(){if(x){var e="primary"===a?"#FFFFFF":"#101828",t=parseInt(R.iconSize.replace("px",""));return n(b,{size:t,color:e})}return F?n("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:F}):null},O=(i=f({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:R.gap,height:R.height,paddingLeft:R.paddingLeft,paddingRight:R.paddingRight,fontSize:R.fontSize,lineHeight:R.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=E,u?(i.opacity=.4,i.cursor="not-allowed"):x?i.backgroundColor=E:N?i.backgroundColor="#EC470A":I&&(i.backgroundColor="#FD843A")):u?(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)"):N?(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",f({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==g||g(e)},onMouseEnter:function(){return!H&&B(!0)},onMouseLeave:function(){B(!1),M(!1)},onMouseDown:function(){return!H&&M(!0)},onMouseUp:function(){return M(!1)},style:O},W,{children:[x&&T(),!x&&"left"===z&&T(),o&&n("span",{style:{display:"inline-block"},children:o}),!x&&"right"===z&&T()]}))};w.displayName="Button";var k=a(function(o,r){var l=o.size,a=void 0===l?"medium":l,c=o.disabled,u=void 0!==c&&c,p=o.error,x=void 0!==p&&p,g=o.readOnly,v=void 0!==g&&g,y=o.prefix,b=o.suffix,w=o.allowClear,k=void 0!==w&&w,C=o.onClear,S=o.className,F=void 0===S?"":S,A=o.style,z=o.type,W=void 0===z?"text":z,L=o.placeholder,E=o.value,D=o.defaultValue,I=o.onChange,B=o.onFocus,j=o.onBlur,N=o.onPressEnter,M=h(o,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=m().primaryColor,H=void 0===R?"#FB6011":R,T=d(null),O=i.useState(D||E||""),P=O[0],K=O[1],V=i.useState(!1),Y=V[0],J=V[1];s(function(){"function"==typeof r?r(T.current):r&&(r.current=T.current)},[r]);var Q=void 0!==E,U=Q?E:P,X=function(e){var n;e.stopPropagation(),Q||K("");null==I||I({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(n=T.current)||void 0===n||n.focus()},q=k&&U&&!u,G={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},_=b||q?"40px":"12px",Z=f({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(x?"#F04438":Y?H:"#D7D3D0"),backgroundColor:u||v?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:y?"40px":"12px",paddingRight:_,paddingTop:G[a].paddingTop,paddingBottom:G[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},A);return e(t,{children:[n("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n /* 移除数字输入框的上下箭头 */\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] {\n -moz-appearance: textfield;\n }\n '}),e("div",{className:"aha-input-wrapper ".concat(F),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[y&&n("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:u?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:y}),n("input",f({ref:T,type:W,value:U,placeholder:L,disabled:u,readOnly:v,onChange:function(e){Q||K(e.target.value),null==I||I(e)},onFocus:function(e){J(!0),null==B||B(e)},onBlur:function(e){J(!1),null==j||j(e)},onKeyDown:function(e){var n;"Enter"===e.key&&N&&N(e),null===(n=M.onKeyDown)||void 0===n||n.call(M,e)},style:Z,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(b||q)&&e("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:u?"#98A2B3":"#78716C",zIndex:1},children:[q&&n(function(){return n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:X,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:n("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),b&&n("span",{style:{pointerEvents:"none"},children:b})]})]})]})});k.displayName="Input";var C=function(o){var r,a=o.value,h=o.defaultValue,g=o.options,v=void 0===g?[]:g,y=o.mode,b=o.disabled,w=void 0!==b&&b,k=o.error,C=void 0!==k&&k,S=o.placeholder,F=void 0===S?"Please select":S,A=o.size,z=void 0===A?"medium":A,W=o.showSearch,L=void 0!==W&&W,E=o.filterOption,D=void 0===E||E,I=o.allowClear,B=void 0!==I&&I,j=o.onChange,N=o.onSelect,M=o.onDeselect,R=o.onSearch,H=o.onFocus,T=o.onBlur,O=o.onDropdownVisibleChange,P=o.className,K=void 0===P?"":P,V=o.style,Y=o.dropdownClassName,J=void 0===Y?"":Y,Q=o.dropdownStyle,U=o.defaultOpen,X=void 0!==U&&U,q=o.open,G=o.maxTagCount,_=o.tagRender,Z=o.optionRender,$=m().primaryColor,ee=void 0===$?"#FB6011":$,ne=l(void 0!==h?h:y?[]:void 0),te=ne[0],ie=ne[1],oe=l(X),re=oe[0],le=oe[1],ae=l(""),de=ae[0],se=ae[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=d(null),he=d(null),xe=d(null),ge=l(null),ve=ge[0],me=ge[1],ye=void 0!==a,be=void 0!==q,we=ye?a:te,ke=be?q:re,Ce="multiple"===y||"tags"===y,Se=c(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(n){return e.includes(n.value)})},[we,v]),Fe=c(function(){return L&&de?!1===D?v:"function"==typeof D?v.filter(function(e){return D(de,e)}):v.filter(function(e){var n=String(e.label||"").toLowerCase(),t=de.toLowerCase();return n.includes(t)}):v},[v,de,L,D]),Ae=u(function(){return Fe()},[Fe]);s(function(){if(ke&&fe.current){var e=function(){if(fe.current){var e=fe.current.getBoundingClientRect();me({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[ke]),s(function(){var e=function(e){var n=e.target;fe.current&&!fe.current.contains(n)&&xe.current&&!xe.current.contains(n)&&(be||le(!1),null==O||O(!1),se(""))};if(ke)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[ke,be,O]),s(function(){if(ke){var e=function(e){var n;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Ae.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var t=Ae[ue];t&&!t.disabled&&ze(t)}else"Escape"===e.key&&(e.preventDefault(),be||le(!1),null==O||O(!1),null===(n=fe.current)||void 0===n||n.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[ke,Ae,ue,be,O]),s(function(){if(ue>=0&&xe.current){var e=xe.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var ze=c(function(e){var n;if(!e.disabled)if(Ce){var t,i=Array.isArray(we)?we:[];i.includes(e.value)?(t=i.filter(function(n){return n!==e.value}),null==M||M(e.value,e)):(t=x(x([],i,!0),[e.value],!1),null==N||N(e.value,e)),ye||ie(t);var o=v.filter(function(e){return t.includes(e.value)});null==j||j(t,o)}else ye||ie(e.value),null==j||j(e.value,e),null==N||N(e.value,e),be||le(!1),null==O||O(!1),se(""),null===(n=fe.current)||void 0===n||n.focus()},[Ce,we,ye,be,v,j,N,M,O]),We=c(function(e,n){if(e.stopPropagation(),Ce&&Array.isArray(we)){var t=we.filter(function(e){return e!==n}),i=v.find(function(e){return e.value===n});ye||ie(t),null==j||j(t,Se()),null==M||M(n,i)}},[Ce,we,ye,v,j,M,Se]),Le=function(e){e.stopPropagation();var n=Ce?[]:void 0;ye||ie(n),null==j||j(n,[]),se("")},Ee={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},De=u(function(){return Se()},[Se]),Ie=u(function(){return B&&we&&!w},[B,we,w]),Be=u(function(){return Ce?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Ce,we]),je=u(function(){if(!Ce||!Array.isArray(we)||0===we.length)return null;var t="responsive"===G?De.slice(0,2):G?De.slice(0,G):De,o=G&&De.length>t.length?De.length-t.length:0;return e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[t.map(function(t){var o={label:t.label,value:t.value,closable:!w,onClose:function(){return We({},t.value)}};return _?n(i.Fragment,{children:_(o)},t.value):e("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[n("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),!w&&n("span",{onClick:function(e){return We(e,t.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:n("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},t.value)}),o>0&&e("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[Ce,we,De,G,w,_]);return e(t,{children:[n("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e("div",{ref:fe,className:"aha-select ".concat(K),style:f({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(C?"#F04438":ke?ee:"#D7D3D0"),backgroundColor:w?"#FAFAF9":"#FFFFFF",cursor:w?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Ee[z].paddingTop,paddingBottom:Ee[z].paddingBottom,fontSize:Ee[z].fontSize,lineHeight:Ee[z].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},V),onClick:function(){if(!w){var e=!ke;be||le(e),null==O||O(e),e&&L?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==H||H(e)},onBlur:function(e){null==T||T(e)},onTouchStart:function(e){w||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:w?-1:0,children:[n("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Ce?je||n("span",F?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:F}:{style:{flex:1,minHeight:"24px"}}):L&&ke?n("input",{ref:he,type:"text",value:de,onChange:function(e){var n=e.target.value;se(n),null==R||R(n),pe(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:w?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Be?void 0:F,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):n("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Be?w?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Be?(null===(r=De[0])||void 0===r?void 0:r.label)||we:F||" "})}),e("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Ie&&n(function(){return n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Le,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:n("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),n(function(e){var t=e.isOpen;return n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:n("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:ke})]})]}),ke&&ve&&p(n("div",{ref:xe,className:"aha-select-dropdown ".concat(J),style:f({position:"absolute",top:"".concat(ve.top,"px"),left:"".concat(ve.left,"px"),width:"".concat(ve.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Q),children:0===Ae.length?n("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Ae.map(function(t,i){var o=Ce?Array.isArray(we)&&we.includes(t.value):we===t.value,r=i===ue;return Z?n("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&ze(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Z(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return ze(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[n("span",{children:t.label}),o&&n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:n("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};C.displayName="Select";var S=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"})})},F=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"})})},A=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"})})},z=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"})]})},W=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"})]})},L=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"})})},E=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"})})},D=function(i){var o=i.current,r=i.defaultCurrent,a=void 0===r?1:r,d=i.total,c=void 0===d?0:d,p=i.pageSize,h=i.defaultPageSize,x=void 0===h?10:h,g=i.showSizeChanger,v=void 0!==g&&g,y=i.pageSizeOptions,b=void 0===y?["10","20","50","100"]:y,S=i.showQuickJumper,F=void 0!==S&&S,A=i.showTotal,z=i.onChange,W=i.onShowSizeChange,D=i.simple,I=void 0!==D&&D,B=i.disabled,j=void 0!==B&&B,N=i.hideOnSinglePage,M=void 0!==N&&N,R=i.className,H=void 0===R?"":R,T=i.style,O=i.size,P=void 0===O?"default":O,K=i.responsive,V=void 0!==K&&K;i.showLessItems;var Y=i.itemRender,J=m().primaryColor,Q=void 0===J?"#FB6011":J,U=l(a),X=U[0],q=U[1],G=l(x),_=G[0],Z=G[1],$=l(""),ee=$[0],ne=$[1],te=null!=o?o:X,ie=null!=p?p:_,oe=u(function(){return Math.ceil(c/ie)},[c,ie]);s(function(){void 0!==o&&q(o)},[o]),s(function(){void 0!==p&&Z(p)},[p]);var re=function(e){e<1||e>oe||e===te||j||(void 0===o&&q(e),null==z||z(e,ie))},le=function(){var e=parseInt(ee,10);e>=1&&e<=oe&&(re(e),ne(""))};if(M&&oe<=1)return null;if(I)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(H),style:T,children:[n(w,{onClick:function(){return re(te-1)},disabled:j||1===te,type:"default",size:"default"===P?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(L,{})}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[te," / ",oe]}),n(w,{onClick:function(){return re(te+1)},disabled:j||te===oe,type:"default",size:"default"===P?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(E,{})})]});var ae=(te-1)*ie+1,de=Math.min(te*ie,c);return e("div",{className:"aha-pagination w-full ".concat(H),style:f({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:V?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},T),children:[A&&n("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:A(c,[ae,de])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[c>0&&n(t,{children:Y?Y(te-1,"prev",n(w,{onClick:function(){return re(te-1)},disabled:j||1===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(L,{})})):n(w,{onClick:function(){return re(te-1)},disabled:j||1===te,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(L,{})})}),n("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(oe<=7)return Array.from({length:oe},function(e,n){return n+1});var e=[];if(te<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(oe)}else if(te>=oe-3){e.push(1),e.push("jump-prev");for(n=oe-4;n<=oe;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=te-1;n<=te+1;n++)e.push(n);e.push("jump-next"),e.push(oe)}return e}().map(function(e,t){return function(e){if("number"==typeof e){var t=e===te,i=n(w,{onClick:function(){return re(e)},disabled:j,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:"none",background:t?"#FAFAF9":"white",backgroundColor:t?"#FAFAF9":"white",color:t?Q:"#79716B",boxShadow:"none",borderRadius:"8px"},children:e},e);return Y?Y(e,"page",i):i}if("jump-prev"===e)return i=n(w,{onClick:function(){return re(Math.max(1,te-5))},disabled:j,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(te-5,"jump-prev",i):i;if("jump-next"===e)return i=n(w,{onClick:function(){return re(Math.min(oe,te+5))},disabled:j,type:"default",size:"default"===P?"medium":"small",style:{minWidth:"small"===P?"32px":"36px",height:"small"===P?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(te+5,"jump-next",i):i;return null}(e)})}),c>0&&n(t,{children:Y?Y(te+1,"next",n(w,{onClick:function(){return re(te+1)},disabled:j||te===oe,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(E,{})})):n(w,{onClick:function(){return re(te+1)},disabled:j||te===oe,type:"default",size:"default"===P?"medium":"small",style:{height:"small"===P?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(E,{})})}),v&&n(C,{value:ie,options:b.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return n=Number(e),t=Math.ceil(c/n),i=te>t?t:te,void 0===p&&Z(n),void 0===o&&q(i),null==W||W(i,n),void(null==z||z(i,n));var n,t,i},disabled:j,size:"small"===P?"small":"medium",style:{minWidth:"small"===P?80:96}}),F&&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:"Go to"}),n(k,{type:"number",min:1,value:ee,onChange:function(e){return ne(e.target.value)},onPressEnter:le,disabled:j,size:"small"===P?"small":"medium",style:{width:56,minWidth:56}}),n("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof F&&F.goButton?n(w,{onClick:le,disabled:j,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:F.goButton}):n(w,{onClick:le,disabled:j,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},I=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,u=void 0===c?"":c,p=t.style,h=t.children,x=m().primaryColor,g=o||l,v=d?"#FAFAF9":g?x:"white",y=d?"#FAFAF9":g?x:"#D7D3D0";return e("div",{className:"aha-checkbox ".concat(u),style:f({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},p),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:g?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:n(l?F:S,{style:{width:"14px",height:"14px",display:"block"}})})}),h&&n("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:h}),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"})]})};I.displayName="Checkbox";var B=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)},j=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=B(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},N=function(e){var t=e.order,i=m().primaryColor;return"ascend"===t?n(W,{style:{color:i}}):"descend"===t?n(z,{style:{color:i}}):n(A,{})},M=function(t){var o,r,a,p,g=t.columns,v=void 0===g?[]:g,m=t.dataSource,y=void 0===m?[]:m,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,z=t.bordered,W=void 0!==z&&z;t.loading;var L=t.locale,E=t.showHeader,M=void 0===E||E,R=t.title,H=t.footer,T=t.summary,O=t.scroll,P=t.tableLayout,K=void 0===P?"auto":P,V=t.onChange,Y=t.onSorterChange,J=t.onPaginationChange,Q=t.onRow,U=t.className,X=void 0===U?"":U,q=t.innerClassName,G=void 0===q?"":q,_=t.style,Z=t.expandable,$=t.rowClassName,ee=t.onHeaderRow;t.sticky;var ne=h(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];s(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],fe=ue[1],he=l(S&&"object"==typeof S&&(S.pageSize||S.defaultPageSize)||10),xe=he[0],ge=he[1];s(function(){S&&"object"==typeof S&&(void 0!==S.current&&fe(S.current),void 0!==S.pageSize&&ge(S.pageSize))},[S]);var ve=l(null),me=ve[0],ye=ve[1],be=l(null),we=be[0],ke=be[1],Ce=l(!1),Se=Ce[0],Fe=Ce[1],Ae=d(null),ze=d(null);s(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=j(e,w);l="radio"===(null==k?void 0:k.type)?n?[a]:[]:n?x(x([],ie,!0),[a],!1):ie.filter(function(e){return e!==a}),oe(l);var d=y.filter(function(e){return l.includes(j(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]),Le=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 j(e,w)}),r=e?o:[];oe(r);var l=y.filter(function(e){return r.includes(j(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]),Ee=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:v.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),Y&&Y(1===o.length?o[0]:o),V&&V({current:pe,pageSize:xe},{},1===o.length?o[0]:o,{currentDataSource:y,action:"sort"})}},[le,V,Y,pe,xe,y,v]);c(function(e,n){var t,i,o,r=j(e,w);o=n?x(x([],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 De,Ie=c(function(){var e=x([],y,!0);return le.size>0&&e.sort(function(e,n){for(var t=function(t,i){var o=v.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=B(e,o.dataIndex||t),a=B(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,v]),Be=Ie(),je=Boolean(S&&"object"==typeof S&&void 0!==S.total),Ne=u(function(){if(!1===S||!S)return Be;if(je)return Be;var e=(pe-1)*xe,n=e+xe;return Be.slice(e,n)},[Be,pe,xe,S,je]),Me=c(function(e,n){var t,i,o=null!=n?n:xe;if(fe(e),n&&ge(n),J&&J(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))),V){var r=Array.from(le.entries()).map(function(e){var n=e[0],t=e[1];return{column:v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});V({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:Be,action:"paginate"})}},[S,J,V,xe,le,v,Be]),Re=c(function(e,n,t){var i=B(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),He=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=v[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<v.length;r++){var l;if("right"===(l=v[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}}},[v,k]),Te=c(function(){if(!M)return null;var t,i,o,r,l=v.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=He(i,t.fixed,!0),d=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return n("th",f({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(){Ee(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(N,{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 j(e,w)}),o=t.length>0&&i.every(function(e){return ie.includes(e)}),r=i.some(function(e){return ie.includes(e)}),n(I,{checked:o,indeterminate:r&&!o,onChange:function(e){return Le(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(v,0);return n("thead",{ref:ze,children:n("tr",f({},s||{},{children:l}))})},[v,M,le,k,ie,Ne,w,Ee,Le,L,ee,He]),Oe=c(function(e){ye(e)},[]),Pe=c(function(e,n){e.preventDefault(),ke(n)},[]),Ke=c(function(e,n){if(e.preventDefault(),null===me||me===n)return ye(null),void ke(null);var t=x([],Ne,!0),i=t[me];t.splice(me,1),t.splice(n,0,i),ye(null),ke(null)},[me,Ne]),Ve=c(function(){ye(null),ke(null)},[]),Ye=c(function(){var e=null==L?void 0:L.emptyText,t="function"==typeof e?e():void 0!==e?e:"No data",i=v.length+(k?1:0);return n("tr",{className:"aha-table-placeholder",children:n("td",{colSpan:i,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:t})})},[null==L?void 0:L.emptyText,v.length,k]),Je=c(function(){return 0===Ne.length?Ye():Ne.map(function(t,o){var r,l=j(t,w),a=ie.includes(l),d=se.includes(l),s=(null==Q?void 0:Q(t,o))||{},c=o===Ne.length-1;return e(i.Fragment,{children:[e("tr",f({className:"".concat("function"==typeof $?$(t,o):$||""," ").concat(me===o?"dragging":""," ").concat(we===o?"drag-over":""),draggable:!0,onDragStart:function(){return Oe(o)},onDragOver:function(e){return Pe(e,o)},onDrop:function(e){return Ke(e,o)},onDragEnd:Ve,style:f({cursor:"move",opacity:me===o?.5:1,backgroundColor:we===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){me!==o&&we!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){me!==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(I,{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})})}),v.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=He(i,e.fixed,!1),s=e.width?"number"==typeof e.width?"".concat(e.width,"px"):e.width:void 0;return n("td",f({className:"".concat(e.className||""," ").concat(e.align?"text-".concat(e.align):""),style:f({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:Re(e,t,o)}),l)})]})),(null==Z?void 0:Z.expandedRowRender)&&d&&n("tr",{children:n("td",{colSpan:v.length+(k?1:0),children:Z.expandedRowRender(t,o,0,!0)})})]},l)})},[Ne,w,ie,se,k,v,Q,$,We,Re,Z,me,we,Oe,Pe,Ke,Ve,He,Ye]),Qe=function(){var e;if(!1===S||!S)return null;var t=null!==(e=S.total)&&void 0!==e?e:Be.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(D,{current:pe,total:t,pageSize:xe,showSizeChanger:S.showSizeChanger,pageSizeOptions:S.pageSizeOptions,showQuickJumper:S.showQuickJumper,showTotal:S.showTotal,onChange:Me,onShowSizeChange:Me,simple:S.simple,responsive:S.responsive,size:"small"===A?"small":"default"})})},Ue=u(function(){return v.some(function(e){return e.fixed})||k&&k.fixed},[v,k]),Xe=u(function(){return v.every(function(e){return e.width})&&(!k||k.columnWidth)},[v,k]),qe=u(function(){if(null==O?void 0:O.x){if("number"==typeof O.x)return O.x;if(!0===O.x)return v.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(Ue)return v.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)},[v,null==O?void 0:O.x,k,Ue]),Ge=u(function(){return"fixed"===K||Ue||Xe||v.some(function(e){return e.width})?"fixed":K},[K,Ue,Xe,v]),_e=f(f({width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},W&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ze=f({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==O?void 0:O.y)?"".concat(O.y,"px"):void 0,borderRadius:"8px"},_);if(Se)return e("div",f({ref:Ae,className:"aha-table aha-table-mobile-wrapper ".concat(X),style:Ze},ne,{children:[R&&n("div",{style:{marginBottom:"16px"},children:R(Be)}),S&&"object"==typeof S&&(null===(o=S.position)||void 0===o?void 0:o.startsWith("top"))&&Qe(),(De="function"==typeof(null==L?void 0:L.emptyText)?L.emptyText():void 0!==(null==L?void 0:L.emptyText)?L.emptyText:"No data",0===Ne.length?n("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:De}):n("div",{className:"aha-table-mobile",children:Ne.map(function(t,i){var o,r=j(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(I,{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})}),v.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),l=B(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(Be)}),S&&("object"!=typeof S||!(null===(r=S.position)||void 0===r?void 0:r.startsWith("top")))&&Qe()]}));var $e={position:"relative",overflowX:(null==O?void 0:O.x)||Ue?"auto":"visible",overflowY:(null==O?void 0:O.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==O?void 0:O.x)?"100%":"number"==typeof(null==O?void 0:O.x)?"".concat(O.x,"px"):void 0,maxHeight:"number"==typeof(null==O?void 0:O.y)?"".concat(O.y,"px"):void 0,borderRadius:"8px"};return e("div",f({ref:Ae,className:"aha-table ".concat(X),style:Ze},ne,{children:[R&&n("div",{style:{marginBottom:"16px"},children:R(Be)}),S&&"object"==typeof S&&(null===(a=S.position)||void 0===a?void 0:a.startsWith("top"))&&Qe(),n("div",{style:$e,children:n("div",{style:{width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",display:"block"},children:e("table",{style:_e,className:G,children:[Te(),n("tbody",{children:Je()}),T&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:v.length+(k?1:0),children:T(Be)})})})]})})}),H&&n("div",{style:{marginTop:"16px"},children:H(Be)}),S&&("object"!=typeof S||!(null===(p=S.position)||void 0===p?void 0:p.startsWith("top")))&&Qe()]}))};export{M as default};
2
2
  //# sourceMappingURL=Table.esm.js.map