aha-components 1.7.6 → 1.7.8
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/Button.esm.js +1 -1
- package/dist/Button.esm.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Popover.esm.js +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/components/Button/Button.stories.d.ts +15 -7
- package/dist/components/Button/index.d.ts +19 -15
- package/dist/components/Popover/index.d.ts +6 -0
- package/dist/index.d.ts +24 -15
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/DesignTokens.stories.d.ts +5 -0
- package/dist/tokens.d.ts +1253 -0
- package/package.json +1 -1
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,forwardRef as a,useRef as d,useEffect as s,useCallback as c,useMemo as p}from"react";import{createPortal as u}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,p=void 0!==c&&c,u=t.loading,x=void 0!==u&&u,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,L=h(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),W=m().primaryColor,D=void 0===W?"#FB6011":W,E=l(!1),I=E[0],B=E[1],j=l(!1),N=j[0],M=j[1],R=y[s],H=p||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=D,p?(i.opacity=.4,i.cursor="not-allowed"):x?i.backgroundColor=D:N?i.backgroundColor="#EC470A":I&&(i.backgroundColor="#FD843A")):p?(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},L,{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,p=void 0!==c&&c,u=o.error,x=void 0!==u&&u,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,L=void 0===z?"text":z,W=o.placeholder,D=o.value,E=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(E||D||""),P=O[0],K=O[1],Y=i.useState(!1),V=Y[0],J=Y[1];s(function(){"function"==typeof r?r(T.current):r&&(r.current=T.current)},[r]);var Q=void 0!==D,q=Q?D:P,U=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()},X=k&&q&&!p,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||X?"40px":"12px",Z=f({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(x?"#F04438":V?H:"#D7D3D0"),backgroundColor:p||v?"#FAFAF9":"#FFFFFF",color:p?"#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:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:y}),n("input",f({ref:T,type:L,value:q,placeholder:W,disabled:p,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||X)&&e("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:p?"#98A2B3":"#78716C",zIndex:1},children:[X&&n(function(){return n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:U,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,L=o.showSearch,W=void 0!==L&&L,D=o.filterOption,E=void 0===D||D,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,Y=o.style,V=o.dropdownClassName,J=void 0===V?"":V,Q=o.dropdownStyle,q=o.defaultOpen,U=void 0!==q&&q,X=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(U),re=oe[0],le=oe[1],ae=l(""),de=ae[0],se=ae[1],ce=l(-1),pe=ce[0],ue=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!==X,we=ye?a:te,ke=be?X: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 W&&de?!1===E?v:"function"==typeof E?v.filter(function(e){return E(de,e)}):v.filter(function(e){var n=String(e.label||"").toLowerCase(),t=de.toLowerCase();return n.includes(t)}):v},[v,de,W,E]),Ae=p(function(){return Fe()},[Fe]);s(function(){if(ke&&fe.current){var e=function(){var e,n;if(fe.current){var t=fe.current.getBoundingClientRect(),i=null!==(n=null===(e=xe.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*Ae.length)),o=window.innerHeight-t.bottom,r=t.top,l=o<i+4&&r>o,a=l?t.top+window.scrollY-i-4:t.bottom+window.scrollY+4;me({top:a,left:t.left+window.scrollX,width:t.width,placement:l?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[ke,Ae.length]),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(),ue(function(e){return e<Ae.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ue(function(e){return e>0?e-1:0});else if("Enter"===e.key&&pe>=0){e.preventDefault();var t=Ae[pe];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,pe,be,O]),s(function(){if(pe>=0&&xe.current){var e=xe.current.querySelectorAll(".aha-select-option")[pe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[pe]);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]),Le=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]),We=function(e){e.stopPropagation();var n=Ce?[]:void 0;ye||ie(n),null==j||j(n,[]),se("")},De={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"}},Ee=p(function(){return Se()},[Se]),Ie=p(function(){return B&&we&&!w},[B,we,w]),Be=p(function(){return Ce?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Ce,we]),je=p(function(){if(!Ce||!Array.isArray(we)||0===we.length)return null;var t="responsive"===G?Ee.slice(0,2):G?Ee.slice(0,G):Ee,o=G&&Ee.length>t.length?Ee.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 Le({},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 Le(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,Ee,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:De[z].paddingTop,paddingBottom:De[z].paddingBottom,fontSize:De[z].fontSize,lineHeight:De[z].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},Y),onClick:function(){if(!w){var e=!ke;be||le(e),null==O||O(e),e&&W?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"}}):W&&ke?n("input",{ref:he,type:"text",value:de,onChange:function(e){var n=e.target.value;se(n),null==R||R(n),ue(-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=Ee[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:We,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&&u(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:"top"===ve.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ve.placement?"bottom center":"top center",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===pe;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"})]})},L=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"})]})},W=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"})})},D=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"})})},E=function(i){var o=i.current,r=i.defaultCurrent,a=void 0===r?1:r,d=i.total,c=void 0===d?0:d,u=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,L=i.onShowSizeChange,E=i.simple,I=void 0!==E&&E,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,Y=void 0!==K&&K;i.showLessItems;var V=i.itemRender,J=m().primaryColor,Q=void 0===J?"#FB6011":J,q=l(a),U=q[0],X=q[1],G=l(x),_=G[0],Z=G[1],$=l(""),ee=$[0],ne=$[1],te=null!=o?o:U,ie=null!=u?u:_,oe=p(function(){return Math.ceil(c/ie)},[c,ie]);s(function(){void 0!==o&&X(o)},[o]),s(function(){void 0!==u&&Z(u)},[u]);var re=function(e){e<1||e>oe||e===te||j||(void 0===o&&X(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(W,{})}),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(D,{})})]});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:Y?"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:V?V(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(W,{})})):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(W,{})})}),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){return function(e){if("number"==typeof e){var t=e===te,i=n(w,{onClick:function(){return re(e)},disabled:j,type:t?"primary":"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:t?"1px solid ".concat(Q):void 0,boxShadow:"none",borderRadius:"8px"},children:e},e);return V?V(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"),V?V(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"),V?V(te+5,"jump-next",i):i;return null}(e)})}),c>0&&n(t,{children:V?V(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(D,{})})):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(D,{})})}),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===u&&Z(n),void 0===o&&X(i),null==L||L(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,p=void 0===c?"":c,u=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(p),style:f({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},u),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(i){var o=i.color;return e(t,{children:[n("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[n("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),n("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},j=function(e){var t=e.loading,i=e.spinColor;if(!t)return null;var o=!0===t?n(B,{color:i}):t;return n("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:o})},N=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)},M=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=N(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},R=function(e){var t=e.order,i=m().primaryColor;return"ascend"===t?n(L,{style:{color:i}}):"descend"===t?n(z,{style:{color:i}}):n(A,{})},H=function(t){var o,r,a,u,g=t.columns,v=void 0===g?[]:g,y=t.dataSource,b=void 0===y?[]:y,w=t.rowKey,k=void 0===w?"key":w,C=t.rowSelection,S=t.pagination,F=void 0!==S&&S,A=t.size,z=void 0===A?"middle":A,L=t.bordered,W=void 0!==L&&L,D=t.loading,B=void 0!==D&&D,H=t.locale,T=t.showHeader,O=void 0===T||T,P=t.title,K=t.footer,Y=t.summary,V=t.scroll,J=t.tableLayout,Q=void 0===J?"auto":J,q=t.onChange,U=t.onSorterChange,X=t.onPaginationChange,G=t.onRow,_=t.className,Z=void 0===_?"":_,$=t.innerClassName,ee=void 0===$?"":$,ne=t.style,te=t.expandable,ie=t.rowClassName,oe=t.onHeaderRow;t.sticky;var re=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"]),le=m().primaryColor||"#FB6011",ae=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),de=ae[0],se=ae[1];s(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&se(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var ce=l(new Map),pe=ce[0],ue=ce[1],fe=l((null==te?void 0:te.defaultExpandedRowKeys)||[]),he=fe[0],xe=fe[1],ge=l(F&&"object"==typeof F&&(F.current||F.defaultCurrent)||1),ve=ge[0],me=ge[1],ye=l(F&&"object"==typeof F&&(F.pageSize||F.defaultPageSize)||10),be=ye[0],we=ye[1];s(function(){F&&"object"==typeof F&&(void 0!==F.current&&me(F.current),void 0!==F.pageSize&&we(F.pageSize))},[F]);var ke=l(null),Ce=ke[0],Se=ke[1],Fe=l(null),Ae=Fe[0],ze=Fe[1],Le=l(!1),We=Le[0],De=Le[1],Ee=d(null),Ie=d(null);s(function(){var e=function(){De(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Be=c(function(e,n){var t,i,o,r=null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e);if(!(null==r?void 0:r.disabled)){var l,a=M(e,k);l="radio"===(null==C?void 0:C.type)?n?[a]:[]:n?x(x([],de,!0),[a],!1):de.filter(function(e){return e!==a}),se(l);var d=b.filter(function(e){return l.includes(M(e,k))});null===(i=null==C?void 0:C.onChange)||void 0===i||i.call(C,l,d),null===(o=null==C?void 0:C.onSelect)||void 0===o||o.call(C,e,n,d,new Event("select"))}},[de,k,C,b]),je=c(function(e,n){var t,i,o=n.filter(function(e){var n;return!(null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}).map(function(e){return M(e,k)}),r=e?o:[];se(r);var l=b.filter(function(e){return r.includes(M(e,k))}),a=e?n.filter(function(e){var n;return!(null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}):[];null===(t=null==C?void 0:C.onChange)||void 0===t||t.call(C,r,l),null===(i=null==C?void 0:C.onSelectAll)||void 0===i||i.call(C,e,l,a)},[k,C,b]),Ne=c(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var i=new Map(pe);null===n?i.delete(t):i.set(t,n),ue(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),U&&U(1===o.length?o[0]:o),q&&q({current:ve,pageSize:be},{},1===o.length?o[0]:o,{currentDataSource:b,action:"sort"})}},[pe,q,U,ve,be,b,v]);c(function(e,n){var t,i,o,r=M(e,k);o=n?x(x([],he,!0),[r],!1):he.filter(function(e){return e!==r}),xe(o),null===(t=null==te?void 0:te.onExpand)||void 0===t||t.call(te,n,e),null===(i=null==te?void 0:te.onExpandedRowsChange)||void 0===i||i.call(te,o)},[he,k,te]);var Me,Re=c(function(){var e=x([],b,!0);return pe.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=N(e,o.dataIndex||t),a=N(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(pe.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},[b,pe,v]),He=Re(),Te=Boolean(F&&"object"==typeof F&&void 0!==F.total),Oe=p(function(){if(!1===F||!F)return He;if(Te)return He;var e=(ve-1)*be,n=e+be;return He.slice(e,n)},[He,ve,be,F,Te]),Pe=c(function(e,n){var t,i,o=null!=n?n:be;if(me(e),n&&we(n),X&&X(e,o),F&&"object"==typeof F&&(null===(t=F.onChange)||void 0===t||t.call(F,e,n),n&&(null===(i=F.onShowSizeChange)||void 0===i||i.call(F,e,n))),q){var r=Array.from(pe.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}});q({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:He,action:"paginate"})}},[F,X,q,be,pe,v,He]),Ke=c(function(e,n,t){var i=N(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),Ye=c(function(e,n,t){if(n){var i=!0===n?"left":n,o=0;if("left"===i){if(C&&("left"===C.fixed||!0===C.fixed))o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.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(C&&"right"===C.fixed)o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return o}}},[v,C]),Ve=c(function(){if(!O)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=pe.get(r)||null,a=Ye(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(){Ne(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(R,{order:l||void 0})})]})}),r)});if(C){var a="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=n("th",{style:{width:a,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:[!C.hideSelectAll&&"radio"!==C.type&&(t=Oe.filter(function(e){var n;return!(null===(n=C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}),i=t.map(function(e){return M(e,k)}),o=t.length>0&&i.every(function(e){return de.includes(e)}),r=i.some(function(e){return de.includes(e)}),n(I,{checked:o,indeterminate:r&&!o,onChange:function(e){return je(e.target.checked,Oe)}})),C.columnTitle&&n("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");l.unshift(d)}var s=null==oe?void 0:oe(v,0);return n("thead",{ref:Ie,children:n("tr",f({},s||{},{children:l}))})},[v,O,pe,C,de,Oe,k,Ne,je,H,oe,Ye]),Je=c(function(e){Se(e)},[]),Qe=c(function(e,n){e.preventDefault(),ze(n)},[]),qe=c(function(e,n){if(e.preventDefault(),null===Ce||Ce===n)return Se(null),void ze(null);var t=x([],Oe,!0),i=t[Ce];t.splice(Ce,1),t.splice(n,0,i),Se(null),ze(null)},[Ce,Oe]),Ue=c(function(){Se(null),ze(null)},[]),Xe=c(function(){var e=null==H?void 0:H.emptyText,t="function"==typeof e?e():void 0!==e?e:"No data",i=v.length+(C?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==H?void 0:H.emptyText,v.length,C]),Ge=c(function(){return 0===Oe.length?Xe():Oe.map(function(t,o){var r,l=M(t,k),a=de.includes(l),d=he.includes(l),s=(null==G?void 0:G(t,o))||{},c=o===Oe.length-1;return e(i.Fragment,{children:[e("tr",f({className:"".concat("function"==typeof ie?ie(t,o):ie||""," ").concat(Ce===o?"dragging":""," ").concat(Ae===o?"drag-over":""),draggable:!0,onDragStart:function(){return Je(o)},onDragOver:function(e){return Qe(e,o)},onDrop:function(e){return qe(e,o)},onDragEnd:Ue,style:f({cursor:"move",opacity:Ce===o?.5:1,backgroundColor:Ae===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Ce!==o&&Ae!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Ce!==o&&Ae!==o&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&n("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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 Be(t,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,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=Ye(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:Ke(e,t,o)}),l)})]})),(null==te?void 0:te.expandedRowRender)&&d&&n("tr",{children:n("td",{colSpan:v.length+(C?1:0),children:te.expandedRowRender(t,o,0,!0)})})]},l)})},[Oe,k,de,he,C,v,G,ie,Be,Ke,te,Ce,Ae,Je,Qe,qe,Ue,Ye,Xe]),_e=function(){var e;if(!1===F||!F)return null;var t=null!==(e=F.total)&&void 0!==e?e:He.length,i=F.position||"bottomRight";return n("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:n(E,{current:ve,total:t,pageSize:be,showSizeChanger:F.showSizeChanger,pageSizeOptions:F.pageSizeOptions,showQuickJumper:F.showQuickJumper,showTotal:F.showTotal,onChange:Pe,onShowSizeChange:Pe,simple:F.simple,responsive:F.responsive,size:"small"===z?"small":"default"})})},Ze=p(function(){return v.some(function(e){return e.fixed})||C&&C.fixed},[v,C]),$e=p(function(){return v.every(function(e){return e.width})&&(!C||C.columnWidth)},[v,C]),en=p(function(){if(null==V?void 0:V.x){if("number"==typeof V.x)return V.x;if(!0===V.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)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Ze)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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[v,null==V?void 0:V.x,C,Ze]),nn=p(function(){return"fixed"===Q||Ze||$e||v.some(function(e){return e.width})?"fixed":Q},[Q,Ze,$e,v]),tn=f(f({width:"100%",minWidth:en?"".concat(en,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:nn,backgroundColor:"white"},W&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),on=f({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==V?void 0:V.y)?"".concat(V.y,"px"):void 0,borderRadius:"8px"},ne);if(We)return e("div",f({ref:Ee,className:"aha-table aha-table-mobile-wrapper ".concat(Z),style:on,"aria-busy":!!B||void 0},re,{children:[P&&n("div",{style:{marginBottom:"16px"},children:P(He)}),F&&"object"==typeof F&&(null===(o=F.position)||void 0===o?void 0:o.startsWith("top"))&&_e(),(Me="function"==typeof(null==H?void 0:H.emptyText)?H.emptyText():void 0!==(null==H?void 0:H.emptyText)?H.emptyText:"No data",0===Oe.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:Me}):n("div",{className:"aha-table-mobile",children:Oe.map(function(t,i){var o,r=M(t,k),l=de.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:[C&&n("div",{style:{marginBottom:"8px"},children:n(I,{checked:l,onChange:function(e){return Be(t,e.target.checked)},disabled:null===(o=C.getCheckboxProps)||void 0===o?void 0:o.call(C,t).disabled})}),v.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),l=N(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)})})),K&&n("div",{style:{marginTop:"16px"},children:K(He)}),F&&("object"!=typeof F||!(null===(r=F.position)||void 0===r?void 0:r.startsWith("top")))&&_e(),n(j,{loading:B,spinColor:le})]}));var rn={position:"relative",overflowX:(null==V?void 0:V.x)||Ze?"auto":"visible",overflowY:(null==V?void 0:V.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==V?void 0:V.x)?"100%":"number"==typeof(null==V?void 0:V.x)?"".concat(V.x,"px"):void 0,maxHeight:"number"==typeof(null==V?void 0:V.y)?"".concat(V.y,"px"):void 0,borderRadius:"8px"};return e("div",f({ref:Ee,className:"aha-table ".concat(Z),style:on,"aria-busy":!!B||void 0},re,{children:[P&&n("div",{style:{marginBottom:"16px"},children:P(He)}),F&&"object"==typeof F&&(null===(a=F.position)||void 0===a?void 0:a.startsWith("top"))&&_e(),n("div",{style:rn,children:n("div",{style:{width:"100%",minWidth:en?"".concat(en,"px"):"100%",display:"block"},children:e("table",{style:tn,className:ee,children:[Ve(),n("tbody",{children:Ge()}),Y&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:v.length+(C?1:0),children:Y(He)})})})]})})}),K&&n("div",{style:{marginTop:"16px"},children:K(He)}),F&&("object"!=typeof F||!(null===(u=F.position)||void 0===u?void 0:u.startsWith("top")))&&_e(),n(j,{loading:B,spinColor:le})]}))};export{H as default};
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import o,{createContext as i,useContext as r,useState as a,forwardRef as l,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,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},f.apply(this,arguments)};function h(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t}function g(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var v={primaryColor:"#FB6011"},x=i(v),m=function(){var e=r(x);return e||v},y={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},b={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},w={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},k=function(o){var i=o.size,r=o.color;return e(t,{children:[n("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[n("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",opacity:"0.25"}),n("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:r,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},C=function(t){var o=t.children,i=t.type,r=void 0===i?"secondary":i,l=t.size,d=void 0===l?"md":l,s=t.disabled,c=void 0!==s&&s,u=t.loading,p=void 0!==u&&u,g=t.iconOnly,v=t.focused,x=void 0!==v&&v,C=t.onClick,S=t.htmlType,F=void 0===S?"button":S,z=t.className,A=void 0===z?"":z,W=t.style,L=t.icon,I=t.iconPosition,B=void 0===I?"left":I,D=h(t,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),E=m().primaryColor,j=a(!1),N=j[0],M=j[1],R=a(!1),H=R[0],T=R[1],O=b[r]||"secondary",P=w[y[d]||"md"],K=null!=g?g:!!L&&null==o,X="link-color"===O||"link-gray"===O||"destructive-link"===O,_=c||p,q=x,Y=E,V=function(){if(c)return"primary"===O||"secondary"===O||"destructive-primary"===O||"destructive-secondary"===O?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=N||H;return"primary"===O?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":Y||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===O?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===O?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===O?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===O?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===O?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===O?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===O?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),J=function(){if(q)return"destructive-primary"===O||"destructive-secondary"===O||"destructive-tertiary"===O||"destructive-link"===O?"destructive-primary"===O||"destructive-secondary"===O?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===O||"secondary"===O?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),Q=f({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:P.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:P.fontSize,lineHeight:"".concat(P.lineHeight,"px"),cursor:_?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:V.bg,color:V.color,border:V.border,boxShadow:null!=J?J:V.boxShadow,textDecoration:V.textDecoration},W);X?(Q.borderRadius="4px",Q.overflow="hidden",K?(Q.width=P.height,Q.height=P.height,Q.padding=0):(Q.height=P.height,Q.paddingLeft=P.paddingX,Q.paddingRight=P.paddingX)):(Q.borderRadius="var(--radius-md, 8px)",K?(Q.width=P.height,Q.height=P.height,Q.padding=0):(Q.height=P.height,Q.paddingLeft=P.paddingX,Q.paddingRight=P.paddingX));var U=function(){return p?n(k,{size:P.iconSize,color:V.iconColor}):L?n("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:P.iconSize,height:P.iconSize,color:V.iconColor,flexShrink:0},children:L}):null},G=p||L&&"left"===B,Z=!p&&L&&"right"===B;return e("button",f({type:F,className:["aha-button","aha-button--".concat(O),"aha-button--".concat(y[d]||"md"),K&&"aha-button--icon-only",_&&"aha-button--disabled",p&&"aha-button--loading",q&&"aha-button--focused",A].filter(Boolean).join(" "),disabled:_,onClick:function(e){_?e.preventDefault():null==C||C(e)},onMouseEnter:function(){return!_&&M(!0)},onMouseLeave:function(){M(!1),T(!1)},onMouseDown:function(){return!_&&T(!0)},onMouseUp:function(){return T(!1)},style:Q},D,{children:[G&&U(),!K&&o,Z&&U(),K&&!L&&!p&&o]}))};C.displayName="Button";var S=l(function(i,r){var a=i.size,l=void 0===a?"medium":a,c=i.disabled,u=void 0!==c&&c,p=i.error,g=void 0!==p&&p,v=i.readOnly,x=void 0!==v&&v,y=i.prefix,b=i.suffix,w=i.allowClear,k=void 0!==w&&w,C=i.onClear,S=i.className,F=void 0===S?"":S,z=i.style,A=i.type,W=void 0===A?"text":A,L=i.placeholder,I=i.value,B=i.defaultValue,D=i.onChange,E=i.onFocus,j=i.onBlur,N=i.onPressEnter,M=h(i,["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=o.useState(B||I||""),P=O[0],K=O[1],X=o.useState(!1),_=X[0],q=X[1];s(function(){"function"==typeof r?r(T.current):r&&(r.current=T.current)},[r]);var Y=void 0!==I,V=Y?I:P,J=function(e){var n;e.stopPropagation(),Y||K("");null==D||D({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(n=T.current)||void 0===n||n.focus()},Q=k&&V&&!u,U={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"}},G=b||Q?"40px":"12px",Z=f({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":_?H:"#D7D3D0"),backgroundColor:u||x?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:y?"40px":"12px",paddingRight:G,paddingTop:U[l].paddingTop,paddingBottom:U[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},z);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:V,placeholder:L,disabled:u,readOnly:x,onChange:function(e){Y||K(e.target.value),null==D||D(e)},onFocus:function(e){q(!0),null==E||E(e)},onBlur:function(e){q(!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:J,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})]})]})]})});S.displayName="Input";var F=function(i){var r,l=i.value,h=i.defaultValue,v=i.options,x=void 0===v?[]:v,y=i.mode,b=i.disabled,w=void 0!==b&&b,k=i.error,C=void 0!==k&&k,S=i.placeholder,F=void 0===S?"Please select":S,z=i.size,A=void 0===z?"medium":z,W=i.showSearch,L=void 0!==W&&W,I=i.filterOption,B=void 0===I||I,D=i.allowClear,E=void 0!==D&&D,j=i.onChange,N=i.onSelect,M=i.onDeselect,R=i.onSearch,H=i.onFocus,T=i.onBlur,O=i.onDropdownVisibleChange,P=i.className,K=void 0===P?"":P,X=i.style,_=i.dropdownClassName,q=void 0===_?"":_,Y=i.dropdownStyle,V=i.defaultOpen,J=void 0!==V&&V,Q=i.open,U=i.maxTagCount,G=i.tagRender,Z=i.optionRender,$=m().primaryColor,ee=void 0===$?"#FB6011":$,ne=a(void 0!==h?h:y?[]:void 0),te=ne[0],oe=ne[1],ie=a(J),re=ie[0],ae=ie[1],le=a(""),de=le[0],se=le[1],ce=a(-1),ue=ce[0],pe=ce[1],fe=d(null),he=d(null),ge=d(null),ve=a(null),xe=ve[0],me=ve[1],ye=void 0!==l,be=void 0!==Q,we=ye?l:te,ke=be?Q:re,Ce="multiple"===y||"tags"===y,Se=c(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return x.filter(function(n){return e.includes(n.value)})},[we,x]),Fe=c(function(){return L&&de?!1===B?x:"function"==typeof B?x.filter(function(e){return B(de,e)}):x.filter(function(e){var n=String(e.label||"").toLowerCase(),t=de.toLowerCase();return n.includes(t)}):x},[x,de,L,B]),ze=u(function(){return Fe()},[Fe]);s(function(){if(ke&&fe.current){var e=function(){var e,n;if(fe.current){var t=fe.current.getBoundingClientRect(),o=null!==(n=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*ze.length)),i=window.innerHeight-t.bottom,r=t.top,a=i<o+4&&r>i,l=a?t.top+window.scrollY-o-4:t.bottom+window.scrollY+4;me({top:l,left:t.left+window.scrollX,width:t.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[ke,ze.length]),s(function(){var e=function(e){var n=e.target;fe.current&&!fe.current.contains(n)&&ge.current&&!ge.current.contains(n)&&(be||ae(!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<ze.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=ze[ue];t&&!t.disabled&&Ae(t)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!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,ze,ue,be,O]),s(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Ae=c(function(e){var n;if(!e.disabled)if(Ce){var t,o=Array.isArray(we)?we:[];o.includes(e.value)?(t=o.filter(function(n){return n!==e.value}),null==M||M(e.value,e)):(t=g(g([],o,!0),[e.value],!1),null==N||N(e.value,e)),ye||oe(t);var i=x.filter(function(e){return t.includes(e.value)});null==j||j(t,i)}else ye||oe(e.value),null==j||j(e.value,e),null==N||N(e.value,e),be||ae(!1),null==O||O(!1),se(""),null===(n=fe.current)||void 0===n||n.focus()},[Ce,we,ye,be,x,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}),o=x.find(function(e){return e.value===n});ye||oe(t),null==j||j(t,Se()),null==M||M(n,o)}},[Ce,we,ye,x,j,M,Se]),Le=function(e){e.stopPropagation();var n=Ce?[]:void 0;ye||oe(n),null==j||j(n,[]),se("")},Ie={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"}},Be=u(function(){return Se()},[Se]),De=u(function(){return E&&we&&!w},[E,we,w]),Ee=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"===U?Be.slice(0,2):U?Be.slice(0,U):Be,i=U&&Be.length>t.length?Be.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 i={label:t.label,value:t.value,closable:!w,onClose:function(){return We({},t.value)}};return G?n(o.Fragment,{children:G(i)},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)}),i>0&&e("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",i]})]})},[Ce,we,Be,U,w,G]);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:Ie[A].paddingTop,paddingBottom:Ie[A].paddingBottom,fontSize:Ie[A].fontSize,lineHeight:Ie[A].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},X),onClick:function(){if(!w){var e=!ke;be||ae(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:Ee?void 0:F,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):n("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Ee?w?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Ee?(null===(r=Be[0])||void 0===r?void 0:r.label)||we:F||" "})}),e("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[De&&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&&xe&&p(n("div",{ref:ge,className:"aha-select-dropdown ".concat(q),style:f({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.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:"top"===xe.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===xe.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Y),children:0===ze.length?n("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ze.map(function(t,o){var i=Ce?Array.isArray(we)&&we.includes(t.value):we===t.value,r=o===ue;return Z?n("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&Ae(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Z(t,{selected:i,focused:r,disabled:t.disabled||!1})},t.value):e("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return Ae(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}),i&&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)]})};F.displayName="Select";var z=function(e){var t=e.className,o=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:o,children:n("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},A=function(e){var t=e.className,o=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:o,children:n("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},W=function(e){var t=e.className,o=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:o,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"})})},L=function(t){var o=t.className,i=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:i,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"})]})},I=function(t){var o=t.className,i=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:i,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"})]})},B=function(e){var t=e.className,o=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:o,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"})})},D=function(e){var t=e.className,o=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:o,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"})})},E=function(o){var i=o.current,r=o.defaultCurrent,l=void 0===r?1:r,d=o.total,c=void 0===d?0:d,p=o.pageSize,h=o.defaultPageSize,g=void 0===h?10:h,v=o.showSizeChanger,x=void 0!==v&&v,y=o.pageSizeOptions,b=void 0===y?["10","20","50","100"]:y,w=o.showQuickJumper,k=void 0!==w&&w,z=o.showTotal,A=o.onChange,W=o.onShowSizeChange,L=o.simple,I=void 0!==L&&L,E=o.disabled,j=void 0!==E&&E,N=o.hideOnSinglePage,M=void 0!==N&&N,R=o.className,H=void 0===R?"":R,T=o.style,O=o.size,P=void 0===O?"default":O,K=o.responsive,X=void 0!==K&&K;o.showLessItems;var _=o.itemRender,q=m().primaryColor,Y=void 0===q?"#FB6011":q,V=a(l),J=V[0],Q=V[1],U=a(g),G=U[0],Z=U[1],$=a(""),ee=$[0],ne=$[1],te=null!=i?i:J,oe=null!=p?p:G,ie=u(function(){return Math.ceil(c/oe)},[c,oe]);s(function(){void 0!==i&&Q(i)},[i]),s(function(){void 0!==p&&Z(p)},[p]);var re=function(e){e<1||e>ie||e===te||j||(void 0===i&&Q(e),null==A||A(e,oe))},ae=function(){var e=parseInt(ee,10);e>=1&&e<=ie&&(re(e),ne(""))};if(M&&ie<=1)return null;if(I)return e("div",{className:"aha-pagination aha-pagination-simple ".concat(H),style:T,children:[n(C,{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(B,{})}),e("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[te," / ",ie]}),n(C,{onClick:function(){return re(te+1)},disabled:j||te===ie,type:"default",size:"default"===P?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:n(D,{})})]});var le=(te-1)*oe+1,de=Math.min(te*oe,c);return e("div",{className:"aha-pagination w-full ".concat(H),style:f({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:X?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},T),children:[z&&n("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:z(c,[le,de])}),e("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[c>0&&n(t,{children:_?_(te-1,"prev",n(C,{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(B,{})})):n(C,{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(B,{})})}),n("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ie<=7)return Array.from({length:ie},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(ie)}else if(te>=ie-3){e.push(1),e.push("jump-prev");for(n=ie-4;n<=ie;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(ie)}return e}().map(function(e){return function(e){if("number"==typeof e){var t=e===te,o=n(C,{onClick:function(){return re(e)},disabled:j,type:t?"primary":"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:t?"1px solid ".concat(Y):void 0,boxShadow:"none",borderRadius:"8px"},children:e},e);return _?_(e,"page",o):o}if("jump-prev"===e)return o=n(C,{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"),_?_(te-5,"jump-prev",o):o;if("jump-next"===e)return o=n(C,{onClick:function(){return re(Math.min(ie,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"),_?_(te+5,"jump-next",o):o;return null}(e)})}),c>0&&n(t,{children:_?_(te+1,"next",n(C,{onClick:function(){return re(te+1)},disabled:j||te===ie,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(D,{})})):n(C,{onClick:function(){return re(te+1)},disabled:j||te===ie,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(D,{})})}),x&&n(F,{value:oe,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),o=te>t?t:te,void 0===p&&Z(n),void 0===i&&Q(o),null==W||W(o,n),void(null==A||A(o,n));var n,t,o},disabled:j,size:"small"===P?"small":"medium",style:{minWidth:"small"===P?80:96}}),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:"Go to"}),n(S,{type:"number",min:1,value:ee,onChange:function(e){return ne(e.target.value)},onPressEnter:ae,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 k&&k.goButton?n(C,{onClick:ae,disabled:j,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:k.goButton}):n(C,{onClick:ae,disabled:j,type:"default",size:"default"===P?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},j=function(t){var o=t.checked,i=void 0!==o&&o,r=t.indeterminate,a=void 0!==r&&r,l=t.disabled,d=void 0!==l&&l,s=t.onChange,c=t.className,u=void 0===c?"":c,p=t.style,h=t.children,g=m().primaryColor,v=i||a,x=d?"#FAFAF9":v?g:"white",y=d?"#FAFAF9":v?g:"#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:!i},currentTarget:{checked:!i}}))},children:[n("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(y),backgroundColor:x,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:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:n(a?A:z,{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:i,ref:function(e){e&&(e.indeterminate=a)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};j.displayName="Checkbox";var N=function(o){var i=o.color;return e(t,{children:[n("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[n("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),n("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},M=function(e){var t=e.loading,o=e.spinColor;if(!t)return null;var i=!0===t?n(N,{color:o}):t;return n("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:i})},R=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)},H=function(e,n){var t,o;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=R(e,n))&&void 0!==t?t:"":null!==(o=e.key)&&void 0!==o?o:""},T=function(e){var t=e.order,o=m().primaryColor;return"ascend"===t?n(I,{style:{color:o}}):"descend"===t?n(L,{style:{color:o}}):n(W,{})},O=function(t){var i,r,l,p,v=t.columns,x=void 0===v?[]:v,y=t.dataSource,b=void 0===y?[]:y,w=t.rowKey,k=void 0===w?"key":w,C=t.rowSelection,S=t.pagination,F=void 0!==S&&S,z=t.size,A=void 0===z?"middle":z,W=t.bordered,L=void 0!==W&&W,I=t.loading,B=void 0!==I&&I,D=t.locale,N=t.showHeader,O=void 0===N||N,P=t.title,K=t.footer,X=t.summary,_=t.scroll,q=t.tableLayout,Y=void 0===q?"auto":q,V=t.onChange,J=t.onSorterChange,Q=t.onPaginationChange,U=t.onRow,G=t.className,Z=void 0===G?"":G,$=t.innerClassName,ee=void 0===$?"":$,ne=t.style,te=t.expandable,oe=t.rowClassName,ie=t.onHeaderRow;t.sticky;var re=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"]),ae=m().primaryColor||"#FB6011",le=a((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),de=le[0],se=le[1];s(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&se(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var ce=a(new Map),ue=ce[0],pe=ce[1],fe=a((null==te?void 0:te.defaultExpandedRowKeys)||[]),he=fe[0],ge=fe[1],ve=a(F&&"object"==typeof F&&(F.current||F.defaultCurrent)||1),xe=ve[0],me=ve[1],ye=a(F&&"object"==typeof F&&(F.pageSize||F.defaultPageSize)||10),be=ye[0],we=ye[1];s(function(){F&&"object"==typeof F&&(void 0!==F.current&&me(F.current),void 0!==F.pageSize&&we(F.pageSize))},[F]);var ke=a(null),Ce=ke[0],Se=ke[1],Fe=a(null),ze=Fe[0],Ae=Fe[1],We=a(!1),Le=We[0],Ie=We[1],Be=d(null),De=d(null);s(function(){var e=function(){Ie(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Ee=c(function(e,n){var t,o,i,r=null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e);if(!(null==r?void 0:r.disabled)){var a,l=H(e,k);a="radio"===(null==C?void 0:C.type)?n?[l]:[]:n?g(g([],de,!0),[l],!1):de.filter(function(e){return e!==l}),se(a);var d=b.filter(function(e){return a.includes(H(e,k))});null===(o=null==C?void 0:C.onChange)||void 0===o||o.call(C,a,d),null===(i=null==C?void 0:C.onSelect)||void 0===i||i.call(C,e,n,d,new Event("select"))}},[de,k,C,b]),je=c(function(e,n){var t,o,i=n.filter(function(e){var n;return!(null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}).map(function(e){return H(e,k)}),r=e?i:[];se(r);var a=b.filter(function(e){return r.includes(H(e,k))}),l=e?n.filter(function(e){var n;return!(null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}):[];null===(t=null==C?void 0:C.onChange)||void 0===t||t.call(C,r,a),null===(o=null==C?void 0:C.onSelectAll)||void 0===o||o.call(C,e,a,l)},[k,C,b]),Ne=c(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var o=new Map(ue);null===n?o.delete(t):o.set(t,n),pe(o);var i=Array.from(o.entries()).map(function(n){var t=n[0],o=n[1];return{column:x.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t})||e,order:o,field:t,columnKey:t}}),r={column:e,order:n,field:t,columnKey:t};e.onSorterChange&&e.onSorterChange(r),J&&J(1===i.length?i[0]:i),V&&V({current:xe,pageSize:be},{},1===i.length?i[0]:i,{currentDataSource:b,action:"sort"})}},[ue,V,J,xe,be,b,x]);c(function(e,n){var t,o,i,r=H(e,k);i=n?g(g([],he,!0),[r],!1):he.filter(function(e){return e!==r}),ge(i),null===(t=null==te?void 0:te.onExpand)||void 0===t||t.call(te,n,e),null===(o=null==te?void 0:te.onExpandedRowsChange)||void 0===o||o.call(te,i)},[he,k,te]);var Me,Re=c(function(){var e=g([],b,!0);return ue.size>0&&e.sort(function(e,n){for(var t=function(t,o){var i=x.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t});if(!i)return"continue";var r=0;if("function"==typeof i.sorter)r=i.sorter(e,n);else if(!0===i.sorter){var a=R(e,i.dataIndex||t),l=R(n,i.dataIndex||t);a<l?r=-1:a>l&&(r=1)}return 0!==r?{value:"ascend"===o?r:-r}:void 0},o=0,i=Array.from(ue.entries());o<i.length;o++){var r=i[o],a=t(r[0],r[1]);if("object"==typeof a)return a.value}return 0}),e},[b,ue,x]),He=Re(),Te=Boolean(F&&"object"==typeof F&&void 0!==F.total),Oe=u(function(){if(!1===F||!F)return He;if(Te)return He;var e=(xe-1)*be,n=e+be;return He.slice(e,n)},[He,xe,be,F,Te]),Pe=c(function(e,n){var t,o,i=null!=n?n:be;if(me(e),n&&we(n),Q&&Q(e,i),F&&"object"==typeof F&&(null===(t=F.onChange)||void 0===t||t.call(F,e,n),n&&(null===(o=F.onShowSizeChange)||void 0===o||o.call(F,e,n))),V){var r=Array.from(ue.entries()).map(function(e){var n=e[0],t=e[1];return{column:x.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:i},{},1===r.length?r[0]:r,{currentDataSource:He,action:"paginate"})}},[F,Q,V,be,ue,x,He]),Ke=c(function(e,n,t){var o=R(n,e.dataIndex||"");return e.render?e.render(o,n,t):o},[]),Xe=c(function(e,n,t){if(n){var o=!0===n?"left":n,i=0;if("left"===o){if(C&&("left"===C.fixed||!0===C.fixed))i+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var r=0;r<e;r++){if("left"===(a=x[r]).fixed||!0===a.fixed)i+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return i}if("right"===o){for(r=e+1;r<x.length;r++){var a;if("right"===(a=x[r]).fixed)i+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)i+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return i}}},[x,C]),_e=c(function(){if(!O)return null;var t,o,i,r,a=x.map(function(t,o){var i,r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||o,a=ue.get(r)||null,l=Xe(o,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!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"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===(i=t.onHeaderCell)||void 0===i?void 0:i.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:a,sortColumn:t}):t.title}),t.sorter&&n("button",{onClick:function(){Ne(t,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:n(T,{order:a||void 0})})]})}),r)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=n("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:[!C.hideSelectAll&&"radio"!==C.type&&(t=Oe.filter(function(e){var n;return!(null===(n=C.getCheckboxProps)||void 0===n?void 0:n.call(C,e).disabled)}),o=t.map(function(e){return H(e,k)}),i=t.length>0&&o.every(function(e){return de.includes(e)}),r=o.some(function(e){return de.includes(e)}),n(j,{checked:i,indeterminate:r&&!i,onChange:function(e){return je(e.target.checked,Oe)}})),C.columnTitle&&n("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(d)}var s=null==ie?void 0:ie(x,0);return n("thead",{ref:De,children:n("tr",f({},s||{},{children:a}))})},[x,O,ue,C,de,Oe,k,Ne,je,D,ie,Xe]),qe=c(function(e){Se(e)},[]),Ye=c(function(e,n){e.preventDefault(),Ae(n)},[]),Ve=c(function(e,n){if(e.preventDefault(),null===Ce||Ce===n)return Se(null),void Ae(null);var t=g([],Oe,!0),o=t[Ce];t.splice(Ce,1),t.splice(n,0,o),Se(null),Ae(null)},[Ce,Oe]),Je=c(function(){Se(null),Ae(null)},[]),Qe=c(function(){var e=null==D?void 0:D.emptyText,t="function"==typeof e?e():void 0!==e?e:"No data",o=x.length+(C?1:0);return n("tr",{className:"aha-table-placeholder",children:n("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:t})})},[null==D?void 0:D.emptyText,x.length,C]),Ue=c(function(){return 0===Oe.length?Qe():Oe.map(function(t,i){var r,a=H(t,k),l=de.includes(a),d=he.includes(a),s=(null==U?void 0:U(t,i))||{},c=i===Oe.length-1;return e(o.Fragment,{children:[e("tr",f({className:"".concat("function"==typeof oe?oe(t,i):oe||""," ").concat(Ce===i?"dragging":""," ").concat(ze===i?"drag-over":""),draggable:!0,onDragStart:function(){return qe(i)},onDragOver:function(e){return Ye(e,i)},onDrop:function(e){return Ve(e,i)},onDragEnd:Je,style:f({cursor:"move",opacity:Ce===i?.5:1,backgroundColor:ze===i?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Ce!==i&&ze!==i&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Ce!==i&&ze!==i&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&n("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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(j,{checked:l,onChange:function(e){return Ee(t,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,t).disabled})})}),x.map(function(e,o){var r,a=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex)||o,l=(null===(r=e.onCell)||void 0===r?void 0:r.call(e,t,i))||{},d=Xe(o,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"},l.style),colSpan:e.colSpan,rowSpan:e.rowSpan},l,{children:Ke(e,t,i)}),a)})]})),(null==te?void 0:te.expandedRowRender)&&d&&n("tr",{children:n("td",{colSpan:x.length+(C?1:0),children:te.expandedRowRender(t,i,0,!0)})})]},a)})},[Oe,k,de,he,C,x,U,oe,Ee,Ke,te,Ce,ze,qe,Ye,Ve,Je,Xe,Qe]),Ge=function(){var e;if(!1===F||!F)return null;var t=null!==(e=F.total)&&void 0!==e?e:He.length,o=F.position||"bottomRight";return n("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:n(E,{current:xe,total:t,pageSize:be,showSizeChanger:F.showSizeChanger,pageSizeOptions:F.pageSizeOptions,showQuickJumper:F.showQuickJumper,showTotal:F.showTotal,onChange:Pe,onShowSizeChange:Pe,simple:F.simple,responsive:F.responsive,size:"small"===A?"small":"default"})})},Ze=u(function(){return x.some(function(e){return e.fixed})||C&&C.fixed},[x,C]),$e=u(function(){return x.every(function(e){return e.width})&&(!C||C.columnWidth)},[x,C]),en=u(function(){if(null==_?void 0:_.x){if("number"==typeof _.x)return _.x;if(!0===_.x)return x.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Ze)return x.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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[x,null==_?void 0:_.x,C,Ze]),nn=u(function(){return"fixed"===Y||Ze||$e||x.some(function(e){return e.width})?"fixed":Y},[Y,Ze,$e,x]),tn=f(f({width:"100%",minWidth:en?"".concat(en,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:nn,backgroundColor:"white"},L&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),on=f({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==_?void 0:_.y)?"".concat(_.y,"px"):void 0,borderRadius:"8px"},ne);if(Le)return e("div",f({ref:Be,className:"aha-table aha-table-mobile-wrapper ".concat(Z),style:on,"aria-busy":!!B||void 0},re,{children:[P&&n("div",{style:{marginBottom:"16px"},children:P(He)}),F&&"object"==typeof F&&(null===(i=F.position)||void 0===i?void 0:i.startsWith("top"))&&Ge(),(Me="function"==typeof(null==D?void 0:D.emptyText)?D.emptyText():void 0!==(null==D?void 0:D.emptyText)?D.emptyText:"No data",0===Oe.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:Me}):n("div",{className:"aha-table-mobile",children:Oe.map(function(t,o){var i,r=H(t,k),a=de.includes(r);return e("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&n("div",{style:{marginBottom:"8px"},children:n(j,{checked:a,onChange:function(e){return Ee(t,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,t).disabled})}),x.map(function(i){var r=i.key||(Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex),a=R(t,i.dataIndex||""),l=i.render?i.render(a,t,o):a;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 i.title?i.title({}):i.title,":"]}),n("span",{style:{flex:1,textAlign:"right"},children:l})]},r)})]},r)})})),K&&n("div",{style:{marginTop:"16px"},children:K(He)}),F&&("object"!=typeof F||!(null===(r=F.position)||void 0===r?void 0:r.startsWith("top")))&&Ge(),n(M,{loading:B,spinColor:ae})]}));var rn={position:"relative",overflowX:(null==_?void 0:_.x)||Ze?"auto":"visible",overflowY:(null==_?void 0:_.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==_?void 0:_.x)?"100%":"number"==typeof(null==_?void 0:_.x)?"".concat(_.x,"px"):void 0,maxHeight:"number"==typeof(null==_?void 0:_.y)?"".concat(_.y,"px"):void 0,borderRadius:"8px"};return e("div",f({ref:Be,className:"aha-table ".concat(Z),style:on,"aria-busy":!!B||void 0},re,{children:[P&&n("div",{style:{marginBottom:"16px"},children:P(He)}),F&&"object"==typeof F&&(null===(l=F.position)||void 0===l?void 0:l.startsWith("top"))&&Ge(),n("div",{style:rn,children:n("div",{style:{width:"100%",minWidth:en?"".concat(en,"px"):"100%",display:"block"},children:e("table",{style:tn,className:ee,children:[_e(),n("tbody",{children:Ue()}),X&&n("tfoot",{children:n("tr",{children:n("td",{colSpan:x.length+(C?1:0),children:X(He)})})})]})})}),K&&n("div",{style:{marginTop:"16px"},children:K(He)}),F&&("object"!=typeof F||!(null===(p=F.position)||void 0===p?void 0:p.startsWith("top")))&&Ge(),n(M,{loading:B,spinColor:ae})]}))};export{O as default};
|
|
2
2
|
//# sourceMappingURL=Table.esm.js.map
|