ono-react-element 0.0.26 → 0.0.28

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 (105) hide show
  1. package/dist/es/Button-Ba6Hyv3b.js +1 -0
  2. package/dist/es/Carousel-auG6ltgk.js +1 -0
  3. package/dist/es/Checkbox-CBBjbiRa.js +1 -0
  4. package/dist/es/ContextMenu-DAy5Czn1.js +1 -0
  5. package/dist/es/FileDropZone-C-nGl7e7.js +1 -0
  6. package/dist/es/InjunctiveBox-BBa5LG49.js +1 -0
  7. package/dist/es/Input-DHoxESrC.js +1 -0
  8. package/dist/es/Message-Dum59ayv.js +1 -0
  9. package/dist/es/Modal-CJVYTPGs.js +1 -0
  10. package/dist/es/Radio-DP0UCRO_.js +1 -0
  11. package/dist/es/ScrollableTabs-2OZ2V-Dt.js +1 -0
  12. package/dist/es/Select-fbqZjk6I.js +1 -0
  13. package/dist/es/SvgImg-N7fVyvgv.js +1 -0
  14. package/dist/es/Switch-BBNDCObV.js +1 -0
  15. package/dist/es/TemplateDialog-DzNHI_F8.js +1 -0
  16. package/dist/es/Toast-aOS_XH1g.js +1 -0
  17. package/dist/es/Tooltip-D7d2_43u.js +1 -0
  18. package/dist/es/VirtualList-DPwQMgnX.js +1 -0
  19. package/dist/es/Waterfall-BcKxRr5b.js +1 -0
  20. package/dist/es/adjustingColors.ts-B4vYvLS1.js +1 -0
  21. package/dist/es/chainClassNames.ts-B9vmfsc1.js +1 -0
  22. package/dist/es/convertSecondToOtherTime.ts-BJegkJhl.js +1 -0
  23. package/dist/es/convertTimestamp.ts-DOHA1Ix6.js +1 -0
  24. package/dist/es/dateFormat.ts-DXskLY1N.js +1 -0
  25. package/dist/es/distinguishPlatform.ts-D2huTxC3.js +1 -0
  26. package/dist/es/distinguishPlatformDelay.ts-BTo3t05U.js +1 -0
  27. package/dist/es/formatTime.ts-DNtDsT9L.js +1 -0
  28. package/dist/es/hex2hsl.ts-C-JnVxv_.js +1 -0
  29. package/dist/es/index.js +1 -1
  30. package/dist/es/localFormat.ts-vxgGt_Za.js +1 -0
  31. package/dist/es/monthFormat.ts-B_s3ZbNy.js +1 -0
  32. package/dist/es/padZero.ts-BTMKlRWN.js +1 -0
  33. package/dist/es/printStr.ts-Nd8JNyzN.js +1 -0
  34. package/dist/es/second2Day.ts-DHntMxxp.js +1 -0
  35. package/dist/es/urlToFile.ts-BAbioPDr.js +1 -0
  36. package/dist/es/yearFormat.ts-DxbWP43R.js +1 -0
  37. package/dist/index.css +1 -1
  38. package/dist/style/Carousel.css +1 -0
  39. package/dist/style/index.css +1 -1
  40. package/dist/types/components/Carousel/Carousel.d.ts +2 -0
  41. package/dist/types/components/Carousel/index.d.ts +1 -0
  42. package/dist/types/components/Carousel/types.d.ts +17 -0
  43. package/dist/types/components/index.d.ts +1 -0
  44. package/dist/types/hooks/useClickOutSide.d.ts +2 -2
  45. package/dist/types/hooks/useCountdown.d.ts +1 -2
  46. package/dist/types/hooks/useEventListener.d.ts +2 -2
  47. package/dist/types/hooks/useGetElementSize.d.ts +1 -2
  48. package/dist/types/hooks/useKeyPress.d.ts +2 -2
  49. package/dist/types/hooks/useMouseClick.d.ts +1 -2
  50. package/dist/types/hooks/useQuery.d.ts +1 -2
  51. package/dist/types/hooks/useTheme.d.ts +2 -2
  52. package/dist/types/hooks/useThemePro.d.ts +2 -2
  53. package/dist/types/index.d.ts +24 -18
  54. package/dist/types/utils/color/getColorType.d.ts +1 -1
  55. package/dist/types/utils/common/chainClassNames.d.ts +1 -0
  56. package/dist/types/utils/common/padZero.d.ts +1 -0
  57. package/dist/types/utils/platform/distinguishPlatform.d.ts +6 -0
  58. package/dist/types/utils/platform/distinguishPlatformDelay.d.ts +4 -0
  59. package/dist/types/utils/time/convertSecondToOtherTime.d.ts +1 -0
  60. package/dist/types/utils/time/convertTimestamp.d.ts +1 -0
  61. package/dist/types/utils/time/dateFormat.d.ts +2 -0
  62. package/dist/types/utils/time/formatTime.d.ts +1 -0
  63. package/dist/types/utils/time/localFormat.d.ts +2 -0
  64. package/dist/types/utils/time/monthFormat.d.ts +2 -0
  65. package/dist/types/utils/time/second2Day.d.ts +1 -0
  66. package/dist/types/utils/time/yearFormat.d.ts +2 -0
  67. package/dist/umd/index.css +1 -1
  68. package/dist/umd/index.css.br +0 -0
  69. package/dist/umd/index.css.gz +0 -0
  70. package/dist/umd/index.umd.cjs +1 -1
  71. package/dist/umd/index.umd.cjs.br +0 -0
  72. package/dist/umd/index.umd.cjs.gz +0 -0
  73. package/package.json +1 -1
  74. package/dist/es/AutoSliderList-CedBSQM5.js +0 -1
  75. package/dist/es/Button-CWrnOZH2.js +0 -1
  76. package/dist/es/Checkbox-jOOMkqbP.js +0 -1
  77. package/dist/es/ContextMenu-BW91eI6D.js +0 -1
  78. package/dist/es/FileDropZone-Czdv3XF4.js +0 -1
  79. package/dist/es/InjunctiveBox-vLlRm8LB.js +0 -1
  80. package/dist/es/Input-UCScuMXP.js +0 -1
  81. package/dist/es/Message-C-4NUqae.js +0 -1
  82. package/dist/es/Modal-C58i1Qbd.js +0 -1
  83. package/dist/es/Radio-m9BOKzf5.js +0 -1
  84. package/dist/es/ScrollableTabs-DgcrSjsb.js +0 -1
  85. package/dist/es/Select-D5zgLQ8n.js +0 -1
  86. package/dist/es/SvgImg-HkuwJQ4_.js +0 -1
  87. package/dist/es/Switch-BEPzl8aC.js +0 -1
  88. package/dist/es/TemplateDialog-VNTyP_2u.js +0 -1
  89. package/dist/es/Toast-CERLQ4i7.js +0 -1
  90. package/dist/es/Tooltip-DDUtx7BP.js +0 -1
  91. package/dist/es/VirtualList-CoQKjvuB.js +0 -1
  92. package/dist/es/Waterfall-DNvOPDGJ.js +0 -1
  93. package/dist/es/adjustingColors.ts-CpC0GUUO.js +0 -1
  94. package/dist/es/formatTimeUtils.ts-ng_eAUID.js +0 -1
  95. package/dist/es/hex2hsl.ts-BLU_9tQG.js +0 -1
  96. package/dist/es/platformUtils.ts-BkXvuNq4.js +0 -1
  97. package/dist/es/printStr.ts-DMJqar33.js +0 -1
  98. package/dist/es/urlToFile.ts-Dp1k4tJm.js +0 -1
  99. package/dist/style/AutoSliderList.css +0 -1
  100. package/dist/types/utils/formatTimeUtils.d.ts +0 -6
  101. package/dist/types/utils/platformUtils.d.ts +0 -13
  102. /package/dist/types/utils/{common → color}/grayColor.d.ts +0 -0
  103. /package/dist/types/utils/{common → file}/formatFileSize.d.ts +0 -0
  104. /package/dist/types/utils/{common → time}/dayOfYear.d.ts +0 -0
  105. /package/dist/types/utils/{common → time}/formatSecond.d.ts +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.26",
