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
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ono-react-element",
3
3
  "private": false,
4
- "version": "0.0.30",
4
+ "version": "0.1.1",
5
5
  "description": "Component library by React + Typescript",
6
6
  "type": "module",
7
7
  "main": "./dist/umd/index.umd.cjs",
@@ -42,14 +42,10 @@
42
42
  "author": "ono",
43
43
  "license": "MIT",
44
44
  "dependencies": {
45
+ "@onoxm/react-hooks": "workspace:*",
46
+ "@onoxm/utils": "workspace:*",
45
47
  "@popperjs/core": "^2.11.8"
46
48
  },
47
- "devDependencies": {
48
- "@rollup/plugin-terser": "^0.4.4",
49
- "terser": "^5.43.1",
50
- "vite-plugin-compression2": "^2.2.0",
51
- "vite-plugin-dts": "^4.5.4"
52
- },
53
49
  "peerDependencies": {
54
50
  "react": ">=18",
55
51
  "react-dom": ">=18"
@@ -1 +0,0 @@
1
- import{j as w}from "./dependencies-B7YNjh_z.js";import{u as F}from "./useGetElementSize.tsx-DML7z5Xp.js";import{c as H}from "./chainClassNames.ts-B9vmfsc1.js";import{p as g}from "./pureNumber.ts-LjeTI9RC.js";import{useState as a,useRef as T,useMemo as $,useEffect as v,cloneElement as M}from "react";var A=((r)=>(r.Horizontal="Horizontal",r.Vertical="Vertical",r))(A||{});const K=({list:r,style:C,disable:s,children:u,sliderBox:N,className:b,sliderStyle:z,duration:c=300,sliderClassName:E,currentIndex:p=0,direction:n=A.Horizontal,sliderTransitionTimingFunction:h="ease-in-out"})=>{const [S,j]=a(!1),[t,x]=a(0),[d,k]=a({t:0,l:0}),[f,D]=a({w:0,h:0}),l=T(null),y=T(null),I=$(()=>["width","height","translate"].map((e)=>`${e}${c/1e3}s ${h}`).join(","),[n,c,h]),L=$(()=>({width:f.w,height:f.h,transition:S ? I:"initial",translate:`${d.l}px ${d.t}px`}),[f,d]),{w:V,h:B}=F();return v(()=>{x(p);},[p]),v(()=>{(()=>{if(typeof t!="number"||!l.current||!y.current)return;const e=Array.from(l.current.children).slice(1);e.forEach((o)=>{o.style.position="relative",o.style.cursor=s ? "not-allowed":"pointer",o.style.zIndex="1";});const i=window.getComputedStyle(l.current),m={t:n==="Horizontal" ? g(i.paddingTop):e[t].offsetTop,l:n==="Horizontal" ? e[t].offsetLeft:g(i.paddingLeft)};k(m),D({w:e[t].offsetWidth,h:e[t].offsetHeight}),setTimeout(()=>j(!0),c);})();},[t,V,B,s]),w.jsxs("ul",{ref:l,className:H("ono-auto-slider-list-container",b,s ? "ono-auto-slider-list-is-disable":""),style:{flexDirection:n==="Horizontal" ? "row":"column",...C},children:[w.jsx("li",{ref:y,className:H("ono-auto-slider-list-slider",E),style:{...z,...L},children:N}),r.map((e,i)=>M(u({item:e,index:i,isActive:i===t}),{onClick:(m)=>{if(s)return;const o=u({item:e,index:i,isActive:i===t}).props.onClick;o&&o(m),x(i);}}))]});};export{K as A,A as D};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{c as N}from "./chainClassNames.ts-B9vmfsc1.js";import{t as w}from "./throttle.ts-D_EqcNzV.js";import{forwardRef as B,useState as L,useRef as h,useEffect as l}from "react";const D=B(({onClick:d,children:m,disabled:r,loading:n,plain:g,shape:u="default",htmlType:y="button",type:x="primary",throttleDuration:c,className:b,style:C,icon:a},s)=>{const [f,p]=L(!1),t=h(null),i=h(null),j=d ? w(d,c ? typeof c=="number" ? c:500:0):void 0;return l(()=>{(()=>{if(!i.current)return;const e=i.current;n ?(p(!0),e.classList.add("ono-loading-start")):(setTimeout(()=>{p(!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:N(`ono-btn-${x}`,n||f ? "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":"",b ?? ""),type:y,disabled:(typeof r=="function" ? r():r)||!!n,style:C,onClick:j,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||f ? e:a ? o.jsx("span",{children:a}):o.jsx(o.Fragment,{});})(),m]});});export{D as B};
@@ -1 +0,0 @@
1
- import{j as i}from "./dependencies-B7YNjh_z.js";import{c as H}from "./chainClassNames.ts-B9vmfsc1.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};
@@ -1 +0,0 @@
1
- import{j as b}from "./dependencies-B7YNjh_z.js";import{c as x}from "./chainClassNames.ts-B9vmfsc1.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};
@@ -1 +0,0 @@
1
- import{j as v}from "./dependencies-B7YNjh_z.js";import{u as k}from "./useEventListener.tsx-C8V9Qip6.js";import{useRef as w,useLayoutEffect as D}from "react";import{p as g}from "./PortalRenderer-izu9LyVc.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:l,position:n})=>{const t=w(null);return k("click",l),D(()=>{if(t.current){const{width:s,height:a}=t.current.getBoundingClientRect(),{innerWidth:p,innerHeight:M}=window;let c=n.x,u=n.y;c+s>p&&(c=Math.max(0,p-s)),u+a>M&&(u=Math.max(0,M-a)),t.current.style.left=`${c}px`,t.current.style.top=`${u}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)=>{l(),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};
@@ -1 +0,0 @@
1
- import{j as g}from "./dependencies-B7YNjh_z.js";import{c as b}from "./chainClassNames.ts-B9vmfsc1.js";import{useState as A,useRef as G,useMemo as N}from "react";const L=({isBox:s=!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]=A(!1),v=G(null);let f=0,p=[],m=[],o=[],S=[];const j=N(()=>D==="all" ? ["image","video","audio","document","directory"]:D,[D]),x=(e)=>{const r=[];o.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=[],o=[],S=[],F(!1);},u=(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((d)=>{z++,d.isDirectory&&u(d);}),m.push(...k),S.includes(e.name)||(o.push(e),S.push(e.name)),z>=100 ? i(O):m.forEach((d)=>u(d,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>=o.length&&o.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",s ? "ono-file-process-container-box":"",typeof E=="string" ? E:E(a)),style:{justifyContent:s&&!l ? "center":"initial",cursor:s&&T ? a ? "not-allowed":"pointer":"",...C instanceof Function ? C(a):C},onClick:()=>{if(s&&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)u(r.webkitGetAsEntry());else u(e.dataTransfer.items[0].webkitGetAsEntry());},children:s ? 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{L as F};
@@ -1 +0,0 @@
1
- import{j as n}from "./dependencies-B7YNjh_z.js";import{c as q}from "./chainClassNames.ts-B9vmfsc1.js";import{forwardRef as I,useState as f,useRef as T,useEffect as P}from "react";import{u as J}from "./useKeyPress.tsx-hgs6v_Jt.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:R,form:y,disabled:g,clearable:k,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=k&&!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:R,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:R,autoSize:y,showCount:g,border:k="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,k,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",R ? "ono-input-is-disabled":""),children:[n.jsx("div",{className:q("ono-textarea-wrapper",z ? k==="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:R,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 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{c as D}from "./chainClassNames.ts-B9vmfsc1.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-izu9LyVc.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:E,onClose:P=()=>{},destroy:R})=>{const [,q]=j(!1),[z,A]=j(0),[x,H]=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:P}),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:E}),[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&&H(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`),A(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};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{a as h}from "./adjustingColors.ts-CpC0GUUO.js";import{c as D}from "./chainClassNames.ts-B9vmfsc1.js";import{useState as E,useRef as y,useEffect as j}from "react";import{p as F}from "./PortalRenderer-izu9LyVc.js";import{B as w}from "./Button-P2AG5fc6.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:g,cancelDisabled:P,startPosition:t,onConfirm:d,onCancel:m,mask:x=!0,maskClosable:T=!1,width:f,btnClr:a,footer:u=({OkBtn:s,CancelBtn:i})=>o.jsxs(o.Fragment,{children:[o.jsx(i,{}),o.jsx(s,{})]}),modalBody:b,destroy:p})=>{const [s,i]=E(!1),l=y(null),n=y(null),z=[{label:"themeColor",value:a||""},{label:"themeHoverColor",value:a&&h(a,"light",10)||""},{label:"themeActiveColor",value:a&&h(a,"dark",20)||""},{label:"themeDisabledClr",value:a&&h(a,"light",20)||""}],r=()=>{if(t){if(!n.current)return;n.current.classList.remove("ono-modal-enter"),n.current.classList.add("ono-modal-leave"),setTimeout(()=>{p();},300);}else p();};return j(()=>(l.current&&(x ? l.current.showModal():l.current.show()),()=>{l.current&&l.current.close();}),[l.current,x]),j(()=>{(()=>{if(!n.current)return;const e=n.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)+"%")),a&&z.forEach((C)=>e.setProperty(`--${C.label}`,C.value));})();},[n]),o.jsx("dialog",{ref:l,className:"ono-modal",onClick:()=>T&&r(),children:b ? b(r):o.jsxs("div",{ref:n,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})]})]}),u&&o.jsx("div",{className:"ono-modal-box-footer",children:u({OkBtn:()=>o.jsx(w,{className:"ono-modal-box-footer-confirmBtn",loading:s,disabled:g,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(w,{className:"ono-modal-box-footer-cancelBtn",disabled:P||s,onClick:()=>{m==null||m(),r();},children:v ?? "Cancel"}),handleClose:()=>r()})})]})});},R=(c)=>F(M,c,"ono-modal");export{R as M};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{c as g}from "./chainClassNames.ts-B9vmfsc1.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:s="#532ce1",unCheckedColor:t="transparent",disabled:d=!1})=>{const [e,n]=E(""),b=y(null),i=y(null),c=y(null),j=[{value:f,name:"w"},{value:k,name:"gap"},{value:s,name:"checkedColor"},{value:t,name:"unCheckedColor"}];return P(()=>{(()=>{if(!c.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(c.current);e||n(u.borderColor),c.current.style.borderColor=l ? s:e;})();},[i,c,l,e]),o.jsxs("div",{ref:i,className:g("ono-radio-box",p),style:m,children:[o.jsx("div",{ref:c,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:s="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:s,onChange:()=>l(e),checked:t+""==e+"",disabled:typeof n=="function" ? n(t):n||!1,children:d},d))});export{R,F as a};
@@ -1 +0,0 @@
1
- import{j as g}from "./dependencies-B7YNjh_z.js";import{c as y}from "./chainClassNames.ts-B9vmfsc1.js";import{forwardRef as k,useState as C,useRef as x,useEffect as h}from "react";const N=({children:s,disabled:i,className:m,style:n,onClick:c})=>g.jsx("li",{className:y("ono-scrollable-tab",m),style:n,onClick:(o)=>!i&&(c==null ? void 0:c(o)),children:s}),L=k(({activeIndex:s,children:i,className:m,style:n,position:c="center",onChange:o},a)=>{const [l,p]=C(0),r=x(null);return h(()=>{const e=r.current;if(!e||l<0)return;const u=e.offsetWidth,t=Array.from(e.children);if(l>=t.length)return;const d=parseInt(((n==null ? void 0:n.gap)||getComputedStyle(e).gap||"0").toString(),10)||0;let f=0;switch(t.slice(0,l+1).forEach((b)=>f+=b.offsetWidth+d),c){case "start":e.scrollLeft=f-t[l].offsetWidth-d;break;case "end":e.scrollLeft=f-u;break;default:f-=t[l].offsetWidth/2+(s!==t.length-1 ? d:0),e.scrollLeft=f-u/2;}},[r,i,s,c]),h(()=>{p(s||0);},[s]),h(()=>{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((u,t)=>{if(u.contains(e.target))return p(t),o==null||o(t),!0;});},children:i(N)});});export{L as S};
@@ -1 +0,0 @@
1
- import{j as n}from "./dependencies-B7YNjh_z.js";import{c as b}from "./chainClassNames.ts-B9vmfsc1.js";import{useState as r,useEffect as M}from "react";import{T as F}from "./Tooltip-DvUB7xZH.js";import{O as T}from "./Input-Hy30rZ_v.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};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{c as p}from "./chainClassNames.ts-B9vmfsc1.js";import{useRef as v,useEffect as y}from "react";const j=({w:c,h:m,src:n,clr:l,className:i,onClick:u})=>{const r=v(null),f=[{value:c,name:"w"},{value:m,name:"h"},{value:l,name:"clr"}];return y(()=>{r.current&&f.forEach((s)=>{var e,a,t;s.value&&(e=s.value,a=s.name,t=r.current,typeof e=="string" ? t.style.setProperty(`--${a}`,e):t.style.setProperty(`--${a}`,`${e}px`));});},[r,l]),o.jsx("div",{ref:r,className:p("ono-svg-img",i),onClick:u,children:o.jsx("img",{src:n,alt:""})});};export{j as S};
@@ -1 +0,0 @@
1
- import{j as c}from "./dependencies-B7YNjh_z.js";import{c as y}from "./chainClassNames.ts-B9vmfsc1.js";import{p as j}from "./pureNumber.ts-LjeTI9RC.js";import{useRef as n,useEffect as k}from "react";const R=({id:g,text:e,style:h,color:t,checked:u,onChange:d,name:N="",className:m,disabled:v=!1})=>{const o=n(null),i=n(null),s=n(null),l=n(null),p=n(null),x=n(null),b=[{value:typeof t=="string" ? t:t==null ? void 0:t.active,name:"checkedClr"},{value:typeof t=="string"||t==null ? void 0:t.inactive,name:"uncheckedClr"}];return k(()=>{(()=>{if(!i.current||!o.current)return;let r=60,w=32;if(m||h){const a=getComputedStyle(i.current);r=j(a.width),w=j(a.height);}[...b,{value:r,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");});})();},[i,o,l,m,h,t,e,p,x]),k(()=>{s.current&&(s.current.checked=u);},[s,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:s,type:"checkbox",checked:u,onChange:(r)=>{v||(d==null||d(r.currentTarget.checked,r));}}),c.jsx("div",{ref:i,className:y("ono-switch-box",m),style:h,onClick:()=>{var r;return(r=s.current)==null ? void 0:r.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{R as S};
@@ -1 +0,0 @@
1
- import{j as u}from "./dependencies-B7YNjh_z.js";import{c as v}from "./chainClassNames.ts-B9vmfsc1.js";import{g as b}from "./getElementCenterPosition.ts-CpWYej6j.js";import{useState as P,useRef as w,useEffect as $,useCallback as j}from "react";const M=({children:s,animation:e,className:d,duration:i=300,style:m,maskColor:p="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:C}=b(e.element),x=(a/window.innerWidth*100).toFixed(2)+"%",h=(C/window.innerHeight*100).toFixed(2)+"%";n.setProperty("--left",x),n.setProperty("--top",h);break;}case "fade":{const a=e.direction==="left-center" ? "--left":"--top";n.setProperty(a,e.startPosition);break;}}})();},[o,e]);const g=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:p},onClick:()=>y&&l(),onContextMenu:(t)=>f&&t.preventDefault(),children:u.jsx("div",{ref:o,className:v("ono-dialog",d,g()),style:m,onClick:(t)=>t.stopPropagation(),children:typeof s=="function" ? s(l):s})});};export{M as T};
@@ -1 +0,0 @@
1
- import{j as r}from "./dependencies-B7YNjh_z.js";import{c as u}from "./chainClassNames.ts-B9vmfsc1.js";import{useEffect as f,useRef as _}from "react";import{i as v}from "./InjunctiveBox-vLlRm8LB.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=(e,i)=>w[e][i],j=(e)=>{switch(e){case "success":return r.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",width:"24px",height:"24px",fill:y(e,"light"),"aria-hidden":"true",children:r.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 r.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",width:"24px",height:"24px",fill:y(e,"light"),"aria-hidden":"true",children:r.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 r.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"exclamation-circle",width:"24px",height:"24px",fill:y(e,"light"),"aria-hidden":"true",children:r.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:e,speed:i=200,message:c,duration:m=2e3,className:d,style:h,isUseEnterAnimation:g=!0,promiseOptions:s,toastList:p,handleDestroy:o})=>{const a=_(null);return f(()=>{a.current&&(a.current.style.setProperty("--speed",i/1e3+"s"),g&&a.current.classList.add(L),e!=="promise"&&setTimeout(()=>{var n,x;(n=a.current)==null||n.classList.remove(L),(x=a.current)==null||x.classList.add("_leave_974ly_36");},m-i));},[a]),f(()=>{e==="promise" ?(typeof c=="function" ? c():c).then((n)=>setTimeout(()=>{o(),l({type:"success",message:typeof(s==null ? void 0:s.success)=="function" ? s.success(n):(s==null ? void 0:s.success)||"",isUseEnterAnimation:!1,toastList:p});},i)).catch((n)=>setTimeout(()=>{o(),l({type:"error",message:typeof(s==null ? void 0:s.error)=="function" ? s.error(n):(s==null ? void 0:s.error)||"",isUseEnterAnimation:!1,toastList:p});},i)):setTimeout(()=>o(()=>p=[]),m);},[e]),r.jsxs("div",{ref:a,className:u(e==="promise" ? "_promise_974ly_15":"_base_974ly_15",d),style:h,onClick:()=>{},children:[r.jsx("div",{className:"_icon_974ly_40",children:j(e)}),r.jsx("p",{children:typeof c=="string" ? c:s&&s.loading})]});},l=({type:e,speed:i=200,message:c,duration:m=2e3,zIndex:d=9999,className:h,style:g,isUseEnterAnimation:s=!0,promiseOptions:p,toastList:o})=>v({className:"_container_974ly_1",isSingle:!0,style:{zIndex:d},content:(a)=>(f(()=>{},[o]),r.jsx(z,{className:h,style:g,type:e,message:c,speed:i,duration:m,isUseEnterAnimation:s,promiseOptions:p,handleDestroy:a,toastList:o}))}),U={success:(e)=>{t.push({type:"success",message:e}),l(typeof e=="string" ?{type:"success",message:e,toastList:t}:{type:"success",...e,toastList:t});},error:(e)=>{t.push({type:"error",message:e}),l(typeof e=="string" ?{type:"error",message:e,toastList:t}:{type:"error",...e,toastList:t});},warning:(e)=>{t.push({type:"warning",message:e}),l(typeof e=="string" ?{type:"warning",message:e,toastList:t}:{type:"warning",...e,toastList:t});},promise:(e,i)=>{t.push({type:"promise",message:e}),l({type:"promise",message:e,promiseOptions:i,toastList:t});}};export{U as t};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{u as b}from "./useClickOutSide.tsx-C6XuLZzd.js";import{c as k}from "./chainClassNames.ts-B9vmfsc1.js";import{createPopper as W}from "@popperjs/core";import{useState as A,useRef as d,useEffect as h}from "react";let u=null,p=null;const E=({children:c,content:a,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]=A(!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=W(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,u&&u.remove(),u=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:a instanceof Function ? a():a}),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};
@@ -1 +0,0 @@
1
- import{j as v}from "./dependencies-B7YNjh_z.js";import{u as k}from "./useEventListener.tsx-C8V9Qip6.js";import{t as B}from "./throttle.ts-D_EqcNzV.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(()=>v.jsx(F,{list:d.slice(s.startIndex,j),children:({id:t,data:r})=>v.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"),g=l[c],C=g.size-(n==="vertical" ? e.height:e.width);C&&(g.size=n==="vertical" ? e.height:e.width,g.end=g.end-C,g.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]),v.jsx("div",{ref:u,className:w,style:{width:"100%",height:"100%",overflow:"auto",...I},children:v.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};
@@ -1 +0,0 @@
1
- import{j as l}from "./dependencies-B7YNjh_z.js";import{u as J}from "./useEventListener.tsx-C8V9Qip6.js";import{c as R}from "./chainClassNames.ts-B9vmfsc1.js";import{t as B}from "./throttle.ts-D_EqcNzV.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 Y=({options:t,pageSize:h,children:$,request:A,reloadData:o,className:S,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 r=o&&a.reloadData!==o;if(a.isFinish)return;u({loading:!0});const n=await A(i,e);k(n),u({isFinish:!n.length,imageList:r ? [...n]:[...a.imageList,...n],page:i+1,loading:!1});},k=(i)=>p((e)=>{const r=o&&a.reloadData!==o,n=r ? []:[...y],c=r ? Array(e.columns).fill(0):[...JSON.stringify(f)!=="[]" ? f:Array(e.columns).fill(0)];return i.forEach((M)=>{const s=((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:s.index%e.columns!==0 ? s.index*e.imageWidth+e.gap*s.index:s.index*e.imageWidth,y:s.height}),c[s.index]+=C+e.gap,D(c);}),N(n),e;}),E=G(()=>{if(!d.current)return;const i=d.current.clientWidth;let e=0,r=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([]),r=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(r,h);},[a,o]),F=()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(E,50);},q=B(()=>{const{scrollTop:i,clientHeight:e,scrollHeight:r}=g.current;r-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:R(S,"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:$(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{Y as W};
@@ -1 +0,0 @@
1
- import{g as p}from "./getColorType.ts-B-_g2UQs.js";const g=(m,r,t)=>{const o=p(m);if(o==="hex"){const h=m.replace("#",""),a=parseInt(h.slice(0,2),16),n=parseInt(h.slice(2,4),16),i=parseInt(h.slice(4,6),16);if(r==="lighten"){const e=Math.min(255,Math.max(0,a+(255-a)*t/100)),M=Math.min(255,Math.max(0,n+(255-n)*t/100)),s=Math.min(255,Math.max(0,i+(255-i)*t/100));return `#${e.toString(16).padStart(2,"0")}${M.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;}if(r==="darken"){const e=Math.min(255,Math.max(0,a-a*t/100)),M=Math.min(255,Math.max(0,n-n*t/100)),s=Math.min(255,Math.max(0,i-i*t/100));return `#${e.toString(16).padStart(2,"0")}${M.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;}}else if(o==="rgb"){const h=m.match(/\d+/g),a=parseInt(h[0]),n=parseInt(h[1]),i=parseInt(h[2]);if(r==="lighten")return `rgb(${Math.min(255,Math.max(0,a+(255-a)*t/100))},${Math.min(255,Math.max(0,n+(255-n)*t/100))},${Math.min(255,Math.max(0,i+(255-i)*t/100))})`;if(r==="darken")return `rgb(${Math.min(255,Math.max(0,a-a*t/100))},${Math.min(255,Math.max(0,n-n*t/100))},${Math.min(255,Math.max(0,i-i*t/100))})`;}return m;};export{g as a};
@@ -1 +0,0 @@
1
- import{g as m}from "./getAllTheNumbers.ts-DaNxVd8a.js";import{h as t}from "./hex2hsl.ts-BLU_9tQG.js";import{h as o}from "./hsl2hex.ts-D9xS0UDg.js";import{r as u}from "./rgb2hsl.ts-BPiSggZg.js";const b=(e,i,s)=>{let r=[];if(e.includes("#"))r=m(t(e));else if(e.includes("rgb"))r=m(u(e));else{if(!e.includes("hsl"))throw new Error("颜色格式错误");r=m(e);}return o(`${r[0]},${r[1]}%,${i==="light" ? Number(r[2])+s>100 ? 100:Number(r[2])+s:Number(r[2])-s<0 ? 0:Number(r[2])-s}%`);};export{b as a};
@@ -1 +0,0 @@
1
- const l=(s)=>{const a=window.fetch,t={status:"pending",value:null},c=(...n)=>{if(t.status==="fulfilled")return t.value;throw t.status==="rejected" ? t.value:a(...n).then((e)=>e.json()).then((e)=>{t.status="fulfilled",t.value=e;}).catch((e)=>{t.status="rejected",t.value=e;});};window.fetch=c;try{s();}catch(n){n instanceof Promise&&n.finally(()=>{window.fetch=c,s(),window.fetch=a;});}window.fetch=a;},o={clearAsyncContagion:l};export{o as a,l as c};
@@ -1 +0,0 @@
1
- const c=(r)=>{const e=r.split(","),a=e[0].match(/:(.*?);/)[1],n=atob(e[1]);let t=n.length;const o=new Uint8Array(t);for(;t--;)o[t]=n.charCodeAt(t);return new Blob([o],{type:a});};export{c as b};
@@ -1 +0,0 @@
1
- const r=(i,l)=>{const n=i.split(","),t=n[0].match(/:(.*?);/u)[1],o=atob(n[1]);let e=o.length,p=t.split("/")[1]==="jpeg" ? ".jpg":"."+t.split("/")[1];const s=new Uint8Array(e);for(;e--;)s[e]=o.charCodeAt(e);const a=new Blob([s],{type:t});return new File([a],l+p,{type:t,lastModified:(new Date()).getTime()});};export{r as b};
@@ -1 +0,0 @@
1
- const l=(t)=>new Promise((a)=>{const e=new FileReader();e.readAsDataURL(t),e.onload=(o)=>{var s;const n=(s=o.target)==null ? void 0:s.result,r=n.split(",")[1];a(r);};});export{l as b};
@@ -1 +0,0 @@
1
- const t=(e,p="abc.jpg")=>new File([e],p,{type:e.type});export{t as b};
@@ -1 +0,0 @@
1
- function o(){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 r={getBrowserInfo:o};export{r as b,o as g};
@@ -1 +0,0 @@
1
- const n=(o,e)=>{const r={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!r[e])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(o/r[e]);};export{n as c};
@@ -1 +0,0 @@
1
- const n=(t)=>t.toString().length>13 ? new Date(Number(t.toString().substring(0,13))):t.toString().length===13 ? new Date(t):t.toString().length<13&&t.toString().length>10 ? new Date(Number((t.toString()+"000").substring(0,13))):t.toString().length===10 ? new Date(1e3*t):new Date(Number((t.toString()+"000000000000").substring(0,13)));export{n as c};
@@ -1 +0,0 @@
1
- const b=(r,u)=>{let t;return u==="en" ? t=r==="01"||r==="21"||r==="31" ? Number(r)+"st":r==="02"||r==="22" ? Number(r)+"nd":r==="03"||r==="23" ? Number(r)+"rd":Number(r)+"th":r==="01" ? t="一日":r==="02" ? t="二日":r==="03" ? t="三日":r==="04" ? t="四日":r==="05" ? t="五日":r==="06" ? t="六日":r==="07" ? t="七日":r==="08" ? t="八日":r==="09" ? t="九日":r==="10" ? t="十日":r==="11" ? t="十一日":r==="12" ? t="十二日":r==="13" ? t="十三日":r==="14" ? t="十四日":r==="15" ? t="十五日":r==="16" ? t="十六日":r==="17" ? t="十七日":r==="18" ? t="十八日":r==="19" ? t="十九日":r==="20" ? t="二十日":r==="21" ? t="二十一日":r==="22" ? t="二十二日":r==="23" ? t="二十三日":r==="24" ? t="二十四日":r==="25" ? t="二十五日":r==="26" ? t="二十六日":r==="27" ? t="二十七日":r==="28" ? t="二十八日":r==="29" ? t="二十九日":r==="30" ? t="三十日":r==="31"&&(t="三十一日"),t ?? r;};export{b as d};
@@ -1 +0,0 @@
1
- const t=(e)=>Math.ceil((e.getTime()-new Date(e.getFullYear(),0,1).getTime())/864e5);export{t as d};