ono-react-element 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/AutoSliderList-CVDZG5cu.js +1 -0
- package/dist/es/Button-P2AG5fc6.js +1 -0
- package/dist/es/Carousel-DOesUSmW.js +1 -0
- package/dist/es/Checkbox-DJYMF9I4.js +1 -0
- package/dist/es/ContextMenu-DlhlsQrA.js +1 -0
- package/dist/es/FileDropZone-BSLGVa4n.js +1 -0
- package/dist/es/InjunctiveBox-vLlRm8LB.js +1 -0
- package/dist/es/Input-Hy30rZ_v.js +1 -0
- package/dist/es/Message-COQA0S8d.js +1 -0
- package/dist/es/Modal-CJrgmTMc.js +1 -0
- package/dist/es/Radio-CEooiIll.js +1 -0
- package/dist/es/ScrollableTabs-okdQWyZ9.js +1 -0
- package/dist/es/Select-bhQ7DjXD.js +1 -0
- package/dist/es/SvgImg-D_jzo9p9.js +1 -0
- package/dist/es/Switch-DZ-GXwol.js +1 -0
- package/dist/es/TemplateDialog-iy7z7joV.js +1 -0
- package/dist/es/Toast-CZw9LQzq.js +1 -0
- package/dist/es/Tooltip-DvUB7xZH.js +1 -0
- package/dist/es/VirtualList-CoQKjvuB.js +1 -0
- package/dist/es/Waterfall-B9EXJfxK.js +1 -0
- package/dist/es/adjustingColors.ts-CpC0GUUO.js +1 -0
- package/dist/es/hex2hsl.ts-BLU_9tQG.js +1 -0
- package/dist/es/index.js +1 -1
- package/dist/es/urlToFile.ts-Dp1k4tJm.js +1 -0
- package/dist/style/AutoSliderList.css +1 -0
- package/dist/style/index.css +1 -1
- package/dist/types/utils/color/getColorType.d.ts +1 -1
- package/dist/umd/index.umd.cjs +1 -1
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/Button-Ba6Hyv3b.js +0 -1
- package/dist/es/Carousel-auG6ltgk.js +0 -1
- package/dist/es/Checkbox-CBBjbiRa.js +0 -1
- package/dist/es/ContextMenu-DAy5Czn1.js +0 -1
- package/dist/es/FileDropZone-C-nGl7e7.js +0 -1
- package/dist/es/InjunctiveBox-BBa5LG49.js +0 -1
- package/dist/es/Input-DHoxESrC.js +0 -1
- package/dist/es/Message-Dum59ayv.js +0 -1
- package/dist/es/Modal-CJVYTPGs.js +0 -1
- package/dist/es/Radio-DP0UCRO_.js +0 -1
- package/dist/es/ScrollableTabs-2OZ2V-Dt.js +0 -1
- package/dist/es/Select-fbqZjk6I.js +0 -1
- package/dist/es/SvgImg-N7fVyvgv.js +0 -1
- package/dist/es/Switch-BBNDCObV.js +0 -1
- package/dist/es/TemplateDialog-DzNHI_F8.js +0 -1
- package/dist/es/Toast-aOS_XH1g.js +0 -1
- package/dist/es/Tooltip-D7d2_43u.js +0 -1
- package/dist/es/VirtualList-DPwQMgnX.js +0 -1
- package/dist/es/Waterfall-BcKxRr5b.js +0 -1
- package/dist/es/adjustingColors.ts-B4vYvLS1.js +0 -1
- package/dist/es/distinguishPlatformDelay.ts-BTo3t05U.js +0 -1
- package/dist/es/hex2hsl.ts-C-JnVxv_.js +0 -1
- package/dist/es/urlToFile.ts-BAbioPDr.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,R as v}from "./dependencies-B7YNjh_z.js";import{u as k}from "./useEventListener.tsx-C8V9Qip6.js";let l,o=null;const x=({className:e,content:n,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,isClickBoxToClose:p})=>(k("click",()=>{p&&o&&(o.remove(),o=null);}),t.jsx("div",{className:e,style:u,onClick:i,onDoubleClick:c,onContextMenu:r,onMouseDown:M,onMouseUp:a,onMouseEnter:m,onMouseLeave:d,onMouseMove:C,children:typeof n=="function" ? n((s)=>{o&&(o.remove(),o=null,s&&s());}):n})),b=(e)=>(f(e.isSingle||!1).render(t.jsx(x,{...e})),o),f=(e)=>(e&&o&&l||(o=document.createElement("div"),document.body.appendChild(o),l=v.createRoot(o)),l);export{b as i};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as
|
|
1
|
+
import{u as x}from "./useClickOutSide.tsx-C6XuLZzd.js";import{u as l}from "./useCountdown.tsx-DWqs6wNp.js";import{u}from "./useEventListener.tsx-C8V9Qip6.js";import{u as g}from "./useGetElementSize.tsx-DML7z5Xp.js";import{u as h}from "./useKeyPress.tsx-hgs6v_Jt.js";import{u as C}from "./useMouseClick.tsx-BmzbuM6X.js";import{u as S}from "./useQuery.tsx-FzGWYq50.js";import{u as y}from "./useTheme.tsx-C-GCpzAS.js";import{u as A}from "./useThemePro.tsx-BIU8EPPB.js";import{a as P,c as w}from "./async2syncUtils.ts-DkF1iSK4.js";import{b as D,g as F}from "./browserUtils.ts-DSM1TN_g.js";import{a as E}from "./adjustColor.ts-Bcmtt429.js";import{a as M}from "./adjustingColors.ts-CpC0GUUO.js";import{f as R}from "./formatColor.ts-BpkK5FYe.js";import{g as z}from "./getColorType.ts-B-_g2UQs.js";import{g as V}from "./getContrastColor.ts-5KaKa1G7.js";import{g as q}from "./grayColor.ts-bqVfONY0.js";import{h as Q}from "./hex2hsl.ts-BLU_9tQG.js";import{h as H}from "./hex2hsv.ts-CNUNM2bM.js";import{h as Y}from "./hex2rgb.ts-BQpml6Tb.js";import{h as X}from "./hex3To6.ts-BNOY-YJ2.js";import{h as $}from "./hsl2hex.ts-D9xS0UDg.js";import{h as ro}from "./hsl2rgb.ts-B6-BIsnP.js";import{h as to}from "./hsv2hex.ts-BNkK519v.js";import{h as so}from "./hsv2rgb.ts-Bvoa3lA1.js";import{i as po}from "./isValidColor.ts-CpkuoTf9.js";import{r as xo}from "./randomColor.ts-Cf-bUfCt.js";import{r as lo}from "./rgb2hex.ts-Dkw9FDV4.js";import{r as uo}from "./rgb2hsl.ts-BPiSggZg.js";import{r as go}from "./rgb2hsv.ts-CxNRFDKF.js";import{r as bo}from "./rgb2rgba.ts-Dx8-1nZt.js";import{a as To}from "./addCommasToNumber.ts-Bc5ZX_HW.js";import{a as vo}from "./addEventWithOriginHandler.ts-CBP4faL-.js";import{c as Oo}from "./calculateAspectRatio.ts-DLTMZ6rT.js";import{c as Io}from "./chainClassNames.ts-B9vmfsc1.js";import{c as wo}from "./checkDeviceIsMobile.ts-D_9fa1Z1.js";import{c as Do}from "./checkStatusCode.ts-CeS5vbbx.js";import{c as ko}from "./copy2Clipboard.ts-D-Ux5BRc.js";import{d as Lo}from "./debounce.ts-DtQl9QX-.js";import{d as No}from "./deepCopy.ts-DZSM2TJ5.js";import{e as Uo}from "./ellipsisString.ts-CEHck07f.js";import{g as Wo}from "./gcd.ts-BCWGat6T.js";import{g as jo}from "./getAllTheNumbers.ts-DaNxVd8a.js";import{g as Go}from "./getElementCenterPosition.ts-CpWYej6j.js";import{g as Zo}from "./getImageSIze.ts-BKCUZEmG.js";import{g as Ko}from "./getPointDistance.ts-oQIzWYT7.js";import{g as Jo}from "./getURLSearchParams.ts-CdkTE_NB.js";import{i as _o}from "./isPureNumber.ts-UvzCfFTt.js";import{m as or}from "./mediaAutoplayPolicies.ts-h8T8o7DV.js";import{p as er}from "./padZero.ts-BTMKlRWN.js";import{p as ar}from "./parseQuery.ts-rxlqkZEE.js";import{p as mr}from "./passwordStrength.ts-BSVicol-.js";import{p as fr}from "./pick.ts-CVf1DuK1.js";import{p as ir}from "./printStr.ts-Nd8JNyzN.js";import{p as nr}from "./pureNumber.ts-LjeTI9RC.js";import{q as cr}from "./quickSort.ts-CTYjJtIg.js";import{r as dr}from "./rafTimeout.ts-atBwwlgC.js";import{r as br}from "./randomString.ts-DpWnx0Kc.js";import{r as Tr}from "./removeTag.ts-K8ovHu9Z.js";import{s as vr}from "./safeCapitalizeWord.ts-CBBsQk5s.js";import{s as Or}from "./singleton.ts-BxAjTJl8.js";import{t as Ir}from "./throttle.ts-D_EqcNzV.js";import{b as wr}from "./base64ToBlob.ts-TfYiqeZD.js";import{b as Dr}from "./base64ToFile.ts-DMMwTaBr.js";import{b as kr}from "./blobToBase64.ts-CPZTWtAM.js";import{b as Lr}from "./blobToFile.ts-BXmUv6W-.js";import{d as Nr}from "./downloadFile.ts-1nf2IAw4.js";import{f as Ur}from "./fileToBase64.ts-Dx4eMf1P.js";import{f as Wr}from "./fileToBlob.ts-t5-IVXI8.js";import{f as jr}from "./formatFileSize.ts-DmkABYUs.js";import{g as Gr}from "./getFileName.ts-BeGee0uD.js";import{g as Zr}from "./getFileSuffix.ts-BNoXbi6l.js";import{u as Kr}from "./urlToBase64.ts-t7glJoIV.js";import{u as Jr}from "./urlToBlob.ts-DDhIhkMn.js";import{u as _r}from "./urlToFile.ts-Dp1k4tJm.js";import{c as oe,e as re,i as ee}from "./intersectionObserverUtils.ts-BdWvnE4X.js";import{d as a}from "./distinguishPlatform.ts-D2huTxC3.js";import{c as ae}from "./convertSecondToOtherTime.ts-BJegkJhl.js";import{d as me}from "./dayOfYear.ts-DdscYtyU.js";import{f as fe}from "./formatSecond.ts-CI2ihnKf.js";import{f as ie}from "./formatTime.ts-DNtDsT9L.js";import{l as ne}from "./localFormat.ts-vxgGt_Za.js";import{s as ce}from "./second2Day.ts-DHntMxxp.js";import{c as de}from "./event-B2tGdMqN.js";import{A as be,D as Ce}from "./AutoSliderList-CVDZG5cu.js";import{A as Se}from "./AvatarCrop-CSkrjAcy.js";import{A as ye,L as Oe}from "./List-DXRmDwDo.js";import{B as Ie}from "./Button-P2AG5fc6.js";import{C as we}from "./Card3D-DrfpLxw2.js";import{C as De}from "./Carousel-DOesUSmW.js";import{C as ke}from "./Checkbox-DJYMF9I4.js";import{c as Le}from "./ContextMenu-DlhlsQrA.js";import{E as Ne,c as Re}from "./VirtualList-CoQKjvuB.js";import{F as ze}from "./FileDropZone-BSLGVa4n.js";import{M as Ve}from "./MenuButton-M93IpBnN.js";import{m as qe}from "./Message-COQA0S8d.js";import{M as Qe}from "./Modal-CJrgmTMc.js";import{O as He,a as Ke}from "./Input-Hy30rZ_v.js";import{O as Je}from "./Select-bhQ7DjXD.js";import{P as _e}from "./Pagination-L17GYQVO.js";import{p as ot}from "./PortalRenderer-izu9LyVc.js";import{R as et,a as tt}from "./Radio-CEooiIll.js";import{S as st}from "./ScrollableTabs-okdQWyZ9.js";import{S as pt}from "./SvgImg-D_jzo9p9.js";import{S as xt}from "./Switch-DZ-GXwol.js";import{T as lt}from "./TemplateDialog-iy7z7joV.js";import{t as ut}from "./Toast-CZw9LQzq.js";import{T as gt}from "./Tooltip-DvUB7xZH.js";import{W as ht}from "./Waterfall-B9EXJfxK.js";const m=({onAndroid:o,onIOS:r,onUnknown:e,timeout:t=500})=>()=>{setTimeout(()=>a({onAndroid:o,onIOS:r,onUnknown:e}),t);};export{be as AutoSliderList,Se as AvatarCrop,ye as AwaitList,Ie as Button,we as Card3D,De as Carousel,ke as Checkbox,Ce as Direction,Ne as EstimatedVirtualList,ze as FileDropZone,Oe as List,Ve as MenuButton,Qe as Modal,He as OnoInput,Je as OnoSelect,Ke as OnoTextarea,_e as Pagination,et as Radio,tt as RadioGroup,st as ScrollableTabs,pt as SvgImg,xt as Switch,lt as TemplateDialog,gt as Tooltip,ht as Waterfall,To as addCommasToNumber,vo as addEventWithOriginHandler,E as adjustColor,M as adjustingColors,P as async2syncUtils,wr as base64ToBlob,Dr as base64ToFile,kr as blobToBase64,Lr as blobToFile,D as browserUtils,Oo as calculateAspectRatio,Io as chainClassNames,wo as checkDeviceIsMobile,Do as checkStatusCode,w as clearAsyncContagion,Le as contextMenu,ae as convertSecondToOtherTime,ko as copy2Clipboard,Re as createDataSource,de as createEventEmitter,oe as createIntersectionObserver,me as dayOfYear,Lo as debounce,No as deepCopy,a as distinguishPlatform,m as distinguishPlatformDelay,Nr as downloadFile,re as elementIsInViewport,Uo as ellipsisString,Ur as fileToBase64,Wr as fileToBlob,R as formatColor,jr as formatFileSize,fe as formatSecond,ie as formatTime,Wo as gcd,jo as getAllTheNumbers,F as getBrowserInfo,z as getColorType,V as getContrastColor,Go as getElementCenterPosition,Gr as getFileName,Zr as getFileSuffix,Zo as getImageSIze,Ko as getPointDistance,Jo as getURLSearchParams,q as grayColor,Q as hex2hsl,H as hex2hsv,Y as hex2rgb,X as hex3To6,$ as hsl2hex,ro as hsl2rgb,to as hsv2hex,so as hsv2rgb,ee as intersectionObserverUtils,_o as isPureNumber,po as isValidColor,ne as localFormat,or as mediaAutoplayPolicies,qe as message,er as padZero,ar as parseQuery,mr as passwordStrength,fr as pick,ot as portalRenderer,ir as printStr,nr as pureNumber,cr as quickSort,dr as rafTimeout,xo as randomColor,br as randomString,Tr as removeTag,lo as rgb2hex,uo as rgb2hsl,go as rgb2hsv,bo as rgb2rgba,vr as safeCapitalizeWord,ce as second2Day,Or as singleton,Ir as throttle,ut as toast,Kr as urlToBase64,Jr as urlToBlob,_r as urlToFile,x as useClickOutSide,l as useCountdown,u as useEventListener,g as useGetElementSize,h as useKeyPress,C as useMouseClick,S as useQuery,y as useTheme,A as useThemePro};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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}
|
package/dist/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--bg-color:pink}@keyframes ono-loading{0%{rotate:0deg}to{rotate:1turn}}
|
|
1
|
+
:root{--bg-color:pink}@keyframes ono-loading{0%{rotate:0deg}to{rotate:1turn}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getColorType: (clr: string) => "
|
|
1
|
+
export declare const getColorType: (clr: string) => "rgb" | "hex" | "unknown";
|