4
+ "version": "0.0.28",
5
5
  "description": "Component library by React + Typescript",
6
6
  "type": "module",
7
7
  "main": "./dist/umd/index.umd.cjs",
@@ -1 +0,0 @@
1
- import{j as y}from "./dependencies-B7YNjh_z.js";import{u as V}from "./useGetElementSize.tsx-DML7z5Xp.js";import{p as g}from "./pureNumber.ts-LjeTI9RC.js";import{useState as a,useRef as H,useMemo as z,useEffect as T,cloneElement as F}from "react";var $=((r)=>(r.Horizontal="Horizontal",r.Vertical="Vertical",r))($||{});const G=({list:r,style:v,disable:s,children:m,sliderBox:A,className:C,sliderStyle:N,duration:c=300,sliderClassName:b,currentIndex:p=0,direction:n=$.Horizontal,sliderTransitionTimingFunction:h="ease-in-out"})=>{const [B,E]=a(!1),[t,w]=a(0),[d,S]=a({t:0,l:0}),[f,j]=a({w:0,h:0}),l=H(null),x=H(null),k=z(()=>["width","height","translate"].map((e)=>`${e}${c/1e3}s ${h}`).join(","),[n,c,h]),D=z(()=>({width:f.w,height:f.h,transition:B ? k:"initial",translate:`${d.l}px ${d.t}px`}),[f,d]),{w:I,h:L}=V();return T(()=>{w(p);},[p]),T(()=>{(()=>{if(typeof t!="number"||!l.current||!x.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),u={t:n==="Horizontal" ? g(i.paddingTop):e[t].offsetTop,l:n==="Horizontal" ? e[t].offsetLeft:g(i.paddingLeft)};S(u),j({w:e[t].offsetWidth,h:e[t].offsetHeight}),setTimeout(()=>E(!0),c);})();},[t,I,L,s]),y.jsxs("ul",{ref:l,className:["ono-auto-slider-list-container",C,s ? "ono-auto-slider-list-is-disable":""].filter(Boolean).join(" "),style:{flexDirection:n==="Horizontal" ? "row":"column",...v},children:[y.jsx("li",{ref:x,className:["ono-auto-slider-list-slider",b].filter(Boolean).join(" "),style:{...N,...D},children:A}),r.map((e,i)=>F(m({item:e,index:i,isActive:i===t}),{onClick:(u)=>{if(s)return;const o=m({item:e,index:i,isActive:i===t}).props.onClick;o&&o(u),w(i);}}))]});};export{G as A,$ as D};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{t as B}from "./throttle.ts-D_EqcNzV.js";import{forwardRef as w,useState as L,useRef as m,useEffect as l}from "react";const T=w(({onClick:d,children:h,disabled:r,loading:n,plain:y,shape:u="default",htmlType:g="button",type:j="primary",throttleDuration:a,className:x,style:b,icon:c},s)=>{const [f,p]=L(!1),t=m(null),i=m(null),C=d ? B(d,a ? typeof a=="number" ? a: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:[`ono-btn-${j}`,n||f ? "ono-is-loading":"",n||c ? "ono-is-icon":"",r ? "ono-btn-is-disabled":"",u==="round" ? "ono-is-round":u==="circle" ? "ono-is-circle":"",y ? "ono-is-plain":"",x ?? ""].filter(Boolean).join(" "),type:g,disabled:(typeof r=="function" ? r():r)||!!n,style:b,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||f ? e:c ? o.jsx("span",{children:c}):o.jsx(o.Fragment,{});})(),h]});});export{T as B};
@@ -1 +0,0 @@
1
- import{j as b}from "./dependencies-B7YNjh_z.js";import{useState as x,useRef as g,useEffect as v}from "react";const S=({id:d,style:o,checked:c,onChange:h,className:a,indeterminate:t=!1,checkedColor:l="#0077cc",indeterminateStyle:y="line",indeterminateColor:p="#0077cc"})=>{const [i,f]=x(""),e=g(null),C=[{value:l,name:"checkedColor"},{value:p,name:"indeterminateColor"}];return v(()=>{(()=>{if(!e.current)return;const r=getComputedStyle(e.current);i||f(r.borderColor),e.current.style.height=r.width,[{value:r.width,name:"w"},{value:c||t ? l:i,name:"border-color"},...C].forEach(({value:s,name:k})=>{s&&((n,u,m)=>{typeof n=="string" ? m.style.setProperty(`--${u}`,n):m.style.setProperty(`--${u}`,`${n}px`);})(s,k,e.current);});})(),e.current&&(e.current.indeterminate=t);},[e,a,o,t]),b.jsx("input",{id:d,type:"checkbox",ref:e,checked:c,onChange:h,className:[a,y==="line" ? "ono-checkbox-line":"ono-checkbox-border"].filter(Boolean).join(" "),style:o});};export{S as C};
@@ -1 +0,0 @@
1
- import{j as v}from "./dependencies-B7YNjh_z.js";import{useRef as k,useLayoutEffect as w}from "react";import{u as D}from "./useEventListener.tsx-C8V9Qip6.js";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=k(null);return D("click",l),w(()=>{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{useState as b,useRef as A,useMemo as m}from "react";const N=({isBox:o=!1,multiple:y=!1,children:s,allowFileType:D="image",style:C={},className:E="",isCanClick:v=!0,getFileListData:w,onFileTypeError:f,readingAnimationOptions:n})=>{const [a,F]=b(!1),S=A(null);let c=0,p=[],u=[],l=[],T=[];const j=m(()=>D==="all" ? ["image","video","audio","document","directory"]:D,[D]),x=(e)=>{const r=[];l.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=[],c=0,u=[],l=[],T=[],F(!1);},h=(e,r="")=>{if(e.isDirectory){if(!j.includes("directory"))return f&&f();const t=e.createReader(),i=(O)=>O.readEntries((k)=>{let z=0;k.forEach((d)=>{z++,d.isDirectory&&h(d);}),u.push(...k),T.includes(e.name)||(l.push(e),T.push(e.name)),z>=100 ? i(O):u.forEach((d)=>h(d,e.name));});i(t);}else e.file((t)=>{if(!j.includes(t.type.split("/")[0])&&t.name!==".DS_Store")return f&&f();p.push({name:t.name,fileType:t.type,file:t,isFile:!0,fileSize:t.size,children:[],parent:r});const i=c>=l.length&&l.length===0 ? c:u.length;p.length===i&&x(p);});};return g.jsxs(g.Fragment,{children:[g.jsx("input",{ref:S,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:["ono-file-process-container",o ? "ono-file-process-container-box":"",typeof E=="string" ? E:E(a)].filter(Boolean).join(" "),style:{justifyContent:o&&!s ? "center":"initial",cursor:o&&v ? a ? "not-allowed":"pointer":"",...C instanceof Function ? C(a):C},onClick:()=>{if(o&&v){if(a&&(n!=null&&n.readingCannotOperattion))return;S.current.click();}},onDragEnter:(e)=>e.preventDefault(),onDragOver:(e)=>e.preventDefault(),onDrop:(e)=>{if(e.preventDefault(),!a||!(n!=null&&n.readingCannotOperattion))if(c=y ? e.dataTransfer.items.length:1,F(!0),y)for(const r of e.dataTransfer.items)h(r.webkitGetAsEntry());else h(e.dataTransfer.items[0].webkitGetAsEntry());},children:o ? s ? a&&(n!=null&&n.readingCannotOperattion)?(n==null ? void 0:n.animations)||"正在读取文件...":s:a&&(n!=null&&n.readingCannotOperattion)?(n==null ? void 0:n.animations)||"正在读取文件...":"请将要上传的文件拖拽到此处":s})]});};export{N as F};
@@ -1 +0,0 @@
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 +0,0 @@
1
- import{j as n}from "./dependencies-B7YNjh_z.js";import{forwardRef as H,useState as f,useRef as I,useEffect as K}from "react";import{u as G}from "./useKeyPress.tsx-hgs6v_Jt.js";const J=()=>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"})}),X=({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"})]})}),oe=H(({id:x,name:Q,max:R,min:w,maxLength:z,minLength:U,type:k="text",className:D,defaultValue:F,placeholder:P,readonly:Y,autocomplete:V="off",autofocus:M,form:y,disabled:v,clearable:E,showPassword:q,prepend:p,append:i,prefix:g,suffix:b,showCount:B,border:W="1px solid #5644b8",boxShadow:m="0 0 0 2px #7969d11a",value:h="",onChange:d,onFocus:N,onBlur:C,onClear:u,onKeyUp:$,onKeyDown:L},O)=>{const [t,j]=f(h),[A,o]=f(!1),[e,s]=f(!1),l=I(null),c=E&&!v&&t,a=q&&!v;return K(()=>{l.current&&(l.current.style.setProperty("--ono-input-border",W),l.current.style.setProperty("--ono-input-box-shadow",m));},[l]),K(()=>{j(h);},[h]),n.jsxs("div",{className:["ono-input","ono-input-border",v ? "ono-input-is-disabled":""].filter(Boolean).join(" "),children:[p&&n.jsx("div",{className:"ono-prepend",children:p}),n.jsxs("div",{ref:l,className:["ono-input-wrapper",A ? "ono-input-is-focus":"",D].filter(Boolean).join(" "),onMouseDown:(r)=>{r.target.tagName!=="INPUT"&&r.preventDefault();},children:[g&&n.jsx("span",{className:"ono-prefix",children:g}),n.jsx("input",{id:x,ref:O,max:R,min:w,name:Q,maxLength:z,minLength:U,defaultValue:F,className:"ono-input-inner",type:q ? e ? "text":"password":k,placeholder:P,readOnly:Y,autoComplete:V,autoFocus:M,form:y,disabled:v,onFocus:(r)=>{N==null||N(r),o(!0);},onBlur:(r)=>{C==null||C(r),o(!1);},value:t,onChange:(r)=>{d==null||d(r),j(r.target.value);},onKeyUp:$,onKeyDown:L}),(b||c||a||B)&&n.jsxs("span",{className:"ono-suffix",children:[b,c&&n.jsx("button",{className:"ono-clear-icon",onClick:()=>{u==null||u(),j("");},children:n.jsx(J,{})}),a&&n.jsx("button",{className:"ono-eye-icon",onClick:()=>s(!e),children:n.jsx(X,{open:e})}),B&&z&&n.jsxs("p",{className:"ono-count",children:[t.length,"/",z]})]})]}),i&&n.jsx("div",{className:"ono-append",children:i})]});}),ne=H(({id:x,name:Q,rows:R,maxLength:w,minLength:z,className:U,placeholder:k,readonly:D,resize:F=!0,autocomplete:P="off",autofocus:Y,form:V,disabled:M,autoSize:y,showCount:v,border:E="1px solid #5644b8",boxShadow:q="0 0 0 2px #7969d11a",value:p="",onChange:i,onFocus:g,onBlur:b,onKeyUp:B,onKeyDown:W},m)=>{const [h,d]=f(p),[N,C]=f(!1),[u,$]=f([p]),[L,O]=f(0),t=I(null),j=(o)=>{const e=u.slice(0,L+1);e.push(o),$(e),O(e.length-1);};return [{key:"CommandOrControl+z",handler:(o)=>{document.activeElement===t.current&&(o.preventDefault(),(()=>{if(L>0&&t.current){const e=L-1,s=u[e];if(t.current.value=s,d(s),O(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),j(e),i){const s={target:t.current};i(s);}}},deps:[u]}].forEach(({key:o,handler:e,deps:s})=>G(o,e,{target:t.current,deps:s})),K(()=>{d(p);},[p]),K(()=>{(()=>{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,F,E,q),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 T=a.offsetHeight;S=Math.max(r,T),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]),K(()=>{m&&t.current&&(m instanceof Function ? m(t.current):m.current=t.current);},[m,t]),n.jsxs("div",{className:["ono-textarea",M ? "ono-input-is-disabled":""].filter(Boolean).join(" "),children:[n.jsx("div",{className:["ono-textarea-wrapper",N ? E==="none" ? "":"ono-input-is-focus":"",U].filter(Boolean).join(" "),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:R,name:Q,maxLength:w,minLength:z,placeholder:k,readOnly:D,autoComplete:P,autoFocus:Y,form:V,disabled:M,onFocus:(o)=>{g==null||g(o),C(!0);},onBlur:(o)=>{b==null||b(o),C(!1);},value:h,onChange:(o)=>{d(o.target.value),j(o.target.value),i==null||i(o);},onKeyUp:B,onKeyDown:W})}),v&&w&&n.jsx("p",{className:"ono-count-bar",onClick:(o)=>o.stopPropagation(),children:h.length+"/"+w})]});});export{oe as O,ne as a};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{useState as j,useRef as O,useMemo as J,useCallback as Q,useEffect as M}from "react";import{p as U}from "./PortalRenderer-izu9LyVc.js";let B=1;const i=[],g=(e,a,r)=>(i.length===0&&(B=1),W(a.instancesKey||"",e,{id:`${r}-${B++}`,key:a.instancesKey||"",reactNode:e,props:a,offsetOptions:{topOffset:0,height:0,bottomOffset:0}}),i),S=(e)=>{const a=i.findIndex((r)=>r.id===e);return a<=0 ? 0:i[a-1].offsetOptions.bottomOffset;},W=(e,a,r)=>{const f=(t)=>U(a,{zIndex:999+B-1,...t.props,id:t.id},t.id,"ono-message-root");if(!e){const t=f(r);i.push({...r,props:{...r.props,id:r.id,destroy:t},destroy:t});}let y=!1;const k=i.map((t)=>{if(t.key===e){y=!0;const p={...t.props,...r.props};return{...t,props:p};}{const p=f(t);return{...t,props:{...t.props,id:t.id,destroy:p},destroy:p};}});if(Object.assign(i,k),!y){const t=f(r);i.push({...r,props:{...r.props,id:r.id,destroy:t},destroy:t});}},X={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)=>X[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:["ono-info-icon","ono-loading"].join(" "),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"})})}),m=({id:e,instancesKey:a,duration:r=3e3,speed:f=300,offset:y=20,message:k,type:t,plain:p=!0,showClose:D=!1,zIndex:F,onClose:E=()=>{},destroy:R})=>{const [,q]=j(!1),[w,A]=j(0),[x,H]=j(((n)=>{const c=i.findIndex((l)=>l.id===n);return c<=0 ? 0:i[c-1].offsetOptions.topOffset;})(e)),[s,P]=j({duration:r,speed:f,message:k,type:t,showClose:D,onClose:E}),v=O(null),z=O(null),d=O(null),I=x+w,V=J(()=>({translate:`-50%${x}px`,transition:`translate ${f}ms ease-in-out`,zIndex:F}),[x,f]),L=()=>{d.current&&(d.current.classList.remove("ono-message-enter"),d.current.classList.add("ono-message-leave"),d.current.style.translate=`-50%${S(e)-w}px`,((n)=>{const c=i.findIndex((l)=>l.id===n);c!==-1&&i.splice(c,1);})(e),setTimeout(()=>R(s.onClose),f));},b=(n,c,l)=>{n!=="loading"&&(v.current=setTimeout(L,c-l));},N=()=>{const n=S(e);q((c)=>(c&&H(n+y),!0)),requestAnimationFrame(N);},$=Q(()=>{if(s.type==="loading"){if(z.current)return;z.current=setTimeout(()=>{var l;z.current=null;const n=(c=a||"")?(l=i.find((u)=>u.key===c))==null ? void 0:l.props:null;var c;n&&(((u)=>{P((G)=>({...G,...u}));})({...n}),b(s.type,n.duration||s.duration,n.speed||s.speed),$());},100);}},[s]);return M(()=>{b(s.type,s.duration,s.speed),N(),$();},[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,c)=>{const l=i.findIndex((u)=>u.id===n);l<0||(i[l].offsetOptions=c);})(e,{topOffset:x,height:w,bottomOffset:I});},[I]),o.jsx("div",{ref:d,className:["ono-message",`ono-message-${s.type}`,"ono-message-enter",p ? "":"ono-message-color"].filter(Boolean).join(" "),style:V,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};}},e0={info:(e)=>{g(m,{...h(e),type:"info"},"ono-message");},success:(e)=>{g(m,{...h(e),type:"success"},"ono-message");},warning:(e)=>{g(m,{...h(e),type:"warning"},"ono-message");},error:(e)=>{g(m,{...h(e),type:"error"},"ono-message");},loading:(e)=>{g(m,{...h(e),type:"loading"},"ono-message");}};export{e0 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{useState as D,useRef as v,useEffect as y}from "react";import{p as E}from "./PortalRenderer-izu9LyVc.js";import{B as w}from "./Button-CWrnOZH2.js";const F=({title:c="This is a modal title",icon:C,content:g="This is a modal content",okText:k="confirm",cancelText:B="cancel",confirmDisabled:N,cancelDisabled:P,startPosition:t,onConfirm:d,onCancel:m,mask:x=!0,maskClosable:T=!1,width:u,btnClr:n,footer:f=({OkBtn:s,CancelBtn:i})=>o.jsxs(o.Fragment,{children:[o.jsx(i,{}),o.jsx(s,{})]}),modalBody:b,destroy:p})=>{const [s,i]=D(!1),l=v(null),a=v(null),z=[{label:"themeColor",value:n||""},{label:"themeHoverColor",value:n&&h(n,"light",10)||""},{label:"themeActiveColor",value:n&&h(n,"dark",20)||""},{label:"themeDisabledClr",value:n&&h(n,"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(()=>(l.current&&(x ? l.current.showModal():l.current.show()),()=>{l.current&&l.current.close();}),[l.current,x]),y(()=>{(()=>{if(!a.current)return;const e=a.current.style;u&&e.setProperty("--width",u+"px"),t&&(e.setProperty("--left",(t.x/window.innerWidth*100).toFixed(2)+"%"),e.setProperty("--top",(t.y/window.innerHeight*100).toFixed(2)+"%")),n&&z.forEach((j)=>e.setProperty(`--${j.label}`,j.value));})();},[a]),o.jsx("dialog",{ref:l,className:"ono-modal",onClick:()=>T&&r(),children:b ? b(r):o.jsxs("div",{ref:a,className:["ono-modal-box",t ? "ono-modal-enter":""].join(" "),onClick:(e)=>e.stopPropagation(),children:[o.jsxs("div",{className:"ono-modal-box-body",children:[C ?? 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:g})]})]}),f&&o.jsx("div",{className:"ono-modal-box-footer",children:f({OkBtn:()=>o.jsx(w,{className:"ono-modal-box-footer-confirmBtn",loading:s,disabled:N,onClick:async()=>{i(!0);try{const e=d==null ? void 0:d();e instanceof Promise&&await e;}finally{i(!1),r();}},children:k ?? "Confirm"}),CancelBtn:()=>o.jsx(w,{className:"ono-modal-box-footer-cancelBtn",disabled:P||s,onClick:()=>{m==null||m(),r();},children:B ?? "Cancel"}),handleClose:()=>r()})})]})});},A=(c)=>E(F,c,"ono-modal");export{A as M};
@@ -1 +0,0 @@
1
- import{j as o}from "./dependencies-B7YNjh_z.js";import{useState as W,useRef as y,useEffect as E}from "react";const P=({name:h,value:a,style:m,checked:n,onChange:C,children:r,className:p,radioW:f=16,radioGap:v=4,checkedColor:c="#532ce1",unCheckedColor:t="transparent",disabled:d=!1})=>{const [e,l]=W(""),b=y(null),i=y(null),s=y(null),x=[{value:f,name:"w"},{value:v,name:"gap"},{value:c,name:"checkedColor"},{value:t,name:"unCheckedColor"}];return E(()=>{(()=>{if(!s.current||!i.current)return;x.forEach(({value:j,name:g})=>{j&&((k,N,w)=>{const G=typeof k=="number";w.style.setProperty(`--${N}`,G ? `${k}px`:k);})(j,g,i.current);});const u=getComputedStyle(s.current);e||l(u.borderColor),s.current.style.borderColor=n ? c:e;})();},[i,s,n,e]),o.jsxs("div",{ref:i,className:["ono-radio-box",p].join(" "),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:n,disabled:d,id:a+""+r,onChange:C})}),r&&o.jsx("label",{htmlFor:a+""+r||"",children:r})]});},$=({name:h,style:a,options:m,onChange:n,className:C,radioW:r=16,radioGap:p=4,labelPosition:f="right",checkedColor:v="#532ce1",unCheckedColor:c="transparent",value:t})=>o.jsx("div",{className:["ono-radio-group",C].join(" "),style:a,children:m.map(({label:d,value:e,disabled:l})=>o.jsx(P,{name:h,value:e,radioW:r,radioGap:p,style:{flexDirection:f==="left" ? "row-reverse":"row"},checkedColor:v,unCheckedColor:c,onChange:()=>n(e),checked:t+""==e+"",disabled:typeof l=="function" ? l(t):l||!1,children:d},d))});export{P as R,$ as a};
@@ -1 +0,0 @@
1
- import{j as g}from "./dependencies-B7YNjh_z.js";import{forwardRef as b,useState as j,useRef as k,useEffect as m}from "react";const C=({children:s,disabled:f,className:h,style:n,onClick:l})=>g.jsx("li",{className:["ono-scrollable-tab",h].filter(Boolean).join(" "),style:n,onClick:(o)=>!f&&(l==null ? void 0:l(o)),children:s}),S=b(({activeIndex:s,children:f,className:h,style:n,position:l="center",onChange:o},c)=>{const [a,p]=j(0),r=k(null);return m(()=>{const e=r.current;if(!e||a<0)return;const u=e.offsetWidth,t=Array.from(e.children);if(a>=t.length)return;const d=parseInt(((n==null ? void 0:n.gap)||getComputedStyle(e).gap||"0").toString(),10)||0;let i=0;switch(t.slice(0,a+1).forEach((y)=>i+=y.offsetWidth+d),l){case "start":e.scrollLeft=i-t[a].offsetWidth-d;break;case "end":e.scrollLeft=i-u;break;default:i-=t[a].offsetWidth/2+(s!==t.length-1 ? d:0),e.scrollLeft=i-u/2;}},[r,f,s,l]),m(()=>{p(s||0);},[s]),m(()=>{c&&(typeof c=="function" ? c(r.current):c.current=r.current);},[c]),g.jsx("ul",{ref:r,className:["ono-scrollable-tabs",h].filter(Boolean).join(" "),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:f(C)});});export{S};
@@ -1 +0,0 @@
1
- import{j as n}from "./dependencies-B7YNjh_z.js";import{useState as s,useEffect as v}from "react";import{T as A}from "./Tooltip-DDUtx7BP.js";import{O as F}from "./Input-UCScuMXP.js";import{L as z}from "./List-DXRmDwDo.js";const D=({label:e,value:a,disabled:i,onChange:c,selectValue:d,optionRender:f,currentValue:u,onChangeCursor:m})=>n.jsx("button",{role:"option","aria-label":e,disabled:i,className:"ono-option-item",onClick:()=>c==null ? void 0:c(a),onMouseEnter:()=>!i&&(m==null ? void 0:m(e)),children:f ? f({label:e,value:a,disabled:i},d===e):n.jsx("div",{className:["ono-option-item-content",u===e&&d!==e ? "ono-option-item-content-active":"",d===e ? "ono-option-item-content-selected":"",i ? "ono-option-item-content-disabled":""].filter(Boolean).join(" "),children:e})}),I=({options:e,defaultValue:a,placeholder:i,inputBorder:c,isShowArrow:d,disabled:f,clearable:u,selectClassName:m,optionsClassName:B,notFoundContent:k,optionRender:M,onClear:b,onChange:r,filterOption:t})=>{const [h,w]=s(""),[O,g]=s(""),[p,j]=s(""),[N,x]=s(!1),[L,y]=s(!1),[E,S]=s(""),V=(o)=>{const l=e.find((C)=>C.value===o);w(l ? l.label:"");},R=(o)=>{r==null||r(o),S(o),V(o);};return v(()=>{a&&V(a);},[a]),v(()=>{var o;if(e.length>0){if(a){const l=e.find((C)=>C.value===a);l&&g(l.label);}else e:for(let l=0;l<e.length;l++)if(((o=e[l])==null ? void 0:o.disabled)!==!0){g(e[0].label);break e;}}},[e,a]),n.jsx(A,{sameWidth:!0,trigger:"click",placement:"bottom",isShowArrow:d,className:["ono-option-container",B].filter(Boolean).join(" "),onOpenChange:(o)=>{y(o),t&&p&&!o&&j("");},content:n.jsx(z,{list:t ? typeof t=="function" ? t(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:k ?? "No Data"})}),children:(o)=>n.jsx(D,{...o,onChange:R,selectValue:h.toString(),currentValue:O.toString(),optionRender:M,onChangeCursor:g},o.value)}),children:n.jsx("div",{className:"ono-select",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:n.jsx(F,{className:[t ? "":"ono-select-readonly",m].filter(Boolean).join(" "),border:c,disabled:f,placeholder:t&&E ? h.toString()||"":i,readonly:!t,value:t&&L ? p:h.toString(),clearable:N&&u,suffix:N&&u&&h||u&&p&&t ? n.jsx(n.Fragment,{}):n.jsx(P,{isVisible:L}),onClear:()=>{b==null||b(),r==null||r(""),S(""),w(""),j("");},onChange:(o)=>j(o.target.value)})})});},P=({isVisible:e})=>n.jsx("svg",{className:["ono-select-arrow-down-icon",e ? "ono-select-arrow-down-active":""].filter(Boolean).join(" "),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{I as O};
@@ -1 +0,0 @@
1
- import{j as n}from "./dependencies-B7YNjh_z.js";import{useRef as v,useEffect as p}from "react";const h=({w:o,h:c,src:m,clr:l,className:i,onClick:u})=>{const e=v(null),f=[{value:o,name:"w"},{value:c,name:"h"},{value:l,name:"clr"}];return p(()=>{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]),n.jsx("div",{ref:e,className:["ono-svg-img",i].join(" "),onClick:u,children:n.jsx("img",{src:m,alt:""})});};export{h as S};
@@ -1 +0,0 @@
1
- import{j as r}from "./dependencies-B7YNjh_z.js";import{p as w}from "./pureNumber.ts-LjeTI9RC.js";import{useRef as c,useEffect as y}from "react";const A=({id:k,text:e,style:d,color:t,checked:u,onChange:h,name:g="",className:m,disabled:v=!1})=>{const o=c(null),l=c(null),s=c(null),i=c(null),p=c(null),x=c(null),N=[{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 y(()=>{(()=>{if(!l.current||!o.current)return;let n=60,j=32;if(m||d){const a=getComputedStyle(l.current);n=w(a.width),j=w(a.height);}[...N,{value:n,name:"w"},{value:j,name:"h"}].forEach(({value:a,name:b})=>{a&&((f,C,B)=>{const E=typeof f=="number";B.style.setProperty(`--${C}`,E ? `${f}px`:f);})(a,b,o.current);}),requestAnimationFrame(()=>{i.current&&(i.current.style.transition="translate 0.3s");});})();},[l,o,i,m,d,t,e,p,x]),y(()=>{s.current&&(s.current.checked=u);},[s,u]),r.jsxs("div",{ref:o,className:["ono-switch",v ? "ono-switch-is-disabled":""].filter(Boolean).join(" "),children:[r.jsx("input",{id:k,name:g,role:"switch",ref:s,type:"checkbox",checked:u,onChange:(n)=>{v||(h==null||h(n.currentTarget.checked,n));}}),r.jsx("div",{ref:l,className:["ono-switch-box",m||""].filter(Boolean).join(" "),style:d,onClick:()=>{var n;return(n=s.current)==null ? void 0:n.click();},children:r.jsxs("div",{ref:i,className:"ono-switch-children-bar",children:[(e==null ? void 0:e.active)&&r.jsx("div",{ref:p,className:"ono-switch-children",children:e==null ? void 0:e.active}),r.jsx("div",{className:"ono-switch-slider"}),(e==null ? void 0:e.inactive)&&r.jsx("div",{ref:x,className:"ono-switch-children",children:e==null ? void 0:e.inactive})]})})]});};export{A as S};
@@ -1 +0,0 @@
1
- import{j as d}from "./dependencies-B7YNjh_z.js";import{g as b}from "./getElementCenterPosition.ts-CpWYej6j.js";import{useState as h,useRef as P,useEffect as $,useCallback as w}from "react";const F=({children:s,animation:e,className:u,duration:l=300,style:p,maskColor:f="rgba(0,0,0,0.5)",disableContextMenu:m,maskClickClose:y=!0,dialogClose:a})=>{const [r,k]=h(!1),o=P(null),c=()=>{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(a,l);}else a();};$(()=>{(()=>{if(!e||!o.current)return;const t=o.current.parentElement.style,n=o.current.style;switch(t.setProperty("--duration",l/1e3+"s"),e.type){case "zoom":{const{x:i,y:C}=b(e.element),x=(i/window.innerWidth*100).toFixed(2)+"%",v=(C/window.innerHeight*100).toFixed(2)+"%";n.setProperty("--left",x),n.setProperty("--top",v);break;}case "fade":{const i=e.direction==="left-center" ? "--left":"--top";n.setProperty(i,e.startPosition);break;}}})();},[o,e]);const g=w(()=>{if(!e)return "";const t=`ono-${e.type}-enter`,n=`ono-${e.type}-leave`;return r ? n:t;},[e,r]);return d.jsx("div",{className:"ono-dialog-mask ono-dialog-mask-"+(r ? "leave":"enter"),style:{background:f},onClick:()=>y&&c(),onContextMenu:(t)=>m&&t.preventDefault(),children:d.jsx("div",{ref:o,className:`ono-dialog ${u}${g()}`,style:p,onClick:(t)=>t.stopPropagation(),children:typeof s=="function" ? s(c):s})});};export{F as T};
@@ -1 +0,0 @@
1
- import{j as i}from "./dependencies-B7YNjh_z.js";import{useEffect as f,useRef as h}from "react";import{i as _}from "./InjunctiveBox-vLlRm8LB.js";const L="_enter_974ly_32";let t=[];const v={success:{light:"#52c41a",dark:"#49aa19"},error:{light:"#ff4d4f",dark:"#a61d24"},warning:{light:"#faad14",dark:"#d89614"},promise:{light:"",dark:""}},g=(s,a)=>v[s][a],w=(s)=>{switch(s){case "success":return i.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",width:"24px",height:"24px",fill:g(s,"light"),"aria-hidden":"true",children:i.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 i.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",width:"24px",height:"24px",fill:g(s,"light"),"aria-hidden":"true",children:i.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 i.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"exclamation-circle",width:"24px",height:"24px",fill:g(s,"light"),"aria-hidden":"true",children:i.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"})});}},j=({type:s,speed:a=200,message:o,duration:m=2e3,className:d,style:u,isUseEnterAnimation:y=!0,promiseOptions:e,toastList:p,handleDestroy:c})=>{const r=h(null);return f(()=>{r.current&&(r.current.style.setProperty("--speed",a/1e3+"s"),y&&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-a));},[r]),f(()=>{s==="promise" ?(typeof o=="function" ? o():o).then((n)=>setTimeout(()=>{c(),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});},a)).catch((n)=>setTimeout(()=>{c(),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});},a)):setTimeout(()=>c(()=>p=[]),m);},[s]),i.jsxs("div",{ref:r,className:[s==="promise" ? "_promise_974ly_15":"_base_974ly_15",d].join(" "),style:u,onClick:()=>{},children:[i.jsx("div",{className:"_icon_974ly_40",children:w(s)}),i.jsx("p",{children:typeof o=="string" ? o:e&&e.loading})]});},l=({type:s,speed:a=200,message:o,duration:m=2e3,zIndex:d=9999,className:u,style:y,isUseEnterAnimation:e=!0,promiseOptions:p,toastList:c})=>_({className:"_container_974ly_1",isSingle:!0,style:{zIndex:d},content:(r)=>(f(()=>{},[c]),i.jsx(j,{className:u,style:y,type:s,message:o,speed:a,duration:m,isUseEnterAnimation:e,promiseOptions:p,handleDestroy:r,toastList:c}))}),N={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,a)=>{t.push({type:"promise",message:s}),l({type:"promise",message:s,promiseOptions:a,toastList:t});}};export{N 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{createPopper as k}from "@popperjs/core";import{useState as W,useRef as d,useEffect as h}from "react";let u=null,p=null;const S=({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]=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=k(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:["ono-tooltip-popper",w].join(" "),"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{S 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{t as R}from "./throttle.ts-D_EqcNzV.js";import{useState as j,useRef as v,useCallback as B,useEffect as z}from "react";import{L as G}from "./List-DXRmDwDo.js";const V=({options:t,pageSize:u,children:$,request:S,reloadData:o,className:A,style:H,updateData:L,loading:c=!0,bottomThreshold:O=50})=>{const [a,h]=j({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]=j([]),[x,N]=j([]),y=v(null),d=v(null),p=v(null),g=(i)=>h((e)=>({...e,...i})),w=async(i,e)=>{const r=o&&a.reloadData!==o;if(a.isFinish)return;g({loading:!0});const n=await S(i,e);k(n),g({isFinish:!n.length,imageList:r ? [...n]:[...a.imageList,...n],page:i+1,loading:!1});},k=(i)=>h((e)=>{const r=o&&a.reloadData!==o,n=r ? []:[...x],m=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};})(m),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}),m[s.index]+=C+e.gap,D(m);}),N(n),e;}),E=B(()=>{if(!p.current)return;const i=p.current.clientWidth;let e=0,r=a.page;if(o&&a.reloadData!==o&&(h({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 m=e ?(i-n*a.imageWidth)/e:0;g({columns:n,gap:m});}else{e=a.columns-1;const n=(i-e*a.gap)/a.columns;g({imageWidth:n});}w(r,u);},[a,o]),F=()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(E,50);},q=R(()=>{const{scrollTop:i,clientHeight:e,scrollHeight:r}=d.current;r-e-i>O||!a.loading&&w(a.page,u);},50);return J("scroll",q,{target:d.current,deps:[a.loading,a.page]}),z(()=>(E(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F);}),[p,o]),z(()=>{L&&w(a.page,u);},[L,a.loading,a.page,d.current]),l.jsxs("div",{className:"ono-waterfall-container",children:[l.jsx("div",{ref:d,className:[A,"ono-waterfall-content"].join(" ").trim(),style:H,children:l.jsx("div",{ref:p,className:"ono-waterfall-wrapper",style:{height:Math.max(...f)-a.gap+"px"},children:l.jsx(G,{list:a.imageList,children:(i,e)=>l.jsx("div",{className:"ono-waterfall-item",style:{width:`${a.imageWidth}px`,translate:`${x[e].x}px ${x[e].y}px`},children:$(i,e)},i.id)})})}),a.loading&&(typeof c=="function" ? c():c&&typeof c=="boolean" ? l.jsx("div",{className:"ono-waterfall-loading",children:"loading..."}):c)]});};export{V as W};
@@ -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 h=(r)=>r<10 ? `0${r}`:`${r}`,l=(r)=>r.toString().length>13 ? new Date(Number(r.toString().substring(0,13))):r.toString().length===13 ? new Date(r):r.toString().length<13&&r.toString().length>10 ? new Date(Number((r.toString()+"000").substring(0,13))):r.toString().length===10 ? new Date(1e3*r):new Date(Number((r.toString()+"000000000000").substring(0,13))),i=(r,o="YY-MM-DD hh:mm:ss")=>{const t=["YY","MM","DD","hh","mm","ss"],u=[],s=l(r);u.push(s.getFullYear().toString()),u.push(h(s.getMonth()+1)),u.push(h(s.getDate())),u.push(h(s.getHours())),u.push(h(s.getMinutes())),u.push(h(s.getSeconds()));for(let g in u)o=o.replace(t[g],u[g]);return o;},m=(r,o="YY-MM-DD hh:mm:ss",t="cn")=>{const u=["YY","MM","DD","hh","mm","ss"],s=[],g=l(r);s.push(((e,a)=>{const n={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return e.split("").map((p)=>n[a][Number(p)]).join("");})(g.getFullYear().toString(),t)),s.push(((e,a)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[a][Number(e)-1])(h(g.getMonth()+1),t)),s.push(((e,a)=>{let n;return a==="en" ? n=e==="01"||e==="21"||e==="31" ? Number(e)+"st":e==="02"||e==="22" ? Number(e)+"nd":e==="03"||e==="23" ? Number(e)+"rd":Number(e)+"th":e==="01" ? n="一日":e==="02" ? n="二日":e==="03" ? n="三日":e==="04" ? n="四日":e==="05" ? n="五日":e==="06" ? n="六日":e==="07" ? n="七日":e==="08" ? n="八日":e==="09" ? n="九日":e==="10" ? n="十日":e==="11" ? n="十一日":e==="12" ? n="十二日":e==="13" ? n="十三日":e==="14" ? n="十四日":e==="15" ? n="十五日":e==="16" ? n="十六日":e==="17" ? n="十七日":e==="18" ? n="十八日":e==="19" ? n="十九日":e==="20" ? n="二十日":e==="21" ? n="二十一日":e==="22" ? n="二十二日":e==="23" ? n="二十三日":e==="24" ? n="二十四日":e==="25" ? n="二十五日":e==="26" ? n="二十六日":e==="27" ? n="二十七日":e==="28" ? n="二十八日":e==="29" ? n="二十九日":e==="30" ? n="三十日":e==="31"&&(n="三十一日"),n ?? e;})(h(g.getDate()),t)),s.push(h(g.getHours())),s.push(h(g.getMinutes())),s.push(h(g.getSeconds()));for(let e in s)o=o.replace(u[e],s[e]);return o;},c=(r,o)=>{const t=["DD","hh","mm","ss"],u=[];u.push(Math.floor(r/86400)),u.push(h(Math.floor(r%86400/3600))),u.push(h(Math.floor(r%3600/60))),u.push(h(r%60));for(let s=0;s<t.length;s++)o=o.replace(t[s],u[s].toString());return o;},D=(r,o)=>{const t={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!t[o])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(r/t[o]);};export{D as c,i as f,m as l,c as s};
@@ -1 +0,0 @@
1
- import{h as r}from "./hex2rgb.ts-BQpml6Tb.js";import{r as m}from "./rgb2hsl.ts-BPiSggZg.js";const p=(o)=>m(r(o));export{p as h};
@@ -1 +0,0 @@
1
- const s=({onAndroid:t,onIOS:i,onUnknown:n,timeout:o=500})=>()=>{setTimeout(()=>d({onAndroid:t,onIOS:i,onUnknown:n}),o);},d=({onAndroid:t,onIOS:i,onUnknown:n})=>{const o=navigator.userAgent;return/android/i.test(o)?(t(),"Android"):/iPad|iPhone|iPod/.test(o)?(i(),"iOS"):(n==null||n(),"Unknown");},r={distinguishPlatformDelay:s,distinguishPlatform:d};export{s as a,d,r as p};
@@ -1 +0,0 @@
1
- const i=({el:t,str:e="hello world",speed:r=100,isExtendStr:x=!0,onDone:o})=>{let n=0,s=null;t.textContent&&x&&(n=t.textContent.length,e=t.textContent+e);const l=()=>{clearTimeout(s);const c=e.substring(0,n+1);t.textContent=c,n++,n!==e.length ? s=setTimeout(l,r):o&&o();};l();};export{i as p};
@@ -1 +0,0 @@
1
- import{b as a}from "./blobToFile.ts-BXmUv6W-.js";import{u as s}from "./urlToBlob.ts-DDhIhkMn.js";const m=async(o)=>a(await s(o));export{m as u};
@@ -1 +0,0 @@
1
- .ono-auto-slider-list-container{align-items:center;display:flex;list-style:none;position:relative;width:fit-content}.ono-auto-slider-list-container .ono-auto-slider-list-slider{background:#ccc;left:0;position:absolute;top:0;transform-origin:top left;z-index:0}.ono-auto-slider-list-is-disable{cursor:not-allowed}
@@ -1,6 +0,0 @@
1
- type LanguageType = 'en' | 'cn';
2
- declare const formatTime: (number: number, format?: string) => string;
3
- declare const localFormat: (number: number, format?: string, language?: LanguageType) => string;
4
- declare const second2Day: (seconds: number, format: string) => string;
5
- declare const convertSecondToOtherTime: (seconds: number, type: "year" | "month" | "day" | "hour" | "minute" | "second") => number;
6
- export { convertSecondToOtherTime, formatTime, localFormat, second2Day };
@@ -1,13 +0,0 @@
1
- interface DistinguishPlatformType {
2
- onAndroid: () => void;
3
- onIOS: () => void;
4
- onUnknown?: () => void;
5
- timeout?: number;
6
- }
7
- export declare const distinguishPlatformDelay: ({ onAndroid, onIOS, onUnknown, timeout }: DistinguishPlatformType) => () => void;
8
- export declare const distinguishPlatform: ({ onAndroid, onIOS, onUnknown }: Omit<DistinguishPlatformType, "timeout">) => "Unknown" | "Android" | "iOS";
9
- declare const _default: {
10
- distinguishPlatformDelay: ({ onAndroid, onIOS, onUnknown, timeout }: DistinguishPlatformType) => () => void;
11
- distinguishPlatform: ({ onAndroid, onIOS, onUnknown }: Omit<DistinguishPlatformType, "timeout">) => "Unknown" | "Android" | "iOS";
12
- };
13
- export default _default;