ono-react-element 0.0.30 → 0.1.1

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.
Files changed (189) hide show
  1. package/dist/es/AutoSliderList-drdrxgEX.js +1 -0
  2. package/dist/es/{AvatarCrop-CSkrjAcy.js → AvatarCrop-Cn9RwTGU.js} +1 -1
  3. package/dist/es/Button-CWqApx4k.js +1 -0
  4. package/dist/es/{Card3D-DrfpLxw2.js → Card3D-C1ddJnYV.js} +1 -1
  5. package/dist/es/Carousel-D7JsU-he.js +1 -0
  6. package/dist/es/Checkbox-C6L0UHHG.js +1 -0
  7. package/dist/es/ContextMenu-Cg72hSPN.js +1 -0
  8. package/dist/es/FileDropZone-CQy4SsUO.js +1 -0
  9. package/dist/es/{InjunctiveBox-vLlRm8LB.js → InjunctiveBox-DsNUniss.js} +1 -1
  10. package/dist/es/Input-CdxX4nzt.js +1 -0
  11. package/dist/es/{MenuButton-M93IpBnN.js → MenuButton-CjudK6uV.js} +1 -1
  12. package/dist/es/Message-CXBf5Xji.js +1 -0
  13. package/dist/es/Modal-Cq9ZPw9X.js +1 -0
  14. package/dist/es/{Pagination-L17GYQVO.js → Pagination-wxdQuNM4.js} +1 -1
  15. package/dist/es/{PortalRenderer-izu9LyVc.js → PortalRenderer-CUaab_Kw.js} +1 -1
  16. package/dist/es/Radio-pth5zZkE.js +1 -0
  17. package/dist/es/ScrollableTabs-CNuEx01I.js +1 -0
  18. package/dist/es/Select-CprTy0VT.js +1 -0
  19. package/dist/es/SvgImg-D2DeoPaA.js +1 -0
  20. package/dist/es/Switch-CQJGc1NQ.js +1 -0
  21. package/dist/es/TemplateDialog-DAzyCsXv.js +1 -0
  22. package/dist/es/Toast-1MB_CUWF.js +1 -0
  23. package/dist/es/Tooltip-7uWxsj7r.js +1 -0
  24. package/dist/es/VirtualList-DThIEdea.js +1 -0
  25. package/dist/es/Waterfall-CDXm71jP.js +1 -0
  26. package/dist/es/adjustColor.ts-D1ttRO_o.js +1 -0
  27. package/dist/es/adjustingColors.ts-CQV_S12M.js +1 -0
  28. package/dist/es/base64ToBlob.ts-BpYnI1_k.js +1 -0
  29. package/dist/es/base64ToFile.ts-B526yxVq.js +1 -0
  30. package/dist/es/blobToBase64.ts-CJROQ7nO.js +1 -0
  31. package/dist/es/blobToFile.ts-CjkxPmEw.js +1 -0
  32. package/dist/es/changeThemeClipPathCircle.ts-CHY9pNkk.js +1 -0
  33. package/dist/es/clearAsyncContagion.ts-DseR8G-S.js +1 -0
  34. package/dist/es/controlTheScrollbarScrolling.ts-WYW8laxj.js +1 -0
  35. package/dist/es/convertSecondToOtherTime.ts-BlSK8Hsn.js +1 -0
  36. package/dist/es/createIntersectionObserver.ts-CPwdNz7M.js +1 -0
  37. package/dist/es/dayOfYear.ts-FVQlJIhw.js +1 -0
  38. package/dist/es/dependencies-D-GIrksw.js +15480 -0
  39. package/dist/es/distinguishPlatform.ts-BITl3t1o.js +1 -0
  40. package/dist/es/distinguishPlatformDelay.ts-DupUPv6F.js +1 -0
  41. package/dist/es/downloadFile.ts-C5v3gvXJ.js +1 -0
  42. package/dist/es/elementIsInViewport.ts-DnBd8TjE.js +1 -0
  43. package/dist/es/event-BIaLzjOy.js +1 -0
  44. package/dist/es/fileToBase64.ts-LDhPtYZ8.js +1 -0
  45. package/dist/es/fileToBlob.ts-C4Y1I82u.js +1 -0
  46. package/dist/es/formatColor.ts-D_Sws4M1.js +1 -0
  47. package/dist/es/formatFileSize.ts-CoUwKtCA.js +1 -0
  48. package/dist/es/formatSecond.ts-Dc436DN-.js +1 -0
  49. package/dist/es/formatTime.ts-BY0hrdXI.js +1 -0
  50. package/dist/es/getBrowserInfo.ts-CFS4Oz41.js +1 -0
  51. package/dist/es/getColorType.ts-B5Qax_03.js +1 -0
  52. package/dist/es/getContrastColor.ts-vmwZYf4O.js +1 -0
  53. package/dist/es/getFileName.ts-CAdDeTqT.js +1 -0
  54. package/dist/es/getFileSuffix.ts-RBCEexOt.js +1 -0
  55. package/dist/es/grayColor.ts-BeAK97Od.js +1 -0
  56. package/dist/es/hex2hsl.ts-fQ072W3P.js +1 -0
  57. package/dist/es/hex2hsv.ts-Bewjcepy.js +1 -0
  58. package/dist/es/hex2rgb.ts-tP-M30oZ.js +1 -0
  59. package/dist/es/hex3To6.ts-epLJiP-G.js +1 -0
  60. package/dist/es/hsl2hex.ts-BILOsbJk.js +1 -0
  61. package/dist/es/hsl2rgb.ts-DCdzknv1.js +1 -0
  62. package/dist/es/hsv2hex.ts-U8Md-VPN.js +1 -0
  63. package/dist/es/hsv2rgb.ts-C4AdDfKf.js +1 -0
  64. package/dist/es/index.js +1 -1
  65. package/dist/es/isValidColor.ts-oChVkAT9.js +1 -0
  66. package/dist/es/localFormat.ts-B32R_kV4.js +1 -0
  67. package/dist/es/randomColor.ts-BiDP87Yi.js +1 -0
  68. package/dist/es/rgb2hex.ts-itJEWSC0.js +1 -0
  69. package/dist/es/rgb2hsl.ts-BmthoL_h.js +1 -0
  70. package/dist/es/rgb2hsv.ts-o8o8uIwc.js +1 -0
  71. package/dist/es/rgb2rgba.ts-ZXQCbTkT.js +1 -0
  72. package/dist/es/second2Day.ts-XjEpcvCc.js +1 -0
  73. package/dist/es/urlToBase64.ts-DzO1pwIZ.js +1 -0
  74. package/dist/es/urlToBlob.ts-DmOp0wbt.js +1 -0
  75. package/dist/es/urlToFile.ts-KrTFcI-e.js +1 -0
  76. package/dist/es/useClickOutSide.tsx-Drp6uYap.js +1 -0
  77. package/dist/es/useCountdown.tsx-BHrpYPuf.js +1 -0
  78. package/dist/es/{useEventListener.tsx-C8V9Qip6.js → useEventListener.tsx-BDtH_FiI.js} +1 -1
  79. package/dist/es/{useGetElementSize.tsx-DML7z5Xp.js → useGetElementSize.tsx-CYGNJaFz.js} +1 -1
  80. package/dist/es/useKeyPress.tsx-ClBLUMui.js +1 -0
  81. package/dist/es/{useMouseClick.tsx-BmzbuM6X.js → useMouseClick.tsx-nz5umn7V.js} +1 -1
  82. package/dist/es/useThemePro.tsx-MwfY4tCX.js +1 -0
  83. package/dist/types/event/eventEmitter.d.ts +3 -1
  84. package/dist/types/hooks/useClickOutSide.d.ts +4 -9
  85. package/dist/types/hooks/useEventListener.d.ts +3 -6
  86. package/dist/types/hooks/useGetElementSize.d.ts +1 -2
  87. package/dist/types/hooks/useKeyPress.d.ts +7 -10
  88. package/dist/types/hooks/useTheme.d.ts +5 -6
  89. package/dist/types/hooks/useThemePro.d.ts +1 -1
  90. package/dist/types/index.d.ts +7 -4
  91. package/dist/types/utils/async2sync/clearAsyncContagion.d.ts +1 -0
  92. package/dist/types/utils/browser/getBrowserInfo.d.ts +2 -0
  93. package/dist/types/utils/color/adjustingColors.d.ts +0 -7
  94. package/dist/types/utils/color/formatColor.d.ts +1 -3
  95. package/dist/types/utils/color/getColorType.d.ts +1 -1
  96. package/dist/types/utils/common/controlTheScrollbarScrolling.d.ts +7 -0
  97. package/dist/types/utils/file/downloadFile.d.ts +0 -5
  98. package/dist/types/utils/intersectionObserver/createIntersectionObserver.d.ts +1 -0
  99. package/dist/types/utils/intersectionObserver/elementIsInViewport.d.ts +5 -0
  100. package/dist/types/utils/platform/distinguishPlatform.d.ts +1 -6
  101. package/dist/types/utils/platform/distinguishPlatformDelay.d.ts +1 -2
  102. package/dist/types/utils/time/convertTimestamp.d.ts +1 -1
  103. package/dist/types/utils/time/dateFormat.d.ts +1 -2
  104. package/dist/types/utils/time/localFormat.d.ts +3 -2
  105. package/dist/types/utils/time/monthFormat.d.ts +1 -2
  106. package/dist/types/utils/time/yearFormat.d.ts +1 -2
  107. package/dist/types/utils/viewTransition/changeThemeClipPathCircle.d.ts +6 -0
  108. package/dist/umd/index.umd.cjs +1 -1
  109. package/dist/umd/index.umd.cjs.br +0 -0
  110. package/dist/umd/index.umd.cjs.gz +0 -0
  111. package/package.json +3 -7
  112. package/dist/es/AutoSliderList-CVDZG5cu.js +0 -1
  113. package/dist/es/Button-P2AG5fc6.js +0 -1
  114. package/dist/es/Carousel-DOesUSmW.js +0 -1
  115. package/dist/es/Checkbox-DJYMF9I4.js +0 -1
  116. package/dist/es/ContextMenu-DlhlsQrA.js +0 -1
  117. package/dist/es/FileDropZone-BSLGVa4n.js +0 -1
  118. package/dist/es/Input-Hy30rZ_v.js +0 -1
  119. package/dist/es/Message-COQA0S8d.js +0 -1
  120. package/dist/es/Modal-CJrgmTMc.js +0 -1
  121. package/dist/es/Radio-CEooiIll.js +0 -1
  122. package/dist/es/ScrollableTabs-okdQWyZ9.js +0 -1
  123. package/dist/es/Select-bhQ7DjXD.js +0 -1
  124. package/dist/es/SvgImg-D_jzo9p9.js +0 -1
  125. package/dist/es/Switch-DZ-GXwol.js +0 -1
  126. package/dist/es/TemplateDialog-iy7z7joV.js +0 -1
  127. package/dist/es/Toast-CZw9LQzq.js +0 -1
  128. package/dist/es/Tooltip-DvUB7xZH.js +0 -1
  129. package/dist/es/VirtualList-CoQKjvuB.js +0 -1
  130. package/dist/es/Waterfall-B9EXJfxK.js +0 -1
  131. package/dist/es/adjustColor.ts-Bcmtt429.js +0 -1
  132. package/dist/es/adjustingColors.ts-CpC0GUUO.js +0 -1
  133. package/dist/es/async2syncUtils.ts-DkF1iSK4.js +0 -1
  134. package/dist/es/base64ToBlob.ts-TfYiqeZD.js +0 -1
  135. package/dist/es/base64ToFile.ts-DMMwTaBr.js +0 -1
  136. package/dist/es/blobToBase64.ts-CPZTWtAM.js +0 -1
  137. package/dist/es/blobToFile.ts-BXmUv6W-.js +0 -1
  138. package/dist/es/browserUtils.ts-DSM1TN_g.js +0 -1
  139. package/dist/es/convertSecondToOtherTime.ts-BJegkJhl.js +0 -1
  140. package/dist/es/convertTimestamp.ts-DOHA1Ix6.js +0 -1
  141. package/dist/es/dateFormat.ts-DXskLY1N.js +0 -1
  142. package/dist/es/dayOfYear.ts-DdscYtyU.js +0 -1
  143. package/dist/es/dependencies-B7YNjh_z.js +0 -15719
  144. package/dist/es/distinguishPlatform.ts-D2huTxC3.js +0 -1
  145. package/dist/es/downloadFile.ts-1nf2IAw4.js +0 -1
  146. package/dist/es/event-B2tGdMqN.js +0 -1
  147. package/dist/es/fileToBase64.ts-Dx4eMf1P.js +0 -1
  148. package/dist/es/fileToBlob.ts-t5-IVXI8.js +0 -1
  149. package/dist/es/formatColor.ts-BpkK5FYe.js +0 -1
  150. package/dist/es/formatFileSize.ts-DmkABYUs.js +0 -1
  151. package/dist/es/formatSecond.ts-CI2ihnKf.js +0 -1
  152. package/dist/es/formatTime.ts-DNtDsT9L.js +0 -1
  153. package/dist/es/getColorType.ts-B-_g2UQs.js +0 -1
  154. package/dist/es/getContrastColor.ts-5KaKa1G7.js +0 -1
  155. package/dist/es/getFileName.ts-BeGee0uD.js +0 -1
  156. package/dist/es/getFileSuffix.ts-BNoXbi6l.js +0 -1
  157. package/dist/es/grayColor.ts-bqVfONY0.js +0 -1
  158. package/dist/es/hex2hsl.ts-BLU_9tQG.js +0 -1
  159. package/dist/es/hex2hsv.ts-CNUNM2bM.js +0 -1
  160. package/dist/es/hex2rgb.ts-BQpml6Tb.js +0 -1
  161. package/dist/es/hex3To6.ts-BNOY-YJ2.js +0 -1
  162. package/dist/es/hsl2hex.ts-D9xS0UDg.js +0 -1
  163. package/dist/es/hsl2rgb.ts-B6-BIsnP.js +0 -1
  164. package/dist/es/hsv2hex.ts-BNkK519v.js +0 -1
  165. package/dist/es/hsv2rgb.ts-Bvoa3lA1.js +0 -1
  166. package/dist/es/intersectionObserverUtils.ts-BdWvnE4X.js +0 -1
  167. package/dist/es/isValidColor.ts-CpkuoTf9.js +0 -1
  168. package/dist/es/localFormat.ts-vxgGt_Za.js +0 -1
  169. package/dist/es/monthFormat.ts-B_s3ZbNy.js +0 -1
  170. package/dist/es/randomColor.ts-Cf-bUfCt.js +0 -1
  171. package/dist/es/rgb2hex.ts-Dkw9FDV4.js +0 -1
  172. package/dist/es/rgb2hsl.ts-BPiSggZg.js +0 -1
  173. package/dist/es/rgb2hsv.ts-CxNRFDKF.js +0 -1
  174. package/dist/es/rgb2rgba.ts-Dx8-1nZt.js +0 -1
  175. package/dist/es/second2Day.ts-DHntMxxp.js +0 -1
  176. package/dist/es/urlToBase64.ts-t7glJoIV.js +0 -1
  177. package/dist/es/urlToBlob.ts-DDhIhkMn.js +0 -1
  178. package/dist/es/urlToFile.ts-Dp1k4tJm.js +0 -1
  179. package/dist/es/useClickOutSide.tsx-C6XuLZzd.js +0 -1
  180. package/dist/es/useCountdown.tsx-DWqs6wNp.js +0 -1
  181. package/dist/es/useKeyPress.tsx-hgs6v_Jt.js +0 -1
  182. package/dist/es/useThemePro.tsx-B4A9l0LS.js +0 -1
  183. package/dist/es/viewTransitionUtils.ts-C-QehXbC.js +0 -1
  184. package/dist/es/yearFormat.ts-DxbWP43R.js +0 -1
  185. package/dist/types/utils/async2syncUtils.d.ts +0 -5
  186. package/dist/types/utils/browserUtils.d.ts +0 -10
  187. package/dist/types/utils/intersectionObserverUtils.d.ts +0 -15
  188. package/dist/types/utils/viewTransitionUtils.d.ts +0 -9
  189. /package/dist/es/{useTheme.tsx-C-GCpzAS.js → useTheme.tsx-C7aAN-Zj.js} +0 -0
