aha-components 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tab.esm.js +1 -1
- package/dist/Tab.esm.js.map +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Tab.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/Table/Table.stories.d.ts +2 -0
- 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/package.json +1 -1
package/dist/Table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-dom"),i=function(){return i=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},i.apply(this,arguments)};function o(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 r(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 l={primaryColor:"#FB6011"},a=n.createContext(l),d=function(){var e=n.useContext(a);return e||l},s={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"}},u=function(n){var t=n.size,i=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},c=function(t){var r,l=t.children,a=t.type,c=void 0===a?"default":a,p=t.size,x=void 0===p?"medium":p,f=t.disabled,h=void 0!==f&&f,g=t.loading,v=void 0!==g&&g,m=t.onClick,y=t.htmlType,b=void 0===y?"button":y,w=t.className,j=void 0===w?"":w,k=t.style,C=t.icon,S=t.iconPosition,F=void 0===S?"left":S,A=o(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),z=d().primaryColor,W=void 0===z?"#FB6011":z,L=n.useState(!1),E=L[0],D=L[1],I=n.useState(!1),B=I[0],M=I[1],N=s[x],R=h||v,H=function(){if(v){var n="primary"===c?"#FFFFFF":"#101828",t=parseInt(N.iconSize.replace("px",""));return e.jsx(u,{size:t,color:n})}return C?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:N.iconSize,height:N.iconSize,flexShrink:0},children:C}):null},T=(r=i({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:N.gap,height:N.height,paddingLeft:N.paddingLeft,paddingRight:N.paddingRight,fontSize:N.fontSize,lineHeight:N.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:R?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},k),"primary"===c?(r.color="#FFFFFF",r.backgroundColor=W,h?(r.opacity=.4,r.cursor="not-allowed"):v?r.backgroundColor=W:B?r.backgroundColor="#EC470A":E&&(r.backgroundColor="#FD843A")):h?(r.backgroundColor="#FAFAF9",r.color="#D6D3D1",r.border="1px solid #E7E5E4"):v?(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(r.backgroundColor="#F5F5F4",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):E?(r.backgroundColor="#FAFAF9",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),r);return e.jsxs("button",i({type:b,className:"aha-button aha-button--".concat(c," aha-button--").concat(x," ").concat(R?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(j),disabled:R,onClick:function(e){R?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!R&&D(!0)},onMouseLeave:function(){D(!1),M(!1)},onMouseDown:function(){return!R&&M(!0)},onMouseUp:function(){return M(!1)},style:T},A,{children:[v&&H(),!v&&"left"===F&&H(),l&&e.jsx("span",{style:{display:"inline-block"},children:l}),!v&&"right"===F&&H()]}))};c.displayName="Button";var p=n.forwardRef(function(t,r){var l=t.size,a=void 0===l?"medium":l,s=t.disabled,u=void 0!==s&&s,c=t.error,p=void 0!==c&&c,x=t.readOnly,f=void 0!==x&&x,h=t.prefix,g=t.suffix,v=t.allowClear,m=void 0!==v&&v,y=t.onClear,b=t.className,w=void 0===b?"":b,j=t.style,k=t.type,C=void 0===k?"text":k,S=t.placeholder,F=t.value,A=t.defaultValue,z=t.onChange,W=t.onFocus,L=t.onBlur,E=t.onPressEnter,D=o(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),I=d().primaryColor,B=void 0===I?"#FB6011":I,M=n.useRef(null),N=n.useState(A||F||""),R=N[0],H=N[1],T=n.useState(!1),O=T[0],P=T[1];n.useEffect(function(){"function"==typeof r?r(M.current):r&&(r.current=M.current)},[r]);var K=void 0!==F,Y=K?F:R,q=function(e){var n;e.stopPropagation(),K||H("");null==z||z({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(n=M.current)||void 0===n||n.focus()},V=m&&Y&&!u,J={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"}},Q=g||V?"40px":"12px",_=i({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":O?B:"#D7D3D0"),backgroundColor:u||f?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:h?"40px":"12px",paddingRight:Q,paddingTop:J[a].paddingTop,paddingBottom:J[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},j);return e.jsxs(e.Fragment,{children:[e.jsx("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.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[h&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:u?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:h}),e.jsx("input",i({ref:M,type:C,value:Y,placeholder:S,disabled:u,readOnly:f,onChange:function(e){K||H(e.target.value),null==z||z(e)},onFocus:function(e){P(!0),null==W||W(e)},onBlur:function(e){P(!1),null==L||L(e)},onKeyDown:function(e){var n;"Enter"===e.key&&E&&E(e),null===(n=D.onKeyDown)||void 0===n||n.call(D,e)},style:_,autoComplete:D.autoComplete||"off",autoCorrect:D.autoCorrect||"off",autoCapitalize:D.autoCapitalize||"off",spellCheck:D.spellCheck||!1},D)),(g||V)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:u?"#98A2B3":"#78716C",zIndex:1},children:[V&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:q,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});p.displayName="Input";var x=function(o){var l,a=o.value,s=o.defaultValue,u=o.options,c=void 0===u?[]:u,p=o.mode,x=o.disabled,f=void 0!==x&&x,h=o.error,g=void 0!==h&&h,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,j=void 0!==w&&w,k=o.filterOption,C=void 0===k||k,S=o.allowClear,F=void 0!==S&&S,A=o.onChange,z=o.onSelect,W=o.onDeselect,L=o.onSearch,E=o.onFocus,D=o.onBlur,I=o.onDropdownVisibleChange,B=o.className,M=void 0===B?"":B,N=o.style,R=o.dropdownClassName,H=void 0===R?"":R,T=o.dropdownStyle,O=o.defaultOpen,P=void 0!==O&&O,K=o.open,Y=o.maxTagCount,q=o.tagRender,V=o.optionRender,J=d().primaryColor,Q=void 0===J?"#FB6011":J,_=n.useState(void 0!==s?s:p?[]:void 0),U=_[0],X=_[1],G=n.useState(P),Z=G[0],$=G[1],ee=n.useState(""),ne=ee[0],te=ee[1],ie=n.useState(-1),oe=ie[0],re=ie[1],le=n.useRef(null),ae=n.useRef(null),de=n.useRef(null),se=n.useState(null),ue=se[0],ce=se[1],pe=void 0!==a,xe=void 0!==K,fe=pe?a:U,he=xe?K:Z,ge="multiple"===p||"tags"===p,ve=n.useCallback(function(){if(!fe)return[];var e=Array.isArray(fe)?fe:[fe];return c.filter(function(n){return e.includes(n.value)})},[fe,c]),me=n.useCallback(function(){return j&&ne?!1===C?c:"function"==typeof C?c.filter(function(e){return C(ne,e)}):c.filter(function(e){var n=String(e.label||"").toLowerCase(),t=ne.toLowerCase();return n.includes(t)}):c},[c,ne,j,C]),ye=n.useMemo(function(){return me()},[me]);n.useEffect(function(){if(he&&le.current){var e=function(){var e,n;if(le.current){var t=le.current.getBoundingClientRect(),i=null!==(n=null===(e=de.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*ye.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;ce({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)}}ce(null)},[he,ye.length]),n.useEffect(function(){var e=function(e){var n=e.target;le.current&&!le.current.contains(n)&&de.current&&!de.current.contains(n)&&(xe||$(!1),null==I||I(!1),te(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,xe,I]),n.useEffect(function(){if(he){var e=function(e){var n;if("ArrowDown"===e.key)e.preventDefault(),re(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),re(function(e){return e>0?e-1:0});else if("Enter"===e.key&&oe>=0){e.preventDefault();var t=ye[oe];t&&!t.disabled&&be(t)}else"Escape"===e.key&&(e.preventDefault(),xe||$(!1),null==I||I(!1),null===(n=le.current)||void 0===n||n.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,oe,xe,I]),n.useEffect(function(){if(oe>=0&&de.current){var e=de.current.querySelectorAll(".aha-select-option")[oe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[oe]);var be=n.useCallback(function(e){var n;if(!e.disabled)if(ge){var t,i=Array.isArray(fe)?fe:[];i.includes(e.value)?(t=i.filter(function(n){return n!==e.value}),null==W||W(e.value,e)):(t=r(r([],i,!0),[e.value],!1),null==z||z(e.value,e)),pe||X(t);var o=c.filter(function(e){return t.includes(e.value)});null==A||A(t,o)}else pe||X(e.value),null==A||A(e.value,e),null==z||z(e.value,e),xe||$(!1),null==I||I(!1),te(""),null===(n=le.current)||void 0===n||n.focus()},[ge,fe,pe,xe,c,A,z,W,I]),we=n.useCallback(function(e,n){if(e.stopPropagation(),ge&&Array.isArray(fe)){var t=fe.filter(function(e){return e!==n}),i=c.find(function(e){return e.value===n});pe||X(t),null==A||A(t,ve()),null==W||W(n,i)}},[ge,fe,pe,c,A,W,ve]),je=function(e){e.stopPropagation();var n=ge?[]:void 0;pe||X(n),null==A||A(n,[]),te("")},ke={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"}},Ce=n.useMemo(function(){return ve()},[ve]),Se=n.useMemo(function(){return F&&fe&&!f},[F,fe,f]),Fe=n.useMemo(function(){return ge?Array.isArray(fe)&&fe.length>0:null!=fe&&""!==fe},[ge,fe]),Ae=n.useMemo(function(){if(!ge||!Array.isArray(fe)||0===fe.length)return null;var t="responsive"===Y?Ce.slice(0,2):Y?Ce.slice(0,Y):Ce,i=Y&&Ce.length>t.length?Ce.length-t.length:0;return e.jsxs("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:!f,onClose:function(){return we({},t.value)}};return q?e.jsx(n.Fragment,{children:q(i)},t.value):e.jsxs("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:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),!f&&e.jsx("span",{onClick:function(e){return we(e,t.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},t.value)}),i>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",i]})]})},[ge,fe,Ce,Y,f,q]);return e.jsxs(e.Fragment,{children:[e.jsx("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.jsxs("div",{ref:le,className:"aha-select ".concat(M),style:i({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(g?"#F04438":he?Q:"#D7D3D0"),backgroundColor:f?"#FAFAF9":"#FFFFFF",cursor:f?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:ke[b].paddingTop,paddingBottom:ke[b].paddingBottom,fontSize:ke[b].fontSize,lineHeight:ke[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:function(){if(!f){var e=!he;xe||$(e),null==I||I(e),e&&j?setTimeout(function(){var e;null===(e=ae.current)||void 0===e||e.focus()},0):te("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==D||D(e)},onTouchStart:function(e){f||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:f?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?Ae||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):j&&he?e.jsx("input",{ref:ae,type:"text",value:ne,onChange:function(e){var n=e.target.value;te(n),null==L||L(n),re(-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:f?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Fe?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Fe?f?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Fe?(null===(l=Ce[0])||void 0===l?void 0:l.label)||fe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Se&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:je,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(n){var t=n.isOpen;return e.jsx("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:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ue&&t.createPortal(e.jsx("div",{ref:de,className:"aha-select-dropdown ".concat(H),style:i({position:"absolute",top:"".concat(ue.top,"px"),left:"".concat(ue.left,"px"),width:"".concat(ue.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"===ue.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ue.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},T),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(n,t){var i=ge?Array.isArray(fe)&&fe.includes(n.value):fe===n.value,o=t===oe;return V?e.jsx("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&be(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:V(n,{selected:i,focused:o,disabled:n.disabled||!1})},n.value):e.jsxs("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return be(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.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:[e.jsx("span",{children:n.label}),i&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:Q,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};x.displayName="Select";var f=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},h=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},g=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},v=function(n){var t=n.className,i=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},m=function(n){var t=n.className,i=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},y=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},b=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},w=function(t){var o=t.current,r=t.defaultCurrent,l=void 0===r?1:r,a=t.total,s=void 0===a?0:a,u=t.pageSize,f=t.defaultPageSize,h=void 0===f?10:f,g=t.showSizeChanger,v=void 0!==g&&g,m=t.pageSizeOptions,w=void 0===m?["10","20","50","100"]:m,j=t.showQuickJumper,k=void 0!==j&&j,C=t.showTotal,S=t.onChange,F=t.onShowSizeChange,A=t.simple,z=void 0!==A&&A,W=t.disabled,L=void 0!==W&&W,E=t.hideOnSinglePage,D=void 0!==E&&E,I=t.className,B=void 0===I?"":I,M=t.style,N=t.size,R=void 0===N?"default":N,H=t.responsive,T=void 0!==H&&H;t.showLessItems;var O=t.itemRender,P=d().primaryColor,K=void 0===P?"#FB6011":P,Y=n.useState(l),q=Y[0],V=Y[1],J=n.useState(h),Q=J[0],_=J[1],U=n.useState(""),X=U[0],G=U[1],Z=null!=o?o:q,$=null!=u?u:Q,ee=n.useMemo(function(){return Math.ceil(s/$)},[s,$]);n.useEffect(function(){void 0!==o&&V(o)},[o]),n.useEffect(function(){void 0!==u&&_(u)},[u]);var ne=function(e){e<1||e>ee||e===Z||L||(void 0===o&&V(e),null==S||S(e,$))},te=function(){var e=parseInt(X,10);e>=1&&e<=ee&&(ne(e),G(""))};if(D&&ee<=1)return null;if(z)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(B),style:M,children:[e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Z," / ",ee]}),e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})]});var ie=(Z-1)*$+1,oe=Math.min(Z*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(B),style:i({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},M),children:[C&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(s,[ie,oe])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:O?O(Z-1,"prev",e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})})):e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:L||1===Z,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,n){return n+1});var e=[];if(Z<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(ee)}else if(Z>=ee-3){e.push(1),e.push("jump-prev");for(n=ee-4;n<=ee;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=Z-1;n<=Z+1;n++)e.push(n);e.push("jump-next"),e.push(ee)}return e}().map(function(n){return function(n){if("number"==typeof n){var t=n===Z,i=e.jsx(c,{onClick:function(){return ne(n)},disabled:L,type:t?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:t?"1px solid ".concat(K):void 0,boxShadow:"none",borderRadius:"8px"},children:n},n);return O?O(n,"page",i):i}if("jump-prev"===n)return i=e.jsx(c,{onClick:function(){return ne(Math.max(1,Z-5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O(Z-5,"jump-prev",i):i;if("jump-next"===n)return i=e.jsx(c,{onClick:function(){return ne(Math.min(ee,Z+5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O(Z+5,"jump-next",i):i;return null}(n)})}),s>0&&e.jsx(e.Fragment,{children:O?O(Z+1,"next",e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})):e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:L||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})}),v&&e.jsx(x,{value:$,options:w.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return n=Number(e),t=Math.ceil(s/n),i=Z>t?t:Z,void 0===u&&_(n),void 0===o&&V(i),null==F||F(i,n),void(null==S||S(i,n));var n,t,i},disabled:L,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),k&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(p,{type:"number",min:1,value:X,onChange:function(e){return G(e.target.value)},onPressEnter:te,disabled:L,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof k&&k.goButton?e.jsx(c,{onClick:te,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:k.goButton}):e.jsx(c,{onClick:te,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},j=function(n){var t=n.checked,o=void 0!==t&&t,r=n.indeterminate,l=void 0!==r&&r,a=n.disabled,s=void 0!==a&&a,u=n.onChange,c=n.className,p=void 0===c?"":c,x=n.style,g=n.children,v=d().primaryColor,m=o||l,y=s?"#FAFAF9":m?v:"white",b=s?"#FAFAF9":m?v:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:i({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},x),onClick:function(e){s||(null==u||u({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(b),backgroundColor:y,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:m?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:l?e.jsx(h,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(f,{style:{width:"14px",height:"14px",display:"block"}})})}),g&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:g}),e.jsx("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=l)},onChange:u,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};j.displayName="Checkbox";var k=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)},C=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=k(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},S=function(n){var t=n.order,i=d().primaryColor;return"ascend"===t?e.jsx(m,{style:{color:i}}):"descend"===t?e.jsx(v,{style:{color:i}}):e.jsx(g,{})};exports.default=function(t){var l,a,d,s,u=t.columns,c=void 0===u?[]:u,p=t.dataSource,x=void 0===p?[]:p,f=t.rowKey,h=void 0===f?"key":f,g=t.rowSelection,v=t.pagination,m=void 0!==v&&v,y=t.size,b=void 0===y?"middle":y,F=t.bordered,A=void 0!==F&&F;t.loading;var z=t.locale,W=t.showHeader,L=void 0===W||W,E=t.title,D=t.footer,I=t.summary,B=t.scroll,M=t.tableLayout,N=void 0===M?"auto":M,R=t.onChange,H=t.onSorterChange,T=t.onPaginationChange,O=t.onRow,P=t.className,K=void 0===P?"":P,Y=t.innerClassName,q=void 0===Y?"":Y,V=t.style,J=t.expandable,Q=t.rowClassName,_=t.onHeaderRow;t.sticky;var U=o(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"]),X=n.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),G=X[0],Z=X[1];n.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&Z(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var $=n.useState(new Map),ee=$[0],ne=$[1],te=n.useState((null==J?void 0:J.defaultExpandedRowKeys)||[]),ie=te[0],oe=te[1],re=n.useState(m&&"object"==typeof m&&(m.current||m.defaultCurrent)||1),le=re[0],ae=re[1],de=n.useState(m&&"object"==typeof m&&(m.pageSize||m.defaultPageSize)||10),se=de[0],ue=de[1];n.useEffect(function(){m&&"object"==typeof m&&(void 0!==m.current&&ae(m.current),void 0!==m.pageSize&&ue(m.pageSize))},[m]);var ce=n.useState(null),pe=ce[0],xe=ce[1],fe=n.useState(null),he=fe[0],ge=fe[1],ve=n.useState(!1),me=ve[0],ye=ve[1],be=n.useRef(null),we=n.useRef(null);n.useEffect(function(){var e=function(){ye(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var je=n.useCallback(function(e,n){var t,i,o,l=null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e);if(!(null==l?void 0:l.disabled)){var a,d=C(e,h);a="radio"===(null==g?void 0:g.type)?n?[d]:[]:n?r(r([],G,!0),[d],!1):G.filter(function(e){return e!==d}),Z(a);var s=x.filter(function(e){return a.includes(C(e,h))});null===(i=null==g?void 0:g.onChange)||void 0===i||i.call(g,a,s),null===(o=null==g?void 0:g.onSelect)||void 0===o||o.call(g,e,n,s,new Event("select"))}},[G,h,g,x]),ke=n.useCallback(function(e,n){var t,i,o=n.filter(function(e){var n;return!(null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}).map(function(e){return C(e,h)}),r=e?o:[];Z(r);var l=x.filter(function(e){return r.includes(C(e,h))}),a=e?n.filter(function(e){var n;return!(null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}):[];null===(t=null==g?void 0:g.onChange)||void 0===t||t.call(g,r,l),null===(i=null==g?void 0:g.onSelectAll)||void 0===i||i.call(g,e,l,a)},[h,g,x]),Ce=n.useCallback(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var i=new Map(ee);null===n?i.delete(t):i.set(t,n),ne(i);var o=Array.from(i.entries()).map(function(n){var t=n[0],i=n[1];return{column:c.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),H&&H(1===o.length?o[0]:o),R&&R({current:le,pageSize:se},{},1===o.length?o[0]:o,{currentDataSource:x,action:"sort"})}},[ee,R,H,le,se,x,c]);n.useCallback(function(e,n){var t,i,o,l=C(e,h);o=n?r(r([],ie,!0),[l],!1):ie.filter(function(e){return e!==l}),oe(o),null===(t=null==J?void 0:J.onExpand)||void 0===t||t.call(J,n,e),null===(i=null==J?void 0:J.onExpandedRowsChange)||void 0===i||i.call(J,o)},[ie,h,J]);var Se,Fe=n.useCallback(function(){var e=r([],x,!0);return ee.size>0&&e.sort(function(e,n){for(var t=function(t,i){var o=c.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=k(e,o.dataIndex||t),a=k(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(ee.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},[x,ee,c]),Ae=Fe(),ze=Boolean(m&&"object"==typeof m&&void 0!==m.total),We=n.useMemo(function(){if(!1===m||!m)return Ae;if(ze)return Ae;var e=(le-1)*se,n=e+se;return Ae.slice(e,n)},[Ae,le,se,m,ze]),Le=n.useCallback(function(e,n){var t,i,o=null!=n?n:se;if(ae(e),n&&ue(n),T&&T(e,o),m&&"object"==typeof m&&(null===(t=m.onChange)||void 0===t||t.call(m,e,n),n&&(null===(i=m.onShowSizeChange)||void 0===i||i.call(m,e,n))),R){var r=Array.from(ee.entries()).map(function(e){var n=e[0],t=e[1];return{column:c.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});R({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:Ae,action:"paginate"})}},[m,T,R,se,ee,c,Ae]),Ee=n.useCallback(function(e,n,t){var i=k(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),De=n.useCallback(function(e,n,t){if(n){var i=!0===n?"left":n,o=0;if("left"===i){if(g&&("left"===g.fixed||!0===g.fixed))o+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=c[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<c.length;r++){var l;if("right"===(l=c[r]).fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(g&&"right"===g.fixed)o+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return o}}},[c,g]),Ie=n.useCallback(function(){if(!L)return null;var n,t,o,r,l=c.map(function(n,t){var o,r=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||t,l=ee.get(r)||null,a=De(t,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("th",i({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=n.onHeaderCell)||void 0===o?void 0:o.call(n,n))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:l,sortColumn:n}):n.title}),n.sorter&&e.jsx("button",{onClick:function(){Ce(n,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:e.jsx(S,{order:l||void 0})})]})}),r)});if(g){var a="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",d=e.jsx("th",{style:{width:a,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.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.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(n=We.filter(function(e){var n;return!(null===(n=g.getCheckboxProps)||void 0===n?void 0:n.call(g,e).disabled)}),t=n.map(function(e){return C(e,h)}),o=n.length>0&&t.every(function(e){return G.includes(e)}),r=t.some(function(e){return G.includes(e)}),e.jsx(j,{checked:o,indeterminate:r&&!o,onChange:function(e){return ke(e.target.checked,We)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");l.unshift(d)}var s=null==_?void 0:_(c,0);return e.jsx("thead",{ref:we,children:e.jsx("tr",i({},s||{},{children:l}))})},[c,L,ee,g,G,We,h,Ce,ke,z,_,De]),Be=n.useCallback(function(e){xe(e)},[]),Me=n.useCallback(function(e,n){e.preventDefault(),ge(n)},[]),Ne=n.useCallback(function(e,n){if(e.preventDefault(),null===pe||pe===n)return xe(null),void ge(null);var t=r([],We,!0),i=t[pe];t.splice(pe,1),t.splice(n,0,i),xe(null),ge(null)},[pe,We]),Re=n.useCallback(function(){xe(null),ge(null)},[]),He=n.useCallback(function(){var n=null==z?void 0:z.emptyText,t="function"==typeof n?n():void 0!==n?n:"No data",i=c.length+(g?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("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==z?void 0:z.emptyText,c.length,g]),Te=n.useCallback(function(){return 0===We.length?He():We.map(function(t,o){var r,l=C(t,h),a=G.includes(l),d=ie.includes(l),s=(null==O?void 0:O(t,o))||{},u=o===We.length-1;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",i({className:"".concat("function"==typeof Q?Q(t,o):Q||""," ").concat(pe===o?"dragging":""," ").concat(he===o?"drag-over":""),draggable:!0,onDragStart:function(){return Be(o)},onDragOver:function(e){return Me(e,o)},onDrop:function(e){return Ne(e,o)},onDragEnd:Re,style:i({cursor:"move",opacity:pe===o?.5:1,backgroundColor:he===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){pe!==o&&he!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){pe!==o&&he!==o&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:u?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(j,{checked:a,onChange:function(e){return je(t,e.target.checked)},disabled:null===(r=g.getCheckboxProps)||void 0===r?void 0:r.call(g,t).disabled})})}),c.map(function(n,r){var l,a=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||r,d=(null===(l=n.onCell)||void 0===l?void 0:l.call(n,t,o))||{},s=De(r,n.fixed,!1),c=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("td",i({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:i({width:c,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:c||void 0,maxWidth:c,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:u?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:n.align||"left"},d.style),colSpan:n.colSpan,rowSpan:n.rowSpan},d,{children:Ee(n,t,o)}),a)})]})),(null==J?void 0:J.expandedRowRender)&&d&&e.jsx("tr",{children:e.jsx("td",{colSpan:c.length+(g?1:0),children:J.expandedRowRender(t,o,0,!0)})})]},l)})},[We,h,G,ie,g,c,O,Q,je,Ee,J,pe,he,Be,Me,Ne,Re,De,He]),Oe=function(){var n;if(!1===m||!m)return null;var t=null!==(n=m.total)&&void 0!==n?n:Ae.length,i=m.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:e.jsx(w,{current:le,total:t,pageSize:se,showSizeChanger:m.showSizeChanger,pageSizeOptions:m.pageSizeOptions,showQuickJumper:m.showQuickJumper,showTotal:m.showTotal,onChange:Le,onShowSizeChange:Le,simple:m.simple,responsive:m.responsive,size:"small"===b?"small":"default"})})},Pe=n.useMemo(function(){return c.some(function(e){return e.fixed})||g&&g.fixed},[c,g]),Ke=n.useMemo(function(){return c.every(function(e){return e.width})&&(!g||g.columnWidth)},[c,g]),Ye=n.useMemo(function(){if(null==B?void 0:B.x){if("number"==typeof B.x)return B.x;if(!0===B.x)return c.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(Pe)return c.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)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[c,null==B?void 0:B.x,g,Pe]),qe=n.useMemo(function(){return"fixed"===N||Pe||Ke||c.some(function(e){return e.width})?"fixed":N},[N,Pe,Ke,c]),Ve=i(i({width:"100%",minWidth:Ye?"".concat(Ye,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:qe,backgroundColor:"white"},A&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Je=i({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==B?void 0:B.y)?"".concat(B.y,"px"):void 0,borderRadius:"8px"},V);if(me)return e.jsxs("div",i({ref:be,className:"aha-table aha-table-mobile-wrapper ".concat(K),style:Je},U,{children:[E&&e.jsx("div",{style:{marginBottom:"16px"},children:E(Ae)}),m&&"object"==typeof m&&(null===(l=m.position)||void 0===l?void 0:l.startsWith("top"))&&Oe(),(Se="function"==typeof(null==z?void 0:z.emptyText)?z.emptyText():void 0!==(null==z?void 0:z.emptyText)?z.emptyText:"No data",0===We.length?e.jsx("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:Se}):e.jsx("div",{className:"aha-table-mobile",children:We.map(function(n,t){var i,o=C(n,h),r=G.includes(o);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(r?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:r?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(j,{checked:r,onChange:function(e){return je(n,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,n).disabled})}),c.map(function(i){var o=i.key||(Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex),r=k(n,i.dataIndex||""),l=i.render?i.render(r,n,t):r;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof i.title?i.title({}):i.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:l})]},o)})]},o)})})),D&&e.jsx("div",{style:{marginTop:"16px"},children:D(Ae)}),m&&("object"!=typeof m||!(null===(a=m.position)||void 0===a?void 0:a.startsWith("top")))&&Oe()]}));var Qe={position:"relative",overflowX:(null==B?void 0:B.x)||Pe?"auto":"visible",overflowY:(null==B?void 0:B.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==B?void 0:B.x)?"100%":"number"==typeof(null==B?void 0:B.x)?"".concat(B.x,"px"):void 0,maxHeight:"number"==typeof(null==B?void 0:B.y)?"".concat(B.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",i({ref:be,className:"aha-table ".concat(K),style:Je},U,{children:[E&&e.jsx("div",{style:{marginBottom:"16px"},children:E(Ae)}),m&&"object"==typeof m&&(null===(d=m.position)||void 0===d?void 0:d.startsWith("top"))&&Oe(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:Ye?"".concat(Ye,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ve,className:q,children:[Ie(),e.jsx("tbody",{children:Te()}),I&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:c.length+(g?1:0),children:I(Ae)})})})]})})}),D&&e.jsx("div",{style:{marginTop:"16px"},children:D(Ae)}),m&&("object"!=typeof m||!(null===(s=m.position)||void 0===s?void 0:s.startsWith("top")))&&Oe()]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-dom"),i=function(){return i=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},i.apply(this,arguments)};function o(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 r(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 l={primaryColor:"#FB6011"},a=n.createContext(l),s=function(){var e=n.useContext(a);return e||l},d={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"}},u=function(n){var t=n.size,i=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},c=function(t){var r,l=t.children,a=t.type,c=void 0===a?"default":a,p=t.size,x=void 0===p?"medium":p,f=t.disabled,h=void 0!==f&&f,g=t.loading,v=void 0!==g&&g,m=t.onClick,y=t.htmlType,b=void 0===y?"button":y,w=t.className,j=void 0===w?"":w,k=t.style,C=t.icon,S=t.iconPosition,F=void 0===S?"left":S,A=o(t,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),z=s().primaryColor,L=void 0===z?"#FB6011":z,W=n.useState(!1),E=W[0],D=W[1],I=n.useState(!1),B=I[0],M=I[1],N=d[x],R=h||v,H=function(){if(v){var n="primary"===c?"#FFFFFF":"#101828",t=parseInt(N.iconSize.replace("px",""));return e.jsx(u,{size:t,color:n})}return C?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:N.iconSize,height:N.iconSize,flexShrink:0},children:C}):null},T=(r=i({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:N.gap,height:N.height,paddingLeft:N.paddingLeft,paddingRight:N.paddingRight,fontSize:N.fontSize,lineHeight:N.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:R?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},k),"primary"===c?(r.color="#FFFFFF",r.backgroundColor=L,h?(r.opacity=.4,r.cursor="not-allowed"):v?r.backgroundColor=L:B?r.backgroundColor="#EC470A":E&&(r.backgroundColor="#FD843A")):h?(r.backgroundColor="#FAFAF9",r.color="#D6D3D1",r.border="1px solid #E7E5E4"):v?(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(r.backgroundColor="#F5F5F4",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):E?(r.backgroundColor="#FAFAF9",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),r);return e.jsxs("button",i({type:b,className:"aha-button aha-button--".concat(c," aha-button--").concat(x," ").concat(R?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(j),disabled:R,onClick:function(e){R?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!R&&D(!0)},onMouseLeave:function(){D(!1),M(!1)},onMouseDown:function(){return!R&&M(!0)},onMouseUp:function(){return M(!1)},style:T},A,{children:[v&&H(),!v&&"left"===F&&H(),l&&e.jsx("span",{style:{display:"inline-block"},children:l}),!v&&"right"===F&&H()]}))};c.displayName="Button";var p=n.forwardRef(function(t,r){var l=t.size,a=void 0===l?"medium":l,d=t.disabled,u=void 0!==d&&d,c=t.error,p=void 0!==c&&c,x=t.readOnly,f=void 0!==x&&x,h=t.prefix,g=t.suffix,v=t.allowClear,m=void 0!==v&&v,y=t.onClear,b=t.className,w=void 0===b?"":b,j=t.style,k=t.type,C=void 0===k?"text":k,S=t.placeholder,F=t.value,A=t.defaultValue,z=t.onChange,L=t.onFocus,W=t.onBlur,E=t.onPressEnter,D=o(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),I=s().primaryColor,B=void 0===I?"#FB6011":I,M=n.useRef(null),N=n.useState(A||F||""),R=N[0],H=N[1],T=n.useState(!1),O=T[0],P=T[1];n.useEffect(function(){"function"==typeof r?r(M.current):r&&(r.current=M.current)},[r]);var K=void 0!==F,Y=K?F:R,q=function(e){var n;e.stopPropagation(),K||H("");null==z||z({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(n=M.current)||void 0===n||n.focus()},V=m&&Y&&!u,J={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"}},Q=g||V?"40px":"12px",_=i({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":O?B:"#D7D3D0"),backgroundColor:u||f?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:h?"40px":"12px",paddingRight:Q,paddingTop:J[a].paddingTop,paddingBottom:J[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},j);return e.jsxs(e.Fragment,{children:[e.jsx("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.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[h&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:u?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:h}),e.jsx("input",i({ref:M,type:C,value:Y,placeholder:S,disabled:u,readOnly:f,onChange:function(e){K||H(e.target.value),null==z||z(e)},onFocus:function(e){P(!0),null==L||L(e)},onBlur:function(e){P(!1),null==W||W(e)},onKeyDown:function(e){var n;"Enter"===e.key&&E&&E(e),null===(n=D.onKeyDown)||void 0===n||n.call(D,e)},style:_,autoComplete:D.autoComplete||"off",autoCorrect:D.autoCorrect||"off",autoCapitalize:D.autoCapitalize||"off",spellCheck:D.spellCheck||!1},D)),(g||V)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:u?"#98A2B3":"#78716C",zIndex:1},children:[V&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:q,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});p.displayName="Input";var x=function(o){var l,a=o.value,d=o.defaultValue,u=o.options,c=void 0===u?[]:u,p=o.mode,x=o.disabled,f=void 0!==x&&x,h=o.error,g=void 0!==h&&h,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,j=void 0!==w&&w,k=o.filterOption,C=void 0===k||k,S=o.allowClear,F=void 0!==S&&S,A=o.onChange,z=o.onSelect,L=o.onDeselect,W=o.onSearch,E=o.onFocus,D=o.onBlur,I=o.onDropdownVisibleChange,B=o.className,M=void 0===B?"":B,N=o.style,R=o.dropdownClassName,H=void 0===R?"":R,T=o.dropdownStyle,O=o.defaultOpen,P=void 0!==O&&O,K=o.open,Y=o.maxTagCount,q=o.tagRender,V=o.optionRender,J=s().primaryColor,Q=void 0===J?"#FB6011":J,_=n.useState(void 0!==d?d:p?[]:void 0),U=_[0],X=_[1],G=n.useState(P),Z=G[0],$=G[1],ee=n.useState(""),ne=ee[0],te=ee[1],ie=n.useState(-1),oe=ie[0],re=ie[1],le=n.useRef(null),ae=n.useRef(null),se=n.useRef(null),de=n.useState(null),ue=de[0],ce=de[1],pe=void 0!==a,xe=void 0!==K,fe=pe?a:U,he=xe?K:Z,ge="multiple"===p||"tags"===p,ve=n.useCallback(function(){if(!fe)return[];var e=Array.isArray(fe)?fe:[fe];return c.filter(function(n){return e.includes(n.value)})},[fe,c]),me=n.useCallback(function(){return j&&ne?!1===C?c:"function"==typeof C?c.filter(function(e){return C(ne,e)}):c.filter(function(e){var n=String(e.label||"").toLowerCase(),t=ne.toLowerCase();return n.includes(t)}):c},[c,ne,j,C]),ye=n.useMemo(function(){return me()},[me]);n.useEffect(function(){if(he&&le.current){var e=function(){var e,n;if(le.current){var t=le.current.getBoundingClientRect(),i=null!==(n=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*ye.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;ce({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)}}ce(null)},[he,ye.length]),n.useEffect(function(){var e=function(e){var n=e.target;le.current&&!le.current.contains(n)&&se.current&&!se.current.contains(n)&&(xe||$(!1),null==I||I(!1),te(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,xe,I]),n.useEffect(function(){if(he){var e=function(e){var n;if("ArrowDown"===e.key)e.preventDefault(),re(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),re(function(e){return e>0?e-1:0});else if("Enter"===e.key&&oe>=0){e.preventDefault();var t=ye[oe];t&&!t.disabled&&be(t)}else"Escape"===e.key&&(e.preventDefault(),xe||$(!1),null==I||I(!1),null===(n=le.current)||void 0===n||n.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,oe,xe,I]),n.useEffect(function(){if(oe>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[oe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[oe]);var be=n.useCallback(function(e){var n;if(!e.disabled)if(ge){var t,i=Array.isArray(fe)?fe:[];i.includes(e.value)?(t=i.filter(function(n){return n!==e.value}),null==L||L(e.value,e)):(t=r(r([],i,!0),[e.value],!1),null==z||z(e.value,e)),pe||X(t);var o=c.filter(function(e){return t.includes(e.value)});null==A||A(t,o)}else pe||X(e.value),null==A||A(e.value,e),null==z||z(e.value,e),xe||$(!1),null==I||I(!1),te(""),null===(n=le.current)||void 0===n||n.focus()},[ge,fe,pe,xe,c,A,z,L,I]),we=n.useCallback(function(e,n){if(e.stopPropagation(),ge&&Array.isArray(fe)){var t=fe.filter(function(e){return e!==n}),i=c.find(function(e){return e.value===n});pe||X(t),null==A||A(t,ve()),null==L||L(n,i)}},[ge,fe,pe,c,A,L,ve]),je=function(e){e.stopPropagation();var n=ge?[]:void 0;pe||X(n),null==A||A(n,[]),te("")},ke={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"}},Ce=n.useMemo(function(){return ve()},[ve]),Se=n.useMemo(function(){return F&&fe&&!f},[F,fe,f]),Fe=n.useMemo(function(){return ge?Array.isArray(fe)&&fe.length>0:null!=fe&&""!==fe},[ge,fe]),Ae=n.useMemo(function(){if(!ge||!Array.isArray(fe)||0===fe.length)return null;var t="responsive"===Y?Ce.slice(0,2):Y?Ce.slice(0,Y):Ce,i=Y&&Ce.length>t.length?Ce.length-t.length:0;return e.jsxs("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:!f,onClose:function(){return we({},t.value)}};return q?e.jsx(n.Fragment,{children:q(i)},t.value):e.jsxs("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:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),!f&&e.jsx("span",{onClick:function(e){return we(e,t.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},t.value)}),i>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",i]})]})},[ge,fe,Ce,Y,f,q]);return e.jsxs(e.Fragment,{children:[e.jsx("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.jsxs("div",{ref:le,className:"aha-select ".concat(M),style:i({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(g?"#F04438":he?Q:"#D7D3D0"),backgroundColor:f?"#FAFAF9":"#FFFFFF",cursor:f?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:ke[b].paddingTop,paddingBottom:ke[b].paddingBottom,fontSize:ke[b].fontSize,lineHeight:ke[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:function(){if(!f){var e=!he;xe||$(e),null==I||I(e),e&&j?setTimeout(function(){var e;null===(e=ae.current)||void 0===e||e.focus()},0):te("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==D||D(e)},onTouchStart:function(e){f||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:f?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?Ae||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):j&&he?e.jsx("input",{ref:ae,type:"text",value:ne,onChange:function(e){var n=e.target.value;te(n),null==W||W(n),re(-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:f?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Fe?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Fe?f?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Fe?(null===(l=Ce[0])||void 0===l?void 0:l.label)||fe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Se&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:je,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(n){var t=n.isOpen;return e.jsx("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:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ue&&t.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(H),style:i({position:"absolute",top:"".concat(ue.top,"px"),left:"".concat(ue.left,"px"),width:"".concat(ue.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"===ue.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ue.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},T),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(n,t){var i=ge?Array.isArray(fe)&&fe.includes(n.value):fe===n.value,o=t===oe;return V?e.jsx("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&be(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:V(n,{selected:i,focused:o,disabled:n.disabled||!1})},n.value):e.jsxs("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(i?"bg-[#FAFAF9]":""),onClick:function(){return be(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.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:[e.jsx("span",{children:n.label}),i&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:Q,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};x.displayName="Select";var f=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},h=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},g=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},v=function(n){var t=n.className,i=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},m=function(n){var t=n.className,i=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},y=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},b=function(n){var t=n.className,i=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:i,children:e.jsx("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"})})},w=function(t){var o=t.current,r=t.defaultCurrent,l=void 0===r?1:r,a=t.total,d=void 0===a?0:a,u=t.pageSize,f=t.defaultPageSize,h=void 0===f?10:f,g=t.showSizeChanger,v=void 0!==g&&g,m=t.pageSizeOptions,w=void 0===m?["10","20","50","100"]:m,j=t.showQuickJumper,k=void 0!==j&&j,C=t.showTotal,S=t.onChange,F=t.onShowSizeChange,A=t.simple,z=void 0!==A&&A,L=t.disabled,W=void 0!==L&&L,E=t.hideOnSinglePage,D=void 0!==E&&E,I=t.className,B=void 0===I?"":I,M=t.style,N=t.size,R=void 0===N?"default":N,H=t.responsive,T=void 0!==H&&H;t.showLessItems;var O=t.itemRender,P=s().primaryColor,K=void 0===P?"#FB6011":P,Y=n.useState(l),q=Y[0],V=Y[1],J=n.useState(h),Q=J[0],_=J[1],U=n.useState(""),X=U[0],G=U[1],Z=null!=o?o:q,$=null!=u?u:Q,ee=n.useMemo(function(){return Math.ceil(d/$)},[d,$]);n.useEffect(function(){void 0!==o&&V(o)},[o]),n.useEffect(function(){void 0!==u&&_(u)},[u]);var ne=function(e){e<1||e>ee||e===Z||W||(void 0===o&&V(e),null==S||S(e,$))},te=function(){var e=parseInt(X,10);e>=1&&e<=ee&&(ne(e),G(""))};if(D&&ee<=1)return null;if(z)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(B),style:M,children:[e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:W||1===Z,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Z," / ",ee]}),e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:W||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})]});var ie=(Z-1)*$+1,oe=Math.min(Z*$,d);return e.jsxs("div",{className:"aha-pagination w-full ".concat(B),style:i({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},M),children:[C&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(d,[ie,oe])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[d>0&&e.jsx(e.Fragment,{children:O?O(Z-1,"prev",e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:W||1===Z,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})})):e.jsx(c,{onClick:function(){return ne(Z-1)},disabled:W||1===Z,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(y,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,n){return n+1});var e=[];if(Z<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(ee)}else if(Z>=ee-3){e.push(1),e.push("jump-prev");for(n=ee-4;n<=ee;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=Z-1;n<=Z+1;n++)e.push(n);e.push("jump-next"),e.push(ee)}return e}().map(function(n){return function(n){if("number"==typeof n){var t=n===Z,i=e.jsx(c,{onClick:function(){return ne(n)},disabled:W,type:t?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:t?"1px solid ".concat(K):void 0,boxShadow:"none",borderRadius:"8px"},children:n},n);return O?O(n,"page",i):i}if("jump-prev"===n)return i=e.jsx(c,{onClick:function(){return ne(Math.max(1,Z-5))},disabled:W,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O(Z-5,"jump-prev",i):i;if("jump-next"===n)return i=e.jsx(c,{onClick:function(){return ne(Math.min(ee,Z+5))},disabled:W,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O(Z+5,"jump-next",i):i;return null}(n)})}),d>0&&e.jsx(e.Fragment,{children:O?O(Z+1,"next",e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:W||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})):e.jsx(c,{onClick:function(){return ne(Z+1)},disabled:W||Z===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(b,{})})}),v&&e.jsx(x,{value:$,options:w.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return n=Number(e),t=Math.ceil(d/n),i=Z>t?t:Z,void 0===u&&_(n),void 0===o&&V(i),null==F||F(i,n),void(null==S||S(i,n));var n,t,i},disabled:W,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),k&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(p,{type:"number",min:1,value:X,onChange:function(e){return G(e.target.value)},onPressEnter:te,disabled:W,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof k&&k.goButton?e.jsx(c,{onClick:te,disabled:W,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:k.goButton}):e.jsx(c,{onClick:te,disabled:W,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},j=function(n){var t=n.checked,o=void 0!==t&&t,r=n.indeterminate,l=void 0!==r&&r,a=n.disabled,d=void 0!==a&&a,u=n.onChange,c=n.className,p=void 0===c?"":c,x=n.style,g=n.children,v=s().primaryColor,m=o||l,y=d?"#FAFAF9":m?v:"white",b=d?"#FAFAF9":m?v:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:i({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},x),onClick:function(e){d||(null==u||u({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(b),backgroundColor:y,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:m?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:l?e.jsx(h,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(f,{style:{width:"14px",height:"14px",display:"block"}})})}),g&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:g}),e.jsx("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=l)},onChange:u,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};j.displayName="Checkbox";var k=function(n){var t=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("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:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},C=function(n){var t=n.loading,i=n.spinColor;if(!t)return null;var o=!0===t?e.jsx(k,{color:i}):t;return e.jsx("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})},S=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)},F=function(e,n){var t,i;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=S(e,n))&&void 0!==t?t:"":null!==(i=e.key)&&void 0!==i?i:""},A=function(n){var t=n.order,i=s().primaryColor;return"ascend"===t?e.jsx(m,{style:{color:i}}):"descend"===t?e.jsx(v,{style:{color:i}}):e.jsx(g,{})};exports.default=function(t){var l,a,d,u,c=t.columns,p=void 0===c?[]:c,x=t.dataSource,f=void 0===x?[]:x,h=t.rowKey,g=void 0===h?"key":h,v=t.rowSelection,m=t.pagination,y=void 0!==m&&m,b=t.size,k=void 0===b?"middle":b,z=t.bordered,L=void 0!==z&&z,W=t.loading,E=void 0!==W&&W,D=t.locale,I=t.showHeader,B=void 0===I||I,M=t.title,N=t.footer,R=t.summary,H=t.scroll,T=t.tableLayout,O=void 0===T?"auto":T,P=t.onChange,K=t.onSorterChange,Y=t.onPaginationChange,q=t.onRow,V=t.className,J=void 0===V?"":V,Q=t.innerClassName,_=void 0===Q?"":Q,U=t.style,X=t.expandable,G=t.rowClassName,Z=t.onHeaderRow;t.sticky;var $=o(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"]),ee=s().primaryColor||"#FB6011",ne=n.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),te=ne[0],ie=ne[1];n.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&ie(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var oe=n.useState(new Map),re=oe[0],le=oe[1],ae=n.useState((null==X?void 0:X.defaultExpandedRowKeys)||[]),se=ae[0],de=ae[1],ue=n.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ce=ue[0],pe=ue[1],xe=n.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),fe=xe[0],he=xe[1];n.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&he(y.pageSize))},[y]);var ge=n.useState(null),ve=ge[0],me=ge[1],ye=n.useState(null),be=ye[0],we=ye[1],je=n.useState(!1),ke=je[0],Ce=je[1],Se=n.useRef(null),Fe=n.useRef(null);n.useEffect(function(){var e=function(){Ce(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Ae=n.useCallback(function(e,n){var t,i,o,l=null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e);if(!(null==l?void 0:l.disabled)){var a,s=F(e,g);a="radio"===(null==v?void 0:v.type)?n?[s]:[]:n?r(r([],te,!0),[s],!1):te.filter(function(e){return e!==s}),ie(a);var d=f.filter(function(e){return a.includes(F(e,g))});null===(i=null==v?void 0:v.onChange)||void 0===i||i.call(v,a,d),null===(o=null==v?void 0:v.onSelect)||void 0===o||o.call(v,e,n,d,new Event("select"))}},[te,g,v,f]),ze=n.useCallback(function(e,n){var t,i,o=n.filter(function(e){var n;return!(null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e).disabled)}).map(function(e){return F(e,g)}),r=e?o:[];ie(r);var l=f.filter(function(e){return r.includes(F(e,g))}),a=e?n.filter(function(e){var n;return!(null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e).disabled)}):[];null===(t=null==v?void 0:v.onChange)||void 0===t||t.call(v,r,l),null===(i=null==v?void 0:v.onSelectAll)||void 0===i||i.call(v,e,l,a)},[g,v,f]),Le=n.useCallback(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var i=new Map(re);null===n?i.delete(t):i.set(t,n),le(i);var o=Array.from(i.entries()).map(function(n){var t=n[0],i=n[1];return{column:p.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),K&&K(1===o.length?o[0]:o),P&&P({current:ce,pageSize:fe},{},1===o.length?o[0]:o,{currentDataSource:f,action:"sort"})}},[re,P,K,ce,fe,f,p]);n.useCallback(function(e,n){var t,i,o,l=F(e,g);o=n?r(r([],se,!0),[l],!1):se.filter(function(e){return e!==l}),de(o),null===(t=null==X?void 0:X.onExpand)||void 0===t||t.call(X,n,e),null===(i=null==X?void 0:X.onExpandedRowsChange)||void 0===i||i.call(X,o)},[se,g,X]);var We,Ee=n.useCallback(function(){var e=r([],f,!0);return re.size>0&&e.sort(function(e,n){for(var t=function(t,i){var o=p.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=S(e,o.dataIndex||t),a=S(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(re.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},[f,re,p]),De=Ee(),Ie=Boolean(y&&"object"==typeof y&&void 0!==y.total),Be=n.useMemo(function(){if(!1===y||!y)return De;if(Ie)return De;var e=(ce-1)*fe,n=e+fe;return De.slice(e,n)},[De,ce,fe,y,Ie]),Me=n.useCallback(function(e,n){var t,i,o=null!=n?n:fe;if(pe(e),n&&he(n),Y&&Y(e,o),y&&"object"==typeof y&&(null===(t=y.onChange)||void 0===t||t.call(y,e,n),n&&(null===(i=y.onShowSizeChange)||void 0===i||i.call(y,e,n))),P){var r=Array.from(re.entries()).map(function(e){var n=e[0],t=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});P({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:De,action:"paginate"})}},[y,Y,P,fe,re,p,De]),Ne=n.useCallback(function(e,n,t){var i=S(n,e.dataIndex||"");return e.render?e.render(i,n,t):i},[]),Re=n.useCallback(function(e,n,t){if(n){var i=!0===n?"left":n,o=0;if("left"===i){if(v&&("left"===v.fixed||!0===v.fixed))o+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=p[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<p.length;r++){var l;if("right"===(l=p[r]).fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(v&&"right"===v.fixed)o+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return o}}},[p,v]),He=n.useCallback(function(){if(!B)return null;var n,t,o,r,l=p.map(function(n,t){var o,r=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||t,l=re.get(r)||null,a=Re(t,n.fixed,!0),s=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("th",i({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:s,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:s||void 0,maxWidth:s,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=n.onHeaderCell)||void 0===o?void 0:o.call(n,n))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:l,sortColumn:n}):n.title}),n.sorter&&e.jsx("button",{onClick:function(){Le(n,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:e.jsx(A,{order:l||void 0})})]})}),r)});if(v){var a="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:a,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.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.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!v.hideSelectAll&&"radio"!==v.type&&(n=Be.filter(function(e){var n;return!(null===(n=v.getCheckboxProps)||void 0===n?void 0:n.call(v,e).disabled)}),t=n.map(function(e){return F(e,g)}),o=n.length>0&&t.every(function(e){return te.includes(e)}),r=t.some(function(e){return te.includes(e)}),e.jsx(j,{checked:o,indeterminate:r&&!o,onChange:function(e){return ze(e.target.checked,Be)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");l.unshift(s)}var d=null==Z?void 0:Z(p,0);return e.jsx("thead",{ref:Fe,children:e.jsx("tr",i({},d||{},{children:l}))})},[p,B,re,v,te,Be,g,Le,ze,D,Z,Re]),Te=n.useCallback(function(e){me(e)},[]),Oe=n.useCallback(function(e,n){e.preventDefault(),we(n)},[]),Pe=n.useCallback(function(e,n){if(e.preventDefault(),null===ve||ve===n)return me(null),void we(null);var t=r([],Be,!0),i=t[ve];t.splice(ve,1),t.splice(n,0,i),me(null),we(null)},[ve,Be]),Ke=n.useCallback(function(){me(null),we(null)},[]),Ye=n.useCallback(function(){var n=null==D?void 0:D.emptyText,t="function"==typeof n?n():void 0!==n?n:"No data",i=p.length+(v?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("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==D?void 0:D.emptyText,p.length,v]),qe=n.useCallback(function(){return 0===Be.length?Ye():Be.map(function(t,o){var r,l=F(t,g),a=te.includes(l),s=se.includes(l),d=(null==q?void 0:q(t,o))||{},u=o===Be.length-1;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",i({className:"".concat("function"==typeof G?G(t,o):G||""," ").concat(ve===o?"dragging":""," ").concat(be===o?"drag-over":""),draggable:!0,onDragStart:function(){return Te(o)},onDragOver:function(e){return Oe(e,o)},onDrop:function(e){return Pe(e,o)},onDragEnd:Ke,style:i({cursor:"move",opacity:ve===o?.5:1,backgroundColor:be===o?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:u?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(j,{checked:a,onChange:function(e){return Ae(t,e.target.checked)},disabled:null===(r=v.getCheckboxProps)||void 0===r?void 0:r.call(v,t).disabled})})}),p.map(function(n,r){var l,a=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||r,s=(null===(l=n.onCell)||void 0===l?void 0:l.call(n,t,o))||{},d=Re(r,n.fixed,!1),c=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("td",i({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:i({width:c,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:c||void 0,maxWidth:c,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===n.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:u?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:n.align||"left"},s.style),colSpan:n.colSpan,rowSpan:n.rowSpan},s,{children:Ne(n,t,o)}),a)})]})),(null==X?void 0:X.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:X.expandedRowRender(t,o,0,!0)})})]},l)})},[Be,g,te,se,v,p,q,G,Ae,Ne,X,ve,be,Te,Oe,Pe,Ke,Re,Ye]),Ve=function(){var n;if(!1===y||!y)return null;var t=null!==(n=y.total)&&void 0!==n?n:De.length,i=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:e.jsx(w,{current:ce,total:t,pageSize:fe,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Me,onShowSizeChange:Me,simple:y.simple,responsive:y.responsive,size:"small"===k?"small":"default"})})},Je=n.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Qe=n.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),_e=n.useMemo(function(){if(null==H?void 0:H.x){if("number"==typeof H.x)return H.x;if(!0===H.x)return p.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Je)return p.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)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==H?void 0:H.x,v,Je]),Ue=n.useMemo(function(){return"fixed"===O||Je||Qe||p.some(function(e){return e.width})?"fixed":O},[O,Je,Qe,p]),Xe=i(i({width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ue,backgroundColor:"white"},L&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ge=i({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"},U);if(ke)return e.jsxs("div",i({ref:Se,className:"aha-table aha-table-mobile-wrapper ".concat(J),style:Ge,"aria-busy":!!E||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(De)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&Ve(),(We="function"==typeof(null==D?void 0:D.emptyText)?D.emptyText():void 0!==(null==D?void 0:D.emptyText)?D.emptyText:"No data",0===Be.length?e.jsx("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:We}):e.jsx("div",{className:"aha-table-mobile",children:Be.map(function(n,t){var i,o=F(n,g),r=te.includes(o);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(r?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:r?"#e6f7ff":"white"},children:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(j,{checked:r,onChange:function(e){return Ae(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})}),p.map(function(i){var o=i.key||(Array.isArray(i.dataIndex)?i.dataIndex.join("."):i.dataIndex),r=S(n,i.dataIndex||""),l=i.render?i.render(r,n,t):r;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof i.title?i.title({}):i.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:l})]},o)})]},o)})})),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(De)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&Ve(),e.jsx(C,{loading:E,spinColor:ee})]}));var Ze={position:"relative",overflowX:(null==H?void 0:H.x)||Je?"auto":"visible",overflowY:(null==H?void 0:H.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==H?void 0:H.x)?"100%":"number"==typeof(null==H?void 0:H.x)?"".concat(H.x,"px"):void 0,maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",i({ref:Se,className:"aha-table ".concat(J),style:Ge,"aria-busy":!!E||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(De)}),y&&"object"==typeof y&&(null===(d=y.position)||void 0===d?void 0:d.startsWith("top"))&&Ve(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Xe,className:_,children:[He(),e.jsx("tbody",{children:qe()}),R&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:R(De)})})})]})})}),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(De)}),y&&("object"!=typeof y||!(null===(u=y.position)||void 0===u?void 0:u.startsWith("top")))&&Ve(),e.jsx(C,{loading:E,spinColor:ee})]}))};
|
|
2
2
|
//# sourceMappingURL=Table.js.map
|