@@ -0,0 +1 @@
1
+ import{j as E}from "./dependencies-D-GIrksw.js";import{w as W}from "./useGetElementSize.tsx-CYGNJaFz.js";import{useState as S,useRef as T,useMemo as j,useEffect as C,cloneElement as q}from "react";const oe=(e)=>{const t=window.fetch,n={status:"pending",value:null},r=(...a)=>{if(n.status==="fulfilled")return n.value;throw n.status==="rejected" ? n.value:t(...a).then((o)=>o.json()).then((o)=>{n.status="fulfilled",n.value=o;}).catch((o)=>{n.status="rejected",n.value=o;});};window.fetch=r;try{e();}catch(a){a instanceof Promise&&a.finally(()=>{window.fetch=r,e(),window.fetch=t;});}window.fetch=t;};function ie(){const e=navigator.userAgent;let t="Unknown",n="Unknown";return/Chrome\/(\d+)/.test(e)?(t="Chrome",n=RegExp.$1):/Firefox\/(\d+)/.test(e)?(t="Firefox",n=RegExp.$1):/Safari\/(\d+)/.test(e)&&/Version\/([\d.]+)/.test(e)?(t="Safari",n=RegExp.$1):/Edge\/(\d+)/.test(e)&&(t="Edge",n=RegExp.$1),{name:t,version:n,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)};}const G=(e)=>/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(e)? "hex":/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(e)? "rgb":"unknown",le=(e,t,n)=>{const r=G(e);if(r==="hex"){const a=e.replace("#",""),o=parseInt(a.slice(0,2),16),s=parseInt(a.slice(2,4),16),l=parseInt(a.slice(4,6),16);if(t==="lighten"){const i=Math.min(255,Math.max(0,o+(255-o)*n/100)),c=Math.min(255,Math.max(0,s+(255-s)*n/100)),u=Math.min(255,Math.max(0,l+(255-l)*n/100));return `#${i.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}if(t==="darken"){const i=Math.min(255,Math.max(0,o-o*n/100)),c=Math.min(255,Math.max(0,s-s*n/100)),u=Math.min(255,Math.max(0,l-l*n/100));return `#${i.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;}}else if(r==="rgb"){const a=e.match(/\d+/g),o=parseInt(a[0]),s=parseInt(a[1]),l=parseInt(a[2]);if(t==="lighten")return `rgb(${Math.min(255,Math.max(0,o+(255-o)*n/100))},${Math.min(255,Math.max(0,s+(255-s)*n/100))},${Math.min(255,Math.max(0,l+(255-l)*n/100))})`;if(t==="darken")return `rgb(${Math.min(255,Math.max(0,o-o*n/100))},${Math.min(255,Math.max(0,s-s*n/100))},${Math.min(255,Math.max(0,l-l*n/100))})`;}return e;},w=(e)=>e.match(/(\d+\.?\d*)/g),O=(e)=>{const t=e.split("#")[1],n=(r)=>[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)];if(t.length===8){const r=parseInt(t.slice(-2),16)/256,a=n(t.slice(0,-2));return a.push(r),"rgba("+a.join(",")+")";}return "rgb("+n(t).join(",")+")";},I=(e)=>{const t=w(e),n=Number(t[0])/255,r=Number(t[1])/255,a=Number(t[2])/255,o=Math.min(n,r,a),s=Math.max(n,r,a);let l=0,i=0,c=(s+o)/2;if(s===o)l=i=0;else{const u=s-o;switch(i=c>0.5 ? u/(2-s-o):u/(s+o),s){case n:l=(r-a)/u+(r<a ? 6:0);break;case r:l=(a-n)/u+2;break;case a:l=(n-r)/u+4;}l/=6;}return `hsl(${Math.round(360*l)},${Math.round(100*i)}%,${Math.round(100*c)}%)`;},K=(e)=>I(O(e)),Q=(e)=>{const t=w(e),n=Number(t[0])/360,r=Number(t[1])/100,a=Number(t[2])/100;let o,s,l;function i(m,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6 ? m+6*(d-m)*h:h<0.5 ? d:h<2/3 ? m+(d-m)*(2/3-h)*6:m;}let c=a<0.5 ? a*(1+r):a+r-a*r,u=2*a-c;return o=i(u,c,n+1/3),s=i(u,c,n),l=i(u,c,n-1/3),`rgb(${Math.round(255*o)},${Math.round(255*s)},${Math.round(255*l)})`;},A=(e)=>{const t=w(e),n=(o)=>Number(o).toString(16).padStart(2,"0"),r=(o)=>o.reduce((s,l)=>s+n(l),"#"),a=(o)=>{const s=o,l=Number(o[o.length-1])!==1 ? Number(o[o.length-1]):100;return s.pop(),r(s)+n(2.56*l);};return t.length===3 ? r(t):t.length===5 ? a([t[0],t[1],t[2],10*Number(t[t.length-1])]):a(t);},X=(e)=>A(Q(e)),ue=(e,t,n)=>{let r=[];if(e.includes("#"))r=w(K(e));else if(e.includes("rgb"))r=w(I(e));else{if(!e.includes("hsl"))throw new Error("颜色格式错误");r=w(e);}return X(`${r[0]},${r[1]}%,${t==="light" ? Number(r[2])+n>100 ? 100:Number(r[2])+n:Number(r[2])-n<0 ? 0:Number(r[2])-n}%`);},U=(e)=>{const t=w(e);let n=Number(t[0])/255,r=Number(t[1])/255,a=Number(t[2])/255;const o=Math.max(n,r,a),s=Math.min(n,r,a);let l=0,i=0,c=o;const u=o-s;if(i=o===0 ? 0:u/o,o===s)l=0;else{switch(o){case n:l=(r-a)/u+(r<a ? 6:0);break;case r:l=(a-n)/u+2;break;case a:l=(n-r)/u+4;}l/=6;}return `hsv(${360*l},${100*i},${100*c})`;},ce=(e,t=1,n="rgba")=>{const r=w(e);let a=Number(r[0])/255,o=Number(r[1])/255,s=Number(r[2])/255;switch(n){case "rgba":return `rgba(${a},${o},${s},${t})`;case "hex":return A(e);case "hsl":return I(e);case "hsv":return U(e);default:return e;}},he=(e)=>{const t=(function(r){if(r.startsWith("#"))return r.length===4&&(r=`#${r.slice(1).repeat(2)}`),[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)];if(r.startsWith("rgb")){const a=r.match(/\d+/g);return [parseInt(a[0]),parseInt(a[1]),parseInt(a[2])];}return null;})(e);return t===null ? null:(299*(n=t)[0]+587*n[1]+114*n[2])/1e3>128 ? "#000":"#fff";var n;},de=(e,t,n)=>0.2126*e+0.7152*t+0.0722*n,me=(e)=>U(O(e)),pe=(e)=>{const t=e.replace("#","").split("");return `#${t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}`;},Z=(e)=>{const t=w(e);let n=Number(t[0])/360,r=Number(t[1])/100,a=Number(t[2])/100,o=0,s=0,l=0;const i=Math.floor(6*n),c=6*n-i,u=a*(1-r),m=a*(1-c*r),d=a*(1-(1-c)*r);switch(i%6){case 0:o=a,s=d,l=u;break;case 1:o=m,s=a,l=u;break;case 2:o=u,s=a,l=d;break;case 3:o=u,s=m,l=a;break;case 4:o=d,s=u,l=a;break;case 5:o=a,s=u,l=m;}return `rgb(${Math.round(255*o)},${Math.round(255*s)},${Math.round(255*l)})`;},ge=(e)=>A(Z(e)),fe=(e)=>!(!/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(e)&&!/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(e)),we=()=>"#"+Math.random().toString(16).slice(2,8).padEnd(6,"0"),be=(e,t)=>{if(!t)return e;if(e.includes("rgba")){const n=e.split(",");return n.pop(),n.push(t+")"),n.join(",");}if(e.includes("rgb")){const n=e.split(","),r="rgba("+n[0].split("(")[1],a=n[n.length-1].split(")")[0];return [r,n[1],a," "+t+")"].join(",");}},F=(...e)=>e.filter(Boolean).join(" "),Me=(e)=>{const t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2};},p=(e)=>e<10 ? `0${e}`:`${e}`,R=(e)=>parseFloat(e.replace(/[^0-9.]/g,""));function $e(e,t,n={}){let r,a=null,o=null,s=0;const l=n.leading!==!1,i=n.trailing!==!1;function c(){o&&(e.apply(r,o),o=null);}function u(){const d=Date.now();d-s>=t ?(i&&o&&c(),a=null):a=setTimeout(u,t-(d-s));}const m=function(...d){const h=Date.now();o=d,r=this,h-s>=t ? a||(s=h,l ? c():i&&(a=setTimeout(u,t))):!a&&i&&(a=setTimeout(u,t-(h-s)));};return m.cancel=function(){a&&(clearTimeout(a),a=null),s=0,o=null;},m;}const xe=(e)=>{const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let a=r.length;const o=new Uint8Array(a);for(;a--;)o[a]=r.charCodeAt(a);return new Blob([o],{type:n});},ye=(e,t)=>{const n=e.split(","),r=n[0].match(/:(.*?);/u)[1],a=atob(n[1]);let o=a.length,s=r.split("/")[1]==="jpeg" ? ".jpg":"."+r.split("/")[1];const l=new Uint8Array(o);for(;o--;)l[o]=a.charCodeAt(o);const i=new Blob([l],{type:r});return new File([i],t+s,{type:r,lastModified:(new Date()).getTime()});},_=(e)=>new Promise((t)=>{const n=new FileReader();n.readAsDataURL(e),n.onload=(r)=>{var a;const o=((a=r.target)==null ? void 0:a.result).split(",")[1];t(o);};}),ee=(e,t="abc.jpg")=>new File([e],t,{type:e.type}),ve=async(e,t)=>{const n=(r,a)=>{const o=window.URL.createObjectURL(r),s=document.createElement("a");s.href=o,s.download=encodeURIComponent(a),document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o);};try{if(typeof e=="string"){const r=await fetch(e);if(!r.ok)throw new Error(`Network response was not ok:${r.statusText}`);n(await r.blob(),t);}else n(e,t);}catch{}},Se=(e)=>new Promise((t)=>{const n=new FileReader();n.readAsDataURL(e),n.onload=(r)=>{var a;return t((a=r.target)==null ? void 0:a.result);};}),Ne=(e)=>e.slice(0,e.size,e.type),ke=(e,t)=>{const n=["B","KB","MB","GB","TB"];let r=n.indexOf((t==null ? void 0:t.unit)?? "B");if(r===-1)throw new Error("Invalid unit");if(t==null||!t.unit)for(;e/Math.pow(1024,r)>=1024;)r++;return `${(e/Math.pow(1024,r)).toFixed((t==null ? void 0:t.decimalPlaces)?? 0)}${n[r]}`;},te=(e)=>{if(!e)return "";const t=e.lastIndexOf(".");return t===-1 ? te(e.substring(e.lastIndexOf("/")+1)):e.substring(0,t);},Ie=(e)=>{if(!e)return "";const t=e.lastIndexOf(".");return e.substring(t+1);},B=async(e)=>await(await fetch(e)).blob(),Ae=async(e)=>await _(await B(e)),De=async(e)=>ee(await B(e)),Ee=(e,t,n)=>{const r=new IntersectionObserver(t,n);e instanceof HTMLElement ? r.observe(e):e.forEach((a)=>r.observe(a));},Te=(e,t,n,r={root:null,rootMargin:"0px",threshold:0})=>{const a=new IntersectionObserver((o)=>o.forEach((s)=>s.isIntersecting ? t(s):n(s)),r);e.forEach((o)=>a.observe(o));},ne=({onAndroid:e,onIOS:t,onUnknown:n})=>{const r=navigator.userAgent;return/android/i.test(r)?(e(),"Android"):/iPad|iPhone|iPod/.test(r)?(t(),"iOS"):(n==null||n(),"Unknown");},je=({onAndroid:e,onIOS:t,onUnknown:n,timeout:r=500})=>()=>{setTimeout(()=>ne({onAndroid:e,onIOS:t,onUnknown:n}),r);},Ce=(e,t)=>{const n={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!n[t])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(e/n[t]);},Fe=(e)=>Math.ceil((e.getTime()-new Date(e.getFullYear(),0,1).getTime())/864e5),Re=(e)=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),a=(o)=>o.toString().padStart(2,"0");return(t>0 ? `${a(t)}:${a(n)}:${a(r)}`:`${a(n)}:${a(r)}`)+(e<10 ? ".00":e<100 ? ".0":"");},z=(e)=>e.toString().length>13 ? new Date(Number(e.toString().substring(0,13))):e.toString().length===13 ? new Date(e):e.toString().length<13&&e.toString().length>10 ? new Date(Number((e.toString()+"000").substring(0,13))):e.toString().length===10 ? new Date(1e3*e):new Date(Number((e.toString()+"000000000000").substring(0,13))),Oe=(e,t="YY-MM-DD hh:mm:ss")=>{const n=["YY","MM","DD","hh","mm","ss"],r=[],a=z(e);r.push(a.getFullYear().toString()),r.push(p(a.getMonth()+1)),r.push(p(a.getDate())),r.push(p(a.getHours())),r.push(p(a.getMinutes())),r.push(p(a.getSeconds()));for(let o in r)t=t.replace(n[o],r[o]);return t;},Ue=(e,t="YY-MM-DD hh:mm:ss",n="cn")=>{const r=["YY","MM","DD","hh","mm","ss"],a=[],o=z(e);a.push(((s,l)=>{const i={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return s.split("").map((c)=>i[l][Number(c)]).join("");})(o.getFullYear().toString(),n)),a.push(((s,l)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[l][Number(s)-1])(p(o.getMonth()+1),n)),a.push(((s,l)=>{let i;return l==="en" ? i=s==="01"||s==="21"||s==="31" ? Number(s)+"st":s==="02"||s==="22" ? Number(s)+"nd":s==="03"||s==="23" ? Number(s)+"rd":Number(s)+"th":s==="01" ? i="一日":s==="02" ? i="二日":s==="03" ? i="三日":s==="04" ? i="四日":s==="05" ? i="五日":s==="06" ? i="六日":s==="07" ? i="七日":s==="08" ? i="八日":s==="09" ? i="九日":s==="10" ? i="十日":s==="11" ? i="十一日":s==="12" ? i="十二日":s==="13" ? i="十三日":s==="14" ? i="十四日":s==="15" ? i="十五日":s==="16" ? i="十六日":s==="17" ? i="十七日":s==="18" ? i="十八日":s==="19" ? i="十九日":s==="20" ? i="二十日":s==="21" ? i="二十一日":s==="22" ? i="二十二日":s==="23" ? i="二十三日":s==="24" ? i="二十四日":s==="25" ? i="二十五日":s==="26" ? i="二十六日":s==="27" ? i="二十七日":s==="28" ? i="二十八日":s==="29" ? i="二十九日":s==="30" ? i="三十日":s==="31"&&(i="三十一日"),i ?? s;})(p(o.getDate()),n)),a.push(p(o.getHours())),a.push(p(o.getMinutes())),a.push(p(o.getSeconds()));for(let s in a)t=t.replace(r[s],a[s]);return t;},Be=(e,t)=>{const n=["DD","hh","mm","ss"],r=[];r.push(Math.floor(e/86400)),r.push(p(Math.floor(e%86400/3600))),r.push(p(Math.floor(e%3600/60))),r.push(p(e%60));for(let a=0;a<n.length;a++)t=t.replace(n[a],r[a].toString());return t;},ze=(e)=>{const t="ono-view-transition-clip-path-circle",{element:n,duration:r=300,themeRules:a,onChangeTheme:o}=e,s=a!=null&&a()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return o(s==="dark" ? "light":"dark");const l=document.startViewTransition(()=>{const $=document.documentElement.classList.contains("dark");o($ ? "light":"dark");}),{top:i,left:c,width:u,height:m}=n.getBoundingClientRect(),d=c+u/2,h=i+m/2,g=[`circle(0%at ${d}px ${h}px)`,`circle(${Math.hypot(Math.max(d,window.innerWidth-d),Math.max(h,window.innerHeight-h))}px at ${d}px ${h}px)`];(($,b)=>{const x=document.createElement("style");x.setAttribute("type","text/css"),x.setAttribute("data-style-tag",b),x.textContent="::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}",document.head.appendChild(x);})(0,t),l.ready.then(()=>{document.documentElement.animate({clipPath:s==="light" ? g:g.reverse()},{duration:r,fill:"forwards",easing:"ease-in-out",pseudoElement:s==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>(($)=>{document.head.querySelectorAll("style").forEach((b)=>b.getAttribute("data-style-tag")===$&&b.remove());})(t),r+50);});};var P=((e)=>(e.Horizontal="Horizontal",e.Vertical="Vertical",e))(P||{});const Pe=({list:e,style:t,disable:n,children:r,sliderBox:a,className:o,sliderStyle:s,duration:l=300,sliderClassName:i,currentIndex:c=0,direction:u=P.Horizontal,sliderTransitionTimingFunction:m="ease-in-out"})=>{const [d,h]=S(!1),[g,$]=S(0),[b,x]=S({t:0,l:0}),[N,H]=S({w:0,h:0}),v=T(null),D=T(null),L=j(()=>["width","height","translate"].map((f)=>`${f}${l/1e3}s ${m}`).join(","),[u,l,m]),Y=j(()=>({width:N.w,height:N.h,transition:d ? L:"initial",translate:`${b.l}px ${b.t}px`}),[N,b]),{w:V,h:J}=W();return C(()=>{$(c);},[c]),C(()=>{(()=>{if(typeof g!="number"||!v.current||!D.current)return;const f=Array.from(v.current.children).slice(1);f.forEach((y)=>{y.style.position="relative",y.style.cursor=n ? "not-allowed":"pointer",y.style.zIndex="1";});const M=window.getComputedStyle(v.current),k={t:u==="Horizontal" ? R(M.paddingTop):f[g].offsetTop,l:u==="Horizontal" ? f[g].offsetLeft:R(M.paddingLeft)};x(k),H({w:f[g].offsetWidth,h:f[g].offsetHeight}),setTimeout(()=>h(!0),l);})();},[g,V,J,n]),E.jsxs("ul",{ref:v,className:F("ono-auto-slider-list-container",o,n ? "ono-auto-slider-list-is-disable":""),style:{flexDirection:u==="Horizontal" ? "row":"column",...t},children:[E.jsx("li",{ref:D,className:F("ono-auto-slider-list-slider",i),style:{...s,...Y},children:a}),e.map((f,M)=>q(r({item:f,index:M,isActive:M===g}),{onClick:(k)=>{if(n)return;const y=r({item:f,index:M,isActive:M===g}).props.onClick;y&&y(k),$(M);}}))]});};export{G as A,he as B,te as C,Ie as D,de as E,K as F,me as G,O as H,pe as I,X as J,Q as K,ge as L,Z as M,fe as N,Ue as O,we as P,A as Q,I as R,U as S,be as T,Be as U,Ae as V,B as W,De as X,Pe as Y,P as Z,R as a,ue as b,xe as c,oe as d,F as e,Ce as f,le as g,Ee as h,Fe as i,ne as j,je as k,_ as l,ve as m,Me as n,Te as o,$e as p,Ne as q,ye as r,Se as s,ee as t,ce as u,ze as v,ke as w,Re as x,Oe as y,ie as z};
@@ -1 +1 @@
1
- import{j as x}from "./dependencies-B7YNjh_z.js";import{useState as g,useRef as G,useEffect as N}from "react";const X=({imageFile:b,cvsW:$=520,maskBG:F="rgba(0,0,0,0.5)",border:k="4px solid #fff",wheelScale:C=0.1,setCtx:S,maskInfo:a,setMaskInfo:v,imageStartState:R,setImageStartState:B,imageState:e,setImageState:c})=>{const [w,L]=g(),[h,U]=g({w:0,h:0}),[p,d]=g({w:0,h:0}),[I,y]=g({x:0,y:0}),[M,j]=g(!1),u=G(null),f=G(null),r=(t,l)=>{l((n)=>({...n,...t}));},Y=()=>{const t=k.split(" ");let l=0;return t.forEach((n)=>{n.includes("px")&&(l=Number(n.split("px")[0]));}),l;},W=()=>{j(!1),e.l>a.l&&r({l:a.l},c),e.t>a.l&&r({t:a.l},c),-e.l>e.w-a.l-a.w&&r({l:-(e.w-a.l-a.w)},c),-e.t>e.h-a.l-a.w&&r({t:-(e.h-a.l-a.w)},c);};return N(()=>{(()=>{if(!u.current)return;const{width:t}=u.current.getBoundingClientRect();((l)=>{const n=new Image();n.src=typeof b=="string" ? b:URL.createObjectURL(b),n.onload=()=>{var E;let m=1,s=n.width,i=n.height;s>i ?(m=s/l,s=l,i/=m,r({w:i},v)):(m=i/l,i=l,s/=m,r({w:s},v));const o=(l-s)/2,D=(l-i)/2;r({w:n.width,h:n.height},d),L(n),r({w:s,h:i,t:D,l:o},c),B({w:s,h:i,t:D,l:o}),r(o>D ?{l:o}:{l:D},v),S((E=f.current)==null ? void 0:E.getContext("2d"));};})(t),U({w:t,h:t});})();},[u]),N(()=>{if(!f.current||!w)return;const t=f.current.getContext("2d");t&&(t.clearRect(0,0,f.current.width,f.current.height),t.drawImage(w,e.l,e.t,e.w,e.h));},[f,w,e]),x.jsxs("div",{ref:u,className:"ono-avatar-canvas",style:{width:$,cursor:M ? "grabbing":"grab"},onWheel:(t)=>{t.preventDefault(),t.stopPropagation();const l=t.deltaY<0 ? "in":"out",n=((s,i)=>{let o=s+(i==="in" ? s*C:-s*C);return o>p.w&&(o=p.w),o<R.w&&(o=R.w),o;})(e.w,l),m=n/p.w;r({w:n,h:p.h*m},c),W();},onMouseUp:W,onMouseLeave:W,children:[x.jsx("canvas",{width:h.w,height:h.h,ref:f,onMouseDown:(t)=>{r({x:t.clientX,y:t.clientY},y),j(!0);},onMouseMove:(t)=>{if(M){const l=t.clientX-I.x,n=t.clientY-I.y;(Math.abs(l)>10||Math.abs(n)>10)&&(r({t:e.t+n,l:e.l+l},c),r({x:t.clientX,y:t.clientY},y));}}}),w&&x.jsx("div",{className:"ono-avatar-mask",children:x.jsx("div",{style:{border:k,boxShadow:`${F}0 0 0 10000px`,width:`${a.w+2*Y()}px`,height:`${a.w+2*Y()}px`}})})]});},A=({imageFile:b,cvsW:$=520,maskBG:F="rgba(0,0,0,0.5)",border:k="4px solid #fff",wheelScale:C=0.1,children:S})=>{const [a,v]=g({w:0,h:0,t:0,l:0}),[R,B]=g({w:0,h:0,t:0,l:0}),[e,c]=g({w:0,l:0}),[w,L]=g();return x.jsxs(x.Fragment,{children:[x.jsx(X,{imageFile:b,cvsW:$,maskBG:F,border:k,wheelScale:C,maskInfo:e,setMaskInfo:c,setCtx:L,imageStartState:a,setImageStartState:v,imageState:R,setImageState:B}),S==null ? void 0:S({handleConfirm:(h,U)=>{if(!w)return;const p=w.getImageData(e.l,e.l,e.w,e.w),d=document.createElement("canvas"),I=d.getContext("2d");if(d.width=e.w,d.height=e.w,!I)return;const{imageSaveType:y="png",dataSaveType:M="base64",quality:j=100}=U||{};I.putImageData(p,0,0,0,0,e.w,e.w),M==="base64" ? h(d.toDataURL(`image/${y}`,j/100)):M==="blob"&&d.toBlob((u)=>{if(u)return h(u);},`image/${y}`,j/100);},handleReduction:(h)=>{B({w:a.w,h:a.h,t:a.t,l:a.l}),h==null||h();}})]});};export{A};
1
+ import{j as x}from "./dependencies-D-GIrksw.js";import{useState as g,useRef as G,useEffect as N}from "react";const X=({imageFile:b,cvsW:$=520,maskBG:F="rgba(0,0,0,0.5)",border:k="4px solid #fff",wheelScale:C=0.1,setCtx:S,maskInfo:a,setMaskInfo:v,imageStartState:R,setImageStartState:B,imageState:e,setImageState:c})=>{const [w,L]=g(),[h,U]=g({w:0,h:0}),[p,d]=g({w:0,h:0}),[I,y]=g({x:0,y:0}),[M,j]=g(!1),u=G(null),f=G(null),r=(t,l)=>{l((n)=>({...n,...t}));},Y=()=>{const t=k.split(" ");let l=0;return t.forEach((n)=>{n.includes("px")&&(l=Number(n.split("px")[0]));}),l;},W=()=>{j(!1),e.l>a.l&&r({l:a.l},c),e.t>a.l&&r({t:a.l},c),-e.l>e.w-a.l-a.w&&r({l:-(e.w-a.l-a.w)},c),-e.t>e.h-a.l-a.w&&r({t:-(e.h-a.l-a.w)},c);};return N(()=>{(()=>{if(!u.current)return;const{width:t}=u.current.getBoundingClientRect();((l)=>{const n=new Image();n.src=typeof b=="string" ? b:URL.createObjectURL(b),n.onload=()=>{var E;let m=1,s=n.width,i=n.height;s>i ?(m=s/l,s=l,i/=m,r({w:i},v)):(m=i/l,i=l,s/=m,r({w:s},v));const o=(l-s)/2,D=(l-i)/2;r({w:n.width,h:n.height},d),L(n),r({w:s,h:i,t:D,l:o},c),B({w:s,h:i,t:D,l:o}),r(o>D ?{l:o}:{l:D},v),S((E=f.current)==null ? void 0:E.getContext("2d"));};})(t),U({w:t,h:t});})();},[u]),N(()=>{if(!f.current||!w)return;const t=f.current.getContext("2d");t&&(t.clearRect(0,0,f.current.width,f.current.height),t.drawImage(w,e.l,e.t,e.w,e.h));},[f,w,e]),x.jsxs("div",{ref:u,className:"ono-avatar-canvas",style:{width:$,cursor:M ? "grabbing":"grab"},onWheel:(t)=>{t.preventDefault(),t.stopPropagation();const l=t.deltaY<0 ? "in":"out",n=((s,i)=>{let o=s+(i==="in" ? s*C:-s*C);return o>p.w&&(o=p.w),o<R.w&&(o=R.w),o;})(e.w,l),m=n/p.w;r({w:n,h:p.h*m},c),W();},onMouseUp:W,onMouseLeave:W,children:[x.jsx("canvas",{width:h.w,height:h.h,ref:f,onMouseDown:(t)=>{r({x:t.clientX,y:t.clientY},y),j(!0);},onMouseMove:(t)=>{if(M){const l=t.clientX-I.x,n=t.clientY-I.y;(Math.abs(l)>10||Math.abs(n)>10)&&(r({t:e.t+n,l:e.l+l},c),r({x:t.clientX,y:t.clientY},y));}}}),w&&x.jsx("div",{className:"ono-avatar-mask",children:x.jsx("div",{style:{border:k,boxShadow:`${F}0 0 0 10000px`,width:`${a.w+2*Y()}px`,height:`${a.w+2*Y()}px`}})})]});},A=({imageFile:b,cvsW:$=520,maskBG:F="rgba(0,0,0,0.5)",border:k="4px solid #fff",wheelScale:C=0.1,children:S})=>{const [a,v]=g({w:0,h:0,t:0,l:0}),[R,B]=g({w:0,h:0,t:0,l:0}),[e,c]=g({w:0,l:0}),[w,L]=g();return x.jsxs(x.Fragment,{children:[x.jsx(X,{imageFile:b,cvsW:$,maskBG:F,border:k,wheelScale:C,maskInfo:e,setMaskInfo:c,setCtx:L,imageStartState:a,setImageStartState:v,imageState:R,setImageState:B}),S==null ? void 0:S({handleConfirm:(h,U)=>{if(!w)return;const p=w.getImageData(e.l,e.l,e.w,e.w),d=document.createElement("canvas"),I=d.getContext("2d");if(d.width=e.w,d.height=e.w,!I)return;const{imageSaveType:y="png",dataSaveType:M="base64",quality:j=100}=U||{};I.putImageData(p,0,0,0,0,e.w,e.w),M==="base64" ? h(d.toDataURL(`image/${y}`,j/100)):M==="blob"&&d.toBlob((u)=>{if(u)return h(u);},`image/${y}`,j/100);},handleReduction:(h)=>{B({w:a.w,h:a.h,t:a.t,l:a.l}),h==null||h();}})]});};export{A};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{p as L,e as w}from "./AutoSliderList-drdrxgEX.js";import{forwardRef as B,useState as N,useRef as h,useEffect as l}from "react";const z=B(({onClick:d,children:m,disabled:r,loading:n,plain:g,shape:u="default",htmlType:x="button",type:b="primary",throttleDuration:c,className:j,style:y,icon:a},s)=>{const [p,f]=N(!1),t=h(null),i=h(null),C=d ? L(d,c ? typeof c=="number" ? c:500:0):void 0;return l(()=>{(()=>{if(!i.current)return;const e=i.current;n ?(f(!0),e.classList.add("ono-loading-start")):(setTimeout(()=>{f(!1);},300),e.classList.remove("ono-loading-start"),e.classList.add("ono-loading-end"));})();},[n,i]),l(()=>{(()=>{if(!t.current)return;const e=t.current,v=e.getBoundingClientRect();e.style.setProperty("--btn-height",v.height+"px");})();},[t]),l(()=>{s&&t&&(typeof s=="function" ? s(t.current):s.current=t.current);},[s,t]),o.jsxs("button",{ref:t,className:w(`ono-btn-${b}`,n||p ? "ono-is-loading":"",n||a ? "ono-is-icon":"",r ? "ono-btn-is-disabled":"",u==="round" ? "ono-is-round":u==="circle" ? "ono-is-circle":"",g ? "ono-is-plain":"",j ?? ""),type:x,disabled:(typeof r=="function" ? r():r)||!!n,style:y,onClick:C,children:[(()=>{const e=o.jsx("span",{ref:i,className:"ono-btn-icon",children:o.jsx("span",{children:typeof n=="object" ? n.icon:o.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})})})});return n||p ? e:a ? o.jsx("span",{children:a}):o.jsx(o.Fragment,{});})(),m]});});export{z as B};
@@ -1 +1 @@
1
- import{j as d}from "./dependencies-B7YNjh_z.js";import{useState as R,useRef as E,useEffect as f}from "react";const w=({src:t,children:s,enlarge:l=!1,scale:y=1.1,shadow:a,xRange:i=[-10,10],yRange:g=[-10,10],borderRadius:p=20})=>{const [v,c]=R(!1),e=E(null),u=(r,o,n)=>o/n*(r[1]-r[0])+r[0];return f(()=>{e.current&&a&&e.current.style.setProperty("--sd",a);},[e.current]),f(()=>{if(!s&&!t)throw new Error("请传入children或者src属性");},[s,t]),d.jsx("div",{ref:e,className:"ono-card",style:{borderRadius:p,transform:`perspective(500px)scale(${v&&l ? y:1})rotateX(var(--rx,0deg))rotateY(var(--ry,0deg))`},onMouseEnter:()=>c(!0),onMouseMove:(r)=>{const{offsetX:o,offsetY:n}=r.nativeEvent,{offsetWidth:x,offsetHeight:h}=e.current,m=u(i,n,h),P=-u(g,o,x);e.current.style.setProperty("--rx",`${m}deg`),e.current.style.setProperty("--ry",`${P}deg`);},onMouseLeave:()=>{c(!1),e.current.style.setProperty("--rx","0deg"),e.current.style.setProperty("--ry","0deg");},children:s ?? d.jsx("img",{src:t,alt:"图片"})});};export{w as C};
1
+ import{j as d}from "./dependencies-D-GIrksw.js";import{useState as R,useRef as E,useEffect as f}from "react";const w=({src:t,children:s,enlarge:l=!1,scale:y=1.1,shadow:a,xRange:i=[-10,10],yRange:g=[-10,10],borderRadius:p=20})=>{const [v,c]=R(!1),e=E(null),u=(r,o,n)=>o/n*(r[1]-r[0])+r[0];return f(()=>{e.current&&a&&e.current.style.setProperty("--sd",a);},[e.current]),f(()=>{if(!s&&!t)throw new Error("请传入children或者src属性");},[s,t]),d.jsx("div",{ref:e,className:"ono-card",style:{borderRadius:p,transform:`perspective(500px)scale(${v&&l ? y:1})rotateX(var(--rx,0deg))rotateY(var(--ry,0deg))`},onMouseEnter:()=>c(!0),onMouseMove:(r)=>{const{offsetX:o,offsetY:n}=r.nativeEvent,{offsetWidth:x,offsetHeight:h}=e.current,m=u(i,n,h),P=-u(g,o,x);e.current.style.setProperty("--rx",`${m}deg`),e.current.style.setProperty("--ry",`${P}deg`);},onMouseLeave:()=>{c(!1),e.current.style.setProperty("--rx","0deg"),e.current.style.setProperty("--ry","0deg");},children:s ?? d.jsx("img",{src:t,alt:"图片"})});};export{w as C};
@@ -0,0 +1 @@
1
+ import{j as i}from "./dependencies-D-GIrksw.js";import{e as H}from "./AutoSliderList-drdrxgEX.js";import{useState as c,useRef as k,useEffect as j}from "react";const O=({style:Y,current:l,children:o,className:D,prevButton:x,nextButton:y,dots:E=!0,speed:p=300,afterChange:N,duration:z=2e3,autoPlay:d=!1,isShowArrow:L=!0,waitForAnimate:R=!0,direction:n="horizontal"})=>{const [s,T]=c(typeof l=="number" ? l+1:1),[B,v]=c(typeof l=="number" ? l:0),[u,F]=c(),[q,G]=c([]),[S,C]=c(!1),[A,M]=c(!1),[P,h]=c(!1),f=k(null),r=k(null),$=k(null),g=(t)=>{r.current.style.transform=n==="horizontal" ? `translateX(-${((u==null ? void 0:u.width)||0)*(t+1)}px)`:`translateY(-${((u==null ? void 0:u.height)||0)*(t+1)}px)`;},w=(t)=>{const e=t-s;if(e===0||R&&S)return;C(!0),h(!1);const a=e<0 ? "prev":"next",m=a==="prev" ? 1:o.length;s===m ?(T(a==="prev" ? o.length:1),v(a==="prev" ? o.length-1:0),g(t-1),setTimeout(()=>{var b;(b=r.current)==null||b.classList.remove("ono-carousel-slider"),g(a==="prev" ? o.length-1:0),setTimeout(()=>{var X;(X=r.current)==null||X.classList.add("ono-carousel-slider"),C(!1),h(!0);},20);},p)):(v(t-1),T(t),g(t-1),setTimeout(()=>{C(!1),h(!0);},p));};return j(()=>{(()=>{if(!o||!f.current)return;f.current.style.setProperty("--speed",`${p}ms`);const t=f.current.getBoundingClientRect();F(t);const e=[...o];var a;e.push(o[0]),e.unshift(o[o.length-1]),G(e.map((m,b)=>i.jsx("div",{style:{width:t.width,height:t.height,flexShrink:0},children:m},b))),a=t,r.current&&(r.current.style.transform=n==="horizontal" ? `translateX(-${a.width*s}px)`:`translateY(-${a.height*s}px)`,r.current.style.flexDirection=n==="horizontal" ? "row":"column",h(d),setTimeout(()=>{var m;return(m=r.current)==null ? void 0:m.classList.add("ono-carousel-slider");},p));})();},[f,r,n,d]),j(()=>{N==null||N(B);},[B]),j(()=>{(()=>{if(A||!d||!P)return clearTimeout($.current),void($.current=null);$.current=setTimeout(()=>w(s+1),z);})();},[d,P,S,s,A]),j(()=>{typeof l=="number"&&(h(!1),w(l+1),setTimeout(()=>h(d),z-p));},[r,l]),i.jsxs("div",{ref:f,className:H("ono-carousel-container",D),style:Y,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:[i.jsx("div",{ref:r,className:"ono-carousel-wrapper",children:q}),L&&i.jsx("button",{className:n==="horizontal" ? "ono-carousel-left":"ono-carousel-top",onClick:()=>w(s-1),children:x ? typeof x=="function" ? x():x:n==="horizontal" ? "left":"top"}),L&&i.jsx("button",{className:n==="horizontal" ? "ono-carousel-right":"ono-carousel-bottom",onClick:()=>w(s+1),children:y ? typeof y=="function" ? y():y:n==="horizontal" ? "right":"bottom"}),E&&i.jsx("div",{className:"ono-carousel-indicators",children:o.map((t,e)=>i.jsx("button",{className:"ono-carousel-indicator",onClick:()=>{g(e),v(e),T(e+1);}},e))})]});};export{O as C};
@@ -0,0 +1 @@
1
+ import{j as b}from "./dependencies-D-GIrksw.js";import{e as x}from "./AutoSliderList-drdrxgEX.js";import{useState as g,useRef as v,useEffect as w}from "react";const E=({id:d,style:n,checked:c,onChange:h,className:a,indeterminate:t=!1,checkedColor:l="#0077cc",indeterminateStyle:p="line",indeterminateColor:y="#0077cc"})=>{const [s,f]=g(""),e=v(null),C=[{value:l,name:"checkedColor"},{value:y,name:"indeterminateColor"}];return w(()=>{(()=>{if(!e.current)return;const r=getComputedStyle(e.current);s||f(r.borderColor),e.current.style.height=r.width,[{value:r.width,name:"w"},{value:c||t ? l:s,name:"border-color"},...C].forEach(({value:i,name:k})=>{i&&((o,u,m)=>{typeof o=="string" ? m.style.setProperty(`--${u}`,o):m.style.setProperty(`--${u}`,`${o}px`);})(i,k,e.current);});})(),e.current&&(e.current.indeterminate=t);},[e,a,n,t]),b.jsx("input",{id:d,type:"checkbox",ref:e,checked:c,onChange:h,className:x(a,p==="line" ? "ono-checkbox-line":"ono-checkbox-border"),style:n});};export{E as C};
@@ -0,0 +1 @@
1
+ import{j as v}from "./dependencies-D-GIrksw.js";import{f as k}from "./useEventListener.tsx-BDtH_FiI.js";import{useRef as w,useLayoutEffect as D}from "react";import{p as g}from "./PortalRenderer-CUaab_Kw.js";const N=({className:e,content:o,style:i,onClick:r,onDoubleClick:m,onContextMenu:x,onMouseDown:y,onMouseUp:f,onMouseEnter:d,onMouseLeave:h,onMouseMove:C,destroy:u,position:n})=>{const t=w(null);return k("click",u),D(()=>{if(t.current){const{width:s,height:a}=t.current.getBoundingClientRect(),{innerWidth:p,innerHeight:M}=window;let c=n.x,l=n.y;c+s>p&&(c=Math.max(0,p-s)),l+a>M&&(l=Math.max(0,M-a)),t.current.style.left=`${c}px`,t.current.style.top=`${l}px`;}},[n]),v.jsx("div",{ref:t,className:e,style:{...i,position:"fixed",left:n.x,top:n.y},onClick:r,onDoubleClick:m,onContextMenu:x,onMouseDown:y,onMouseUp:f,onMouseEnter:d,onMouseLeave:h,onMouseMove:C,children:typeof o=="function" ? o((s)=>{u(),s&&s();}):o});},R=({e,style:o,content:i,className:r})=>{e.preventDefault(),g(N,{className:r,content:i,position:{x:e.clientX,y:e.clientY},style:{zIndex:9999,...o}},"content-menu-root");};export{R as c};
@@ -0,0 +1 @@
1
+ import{j as g}from "./dependencies-D-GIrksw.js";import{e as b}from "./AutoSliderList-drdrxgEX.js";import{useState as u,useRef as A,useMemo as G}from "react";const B=({isBox:o=!1,multiple:y=!1,children:l,allowFileType:D="image",style:C={},className:E="",isCanClick:T=!0,getFileListData:w,onFileTypeError:c,readingAnimationOptions:n})=>{const [a,F]=u(!1),v=A(null);let f=0,p=[],m=[],s=[],S=[];const j=G(()=>D==="all" ? ["image","video","audio","document","directory"]:D,[D]),x=(e)=>{const r=[];s.forEach((t)=>r.push({name:t.name,fileType:"directory",file:"",isFile:!1,fileSize:0,children:[],parent:""}));for(let t=0;t<r.length;t++)for(let i=0;i<e.length;i++)e[i].parent===r[t].name&&e[i].name!==".DS_Store"&&r[t].children.push(e[i]);r.length===0&&r.push(...e),w(r),p=[],f=0,m=[],s=[],S=[],F(!1);},d=(e,r="")=>{if(e.isDirectory){if(!j.includes("directory"))return c&&c();const t=e.createReader(),i=(O)=>O.readEntries((k)=>{let z=0;k.forEach((h)=>{z++,h.isDirectory&&d(h);}),m.push(...k),S.includes(e.name)||(s.push(e),S.push(e.name)),z>=100 ? i(O):m.forEach((h)=>d(h,e.name));});i(t);}else e.file((t)=>{if(!j.includes(t.type.split("/")[0])&&t.name!==".DS_Store")return c&&c();p.push({name:t.name,fileType:t.type,file:t,isFile:!0,fileSize:t.size,children:[],parent:r});const i=f>=s.length&&s.length===0 ? f:m.length;p.length===i&&x(p);});};return g.jsxs(g.Fragment,{children:[g.jsx("input",{ref:v,type:"file",style:{display:"none"},multiple:y,value:"",onChange:(e)=>{const r=[...e.target.files],t=[];F(!0),r.forEach((i)=>t.push({name:i.name,fileType:i.type,file:i,isFile:!0,fileSize:i.size,children:[],parent:""})),x(t);}}),g.jsx("div",{className:b("ono-file-process-container",o ? "ono-file-process-container-box":"",typeof E=="string" ? E:E(a)),style:{justifyContent:o&&!l ? "center":"initial",cursor:o&&T ? a ? "not-allowed":"pointer":"",...C instanceof Function ? C(a):C},onClick:()=>{if(o&&T){if(a&&(n!=null&&n.readingCannotOperattion))return;v.current.click();}},onDragEnter:(e)=>e.preventDefault(),onDragOver:(e)=>e.preventDefault(),onDrop:(e)=>{if(e.preventDefault(),!a||!(n!=null&&n.readingCannotOperattion))if(f=y ? e.dataTransfer.items.length:1,F(!0),y)for(const r of e.dataTransfer.items)d(r.webkitGetAsEntry());else d(e.dataTransfer.items[0].webkitGetAsEntry());},children:o ? l ? a&&(n!=null&&n.readingCannotOperattion)?(n==null ? void 0:n.animations)||"正在读取文件...":l:a&&(n!=null&&n.readingCannotOperattion)?(n==null ? void 0:n.animations)||"正在读取文件...":"请将要上传的文件拖拽到此处":l})]});};export{B as F};
@@ -1 +1 @@
1
- import{j as t,R as v}from "./dependencies-B7YNjh_z.js";import{u as k}from "./useEventListener.tsx-C8V9Qip6.js";let l,o=null;const x=({className:e,content:n,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,isClickBoxToClose:p})=>(k("click",()=>{p&&o&&(o.remove(),o=null);}),t.jsx("div",{className:e,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,children:typeof n=="function" ? n((s)=>{o&&(o.remove(),o=null,s&&s());}):n})),b=(e)=>(f(e.isSingle||!1).render(t.jsx(x,{...e})),o),f=(e)=>(e&&o&&l||(o=document.createElement("div"),document.body.appendChild(o),l=v.createRoot(o)),l);export{b as i};
1
+ import{j as t,R as v}from "./dependencies-D-GIrksw.js";import{f as k}from "./useEventListener.tsx-BDtH_FiI.js";let l,o=null;const x=({className:e,content:n,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,isClickBoxToClose:p})=>(k("click",()=>{p&&o&&(o.remove(),o=null);}),t.jsx("div",{className:e,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,children:typeof n=="function" ? n((s)=>{o&&(o.remove(),o=null,s&&s());}):n})),b=(e)=>(f(e.isSingle||!1).render(t.jsx(x,{...e})),o),f=(e)=>(e&&o&&l||(o=document.createElement("div"),document.body.appendChild(o),l=v.createRoot(o)),l);export{b as i};
@@ -0,0 +1 @@
1
+ import{j as n}from "./dependencies-D-GIrksw.js";import{e as q}from "./AutoSliderList-drdrxgEX.js";import{forwardRef as I,useState as f,useRef as T,useEffect as P}from "react";import{k as J}from "./useKeyPress.tsx-ClBLUMui.js";const X=()=>n.jsx("svg",{className:"ono-input-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})}),Z=({open:x})=>n.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":x ? "eye":"eye-invisible",fill:"currentColor","aria-hidden":"true",className:"ono-input-icon",children:x ? n.jsx("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}):n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}),n.jsx("path",{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"})]})}),te=I(({id:x,name:D,max:F,min:j,maxLength:L,minLength:M,type:Q="text",className:Y,defaultValue:B,placeholder:E,readonly:V,autocomplete:W="off",autofocus:k,form:y,disabled:g,clearable:R,showPassword:K,prepend:p,append:i,prefix:b,suffix:v,showCount:O,border:$="1px solid #5644b8",boxShadow:m="0 0 0 2px #7969d11a",value:h="",onChange:d,onFocus:z,onBlur:w,onClear:u,onKeyUp:A,onKeyDown:N},U)=>{const [t,C]=f(h),[H,o]=f(!1),[e,s]=f(!1),l=T(null),c=R&&!g&&t,a=K&&!g;return P(()=>{l.current&&(l.current.style.setProperty("--ono-input-border",$),l.current.style.setProperty("--ono-input-box-shadow",m));},[l]),P(()=>{C(h);},[h]),n.jsxs("div",{className:q("ono-input","ono-input-border",g ? "ono-input-is-disabled":""),children:[p&&n.jsx("div",{className:"ono-prepend",children:p}),n.jsxs("div",{ref:l,className:q("ono-input-wrapper",H ? "ono-input-is-focus":"",Y),onMouseDown:(r)=>{r.target.tagName!=="INPUT"&&r.preventDefault();},children:[b&&n.jsx("span",{className:"ono-prefix",children:b}),n.jsx("input",{id:x,ref:U,max:F,min:j,name:D,maxLength:L,minLength:M,defaultValue:B,className:"ono-input-inner",type:K ? e ? "text":"password":Q,placeholder:E,readOnly:V,autoComplete:W,autoFocus:k,form:y,disabled:g,onFocus:(r)=>{z==null||z(r),o(!0);},onBlur:(r)=>{w==null||w(r),o(!1);},value:t,onChange:(r)=>{d==null||d(r),C(r.target.value);},onKeyUp:A,onKeyDown:N}),(v||c||a||O)&&n.jsxs("span",{className:"ono-suffix",children:[v,c&&n.jsx("button",{className:"ono-clear-icon",onClick:()=>{u==null||u(),C("");},children:n.jsx(X,{})}),a&&n.jsx("button",{className:"ono-eye-icon",onClick:()=>s(!e),children:n.jsx(Z,{open:e})}),O&&L&&n.jsxs("p",{className:"ono-count",children:[t.length,"/",L]})]})]}),i&&n.jsx("div",{className:"ono-append",children:i})]});}),ae=I(({id:x,name:D,rows:F,maxLength:j,minLength:L,className:M,placeholder:Q,readonly:Y,resize:B=!0,autocomplete:E="off",autofocus:V,form:W,disabled:k,autoSize:y,showCount:g,border:R="1px solid #5644b8",boxShadow:K="0 0 0 2px #7969d11a",value:p="",onChange:i,onFocus:b,onBlur:v,onKeyUp:O,onKeyDown:$},m)=>{const [h,d]=f(p),[z,w]=f(!1),[u,A]=f([p]),[N,U]=f(0),t=T(null),C=(o)=>{const e=u.slice(0,N+1);e.push(o),A(e),U(e.length-1);};return [{key:"CommandOrControl+z",handler:(o)=>{document.activeElement===t.current&&(o.preventDefault(),(()=>{if(N>0&&t.current){const e=N-1,s=u[e];if(t.current.value=s,d(s),U(e),i){const l={target:t.current};i(l);}}})());},deps:[u]},{key:"CommandOrControl+d",handler:(o)=>{if(t.current&&document.activeElement===t.current){o.preventDefault();const e=((s)=>{const{value:l,selectionStart:c,selectionEnd:a}=s,r=l.substring(0,c)+l.substring(a);return s.value=r,s.setSelectionRange(c,c),r;})(t.current);if(d(e),C(e),i){const s={target:t.current};i(s);}}},deps:[u]}].forEach(({key:o,handler:e,deps:s})=>J(o,e,{target:t.current,deps:s})),P(()=>{d(p);},[p]),P(()=>{(()=>{if(!t.current)return;const o=t.current;((e,s,l,c,a)=>{const r=e.parentNode;e.style.resize=s ? "none":l ? "vertical":"none",r.style.setProperty("--ono-input-border",c),r.style.setProperty("--ono-input-box-shadow",a),r.style.setProperty("--ono-input-height","auto");})(o,y||!1,B,R,K),y&&((e,s)=>{const{minRows:l=2,maxRows:c}=typeof s=="object" ? s:{},a=document.createElement("div");a.style.position="absolute",a.style.visibility="hidden",a.style.whiteSpace="pre-wrap",a.style.wordWrap="break-word",a.style.width=`${e.clientWidth}px`,a.style.font=getComputedStyle(e).font,a.style.padding=getComputedStyle(e).padding,a.style.border=getComputedStyle(e).border,a.style.boxSizing="border-box",document.body.appendChild(a);const r=34*l;let S=r;if(e.value){a.textContent=e.value;const G=a.offsetHeight;S=Math.max(r,G),c&&S>34*c ?(S=34*c,e.style.overflowY="auto"):e.style.overflowY="hidden";}else e.style.overflowY="hidden";e.style.height=`${S}px`,e.style.resize=s ? "none":"vertical",document.body.removeChild(a),Math.floor(S/34);})(o,y);})();},[t,y,h]),P(()=>{m&&t.current&&(m instanceof Function ? m(t.current):m.current=t.current);},[m,t]),n.jsxs("div",{className:q("ono-textarea",k ? "ono-input-is-disabled":""),children:[n.jsx("div",{className:q("ono-textarea-wrapper",z ? R==="none" ? "":"ono-input-is-focus":"",M),onClick:()=>{var o;return(o=t.current)==null ? void 0:o.focus();},children:n.jsx("textarea",{ref:t,className:"ono-textarea-inner",id:x,rows:F,name:D,maxLength:j,minLength:L,placeholder:Q,readOnly:Y,autoComplete:E,autoFocus:V,form:W,disabled:k,onFocus:(o)=>{b==null||b(o),w(!0);},onBlur:(o)=>{v==null||v(o),w(!1);},value:h,onChange:(o)=>{d(o.target.value),C(o.target.value),i==null||i(o);},onKeyUp:O,onKeyDown:$})}),g&&j&&n.jsx("p",{className:"ono-count-bar",onClick:(o)=>o.stopPropagation(),children:h.length+"/"+j})]});});export{te as O,ae as a};
@@ -1 +1 @@
1
- import{j as m}from "./dependencies-B7YNjh_z.js";import{useState as b,useMemo as x,useEffect as w}from "react";const k=({active:u,onchange:n,width:r=40,duration:c=400,lineColor:f="#f5f5f5",backgroundColor:g="#342A7C"})=>{const [a,h]=b(!1),t=x(()=>typeof r=="string" ? r:`${r}px`,[r]),e=(o,i)=>{let d;const l=o.split("");return l[l.length-1]==="x"&&(d=Number(l.slice(0,-2).join(""))*i+"px"),d;},s={width:e(t,0.6),height:e(t,0.06),left:e(t,a ? 0.11:0.2),borderRadius:e(t,1),background:f,transition:`all ${c/1e3}s`},p=[{...s,width:e(t,a ? 0.8:0.5),height:e(t,a ? 0.05:0.06),transform:a ? "translateY(0)rotate(45deg)":`translateY(-${e(t,0.22)})`},{...s,width:e(t,a ? 0.8:0.3),height:e(t,a ? 0.05:0.06),transform:a ? "translateY(0)rotate(315deg)":`translateY(${e(t,0.22)})`},{...s,left:"auto",transform:a ? `translateX(${e(t,1.1)})`:"translateX(0)"}];return w(()=>{h(!!u);},[u]),m.jsx("button",{className:"ono-menu-button",style:{width:t,height:t,background:g,borderRadius:e(t,0.2)},onClick:()=>requestAnimationFrame(()=>{n==null||n(!a),h(!a);}),children:p.map((o,i)=>m.jsx("span",{style:{...o}},i))});};export{k as M};
1
+ import{j as m}from "./dependencies-D-GIrksw.js";import{useState as b,useMemo as x,useEffect as w}from "react";const k=({active:u,onchange:n,width:r=40,duration:c=400,lineColor:f="#f5f5f5",backgroundColor:g="#342A7C"})=>{const [a,h]=b(!1),t=x(()=>typeof r=="string" ? r:`${r}px`,[r]),e=(o,i)=>{let d;const l=o.split("");return l[l.length-1]==="x"&&(d=Number(l.slice(0,-2).join(""))*i+"px"),d;},s={width:e(t,0.6),height:e(t,0.06),left:e(t,a ? 0.11:0.2),borderRadius:e(t,1),background:f,transition:`all ${c/1e3}s`},p=[{...s,width:e(t,a ? 0.8:0.5),height:e(t,a ? 0.05:0.06),transform:a ? "translateY(0)rotate(45deg)":`translateY(-${e(t,0.22)})`},{...s,width:e(t,a ? 0.8:0.3),height:e(t,a ? 0.05:0.06),transform:a ? "translateY(0)rotate(315deg)":`translateY(${e(t,0.22)})`},{...s,left:"auto",transform:a ? `translateX(${e(t,1.1)})`:"translateX(0)"}];return w(()=>{h(!!u);},[u]),m.jsx("button",{className:"ono-menu-button",style:{width:t,height:t,background:g,borderRadius:e(t,0.2)},onClick:()=>requestAnimationFrame(()=>{n==null||n(!a),h(!a);}),children:p.map((o,i)=>m.jsx("span",{style:{...o}},i))});};export{k as M};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{e as D}from "./AutoSliderList-drdrxgEX.js";import{useState as j,useRef as O,useMemo as Q,useCallback as U,useEffect as M}from "react";import{p as W}from "./PortalRenderer-CUaab_Kw.js";let I=1;const c=[],m=(e,a,r)=>(c.length===0&&(I=1),X(a.instancesKey||"",e,{id:`${r}-${I++}`,key:a.instancesKey||"",reactNode:e,props:a,offsetOptions:{topOffset:0,height:0,bottomOffset:0}}),c),S=(e)=>{const a=c.findIndex((r)=>r.id===e);return a<=0 ? 0:c[a-1].offsetOptions.bottomOffset;},X=(e,a,r)=>{const p=(t)=>W(a,{zIndex:999+I-1,...t.props,id:t.id},t.id,"ono-message-root");if(!e){const t=p(r);c.push({...r,props:{...r.props,id:r.id,destroy:t},destroy:t});}let y=!1;const k=c.map((t)=>{if(t.key===e){y=!0;const f={...t.props,...r.props};return{...t,props:f};}{const f=p(t);return{...t,props:{...t.props,id:t.id,destroy:f},destroy:f};}});if(Object.assign(c,k),!y){const t=p(r);c.push({...r,props:{...r.props,id:r.id,destroy:t},destroy:t});}},Y={info:{light:"#1677ff",dark:"#1677ff"},success:{light:"#52c41a",dark:"#49aa19"},error:{light:"#ff4d4f",dark:"#a61d24"},warning:{light:"#faad14",dark:"#d89614"},loading:{light:"#9254de",dark:"#f5f5f5"}},C=(e,a)=>Y[e][a],K=(e)=>{switch(e){case "success":return o.jsx("svg",{className:"ono-type-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",fill:C(e,"light"),"aria-hidden":"true",children:o.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})});case "error":return o.jsx("svg",{className:"ono-type-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",fill:C(e,"light"),"aria-hidden":"true",children:o.jsx("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})});case "loading":return o.jsx("svg",{className:D("ono-info-icon","ono-loading"),viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",fill:C(e,"light"),"aria-hidden":"true",children:o.jsx("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});default:return o.jsx("svg",{className:"ono-info-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"exclamation-circle",fill:C(e,"light"),"aria-hidden":"true",children:o.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})});}},T=({handleDestroy:e})=>o.jsx("button",{onClick:e,children:o.jsx("svg",{className:"ono-clear-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})})}),g=({id:e,instancesKey:a,duration:r=3e3,speed:p=300,offset:y=20,message:k,type:t,plain:f=!0,showClose:F=!1,zIndex:A,onClose:E=()=>{},destroy:R})=>{const [,q]=j(!1),[z,H]=j(0),[x,P]=j(((n)=>{const i=c.findIndex((l)=>l.id===n);return i<=0 ? 0:c[i-1].offsetOptions.topOffset;})(e)),[s,V]=j({duration:r,speed:p,message:k,type:t,showClose:F,onClose:E}),v=O(null),w=O(null),d=O(null),N=x+z,G=Q(()=>({translate:`-50%${x}px`,transition:`translate ${p}ms ease-in-out`,zIndex:A}),[x,p]),L=()=>{d.current&&(d.current.classList.remove("ono-message-enter"),d.current.classList.add("ono-message-leave"),d.current.style.translate=`-50%${S(e)-z}px`,((n)=>{const i=c.findIndex((l)=>l.id===n);i!==-1&&c.splice(i,1);})(e),setTimeout(()=>R(s.onClose),p));},b=(n,i,l)=>{n!=="loading"&&(v.current=setTimeout(L,i-l));},$=()=>{const n=S(e);q((i)=>(i&&P(n+y),!0)),requestAnimationFrame($);},B=U(()=>{if(s.type==="loading"){if(w.current)return;w.current=setTimeout(()=>{var l;w.current=null;const n=(i=a||"")?(l=c.find((u)=>u.key===i))==null ? void 0:l.props:null;var i;n&&(((u)=>{V((J)=>({...J,...u}));})({...n}),b(s.type,n.duration||s.duration,n.speed||s.speed),B());},100);}},[s]);return M(()=>{b(s.type,s.duration,s.speed),$(),B();},[s.type,s.duration,s.speed]),M(()=>{(()=>{if(!d.current)return;const{height:n}=d.current.getBoundingClientRect();d.current.style.setProperty("--speed",`${s.speed}ms`),H(n);})();},[d]),M(()=>{((n,i)=>{const l=c.findIndex((u)=>u.id===n);l<0||(c[l].offsetOptions=i);})(e,{topOffset:x,height:z,bottomOffset:N});},[N]),o.jsx("div",{ref:d,className:D("ono-message",`ono-message-${s.type}`,"ono-message-enter",f ? "":"ono-message-color"),style:G,onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null);},onMouseLeave:()=>b(s.type,s.duration,s.speed),children:typeof s.message=="function" ? s.message(K(s.type),s.showClose&&o.jsx(T,{handleDestroy:L})):o.jsxs(o.Fragment,{children:[K(s.type),o.jsx("div",{children:s.message}),s.showClose&&o.jsx(T,{handleDestroy:L})]})});},h=(e)=>{if(typeof e=="string")return{message:e};{const a={...e,instancesKey:e.key};return delete a.key,{...a};}},t0={info:(e)=>{m(g,{...h(e),type:"info"},"ono-message");},success:(e)=>{m(g,{...h(e),type:"success"},"ono-message");},warning:(e)=>{m(g,{...h(e),type:"warning"},"ono-message");},error:(e)=>{m(g,{...h(e),type:"error"},"ono-message");},loading:(e)=>{m(g,{...h(e),type:"loading"},"ono-message");}};export{t0 as m};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{b as h,e as D}from "./AutoSliderList-drdrxgEX.js";import{useState as E,useRef as j,useEffect as y}from "react";import{p as F}from "./PortalRenderer-CUaab_Kw.js";import{B as g}from "./Button-CWqApx4k.js";const M=({title:c="This is a modal title",icon:k,content:B="This is a modal content",okText:N="confirm",cancelText:v="cancel",confirmDisabled:w,cancelDisabled:P,startPosition:t,onConfirm:d,onCancel:m,mask:x=!0,maskClosable:T=!1,width:f,btnClr:l,footer:b=({OkBtn:s,CancelBtn:i})=>o.jsxs(o.Fragment,{children:[o.jsx(i,{}),o.jsx(s,{})]}),modalBody:u,destroy:p})=>{const [s,i]=E(!1),n=j(null),a=j(null),z=[{label:"themeColor",value:l||""},{label:"themeHoverColor",value:l&&h(l,"light",10)||""},{label:"themeActiveColor",value:l&&h(l,"dark",20)||""},{label:"themeDisabledClr",value:l&&h(l,"light",20)||""}],r=()=>{if(t){if(!a.current)return;a.current.classList.remove("ono-modal-enter"),a.current.classList.add("ono-modal-leave"),setTimeout(()=>{p();},300);}else p();};return y(()=>(n.current&&(x ? n.current.showModal():n.current.show()),()=>{n.current&&n.current.close();}),[n.current,x]),y(()=>{(()=>{if(!a.current)return;const e=a.current.style;f&&e.setProperty("--width",f+"px"),t&&(e.setProperty("--left",(t.x/window.innerWidth*100).toFixed(2)+"%"),e.setProperty("--top",(t.y/window.innerHeight*100).toFixed(2)+"%")),l&&z.forEach((C)=>e.setProperty(`--${C.label}`,C.value));})();},[a]),o.jsx("dialog",{ref:n,className:"ono-modal",onClick:()=>T&&r(),children:u ? u(r):o.jsxs("div",{ref:a,className:D("ono-modal-box",t ? "ono-modal-enter":""),onClick:(e)=>e.stopPropagation(),children:[o.jsxs("div",{className:"ono-modal-box-body",children:[k ?? o.jsx("div",{className:"ono-modal-box-body-icon",children:o.jsx("svg",{color:"#faad14",viewBox:"64 64 896 896",focusable:"false","data-icon":"exclamation-circle",width:"22px",height:"22px",fill:"currentColor","aria-hidden":"true",style:{marginInlineEnd:"12px"},children:o.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})})}),o.jsxs("div",{className:"ono-modal-box-body-contentBar",children:[o.jsx("h1",{className:"ono-modal-box-body-contentBar-title",children:c}),o.jsx("p",{className:"ono-modal-box-body-contentBar-content",children:B})]})]}),b&&o.jsx("div",{className:"ono-modal-box-footer",children:b({OkBtn:()=>o.jsx(g,{className:"ono-modal-box-footer-confirmBtn",loading:s,disabled:w,onClick:async()=>{i(!0);try{const e=d==null ? void 0:d();e instanceof Promise&&await e;}finally{i(!1),r();}},children:N ?? "Confirm"}),CancelBtn:()=>o.jsx(g,{className:"ono-modal-box-footer-cancelBtn",disabled:P||s,onClick:()=>{m==null||m(),r();},children:v ?? "Cancel"}),handleClose:()=>r()})})]})});},I=(c)=>F(M,c,"ono-modal");export{I as M};
@@ -1 +1 @@
1
- import{j as t}from "./dependencies-B7YNjh_z.js";const C=({firstBtn:r,lastBtn:g,currentPage:n,total:a,prevBtn:e,nextBtn:l,styles:m,className:b,children:p,onChange:c,pageBtnClassName:x,pageBtnActiveClassName:N,hiddenNextBtnOnLastPage:u,hiddenPrevBtnOnFirstPage:j})=>{const d=Math.max(1,Math.min(n,a));return t.jsxs("ul",{className:`ono-pagination ${b}`,style:m,children:[r&&t.jsx("li",{className:r ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>c(1),children:r}),j&&n===1 ? null:t.jsx("li",{className:"ono-pagination-base",style:{cursor:n!==1 ? "pointer":"no-drop"},onClick:()=>{n<=1||c(n-1);},children:e ? typeof e=="function" ? e(n!==1):e:t.jsx("div",{className:e ? "ono-pagination-base":"ono-pagination-btn",children:"prevBtn"})}),(()=>{const i=Array.from({length:a},(v,s)=>t.jsx("li",{className:"ono-pagination-base",onClick:()=>c(s+1),children:p ? p({page:s+1,isActive:n===s+1}):t.jsx("div",{className:`ono-pagination-base ${x ?? "ono-pagination-btn"}${d===s+1 ? N ?? "ono-pagination-btn-active":""}`,children:s+1})},s+1));if(i.length<=7)return i;const h=a-1,o=d,B=o>=a-2;return o<=3 ? [...i.slice(0,o===3 ? 4:3),"...",i[h]]:B ? [i[0],"...",...i.slice(o===a-2 ?-4:-3)]:[i[0],"...",...i.slice(o-2,o+1),"...",i[h]];})(),u&&n===a ? null:t.jsx("li",{className:"ono-pagination-base",style:{cursor:n!==a ? "pointer":"no-drop"},onClick:()=>{c(n>=a ? a:n+1);},children:l ? typeof l=="function" ? l(n!==a):l:t.jsx("div",{className:l ? "ono-pagination-base":"ono-pagination-btn",children:"nextBtn"})}),g&&t.jsx("li",{className:g ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>c(a),children:g})]});};export{C as P};
1
+ import{j as t}from "./dependencies-D-GIrksw.js";const C=({firstBtn:r,lastBtn:g,currentPage:n,total:a,prevBtn:e,nextBtn:l,styles:m,className:b,children:p,onChange:c,pageBtnClassName:x,pageBtnActiveClassName:N,hiddenNextBtnOnLastPage:u,hiddenPrevBtnOnFirstPage:j})=>{const d=Math.max(1,Math.min(n,a));return t.jsxs("ul",{className:`ono-pagination ${b}`,style:m,children:[r&&t.jsx("li",{className:r ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>c(1),children:r}),j&&n===1 ? null:t.jsx("li",{className:"ono-pagination-base",style:{cursor:n!==1 ? "pointer":"no-drop"},onClick:()=>{n<=1||c(n-1);},children:e ? typeof e=="function" ? e(n!==1):e:t.jsx("div",{className:e ? "ono-pagination-base":"ono-pagination-btn",children:"prevBtn"})}),(()=>{const i=Array.from({length:a},(v,s)=>t.jsx("li",{className:"ono-pagination-base",onClick:()=>c(s+1),children:p ? p({page:s+1,isActive:n===s+1}):t.jsx("div",{className:`ono-pagination-base ${x ?? "ono-pagination-btn"}${d===s+1 ? N ?? "ono-pagination-btn-active":""}`,children:s+1})},s+1));if(i.length<=7)return i;const h=a-1,o=d,B=o>=a-2;return o<=3 ? [...i.slice(0,o===3 ? 4:3),"...",i[h]]:B ? [i[0],"...",...i.slice(o===a-2 ?-4:-3)]:[i[0],"...",...i.slice(o-2,o+1),"...",i[h]];})(),u&&n===a ? null:t.jsx("li",{className:"ono-pagination-base",style:{cursor:n!==a ? "pointer":"no-drop"},onClick:()=>{c(n>=a ? a:n+1);},children:l ? typeof l=="function" ? l(n!==a):l:t.jsx("div",{className:l ? "ono-pagination-base":"ono-pagination-btn",children:"nextBtn"})}),g&&t.jsx("li",{className:g ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>c(a),children:g})]});};export{C as P};
@@ -1 +1 @@
1
- import{j as l,R as p}from "./dependencies-B7YNjh_z.js";const y=(c,i,r,u)=>{const{target:o,root:a}=((n,d)=>{let e=null,t=null;return d&&(e=document.getElementById(d),e||(e=document.createElement("div"),e.id=d,document.body.appendChild(e))),n ?(t=document.getElementById(n),t||(t=document.createElement("div"),t.id=n,e ? e.appendChild(t):document.body.appendChild(t))):(t=document.createElement("div"),e ? e.appendChild(t):document.body.appendChild(t)),{target:t,root:e};})(r,u),m=(n)=>{var d;typeof n=="function"&&n(),r ?(d=document.getElementById(r))==null||d.remove():o.remove(),requestAnimationFrame(()=>a&&a.children.length===0&&a.remove());};if(o.__reactContainer$!==void 0)o.__reactContainer$.render(l.jsx(c,{...i,destroy:m}));else{const n=p.createRoot(o);o.__reactContainer$=n,n.render(l.jsx(c,{...i,destroy:m}));}return m;};export{y as p};
1
+ import{j as l,R as p}from "./dependencies-D-GIrksw.js";const y=(c,i,r,u)=>{const{target:o,root:a}=((n,d)=>{let e=null,t=null;return d&&(e=document.getElementById(d),e||(e=document.createElement("div"),e.id=d,document.body.appendChild(e))),n ?(t=document.getElementById(n),t||(t=document.createElement("div"),t.id=n,e ? e.appendChild(t):document.body.appendChild(t))):(t=document.createElement("div"),e ? e.appendChild(t):document.body.appendChild(t)),{target:t,root:e};})(r,u),m=(n)=>{var d;typeof n=="function"&&n(),r ?(d=document.getElementById(r))==null||d.remove():o.remove(),requestAnimationFrame(()=>a&&a.children.length===0&&a.remove());};if(o.__reactContainer$!==void 0)o.__reactContainer$.render(l.jsx(c,{...i,destroy:m}));else{const n=p.createRoot(o);o.__reactContainer$=n,n.render(l.jsx(c,{...i,destroy:m}));}return m;};export{y as p};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{e as g}from "./AutoSliderList-drdrxgEX.js";import{useState as E,useRef as y,useEffect as P}from "react";const R=({name:h,value:a,style:m,checked:l,onChange:C,children:r,className:p,radioW:f=16,radioGap:k=4,checkedColor:c="#532ce1",unCheckedColor:t="transparent",disabled:d=!1})=>{const [e,n]=E(""),b=y(null),i=y(null),s=y(null),j=[{value:f,name:"w"},{value:k,name:"gap"},{value:c,name:"checkedColor"},{value:t,name:"unCheckedColor"}];return P(()=>{(()=>{if(!s.current||!i.current)return;j.forEach(({value:x,name:N})=>{x&&((v,w,G)=>{const W=typeof v=="number";G.style.setProperty(`--${w}`,W ? `${v}px`:v);})(x,N,i.current);});const u=getComputedStyle(s.current);e||n(u.borderColor),s.current.style.borderColor=l ? c:e;})();},[i,s,l,e]),o.jsxs("div",{ref:i,className:g("ono-radio-box",p),style:m,children:[o.jsx("div",{ref:s,className:"ono-radio",onClick:()=>{var u;return(u=b.current)==null ? void 0:u.click();},children:o.jsx("input",{type:"radio",name:h,ref:b,value:a+"",checked:l,disabled:d,id:a+""+r,onChange:C})}),r&&o.jsx("label",{htmlFor:a+""+r||"",children:r})]});},F=({name:h,style:a,options:m,onChange:l,className:C,radioW:r=16,radioGap:p=4,labelPosition:f="right",checkedColor:k="#532ce1",unCheckedColor:c="transparent",value:t})=>o.jsx("div",{className:g("ono-radio-group",C),style:a,children:m.map(({label:d,value:e,disabled:n})=>o.jsx(R,{name:h,value:e,radioW:r,radioGap:p,style:{flexDirection:f==="left" ? "row-reverse":"row"},checkedColor:k,unCheckedColor:c,onChange:()=>l(e),checked:t+""==e+"",disabled:typeof n=="function" ? n(t):n||!1,children:d},d))});export{R,F as a};
@@ -0,0 +1 @@
1
+ import{j as g}from "./dependencies-D-GIrksw.js";import{e as y}from "./AutoSliderList-drdrxgEX.js";import{forwardRef as k,useState as C,useRef as x,useEffect as d}from "react";const N=({children:s,disabled:i,className:m,style:n,onClick:l})=>g.jsx("li",{className:y("ono-scrollable-tab",m),style:n,onClick:(c)=>!i&&(l==null ? void 0:l(c)),children:s}),L=k(({activeIndex:s,children:i,className:m,style:n,position:l="center",onChange:c},a)=>{const [o,p]=C(0),r=x(null);return d(()=>{const e=r.current;if(!e||o<0)return;const h=e.offsetWidth,t=Array.from(e.children);if(o>=t.length)return;const u=parseInt(((n==null ? void 0:n.gap)||getComputedStyle(e).gap||"0").toString(),10)||0;let f=0;switch(t.slice(0,o+1).forEach((b)=>f+=b.offsetWidth+u),l){case "start":e.scrollLeft=f-t[o].offsetWidth-u;break;case "end":e.scrollLeft=f-h;break;default:f-=t[o].offsetWidth/2+(s!==t.length-1 ? u:0),e.scrollLeft=f-h/2;}},[r,i,s,l]),d(()=>{p(s||0);},[s]),d(()=>{a&&(typeof a=="function" ? a(r.current):a.current=r.current);},[a]),g.jsx("ul",{ref:r,className:y("ono-scrollable-tabs",m),style:n,onClick:(e)=>{r.current&&Array.from(r.current.children).some((h,t)=>{if(h.contains(e.target))return p(t),c==null||c(t),!0;});},children:i(N)});});export{L as S};
@@ -0,0 +1 @@
1
+ import{j as n}from "./dependencies-D-GIrksw.js";import{e as b}from "./AutoSliderList-drdrxgEX.js";import{useState as r,useEffect as M}from "react";import{T as F}from "./Tooltip-7uWxsj7r.js";import{O as T}from "./Input-CdxX4nzt.js";import{L as z}from "./List-DXRmDwDo.js";const D=({label:e,value:t,disabled:i,onChange:c,selectValue:d,optionRender:h,currentValue:m,onChangeCursor:u})=>n.jsx("button",{role:"option","aria-label":e,disabled:i,className:"ono-option-item",onClick:()=>c==null ? void 0:c(t),onMouseEnter:()=>!i&&(u==null ? void 0:u(e)),children:h ? h({label:e,value:t,disabled:i},d===e):n.jsx("div",{className:b("ono-option-item-content",m===e&&d!==e ? "ono-option-item-content-active":"",d===e ? "ono-option-item-content-selected":"",i ? "ono-option-item-content-disabled":""),children:e})}),K=({options:e,defaultValue:t,placeholder:i,inputBorder:c,isShowArrow:d,disabled:h,clearable:m,selectClassName:u,optionsClassName:O,notFoundContent:w,optionRender:y,onClear:g,onChange:s,filterOption:a})=>{const [f,N]=r(""),[E,C]=r(""),[p,j]=r(""),[L,S]=r(!1),[V,R]=r(!1),[A,x]=r(""),k=(o)=>{const l=e.find((v)=>v.value===o);N(l ? l.label:"");},B=(o)=>{s==null||s(o),x(o),k(o);};return M(()=>{t&&k(t);},[t]),M(()=>{var o;if(e.length>0){if(t){const l=e.find((v)=>v.value===t);l&&C(l.label);}else e:for(let l=0;l<e.length;l++)if(((o=e[l])==null ? void 0:o.disabled)!==!0){C(e[0].label);break e;}}},[e,t]),n.jsx(F,{sameWidth:!0,trigger:"click",placement:"bottom",isShowArrow:d,className:b("ono-option-container",O),onOpenChange:(o)=>{R(o),a&&p&&!o&&j("");},content:n.jsx(z,{list:a ? typeof a=="function" ? a(p,e):e.filter((o)=>o.label.toLocaleLowerCase().includes(p.toLocaleLowerCase())):e,fallback:n.jsx("div",{className:"ono-option-item",children:n.jsx("div",{className:"ono-option-item-content-no-data",onClick:(o)=>o.stopPropagation(),children:w ?? "No Data"})}),children:(o)=>n.jsx(D,{...o,onChange:B,selectValue:f.toString(),currentValue:E.toString(),optionRender:y,onChangeCursor:C},o.value)}),children:n.jsx("div",{className:"ono-select",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:n.jsx(T,{className:b(a ? "":"ono-select-readonly",u),border:c,disabled:h,placeholder:a&&A ? f.toString()||"":i,readonly:!a,value:a&&V ? p:f.toString(),clearable:L&&m,suffix:L&&m&&f||m&&p&&a ? n.jsx(n.Fragment,{}):n.jsx(P,{isVisible:V}),onClear:()=>{g==null||g(),s==null||s(""),x(""),N(""),j("");},onChange:(o)=>j(o.target.value)})})});},P=({isVisible:e})=>n.jsx("svg",{className:b("ono-select-arrow-down-icon",e ? "ono-select-arrow-down-active":""),viewBox:"64 64 896 896",focusable:"false","data-icon":"down",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})});export{K as O};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{e as p}from "./AutoSliderList-drdrxgEX.js";import{useRef as v,useEffect as y}from "react";const j=({w:c,h:m,src:n,clr:l,className:u,onClick:i})=>{const e=v(null),f=[{value:c,name:"w"},{value:m,name:"h"},{value:l,name:"clr"}];return y(()=>{e.current&&f.forEach((s)=>{var r,a,t;s.value&&(r=s.value,a=s.name,t=e.current,typeof r=="string" ? t.style.setProperty(`--${a}`,r):t.style.setProperty(`--${a}`,`${r}px`));});},[e,l]),o.jsx("div",{ref:e,className:p("ono-svg-img",u),onClick:i,children:o.jsx("img",{src:n,alt:""})});};export{j as S};
@@ -0,0 +1 @@
1
+ import{j as c}from "./dependencies-D-GIrksw.js";import{e as y,a as j}from "./AutoSliderList-drdrxgEX.js";import{useRef as r,useEffect as k}from "react";const P=({id:g,text:e,style:h,color:n,checked:u,onChange:d,name:N="",className:m,disabled:v=!1})=>{const o=r(null),s=r(null),i=r(null),l=r(null),p=r(null),x=r(null),b=[{value:typeof n=="string" ? n:n==null ? void 0:n.active,name:"checkedClr"},{value:typeof n=="string"||n==null ? void 0:n.inactive,name:"uncheckedClr"}];return k(()=>{(()=>{if(!s.current||!o.current)return;let t=60,w=32;if(m||h){const a=getComputedStyle(s.current);t=j(a.width),w=j(a.height);}[...b,{value:t,name:"w"},{value:w,name:"h"}].forEach(({value:a,name:C})=>{a&&((f,E,S)=>{const $=typeof f=="number";S.style.setProperty(`--${E}`,$ ? `${f}px`:f);})(a,C,o.current);}),requestAnimationFrame(()=>{l.current&&(l.current.style.transition="translate 0.3s");});})();},[s,o,l,m,h,n,e,p,x]),k(()=>{i.current&&(i.current.checked=u);},[i,u]),c.jsxs("div",{ref:o,className:y("ono-switch",v ? "ono-switch-is-disabled":""),children:[c.jsx("input",{id:g,name:N,role:"switch",ref:i,type:"checkbox",checked:u,onChange:(t)=>{v||(d==null||d(t.currentTarget.checked,t));}}),c.jsx("div",{ref:s,className:y("ono-switch-box",m),style:h,onClick:()=>{var t;return(t=i.current)==null ? void 0:t.click();},children:c.jsxs("div",{ref:l,className:"ono-switch-children-bar",children:[(e==null ? void 0:e.active)&&c.jsx("div",{ref:p,className:"ono-switch-children",children:e==null ? void 0:e.active}),c.jsx("div",{className:"ono-switch-slider"}),(e==null ? void 0:e.inactive)&&c.jsx("div",{ref:x,className:"ono-switch-children",children:e==null ? void 0:e.inactive})]})})]});};export{P as S};
@@ -0,0 +1 @@
1
+ import{j as u}from "./dependencies-D-GIrksw.js";import{e as b,n as h}from "./AutoSliderList-drdrxgEX.js";import{useState as P,useRef as w,useEffect as $,useCallback as j}from "react";const L=({children:s,animation:e,className:d,duration:i=300,style:p,maskColor:m="rgba(0,0,0,0.5)",disableContextMenu:f,maskClickClose:y=!0,dialogClose:c})=>{const [r,k]=P(!1),o=w(null),l=()=>{if(o.current)if(k(!0),e){const t=o.current;t.classList.remove(`ono-${e.type}-enter`),t.classList.add(`ono-${e.type}-leave`),setTimeout(c,i);}else c();};$(()=>{(()=>{if(!e||!o.current)return;const t=o.current.parentElement.style,n=o.current.style;switch(t.setProperty("--duration",i/1e3+"s"),e.type){case "zoom":{const{x:a,y:g}=h(e.element),x=(a/window.innerWidth*100).toFixed(2)+"%",v=(g/window.innerHeight*100).toFixed(2)+"%";n.setProperty("--left",x),n.setProperty("--top",v);break;}case "fade":{const a=e.direction==="left-center" ? "--left":"--top";n.setProperty(a,e.startPosition);break;}}})();},[o,e]);const C=j(()=>{if(!e)return "";const t=`ono-${e.type}-enter`,n=`ono-${e.type}-leave`;return r ? n:t;},[e,r]);return u.jsx("div",{className:"ono-dialog-mask ono-dialog-mask-"+(r ? "leave":"enter"),style:{background:m},onClick:()=>y&&l(),onContextMenu:(t)=>f&&t.preventDefault(),children:u.jsx("div",{ref:o,className:b("ono-dialog",d,C()),style:p,onClick:(t)=>t.stopPropagation(),children:typeof s=="function" ? s(l):s})});};export{L as T};
@@ -0,0 +1 @@
1
+ import{j as a}from "./dependencies-D-GIrksw.js";import{e as u}from "./AutoSliderList-drdrxgEX.js";import{useEffect as f,useRef as _}from "react";import{i as v}from "./InjunctiveBox-DsNUniss.js";const L="_enter_974ly_32";let t=[];const w={success:{light:"#52c41a",dark:"#49aa19"},error:{light:"#ff4d4f",dark:"#a61d24"},warning:{light:"#faad14",dark:"#d89614"},promise:{light:"",dark:""}},y=(s,i)=>w[s][i],j=(s)=>{switch(s){case "success":return a.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",width:"24px",height:"24px",fill:y(s,"light"),"aria-hidden":"true",children:a.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})});case "error":return a.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",width:"24px",height:"24px",fill:y(s,"light"),"aria-hidden":"true",children:a.jsx("path",{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"})});case "warning":return a.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"exclamation-circle",width:"24px",height:"24px",fill:y(s,"light"),"aria-hidden":"true",children:a.jsx("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})});}},z=({type:s,speed:i=200,message:c,duration:m=2e3,className:d,style:h,isUseEnterAnimation:g=!0,promiseOptions:e,toastList:p,handleDestroy:o})=>{const r=_(null);return f(()=>{r.current&&(r.current.style.setProperty("--speed",i/1e3+"s"),g&&r.current.classList.add(L),s!=="promise"&&setTimeout(()=>{var n,x;(n=r.current)==null||n.classList.remove(L),(x=r.current)==null||x.classList.add("_leave_974ly_36");},m-i));},[r]),f(()=>{s==="promise" ?(typeof c=="function" ? c():c).then((n)=>setTimeout(()=>{o(),l({type:"success",message:typeof(e==null ? void 0:e.success)=="function" ? e.success(n):(e==null ? void 0:e.success)||"",isUseEnterAnimation:!1,toastList:p});},i)).catch((n)=>setTimeout(()=>{o(),l({type:"error",message:typeof(e==null ? void 0:e.error)=="function" ? e.error(n):(e==null ? void 0:e.error)||"",isUseEnterAnimation:!1,toastList:p});},i)):setTimeout(()=>o(()=>p=[]),m);},[s]),a.jsxs("div",{ref:r,className:u(s==="promise" ? "_promise_974ly_15":"_base_974ly_15",d),style:h,onClick:()=>{},children:[a.jsx("div",{className:"_icon_974ly_40",children:j(s)}),a.jsx("p",{children:typeof c=="string" ? c:e&&e.loading})]});},l=({type:s,speed:i=200,message:c,duration:m=2e3,zIndex:d=9999,className:h,style:g,isUseEnterAnimation:e=!0,promiseOptions:p,toastList:o})=>v({className:"_container_974ly_1",isSingle:!0,style:{zIndex:d},content:(r)=>(f(()=>{},[o]),a.jsx(z,{className:h,style:g,type:s,message:c,speed:i,duration:m,isUseEnterAnimation:e,promiseOptions:p,handleDestroy:r,toastList:o}))}),U={success:(s)=>{t.push({type:"success",message:s}),l(typeof s=="string" ?{type:"success",message:s,toastList:t}:{type:"success",...s,toastList:t});},error:(s)=>{t.push({type:"error",message:s}),l(typeof s=="string" ?{type:"error",message:s,toastList:t}:{type:"error",...s,toastList:t});},warning:(s)=>{t.push({type:"warning",message:s}),l(typeof s=="string" ?{type:"warning",message:s,toastList:t}:{type:"warning",...s,toastList:t});},promise:(s,i)=>{t.push({type:"promise",message:s}),l({type:"promise",message:s,promiseOptions:i,toastList:t});}};export{U as t};
@@ -0,0 +1 @@
1
+ import{j as o}from "./dependencies-D-GIrksw.js";import{c as b}from "./useClickOutSide.tsx-Drp6uYap.js";import{e as k}from "./AutoSliderList-drdrxgEX.js";import{createPopper as A}from "@popperjs/core";import{useState as W,useRef as d,useEffect as h}from "react";let a=null,p=null;const E=({children:c,content:u,onOpenChange:l,trigger:n="hover",placement:f="top",popperOptions:m={},className:w,style:x,isShowArrow:v=!0,sameWidth:y,autoAdjustOverflow:g=!0})=>{const [s,j]=W(!1),i=d(null),e=d(null),r=(t)=>{l==null||l(t),j(t);};return b(e,()=>{n!=="click"&&n!=="contextmenu"||r(!1);},{event:["click","contextmenu"],deps:[n,l]}),h(()=>{(()=>{if(!e.current)return;const t=Array.from(e.current.children);if(t.length>1)throw new Error("Tooltip only support one child");e.current.style.width=t[0].getBoundingClientRect().width+"px";})();},[e,c]),h(()=>{e.current&&(n==="hover" ?(e.current.onmouseenter=()=>r(!0),e.current.onmouseleave=()=>r(!1)):n==="click" ? e.current.onclick=()=>r(!s):n==="focus" ?(e.current.onfocus=()=>r(!0),e.current.onblur=()=>r(!1)):e.current.oncontextmenu=()=>r(!s)),s&&e.current&&i.current ? p=A(e.current,i.current,{placement:f,modifiers:[{name:"offset",options:{offset:[0,6]}},y ?{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn({state:t}){t.styles.popper.width=`${t.rects.reference.width}px`;},effect({state:t}){t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`;}}:{},g ?{name:"flip",enabled:!0}:{}],...m}):p&&(p.destroy(),p=null,a&&a.remove(),a=null);},[s,e,i]),o.jsxs(o.Fragment,{children:[s&&o.jsxs("div",{ref:i,style:x,className:k("ono-tooltip-popper",w),"data-popper-placement":m.placement||f,children:[o.jsx("div",{children:u instanceof Function ? u():u}),v&&o.jsx("div",{className:"ono-tooltip-popper-arrow","data-popper-arrow":!0})]}),o.jsx("div",{ref:e,children:c instanceof Function ? c():c})]});};export{E as T};
@@ -0,0 +1 @@
1
+ import{j as g}from "./dependencies-D-GIrksw.js";import{f as k}from "./useEventListener.tsx-BDtH_FiI.js";import{p as B}from "./AutoSliderList-drdrxgEX.js";import{memo as q,useState as N,useMemo as z,useRef as b,useEffect as x}from "react";import{L as F}from "./List-DXRmDwDo.js";const Q=q(({containerClassName:w,dataSource:d,containerStyle:I={},onEndCallback:p,refreshSpeed:E=50,wrapperClassName:A,wrapperStyle:H={},estimatedSize:y=35,updateDataSourceScroll2Top:L,direction:n="vertical"})=>{const [s,M]=N({viewSize:0,startIndex:0,listSize:0,renderCount:0,prevLen:0}),[l,T]=N([]),h=typeof y=="number" ? y:y(),j=z(()=>Math.min(d.length,s.startIndex+s.renderCount),[d,s]),m=z(()=>{var t;return s.startIndex>0 ?(t=l[s.startIndex-1])==null ? void 0:t.end:0;},[s.startIndex,l]),W=z(()=>g.jsx(F,{list:d.slice(s.startIndex,j),children:({id:t,data:r})=>g.jsx("li",{"data-virtual-id":t,style:n==="vertical" ?{width:"100%"}:{height:"100%"},children:r},t)}),[j,d,s.startIndex,n]),D=z(()=>({display:"flex",listStyle:"none",flexDirection:n==="vertical" ? "column":"row",height:n==="vertical" ? s.listSize-m+"px":"100%",width:n==="vertical" ? "auto":s.listSize-m+"px",translate:n==="vertical" ? `0 ${m}px 0`:`${m}px 0 0`}),[s.listSize,m,n]),u=b(null),f=b(null),S=(t)=>M((r)=>({...r,...t})),R=B(()=>{const{scrollTop:t,clientHeight:r,scrollHeight:o,scrollLeft:a,clientWidth:i,scrollWidth:e}=u.current,c=n==="vertical" ? o-r-t:e-i-a;S({startIndex:$(l,n==="vertical" ? t:a)}),(n==="vertical" ? t===h/2:a===h/2)&&S({startIndex:0}),c<=20&&p&&p();},E),$=(t,r)=>{let o=0,a=t.length-1,i=-1;for(;o<=a;){const e=o+Math.floor((a-o)/2),c=t[e].end;if(c===r)return e+1;c<r ? o=e+1:((i===-1||i>e)&&(i=e),a=e-1);}return i;};return k("scroll",R,{target:u.current,deps:[l,n]}),x(()=>{(()=>{if(!u.current)return;const t=(n==="vertical" ? u.current.offsetHeight:u.current.offsetWidth)||0;S({viewSize:t,renderCount:Math.ceil(t/h)+1});})();},[u,n]),x(()=>{d.length&&f&&(()=>{var i;const t=[],r=d.length-s.prevLen,o=r>0 ? l.length:0,a=o>0 ? l[o-1].end:0;for(let e=0;e<(r>0 ? r:d.length);e++){const c=d[(r>0 ? s.prevLen:0)+e];t.push({index:c.id,size:h,start:a ? a+e*h:c.id*h,end:a ? a+(e+1)*h:(c.id+1)*h,dSize:0});}T((e)=>[...r>0 ? e:[],...t]),S({prevLen:d.length}),L&&((i=u.current)==null||i.scrollTo(0,0));})();},[f,d,L]),x(()=>{(()=>{if(!f.current||l.length===0)return;const t=Array.from(f.current.childNodes);if(!t.length)return;t.forEach((i)=>{const e=i.getBoundingClientRect(),c=+i.getAttribute("data-virtual-id"),v=l[c],C=v.size-(n==="vertical" ? e.height:e.width);C&&(v.size=n==="vertical" ? e.height:e.width,v.end=v.end-C,v.dSize=C);});const r=+t[0].getAttribute("data-virtual-id"),o=l.length;let a=l[r].dSize;l[r].dSize=0;for(let i=r+1;i<o;i++){const e=l[i];e.start=l[i-1].end,e.end=e.end-a,e.dSize&&(a+=e.dSize,e.dSize=0);}S({listSize:l[o-1].end});})();},[f,l,s.startIndex,n]),g.jsx("div",{ref:u,className:w,style:{width:"100%",height:"100%",overflow:"auto",...I},children:g.jsx("ul",{ref:f,className:A,style:{...D,...H},children:W})});}),U=(w,d)=>w.map((I,p)=>({id:p,data:d(I,p)}));export{Q as E,U as c};
@@ -0,0 +1 @@
1
+ import{j as l}from "./dependencies-D-GIrksw.js";import{f as J}from "./useEventListener.tsx-BDtH_FiI.js";import{p as R,e as B}from "./AutoSliderList-drdrxgEX.js";import{useState as v,useRef as L,useCallback as G,useEffect as z}from "react";import{L as I}from "./List-DXRmDwDo.js";const X=({options:t,pageSize:h,children:S,request:A,reloadData:o,className:$,style:H,updateData:j,loading:m=!0,bottomThreshold:O=50})=>{const [a,p]=v({page:1,reloadData:o,loading:!1,isFinish:!1,gap:typeof t=="number" ? 0:t.gap,imageWidth:typeof t=="number" ? t:0,columns:typeof t=="number" ? 0:t.columns,imageList:[]}),[f,D]=v([]),[y,N]=v([]),x=L(null),g=L(null),d=L(null),u=(i)=>p((e)=>({...e,...i})),w=async(i,e)=>{const s=o&&a.reloadData!==o;if(a.isFinish)return;u({loading:!0});const n=await A(i,e);k(n),u({isFinish:!n.length,imageList:s ? [...n]:[...a.imageList,...n],page:i+1,loading:!1});},k=(i)=>p((e)=>{const s=o&&a.reloadData!==o,n=s ? []:[...y],c=s ? Array(e.columns).fill(0):[...JSON.stringify(f)!=="[]" ? f:Array(e.columns).fill(0)];return i.forEach((M)=>{const r=((W)=>{let b=0,T=0;return b=W.indexOf(Math.min(...W)),T=W[b],{index:b,height:T};})(c),C=Math.floor(M.height*e.imageWidth/M.width);n.push({x:r.index%e.columns!==0 ? r.index*e.imageWidth+e.gap*r.index:r.index*e.imageWidth,y:r.height}),c[r.index]+=C+e.gap,D(c);}),N(n),e;}),E=G(()=>{if(!d.current)return;const i=d.current.clientWidth;let e=0,s=a.page;if(o&&a.reloadData!==o&&(p({page:1,reloadData:o,loading:!1,isFinish:!1,gap:typeof t=="number" ? 0:t.gap,imageWidth:typeof t=="number" ? t:0,columns:typeof t=="number" ? 0:t.columns,imageList:[]}),D([]),N([]),s=1),typeof t=="number"){const n=Math.floor(i/a.imageWidth);e=n-1;const c=e ?(i-n*a.imageWidth)/e:0;u({columns:n,gap:c});}else{e=a.columns-1;const n=(i-e*a.gap)/a.columns;u({imageWidth:n});}w(s,h);},[a,o]),F=()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(E,50);},q=R(()=>{const{scrollTop:i,clientHeight:e,scrollHeight:s}=g.current;s-e-i>O||!a.loading&&w(a.page,h);},50);return J("scroll",q,{target:g.current,deps:[a.loading,a.page]}),z(()=>(E(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F);}),[d,o]),z(()=>{j&&w(a.page,h);},[j,a.loading,a.page,g.current]),l.jsxs("div",{className:"ono-waterfall-container",children:[l.jsx("div",{ref:g,className:B($,"ono-waterfall-content"),style:H,children:l.jsx("div",{ref:d,className:"ono-waterfall-wrapper",style:{height:Math.max(...f)-a.gap+"px"},children:l.jsx(I,{list:a.imageList,children:(i,e)=>l.jsx("div",{className:"ono-waterfall-item",style:{width:`${a.imageWidth}px`,translate:`${y[e].x}px ${y[e].y}px`},children:S(i,e)},i.id)})})}),a.loading&&(typeof m=="function" ? m():m&&typeof m=="boolean" ? l.jsx("div",{className:"ono-waterfall-loading",children:"loading..."}):m)]});};export{X as W};
@@ -0,0 +1 @@
1
+ import{g as o}from "./AutoSliderList-drdrxgEX.js";const a=o;export{a};
@@ -0,0 +1 @@
1
+ import{b as o}from "./AutoSliderList-drdrxgEX.js";const a=o;export{a};
@@ -0,0 +1 @@
1
+ import{c as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as b};
@@ -0,0 +1 @@
1
+ import{r as o}from "./AutoSliderList-drdrxgEX.js";const t=o;export{t as b};
@@ -0,0 +1 @@
1
+ import{l as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as b};
@@ -0,0 +1 @@
1
+ import{t as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as b};
@@ -0,0 +1 @@
1
+ import{v as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as c};
@@ -0,0 +1 @@
1
+ import{d as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as c};
@@ -0,0 +1 @@
1
+ const n=({currentIndex:t,itemHeight:e,total:a,showMaxNumber:o,element:l})=>{const m=Math.max(0,(a-o)*e),h=Math.floor(l.scrollTop/e);if(t>=h&&t<=h+o-1)return;let r=0;r=t<h ? t*e:(t-o+1)*e,l.scrollTo({top:Math.max(0,Math.min(m,r)),behavior:"smooth"});};export{n as c};
@@ -0,0 +1 @@
1
+ import{f as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as c};
@@ -0,0 +1 @@
1
+ import{h as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as c};
@@ -0,0 +1 @@
1
+ import{i as o}from "./AutoSliderList-drdrxgEX.js";const r=o;export{r as d};