ono-react-element 0.0.20 → 0.0.21
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-DD7w6KlD.js +1 -0
- package/dist/es/AvatarCrop-CSkrjAcy.js +1 -0
- package/dist/es/Button-DXWGWvF-.js +1 -0
- package/dist/es/Card3D-DrfpLxw2.js +1 -0
- package/dist/es/Checkbox-jOOMkqbP.js +1 -0
- package/dist/es/ContextMenu-BL414VF5.js +1 -0
- package/dist/es/InjunctiveBox-vLlRm8LB.js +1 -0
- package/dist/es/Input-lVK5hctw.js +1 -0
- package/dist/es/List-DXRmDwDo.js +1 -0
- package/dist/es/MenuButton-C22ekETH.js +1 -0
- package/dist/es/Message-AC7MOJ5X.js +1 -0
- package/dist/es/Modal-e1dQi2y3.js +1 -0
- package/dist/es/Pagination-L17GYQVO.js +1 -0
- package/dist/es/PortalRenderer-izu9LyVc.js +1 -0
- package/dist/es/Radio-m9BOKzf5.js +1 -0
- package/dist/es/ScrollableTabs-DgcrSjsb.js +1 -0
- package/dist/es/Select-BSNVfoEp.js +1 -0
- package/dist/es/SvgImg-HkuwJQ4_.js +1 -0
- package/dist/es/Switch-DoiR9_x4.js +1 -0
- package/dist/es/TemplateDialog-D4D6YS2U.js +1 -0
- package/dist/es/Toast-CERLQ4i7.js +1 -0
- package/dist/es/Tooltip-DDUtx7BP.js +1 -0
- package/dist/es/VirtualList-YXDe-9GK.js +1 -0
- package/dist/es/Waterfall-D8AExUDu.js +1 -0
- package/dist/es/colorUtils.ts-Cxx4mvOB.js +1 -0
- package/dist/es/common.ts-OTJMJPHg.js +1 -0
- package/dist/es/dependencies-B7YNjh_z.js +15719 -0
- package/dist/es/event-B2tGdMqN.js +1 -0
- package/dist/es/fileFormatConversion.ts-3AQHtta9.js +1 -0
- package/dist/es/formatTimeUtils.ts-ng_eAUID.js +1 -0
- package/dist/es/index.js +1 -1
- package/dist/es/useClickOutSide.tsx-C6XuLZzd.js +1 -0
- package/dist/es/useCountdown.tsx-DWqs6wNp.js +1 -0
- package/dist/es/useEventListener.tsx-C8V9Qip6.js +1 -0
- package/dist/es/useGetElementSize.tsx-DML7z5Xp.js +1 -0
- package/dist/es/useKeyPress.tsx-hgs6v_Jt.js +1 -0
- package/dist/es/useMouseClick.tsx-BmzbuM6X.js +1 -0
- package/dist/es/useTheme.tsx-C-GCpzAS.js +1 -0
- package/dist/es/useThemePro.tsx-BIU8EPPB.js +1 -0
- package/dist/es/viewTransitionUtils.ts-tmSvCt31.js +1 -0
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +9 -0
- package/dist/types/components/ContextMenu/index.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- 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/AutoSliderList-tkaOmfnx.js +0 -1
- package/dist/es/AvatarCrop-DrA-SARP.js +0 -1
- package/dist/es/Button-QIC7QPK9.js +0 -1
- package/dist/es/Card3D-DMvCSUhe.js +0 -1
- package/dist/es/Checkbox-daBabj14.js +0 -1
- package/dist/es/InjunctiveBox-DUNoNHCO.js +0 -1
- package/dist/es/Input-DLOeg2pz.js +0 -1
- package/dist/es/List-UAKCMuGC.js +0 -1
- package/dist/es/MenuButton-DHkU5Bq7.js +0 -1
- package/dist/es/Message-BGDILiLc.js +0 -1
- package/dist/es/Modal-D2289ZPX.js +0 -1
- package/dist/es/Pagination-m71H2tfS.js +0 -1
- package/dist/es/PortalRenderer-CDAzQJgm.js +0 -1
- package/dist/es/Radio-D_GKVoOC.js +0 -1
- package/dist/es/ScrollableTabs--449B73p.js +0 -1
- package/dist/es/Select-B11NvK-I.js +0 -1
- package/dist/es/SvgImg-CZwq2D7J.js +0 -1
- package/dist/es/Switch-C61q7rR5.js +0 -1
- package/dist/es/TemplateDialog-CAimG5cv.js +0 -1
- package/dist/es/Toast-CQEsbqUJ.js +0 -1
- package/dist/es/Tooltip-CgttMIcX.js +0 -1
- package/dist/es/VirtualList-BAiIymCF.js +0 -1
- package/dist/es/Waterfall-C7SWCxJ1.js +0 -1
- package/dist/es/colorUtils.ts-DYuRvCXZ.js +0 -1
- package/dist/es/common.ts-BbDnZ7vC.js +0 -1
- package/dist/es/dependencies-CbQbPZZ-.js +0 -15524
- package/dist/es/event-CtX9rswE.js +0 -1
- package/dist/es/fileFormatConversion.ts-tUlewYon.js +0 -1
- package/dist/es/formatTimeUtils.ts-CkdWJ_Sl.js +0 -1
- package/dist/es/useClickOutSide.tsx-CMvd2uTW.js +0 -1
- package/dist/es/useCountdown.tsx-Btzj-keH.js +0 -1
- package/dist/es/useEventListener.tsx-BBGVcI5T.js +0 -1
- package/dist/es/useGetElementSize.tsx-Dtshth0Y.js +0 -1
- package/dist/es/useKeyPress.tsx-Db44HXXz.js +0 -1
- package/dist/es/useMouseClick.tsx-C7uAH4n4.js +0 -1
- package/dist/es/useTheme.tsx-C5b7BRYz.js +0 -1
- package/dist/es/useThemePro.tsx-DQuSI8J7.js +0 -1
- package/dist/es/viewTransitionUtils.ts-CHa9uBpi.js +0 -1
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from "./dependencies-CbQbPZZ-.js";import{u as e}from "./useGetElementSize.tsx-Dtshth0Y.js";import{p as i}from "./common.ts-BbDnZ7vC.js";import{useState as o,useRef as r,useMemo as n,useEffect as s,cloneElement as l}from "react";var a=((t2)=>(t2.Horizontal="Horizontal",t2.Vertical="Vertical",t2))(a||{});const c=({list:c2,style:d,disable:f,children:m,sliderBox:u,className:p,sliderStyle:h,duration:x=300,sliderClassName:w,currentIndex:y=0,direction:j=a.Horizontal,sliderTransitionTimingFunction:z="ease-in-out"})=>{const [g,H]=o(false),[T,$]=o(0),[v,A]=o({t:0,l:0}),[C,N]=o({w:0,h:0}),b=r(null),B=r(null),S=n(()=>["width","height","transform"].map((t2)=>`${t2}${x/1e3}s ${z}`).join(","),[j,x,z]),k=n(()=>({width:C.w,height:C.h,transition:g ? S:"initial",transform:`translate(${v.l}px,${v.t}px)`}),[C,v]),{w:D,h:E}=e();return s(()=>{$(y);},[y]),s(()=>{(()=>{if("number"!=typeof T)return;if(!b.current||!B.current)return;const t2=Array.from(b.current.children).slice(1);t2.forEach((t3)=>{t3.style.position="relative",t3.style.cursor=f ? "not-allowed":"pointer",t3.style.zIndex="1";});const e2=window.getComputedStyle(b.current),o2={t:"Horizontal"===j ? i(e2.paddingTop):t2[T].offsetTop,l:"Horizontal"===j ? t2[T].offsetLeft:i(e2.paddingLeft)};A(o2),N({w:t2[T].offsetWidth,h:t2[T].offsetHeight}),setTimeout(()=>H(true),x);})();},[T,D,E,f]),t.jsxs("ul",{ref:b,className:["ono-auto-slider-list-container",p,f ? "ono-auto-slider-list-is-disable":""].filter(Boolean).join(" "),style:{flexDirection:"Horizontal"===j ? "row":"column",...d},children:[t.jsx("li",{ref:B,className:["ono-auto-slider-list-slider",w].filter(Boolean).join(" "),style:{...h,...k},children:u}),c2.map((t2,e2)=>l(m({item:t2,index:e2,isActive:e2===T}),{onClick:(i2)=>{if(f)return;const o2=m({item:t2,index:e2,isActive:e2===T}).props.onClick;o2&&o2(i2),$(e2);}}))]});};export{c as A,a as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from "./dependencies-CbQbPZZ-.js";import{useState as e,useRef as a,useEffect as n}from "react";const r=({imageFile:r2,cvsW:l2=520,maskBG:s="rgba(0,0,0,0.5)",border:i="4px solid #fff",wheelScale:o=0.1,setCtx:c,maskInfo:w,setMaskInfo:h,imageStartState:g,setImageStartState:d,imageState:m,setImageState:u})=>{const [f,x]=e(),[p,b]=e({w:0,h:0}),[S,v]=e({w:0,h:0}),[I,y]=e({x:0,y:0}),[j,M]=e(false),k=a(null),C=a(null),R=(t2,e2)=>{e2((e3)=>({...e3,...t2}));},B=()=>{const t2=i.split(" ");let e2=0;return t2.forEach((t3)=>{t3.includes("px")&&(e2=Number(t3.split("px")[0]));}),e2;},D=()=>{M(false),m.l>w.l&&R({l:w.l},u),m.t>w.l&&R({t:w.l},u),-m.l>m.w-w.l-w.w&&R({l:-(m.w-w.l-w.w)},u),-m.t>m.h-w.l-w.w&&R({t:-(m.h-w.l-w.w)},u);};return n(()=>{(()=>{if(!k.current)return;const{width:t2}=k.current.getBoundingClientRect();((t3)=>{const e2=new Image();e2.src="string"==typeof r2 ? r2:URL.createObjectURL(r2),e2.onload=()=>{var _a;let a2=1,n2=e2.width,r3=e2.height;n2>r3 ?(a2=n2/t3,n2=t3,r3/=a2,R({w:r3},h)):(a2=r3/t3,r3=t3,n2/=a2,R({w:n2},h));const l3=(t3-n2)/2,s2=(t3-r3)/2;R({w:e2.width,h:e2.height},v),x(e2),R({w:n2,h:r3,t:s2,l:l3},u),d({w:n2,h:r3,t:s2,l:l3}),R(l3>s2 ?{l:l3}:{l:s2},h),c((_a=C.current)==null ? void 0:_a.getContext("2d"));};})(t2),b({w:t2,h:t2});})();},[k]),n(()=>{if(!C.current||!f)return;const t2=C.current.getContext("2d");t2&&(t2.clearRect(0,0,C.current.width,C.current.height),t2.drawImage(f,m.l,m.t,m.w,m.h));},[C,f,m]),t.jsxs("div",{ref:k,className:"ono-avatar-canvas",style:{width:l2,cursor:j ? "grabbing":"grab"},onWheel:(t2)=>{t2.preventDefault(),t2.stopPropagation();const e2=t2.deltaY<0 ? "in":"out",a2=((t3,e3)=>{let a3=t3+("in"===e3 ? t3*o:-t3*o);return a3>S.w&&(a3=S.w),a3<g.w&&(a3=g.w),a3;})(m.w,e2),n2=a2/S.w;R({w:a2,h:S.h*n2},u),D();},onMouseUp:D,onMouseLeave:D,children:[t.jsx("canvas",{width:p.w,height:p.h,ref:C,onMouseDown:(t2)=>{R({x:t2.clientX,y:t2.clientY},y),M(true);},onMouseMove:(t2)=>{if(j){const e2=t2.clientX-I.x,a2=t2.clientY-I.y;(Math.abs(e2)>10||Math.abs(a2)>10)&&(R({t:m.t+a2,l:m.l+e2},u),R({x:t2.clientX,y:t2.clientY},y));}}}),f&&t.jsx("div",{className:"ono-avatar-mask",children:t.jsx("div",{style:{border:i,boxShadow:`${s}0 0 0 10000px`,width:`${w.w+2*B()}px`,height:`${w.w+2*B()}px`}})})]});},l=({imageFile:a2,cvsW:n2=520,maskBG:l2="rgba(0,0,0,0.5)",border:s="4px solid #fff",wheelScale:i=0.1,children:o})=>{const [c,w]=e({w:0,h:0,t:0,l:0}),[h,g]=e({w:0,h:0,t:0,l:0}),[d,m]=e({w:0,l:0}),[u,f]=e();return t.jsxs(t.Fragment,{children:[t.jsx(r,{imageFile:a2,cvsW:n2,maskBG:l2,border:s,wheelScale:i,maskInfo:d,setMaskInfo:m,setCtx:f,imageStartState:c,setImageStartState:w,imageState:h,setImageState:g}),o==null ? void 0:o({handleConfirm:(t2,e2)=>{if(!u)return;const a3=u.getImageData(d.l,d.l,d.w,d.w),n3=document.createElement("canvas"),r2=n3.getContext("2d");if(n3.width=d.w,n3.height=d.w,!r2)return;const{imageSaveType:l3="png",dataSaveType:s2="base64",quality:i2=100}=e2||{};r2.putImageData(a3,0,0,0,0,d.w,d.w),"base64"===s2 ? t2(n3.toDataURL(`image/${l3}`,i2/100)):"blob"===s2&&n3.toBlob((e3)=>{if(e3)return t2(e3);},`image/${l3}`,i2/100);},handleReduction:(t2)=>{g({w:c.w,h:c.h,t:c.t,l:c.l}),t2==null ? void 0:t2();}})]});};export{l as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from "./dependencies-CbQbPZZ-.js";import{t as o}from "./common.ts-BbDnZ7vC.js";import{forwardRef as t,useState as e,useRef as i,useEffect as r}from "react";const s=t(({onClick:t2,children:s2,disabled:c,loading:a,plain:l,shape:d="default",htmlType:u="button",type:p="primary",throttleDuration:m,className:f,style:h,icon:g},b)=>{const [j,y]=e(false),x=i(null),C=i(null),v=t2 ? o(t2,m ? "number"==typeof m ? m:500:0):void 0;return r(()=>{(()=>{if(!C.current)return;const n2=C.current;a ?(y(true),n2.classList.add("ono-loading-start")):(setTimeout(()=>{y(false);},300),n2.classList.remove("ono-loading-start"),n2.classList.add("ono-loading-end"));})();},[a,C]),r(()=>{(()=>{if(!x.current)return;const n2=x.current,o2=n2.getBoundingClientRect();n2.style.setProperty("--btn-height",o2.height+"px");})();},[x]),r(()=>{b&&x&&("function"==typeof b ? b(x.current):b.current=x.current);},[b,x]),n.jsxs("button",{ref:x,className:[`ono-btn-${p}`,a||j ? "ono-is-loading":"",a||g ? "ono-is-icon":"",c ? "ono-btn-is-disabled":"","round"===d ? "ono-is-round":"circle"===d ? "ono-is-circle":"",l ? "ono-is-plain":"",f ?? ""].filter(Boolean).join(" "),type:u,disabled:("function"==typeof c ? c():c)||!!a,style:h,onClick:v,children:[(()=>{const o2=n.jsx("span",{ref:C,className:"ono-btn-icon",children:n.jsx("span",{children:"object"==typeof a ? a.icon:n.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:n.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 a||j ? o2:g ? n.jsx("span",{children:g}):n.jsx(n.Fragment,{});})(),s2]});});export{s as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as r,useRef as t,useEffect as s}from "react";const o=({src:o2,children:n,enlarge:c=false,scale:a=1.1,shadow:d,xRange:l=[-10,10],yRange:i=[-10,10],borderRadius:u=20})=>{const [y,f]=r(false),p=t(null),g=(e2,r2,t2)=>r2/t2*(e2[1]-e2[0])+e2[0];return s(()=>{p.current&&d&&p.current.style.setProperty("--sd",d);},[p.current]),s(()=>{if(!n&&!o2)throw new Error("请传入children或者src属性");},[n,o2]),e.jsx("div",{ref:p,className:"ono-card",style:{borderRadius:u,transform:`perspective(500px)scale(${y&&c ? a:1})rotateX(var(--rx,0deg))rotateY(var(--ry,0deg))`},onMouseEnter:()=>f(true),onMouseMove:(e2)=>{const{offsetX:r2,offsetY:t2}=e2.nativeEvent,{offsetWidth:s2,offsetHeight:o3}=p.current,n2=g(l,t2,o3),c2=-g(i,r2,s2);p.current.style.setProperty("--rx",`${n2}deg`),p.current.style.setProperty("--ry",`${c2}deg`);},onMouseLeave:()=>{f(false),p.current.style.setProperty("--rx","0deg"),p.current.style.setProperty("--ry","0deg");},children:n ?? e.jsx("img",{src:o2,alt:"图片"})});};export{o as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as r,useRef as t,useEffect as n}from "react";const o=({id:o2,style:c,checked:l,onChange:a,className:i,indeterminate:s=false,checkedColor:d="#0077cc",indeterminateStyle:m="line",indeterminateColor:u="#0077cc"})=>{const [h,p]=r(""),y=t(null),C=[{value:d,name:"checkedColor"},{value:u,name:"indeterminateColor"}];return n(()=>{(()=>{if(!y.current)return;const e2=getComputedStyle(y.current);h||p(e2.borderColor),y.current.style.height=e2.width,[{value:e2.width,name:"w"},{value:l||s ? d:h,name:"border-color"},...C].forEach(({value:e3,name:r2})=>{e3&&((e4,r3,t2)=>{"string"==typeof e4 ? t2.style.setProperty(`--${r3}`,e4):t2.style.setProperty(`--${r3}`,`${e4}px`);})(e3,r2,y.current);});})(),y.current&&(y.current.indeterminate=s);},[y,i,c,s]),e.jsx("input",{id:o2,type:"checkbox",ref:y,checked:l,onChange:a,className:[i,"line"===m ? "ono-checkbox-line":"ono-checkbox-border"].filter(Boolean).join(" "),style:c});};export{o as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,R as o}from "./dependencies-CbQbPZZ-.js";import{u as n}from "./useEventListener.tsx-BBGVcI5T.js";let s,t=null;const l=({className:o2,content:s2,style:l2,onClick:u2,onDoubleClick:i2,onContextMenu:c,onMouseDown:r,onMouseUp:a,onMouseEnter:M,onMouseLeave:d,onMouseMove:m,isClickBoxToClose:p})=>(n("click",()=>{p&&t&&(t.remove(),t=null);}),e.jsx("div",{className:o2,style:l2,onClick:u2,onDoubleClick:i2,onContextMenu:c,onMouseDown:r,onMouseUp:a,onMouseEnter:M,onMouseLeave:d,onMouseMove:m,children:"function"==typeof s2 ? s2((e2)=>{t&&(t.remove(),t=null,e2&&e2());}):s2})),u=(o2)=>(i(o2.isSingle||false).render(e.jsx(l,{...o2})),t),i=(e2)=>(e2&&t&&s||(t=document.createElement("div"),document.body.appendChild(t),s=o.createRoot(t)),s);export{u as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as o,useRef as t,useEffect as n}from "react";import{u as a}from "./useKeyPress.tsx-Db44HXXz.js";const s=()=>e.jsx("svg",{className:"ono-input-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",fill:"currentColor","aria-hidden":"true",children:e.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"})}),r=({open:o2})=>e.jsx("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":o2 ? "eye":"eye-invisible",fill:"currentColor","aria-hidden":"true",className:"ono-input-icon",children:o2 ? e.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"}):e.jsxs(e.Fragment,{children:[e.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"}),e.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"})]})}),l=({id:a2,name:l2,max:i2,min:c,maxLength:d,minLength:u,type:p="text",className:m,defaultValue:h,placeholder:x,readonly:f,autocomplete:y="off",autofocus:g,form:v,disabled:b,clearable:C,showPassword:j,prepend:w,append:N,prefix:L,suffix:z,showCount:S,border:B="1px solid #5644b8",boxShadow:M="0 0 0 2px #7969d11a",value:P="",onChange:k,onFocus:F,onBlur:E,onClear:O})=>{const [q,D]=o(P),[Q,R]=o(false),[Y,V]=o(false),W=t(null),$=C&&!b&&q,A=j&&!b;return n(()=>{W.current&&(W.current.style.setProperty("--ono-input-border",B),W.current.style.setProperty("--ono-input-box-shadow",M));},[W]),n(()=>{D(P);},[P]),e.jsxs("div",{className:["ono-input","ono-input-border",b ? "ono-input-is-disabled":""].filter(Boolean).join(" "),children:[w&&e.jsx("div",{className:"ono-prepend",children:w}),e.jsxs("div",{ref:W,className:["ono-input-wrapper",Q ? "ono-input-is-focus":"",m].filter(Boolean).join(" "),onMouseDown:(e2)=>{"INPUT"!==e2.target.tagName&&e2.preventDefault();},children:[L&&e.jsx("span",{className:"ono-prefix",children:L}),e.jsx("input",{id:a2,max:i2,min:c,name:l2,maxLength:d,minLength:u,defaultValue:h,className:"ono-input-inner",type:j ? Y ? "text":"password":p,placeholder:x,readOnly:f,autoComplete:y,autoFocus:g,form:v,disabled:b,onFocus:(e2)=>{F==null ? void 0:F(e2),R(true);},onBlur:(e2)=>{E==null ? void 0:E(e2),R(false);},value:q,onChange:(e2)=>{k==null ? void 0:k(e2),D(e2.target.value);}}),(z||$||A||S)&&e.jsxs("span",{className:"ono-suffix",children:[z,$&&e.jsx("button",{className:"ono-clear-icon",onClick:()=>{O==null ? void 0:O(),D("");},children:e.jsx(s,{})}),A&&e.jsx("button",{className:"ono-eye-icon",onClick:()=>V(!Y),children:e.jsx(r,{open:Y})}),S&&d&&e.jsxs("p",{className:"ono-count",children:[q.length,"/",d]})]})]}),N&&e.jsx("div",{className:"ono-append",children:N})]});},i=({id:s2,name:r2,rows:l2,maxLength:i2,minLength:c,className:d,placeholder:u,readonly:p,resize:m=true,autocomplete:h="off",autofocus:x,form:f,disabled:y,autoSize:g,showCount:v,border:b="1px solid #5644b8",boxShadow:C="0 0 0 2px #7969d11a",value:j="",onChange:w})=>{const [N,L]=o(j),[z,S]=o(false),[B,M]=o([j]),[P,k]=o(0),F=t(null),E=(e2)=>{const o2=B.slice(0,P+1);o2.push(e2),M(o2),k(o2.length-1);},O=[{key:"CommandOrControl+z",handler:(e2)=>{document.activeElement===F.current&&(e2.preventDefault(),(()=>{if(P>0&&F.current){const e3=P-1,o2=B[e3];if(F.current.value=o2,L(o2),k(e3),w){const e4={target:F.current};w(e4);}}})());},deps:[B]},{key:"CommandOrControl+d",handler:(e2)=>{if(F.current&&document.activeElement===F.current){e2.preventDefault();const o2=((e3)=>{const{value:o3,selectionStart:t2,selectionEnd:n2}=e3,a2=o3.substring(0,t2)+o3.substring(n2);return e3.value=a2,e3.setSelectionRange(t2,t2),a2;})(F.current);if(L(o2),E(o2),w){const e3={target:F.current};w(e3);}}},deps:[B]}];return O.forEach(({key:e2,handler:o2,deps:t2})=>a(e2,o2,{target:F.current,deps:t2})),n(()=>{L(j);},[j]),n(()=>{(()=>{if(!F.current)return;const e2=F.current;((e3,o2,t2,n2,a2)=>{const s3=e3.parentNode;e3.style.resize=o2 ? "none":t2 ? "vertical":"none",s3.style.setProperty("--ono-input-border",n2),s3.style.setProperty("--ono-input-box-shadow",a2),s3.style.setProperty("--ono-input-height","auto");})(e2,g||false,m,b,C),g&&((e3,o2)=>{const{minRows:t2=2,maxRows:n2}="object"==typeof o2 ? o2:{},a2=document.createElement("div");a2.style.position="absolute",a2.style.visibility="hidden",a2.style.whiteSpace="pre-wrap",a2.style.wordWrap="break-word",a2.style.width=`${e3.clientWidth}px`,a2.style.font=getComputedStyle(e3).font,a2.style.padding=getComputedStyle(e3).padding,a2.style.border=getComputedStyle(e3).border,a2.style.boxSizing="border-box",document.body.appendChild(a2);const s3=34*t2;let r3=s3;if(e3.value){a2.textContent=e3.value;const o3=a2.offsetHeight;r3=Math.max(s3,o3),n2&&r3>34*n2 ?(r3=34*n2,e3.style.overflowY="auto"):e3.style.overflowY="hidden";}else e3.style.overflowY="hidden";e3.style.height=`${r3}px`,e3.style.resize=o2 ? "none":"vertical",document.body.removeChild(a2),Math.floor(r3/34);})(e2,g);})();},[F,g,N]),e.jsxs("div",{className:["ono-textarea",y ? "ono-input-is-disabled":""].filter(Boolean).join(" "),children:[e.jsx("div",{className:["ono-textarea-wrapper",z ? "none"===b ? "":"ono-input-is-focus":"",d].filter(Boolean).join(" "),onClick:()=>{var _a;return(_a=F.current)==null ? void 0:_a.focus();},children:e.jsx("textarea",{ref:F,className:"ono-textarea-inner",id:s2,rows:l2,name:r2,maxLength:i2,minLength:c,placeholder:u,readOnly:p,autoComplete:h,autoFocus:x,form:f,disabled:y,onFocus:()=>S(true),onBlur:()=>S(false),value:N,onChange:(e2)=>{L(e2.target.value),E(e2.target.value),w==null ? void 0:w(e2);}})}),v&&i2&&e.jsx("p",{className:"ono-count-bar",onClick:(e2)=>e2.stopPropagation(),children:N.length+"/"+i2})]});};export{l as O,i as a};
|
package/dist/es/List-UAKCMuGC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e,useEffect as t}from "react";const n=({list:n2,children:r2,fallback:s,deps:l=[],insertBetweenDom:o})=>{const [c,a]=e([]);return t(()=>{(async()=>{if(!n2)return;a(s);const e2="function"==typeof n2 ? await n2():n2;a(e2.length>0 ?((e3,t2)=>t2 ? e3.reduce((n3,r3,s2)=>(n3.push(r3),s2<e3.length-1&&n3.push(t2(s2)),n3),[]):e3)(((e3)=>e3.map(r2).filter((e4)=>e4))(e2),o):s);})();},[...l]),c;},r=({list:e2,children:t2,fallback:n2,insertBetweenDom:r2})=>(()=>{const s="function"==typeof e2 ? e2():e2;return s.length>0 ?((e3,t3)=>t3 ? e3.reduce((n3,r3,s2)=>(n3.push(r3),s2<e3.length-1&&n3.push(t3(s2)),n3),[]):e3)(((e3)=>e3.map(t2).filter(Boolean))(s),r2):n2;})();export{n as A,r as L};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from "./dependencies-CbQbPZZ-.js";import{useState as e,useEffect as r}from "react";const a=({active:a2,onchange:n,w:s="40px",duration:o=400,clr:i="#f5f5f5",bgc:l="#342A7C"})=>{const [d,c]=e(false),h=(t2,e2)=>{let r2;const a3=t2.split("");return "x"===a3[a3.length-1]&&(r2=Number(a3.slice(0,-2).join(""))*e2+"px"),r2;},m={width:h(s,0.6),height:h(s,0.06),left:h(s,d ? 0.11:0.2),borderRadius:h(s,1),background:i,transition:`all ${o/1e3}s`},u=[{...m,width:h(s,d ? 0.8:0.5),height:h(s,d ? 0.05:0.06),transform:d ? "translateY(0)rotate(45deg)":`translateY(-${h(s,0.22)})`},{...m,width:h(s,d ? 0.8:0.3),height:h(s,d ? 0.05:0.06),transform:d ? "translateY(0)rotate(315deg)":`translateY(${h(s,0.22)})`},{...m,left:"auto",transform:d ? `translateX(${h(s,1.1)})`:"translateX(0)"}];return r(()=>{c(!!a2);},[a2]),t.jsx("button",{className:"ono-menu-button",style:{width:s,height:s,background:l,borderRadius:h(s,0.2)},onClick:()=>requestAnimationFrame(()=>{n==null ? void 0:n(!d),c(!d);}),children:u.map((e2,r2)=>t.jsx("span",{style:{...e2}},r2))});};export{a as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as s,useRef as o,useMemo as t,useCallback as n,useEffect as r}from "react";import{p as a}from "./PortalRenderer-CDAzQJgm.js";let i=1;const c=[],l=(e2,s2,o2)=>(0===c.length&&(i=1),p(s2.instancesKey||"",e2,{id:`${o2}-${i++}`,key:s2.instancesKey||"",reactNode:e2,props:s2,offsetOptions:{topOffset:0,height:0,bottomOffset:0}}),c),d=(e2)=>{const s2=c.findIndex((s3)=>s3.id===e2);return s2<=0 ? 0:c[s2-1].offsetOptions.bottomOffset;},p=(e2,s2,o2)=>{const t2=(e3)=>a(s2,{zIndex:999+i-1,...e3.props,id:e3.id},e3.id,"ono-message-root");if(!e2){const e3=t2(o2);c.push({...o2,props:{...o2.props,id:o2.id,destroy:e3},destroy:e3});}let n2=false;const r2=c.map((s3)=>{if(s3.key===e2){n2=true;const e3={...s3.props,...o2.props};return{...s3,props:e3};}{const e3=t2(s3);return{...s3,props:{...s3.props,id:s3.id,destroy:e3},destroy:e3};}});if(Object.assign(c,r2),!n2){const e3=t2(o2);c.push({...o2,props:{...o2.props,id:o2.id,destroy:e3},destroy:e3});}},f={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"}},u=(e2,s2)=>f[e2][s2],m=(s2)=>{switch(s2){case "success":return e.jsx("svg",{className:"ono-type-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",fill:u(s2,"light"),"aria-hidden":"true",children:e.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 e.jsx("svg",{className:"ono-type-icon",viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",fill:u(s2,"light"),"aria-hidden":"true",children:e.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 e.jsx("svg",{className:["ono-info-icon","ono-loading"].join(" "),viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",fill:u(s2,"light"),"aria-hidden":"true",children:e.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 e.jsx("svg",{className:"ono-info-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"exclamation-circle",fill:u(s2,"light"),"aria-hidden":"true",children:e.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"})});}},g=({handleDestroy:s2})=>e.jsx("button",{onClick:s2,children:e.jsx("svg",{className:"ono-clear-icon",viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",fill:"currentColor","aria-hidden":"true",children:e.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"})})}),h=({id:a2,instancesKey:i2,duration:l2=3e3,speed:p2=300,offset:f2=20,message:u2,type:h2,plain:y2=true,showClose:x2=false,zIndex:j,onClose:v=()=>{},destroy:C})=>{const [,w]=s(false),[z,k]=s(0),[L,O]=s(((e2)=>{const s2=c.findIndex((s3)=>s3.id===e2);return s2<=0 ? 0:c[s2-1].offsetOptions.topOffset;})(a2)),[b,B]=s({duration:l2,speed:p2,message:u2,type:h2,showClose:x2,onClose:v}),I=o(null),M=o(null),N=o(null),$=L+z,K=t(()=>({transform:`translate(-50%,${L}px)`,transition:`transform ${p2}ms ease-in-out`,zIndex:j}),[L,p2]),S=()=>{N.current&&(N.current.classList.remove("ono-message-enter"),N.current.classList.add("ono-message-leave"),N.current.style.transform=`translate(-50%,${d(a2)-z}px)`,((e2)=>{const s2=c.findIndex((s3)=>s3.id===e2);-1!==s2&&c.splice(s2,1);})(a2),setTimeout(()=>C(b.onClose),p2));},T=(e2,s2,o2)=>{"loading"!==e2&&(I.current=setTimeout(S,s2-o2));},D=()=>{const e2=d(a2);w((s2)=>(s2&&O(e2+f2),true)),requestAnimationFrame(D);},F=n(()=>{if("loading"===b.type){if(M.current)return;M.current=setTimeout(()=>{var _a;M.current=null;const e2=(s2=i2||"")?(_a=c.find((e3)=>e3.key===s2))==null ? void 0:_a.props:null;var s2;e2&&(((e3)=>{B((s3)=>({...s3,...e3}));})({...e2}),T(b.type,e2.duration||b.duration,e2.speed||b.speed),F());},100);}},[b]);return r(()=>{T(b.type,b.duration,b.speed),D(),F();},[b.type,b.duration,b.speed]),r(()=>{(()=>{if(!N.current)return;const{height:e2}=N.current.getBoundingClientRect();N.current.style.setProperty("--speed",`${b.speed}ms`),k(e2);})();},[N]),r(()=>{((e2,s2)=>{const o2=c.findIndex((s3)=>s3.id===e2);o2<0||(c[o2].offsetOptions=s2);})(a2,{topOffset:L,height:z,bottomOffset:$});},[$]),e.jsx("div",{ref:N,className:["ono-message",`ono-message-${b.type}`,"ono-message-enter",y2 ? "":"ono-message-color"].filter(Boolean).join(" "),style:K,onMouseEnter:()=>{I.current&&(clearTimeout(I.current),I.current=null);},onMouseLeave:()=>T(b.type,b.duration,b.speed),children:"function"==typeof b.message ? b.message(m(b.type),b.showClose&&e.jsx(g,{handleDestroy:S})):e.jsxs(e.Fragment,{children:[m(b.type),e.jsx("div",{children:b.message}),b.showClose&&e.jsx(g,{handleDestroy:S})]})});},y=(e2)=>{if("string"==typeof e2)return{message:e2};{const s2={...e2,instancesKey:e2.key};return delete s2.key,{...s2};}},x={info:(e2)=>{l(h,{...y(e2),type:"info"},"ono-message");},success:(e2)=>{l(h,{...y(e2),type:"success"},"ono-message");},warning:(e2)=>{l(h,{...y(e2),type:"warning"},"ono-message");},error:(e2)=>{l(h,{...y(e2),type:"error"},"ono-message");},loading:(e2)=>{l(h,{...y(e2),type:"loading"},"ono-message");}};export{x as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from "./dependencies-CbQbPZZ-.js";import{a as e}from "./colorUtils.ts-DYuRvCXZ.js";import{useState as n,useRef as l,useEffect as a}from "react";import{p as t}from "./PortalRenderer-CDAzQJgm.js";import{B as r}from "./Button-QIC7QPK9.js";const s=({title:t2="This is a modal title",icon:s2,content:i2="This is a modal content",okText:c="confirm",cancelText:d="cancel",confirmDisabled:m,cancelDisabled:h,position:x,onConfirm:b,onCancel:f,mask:u=true,maskClosable:p=false,width:j,btnClr:C,footer:v=({OkBtn:e2,CancelBtn:n2})=>o.jsxs(o.Fragment,{children:[o.jsx(n2,{}),o.jsx(e2,{})]}),modalBody:y,destroy:B})=>{const [g,w]=n(false),k=l(null),N=l(null),P=[{label:"themeColor",value:C||""},{label:"themeHoverColor",value:C&&e(C,"light",10)||""},{label:"themeActiveColor",value:C&&e(C,"dark",20)||""},{label:"themeDisabledClr",value:C&&e(C,"light",20)||""}],T=()=>{if(x){if(!N.current)return;N.current.classList.remove("ono-modal-enter"),N.current.classList.add("ono-modal-leave"),setTimeout(()=>{B();},300);}else B();};return a(()=>(k.current&&(u ? k.current.showModal():k.current.show()),()=>{k.current&&k.current.close();}),[k.current,u]),a(()=>{(()=>{if(!N.current)return;const o2=N.current.style;j&&o2.setProperty("--width",j+"px"),x&&(o2.setProperty("--left",(x.x/window.innerWidth*100).toFixed(2)+"%"),o2.setProperty("--top",(x.y/window.innerHeight*100).toFixed(2)+"%")),C&&P.forEach((e2)=>o2.setProperty(`--${e2.label}`,e2.value));})();},[N]),o.jsx("dialog",{ref:k,className:"ono-modal",onClick:()=>p&&T(),children:y ? y(T):o.jsxs("div",{ref:N,className:["ono-modal-box",x ? "ono-modal-enter":""].join(" "),onClick:(o2)=>o2.stopPropagation(),children:[o.jsxs("div",{className:"ono-modal-box-body",children:[s2 ?? 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:t2}),o.jsx("p",{className:"ono-modal-box-body-contentBar-content",children:i2})]})]}),v&&o.jsx("div",{className:"ono-modal-box-footer",children:v({OkBtn:()=>o.jsx(r,{className:"ono-modal-box-footer-confirmBtn",loading:g,disabled:m,onClick:async()=>{w(true);try{const o2=b==null ? void 0:b();o2 instanceof Promise&&await o2;}finally{w(false),T();}},children:c ?? "Confirm"}),CancelBtn:()=>o.jsx(r,{className:"ono-modal-box-footer-cancelBtn",disabled:h||g,onClick:()=>{f==null ? void 0:f(),T();},children:d ?? "Cancel"}),handleClose:()=>T()})})]})});},i=(o2)=>t(s,o2,"ono-modal");export{i as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from "./dependencies-CbQbPZZ-.js";const a=({firstBtn:a2,lastBtn:i,currentPage:o,total:e,prevBtn:t,nextBtn:s,styles:l,className:c,children:r,onChange:p,pageBtnClassName:g,pageBtnActiveClassName:d,hiddenNextBtnOnLastPage:h,hiddenPrevBtnOnFirstPage:m})=>{const b=Math.max(1,Math.min(o,e));return n.jsxs("ul",{className:`ono-pagination ${c}`,style:l,children:[a2&&n.jsx("li",{className:a2 ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>p(1),children:a2}),m&&1===o ? null:n.jsx("li",{className:"ono-pagination-base",style:{cursor:1!==o ? "pointer":"no-drop"},onClick:()=>{o<=1||p(o-1);},children:t ? "function"==typeof t ? t(1!==o):t:n.jsx("div",{className:t ? "ono-pagination-base":"ono-pagination-btn",children:"prevBtn"})}),(()=>{const a3=Array.from({length:e},(a4,i3)=>n.jsx("li",{className:"ono-pagination-base",onClick:()=>p(i3+1),children:r ? r({page:i3+1,isActive:o===i3+1}):n.jsx("div",{className:`ono-pagination-base ${g ?? "ono-pagination-btn"}${b===i3+1 ? d ?? "ono-pagination-btn-active":""}`,children:i3+1})},i3+1));if(a3.length<=7)return a3;const i2=e-1,t2=b,s2=t2>=e-2;return t2<=3 ? [...a3.slice(0,3===t2 ? 4:3),"...",a3[i2]]:s2 ? [a3[0],"...",...a3.slice(t2===e-2 ?-4:-3)]:[a3[0],"...",...a3.slice(t2-2,t2+1),"...",a3[i2]];})(),h&&o===e ? null:n.jsx("li",{className:"ono-pagination-base",style:{cursor:o!==e ? "pointer":"no-drop"},onClick:()=>{p(o>=e ? e:o+1);},children:s ? "function"==typeof s ? s(o!==e):s:n.jsx("div",{className:s ? "ono-pagination-base":"ono-pagination-btn",children:"nextBtn"})}),i&&n.jsx("li",{className:i ? "ono-pagination-base":"ono-pagination-btn",onClick:()=>p(e),children:i})]});};export{a as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,R as t}from "./dependencies-CbQbPZZ-.js";const n=(n2,d,o,r)=>{const{target:a,root:c}=((e2,t2)=>{let n3=null,d2=null;return t2&&(n3=document.getElementById(t2),n3||(n3=document.createElement("div"),n3.id=t2,document.body.appendChild(n3))),e2 ?(d2=document.getElementById(e2),d2||(d2=document.createElement("div"),d2.id=e2,n3 ? n3.appendChild(d2):document.body.appendChild(d2))):(d2=document.createElement("div"),n3 ? n3.appendChild(d2):document.body.appendChild(d2)),{target:d2,root:n3};})(o,r),m=(e2)=>{var _a;"function"==typeof e2&&e2(),o ?(_a=document.getElementById(o))==null ? void 0:_a.remove():a.remove(),requestAnimationFrame(()=>c&&0===c.children.length&&c.remove());};if(void 0!==a.__reactContainer$)a.__reactContainer$.render(e.jsx(n2,{...{...d,destroy:m}}));else{const o2=t.createRoot(a);a.__reactContainer$=o2,o2.render(e.jsx(n2,{...{...d,destroy:m}}));}return m;};export{n as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as r,useRef as o,useEffect as a}from "react";const n=({name:n2,value:l2,style:c,checked:d,onChange:s,children:t,className:i,radioW:u=16,radioGap:h=4,checkedColor:m="#532ce1",unCheckedColor:p="transparent",disabled:C=false})=>{const [v,k]=r(""),f=o(null),y=o(null),b=o(null),j=[{value:u,name:"w"},{value:h,name:"gap"},{value:m,name:"checkedColor"},{value:p,name:"unCheckedColor"}];return a(()=>{(()=>{if(!b.current||!y.current)return;j.forEach(({value:e3,name:r2})=>{e3&&((e4,r3,o2)=>{const a2="number"==typeof e4;o2.style.setProperty(`--${r3}`,a2 ? `${e4}px`:e4);})(e3,r2,y.current);});const e2=getComputedStyle(b.current);v||k(e2.borderColor),b.current.style.borderColor=d ? m:v;})();},[y,b,d,v]),e.jsxs("div",{ref:y,className:["ono-radio-box",i].join(" "),style:c,children:[e.jsx("div",{ref:b,className:"ono-radio",onClick:()=>{var _a;return(_a=f.current)==null ? void 0:_a.click();},children:e.jsx("input",{type:"radio",name:n2,ref:f,value:l2+"",checked:d,disabled:C,id:l2+""+t,onChange:s})}),t&&e.jsx("label",{htmlFor:l2+""+t||"",children:t})]});},l=({name:r2,style:o2,options:a2,onChange:l2,className:c,radioW:d=16,radioGap:s=4,labelPosition:t="right",checkedColor:i="#532ce1",unCheckedColor:u="transparent",value:h})=>e.jsx("div",{className:["ono-radio-group",c].join(" "),style:o2,children:a2.map(({label:o3,value:a3,disabled:c2})=>e.jsx(n,{name:r2,value:a3,radioW:d,radioGap:s,style:{flexDirection:"left"===t ? "row-reverse":"row"},checkedColor:i,unCheckedColor:u,onChange:()=>l2(a3),checked:h+""==a3+"",disabled:"function"==typeof c2 ? c2(h):c2||false,children:o3},o3))});export{n as R,l as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{forwardRef as t,useState as r,useRef as n,useEffect as l}from "react";const o=({children:t2,disabled:r2,className:n2,style:l2,onClick:o2})=>e.jsx("li",{className:["ono-scrollable-tab",n2].filter(Boolean).join(" "),style:l2,onClick:(e2)=>!r2&&(o2==null ? void 0:o2(e2)),children:t2}),s=t(({activeIndex:t2,children:s2,className:c,style:a,position:i="center",onChange:f},d)=>{const [h,u]=r(0),m=n(null);return l(()=>{const e2=m.current;if(!e2||h<0)return;const r2=e2.offsetWidth,n2=Array.from(e2.children);if(h>=n2.length)return;const l2=parseInt(((a==null ? void 0:a.gap)||getComputedStyle(e2).gap||"0").toString(),10)||0;let o2=0;switch(n2.slice(0,h+1).forEach((e3)=>o2+=e3.offsetWidth+l2),i){case "start":e2.scrollLeft=o2-n2[h].offsetWidth-l2;break;case "end":e2.scrollLeft=o2-r2;break;default:o2-=n2[h].offsetWidth/2+(t2!==n2.length-1 ? l2:0),e2.scrollLeft=o2-r2/2;}},[m,s2,t2,i]),l(()=>{u(t2||0);},[t2]),l(()=>{d&&("function"==typeof d ? d(m.current):d.current=m.current);},[d]),e.jsx("ul",{ref:m,className:["ono-scrollable-tabs",c].filter(Boolean).join(" "),style:a,onClick:(e2)=>{m.current&&Array.from(m.current.children).some((t3,r2)=>{if(t3.contains(e2.target))return u(r2),f==null ? void 0:f(r2),true;});},children:s2(o)});});export{s as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useState as o,useEffect as n}from "react";import{T as t}from "./Tooltip-CgttMIcX.js";import{O as l}from "./Input-DLOeg2pz.js";import{L as a}from "./List-UAKCMuGC.js";const i=({label:o2,value:n2,disabled:t2,onChange:l2,selectValue:a2,optionRender:i2,currentValue:s2,onChangeCursor:r2})=>e.jsx("button",{role:"option","aria-label":o2,disabled:t2,className:"ono-option-item",onClick:()=>l2==null ? void 0:l2(n2),onMouseEnter:()=>!t2&&(r2==null ? void 0:r2(o2)),children:i2 ? i2({label:o2,value:n2,disabled:t2},a2===o2):e.jsx("div",{className:["ono-option-item-content",s2===o2&&a2!==o2 ? "ono-option-item-content-active":"",a2===o2 ? "ono-option-item-content-selected":"",t2 ? "ono-option-item-content-disabled":""].filter(Boolean).join(" "),children:o2})}),s=({options:s2,defaultValue:c,placeholder:d,inputBorder:p,isShowArrow:m,disabled:u,clearable:f,selectClassName:h,optionsClassName:b,notFoundContent:j,optionRender:g,onClear:C,onChange:v,filterOption:x})=>{const [w,N]=o(""),[L,V]=o(""),[B,S]=o(""),[k,M]=o(false),[O,y]=o(false),[R,A]=o(""),E=(e2)=>{const o2=s2.find((o3)=>o3.value===e2);N(o2 ? o2.label:"");},F=(e2)=>{v==null ? void 0:v(e2),A(e2),E(e2);};return n(()=>{c&&E(c);},[c]),n(()=>{var _a;if(s2.length>0){if(c){const e2=s2.find((e3)=>e3.value===c);e2&&V(e2.label);}else e:for(let e2=0;e2<s2.length;e2++)if(true!==((_a=s2[e2])==null ? void 0:_a.disabled)){V(s2[0].label);break e;}}},[s2,c]),e.jsx(t,{sameWidth:true,trigger:"click",placement:"bottom",isShowArrow:m,className:["ono-option-container",b].filter(Boolean).join(" "),onOpenChange:(e2)=>{y(e2),x&&B&&!e2&&S("");},content:e.jsx(a,{list:x ? "function"==typeof x ? x(B,s2):s2.filter((e2)=>e2.label.toLocaleLowerCase().includes(B.toLocaleLowerCase())):s2,fallback:e.jsx("div",{className:"ono-option-item",children:e.jsx("div",{className:"ono-option-item-content-no-data",onClick:(e2)=>e2.stopPropagation(),children:j ?? "No Data"})}),children:(o2)=>e.jsx(i,{...o2,onChange:F,selectValue:w.toString(),currentValue:L.toString(),optionRender:g,onChangeCursor:V},o2.value)}),children:e.jsx("div",{className:"ono-select",onMouseEnter:()=>M(true),onMouseLeave:()=>M(false),children:e.jsx(l,{className:[x ? "":"ono-select-readonly",h].filter(Boolean).join(" "),border:p,disabled:u,placeholder:x&&R ? w.toString()||"":d,readonly:!x,value:x&&O ? B:w.toString(),clearable:k&&f,suffix:k&&f&&w||f&&B&&x ? e.jsx(e.Fragment,{}):e.jsx(r,{isVisible:O}),onClear:()=>{C==null ? void 0:C(),v==null ? void 0:v(""),A(""),N(""),S("");},onChange:(e2)=>S(e2.target.value)})})});},r=({isVisible:o2})=>e.jsx("svg",{className:["ono-select-arrow-down-icon",o2 ? "ono-select-arrow-down-active":""].filter(Boolean).join(" "),viewBox:"64 64 896 896",focusable:"false","data-icon":"down",fill:"currentColor","aria-hidden":"true",children:e.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{s as O};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useRef as r,useEffect as s}from "react";const a=({w:a2,h:n,src:t,clr:l,className:c,onClick:o})=>{const m=r(null),i=[{value:a2,name:"w"},{value:n,name:"h"},{value:l,name:"clr"}];return s(()=>{m.current&&i.forEach((e2)=>{var r2,s2,a3;e2.value&&(r2=e2.value,s2=e2.name,a3=m.current,"string"==typeof r2 ? a3.style.setProperty(`--${s2}`,r2):a3.style.setProperty(`--${s2}`,`${r2}px`));});},[m,l]),e.jsx("div",{ref:m,className:["ono-svg-img",c].join(" "),onClick:o,children:e.jsx("img",{src:t,alt:""})});};export{a as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{p as n}from "./common.ts-BbDnZ7vC.js";import{useRef as r,useEffect as c}from "react";const t=({id:t2,text:i,style:s,color:l,checked:o,onChange:a,name:d="",className:h,disabled:u=false})=>{const m=r(null),f=r(null),v=r(null),p=r(null),j=r(null),x=r(null),w=[{value:"string"==typeof l ? l:l==null ? void 0:l.active,name:"checkedClr"},{value:"string"==typeof l ? void 0:l==null ? void 0:l.inactive,name:"uncheckedClr"}];return c(()=>{(()=>{if(!f.current||!m.current)return;let e2=60,r2=32;if(h||s){const c2=getComputedStyle(f.current);e2=n(c2.width),r2=n(c2.height);}[...w,{value:e2,name:"w"},{value:r2,name:"h"}].forEach(({value:e3,name:n2})=>{e3&&((e4,n3,r3)=>{const c2="number"==typeof e4;r3.style.setProperty(`--${n3}`,c2 ? `${e4}px`:e4);})(e3,n2,m.current);}),requestAnimationFrame(()=>{p.current&&(p.current.style.transition="transform 0.3s");});})();},[f,m,p,h,s,l,i,j,x]),c(()=>{v.current&&(v.current.checked=o);},[v,o]),e.jsxs("div",{ref:m,className:["ono-switch",u ? "ono-switch-is-disabled":""].filter(Boolean).join(" "),children:[e.jsx("input",{id:t2,name:d,role:"switch",ref:v,type:"checkbox",checked:o,onChange:(e2)=>{u||(a==null ? void 0:a(e2.currentTarget.checked,e2));}}),e.jsx("div",{ref:f,className:["ono-switch-box",h||""].filter(Boolean).join(" "),style:s,onClick:()=>{var _a;return(_a=v.current)==null ? void 0:_a.click();},children:e.jsxs("div",{ref:p,className:"ono-switch-children-bar",children:[(i==null ? void 0:i.active)&&e.jsx("div",{ref:j,className:"ono-switch-children",children:i==null ? void 0:i.active}),e.jsx("div",{className:"ono-switch-slider"}),(i==null ? void 0:i.inactive)&&e.jsx("div",{ref:x,className:"ono-switch-children",children:i==null ? void 0:i.inactive})]})})]});};export{t as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{g as t}from "./common.ts-BbDnZ7vC.js";import{useState as o,useRef as n,useEffect as r,useCallback as s}from "react";const i=({children:i2,animation:a,className:l,duration:c=300,style:d,maskColor:m="rgba(0,0,0,0.5)",disableContextMenu:p,maskClickClose:u=true,dialogClose:y})=>{const [f,k]=o(false),g=n(null),x=()=>{if(g.current)if(k(true),a){const e2=g.current;e2.classList.remove(`ono-${a.type}-enter`),e2.classList.add(`ono-${a.type}-leave`),setTimeout(y,c);}else y();};r(()=>{(()=>{if(!a||!g.current)return;const e2=g.current.parentElement.style,o2=g.current.style;switch(e2.setProperty("--duration",c/1e3+"s"),a.type){case "zoom":{const{x:e3,y:n2}=t(a.element),r2=(e3/window.innerWidth*100).toFixed(2)+"%",s2=(n2/window.innerHeight*100).toFixed(2)+"%";o2.setProperty("--left",r2),o2.setProperty("--top",s2);break;}case "fade":{const e3="left-center"===a.direction ? "--left":"--top";o2.setProperty(e3,a.startPosition);break;}}})();},[g,a]);const C=s(()=>{if(!a)return "";const e2=`ono-${a.type}-enter`,t2=`ono-${a.type}-leave`;return f ? t2:e2;},[a,f]);return e.jsx("div",{className:` ono-dialog-mask ono-dialog-mask-${f ? "leave":"enter"}`,style:{background:m},onClick:()=>u&&x(),onContextMenu:(e2)=>p&&e2.preventDefault(),children:e.jsx("div",{ref:g,className:` ono-dialog ${l||""}${C()}`,style:d,onClick:(e2)=>e2.stopPropagation(),children:"function"==typeof i2 ? i2(x):i2})});};export{i as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{useEffect as s,useRef as t}from "react";import{i}from "./InjunctiveBox-DUNoNHCO.js";const a="_enter_974ly_32";let r=[];const c={success:{light:"#52c41a",dark:"#49aa19"},error:{light:"#ff4d4f",dark:"#a61d24"},warning:{light:"#faad14",dark:"#d89614"},promise:{light:"",dark:""}},o=(e2,s2)=>c[e2][s2],n=(s2)=>{switch(s2){case "success":return e.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"check-circle",width:"24px",height:"24px",fill:o(s2,"light"),"aria-hidden":"true",children:e.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 e.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"close-circle",width:"24px",height:"24px",fill:o(s2,"light"),"aria-hidden":"true",children:e.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 e.jsx("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"exclamation-circle",width:"24px",height:"24px",fill:o(s2,"light"),"aria-hidden":"true",children:e.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"})});}},l=({type:i2,speed:r2=200,message:c2,duration:o2=2e3,className:l2,style:m2,isUseEnterAnimation:d=true,promiseOptions:h,toastList:u,handleDestroy:g})=>{const y=t(null);return s(()=>{y.current&&(y.current.style.setProperty("--speed",r2/1e3+"s"),d&&y.current.classList.add(a),"promise"!==i2&&setTimeout(()=>{var _a,_b;(_a=y.current)==null ? void 0:_a.classList.remove(a),(_b=y.current)==null ? void 0:_b.classList.add("_leave_974ly_36");},o2-r2));},[y]),s(()=>{"promise"===i2 ?("function"==typeof c2 ? c2():c2).then((e2)=>setTimeout(()=>{g(),p({type:"success",message:"function"==typeof(h==null ? void 0:h.success)? h.success(e2):(h==null ? void 0:h.success)||"",isUseEnterAnimation:false,toastList:u});},r2)).catch((e2)=>setTimeout(()=>{g(),p({type:"error",message:"function"==typeof(h==null ? void 0:h.error)? h.error(e2):(h==null ? void 0:h.error)||"",isUseEnterAnimation:false,toastList:u});},r2)):setTimeout(()=>g(()=>u=[]),o2);},[i2]),e.jsxs("div",{ref:y,className:["promise"===i2 ? "_promise_974ly_15":"_base_974ly_15",l2].join(" "),style:m2,onClick:()=>{},children:[e.jsx("div",{className:"_icon_974ly_40",children:n(i2)}),e.jsx("p",{children:"string"==typeof c2 ? c2:h&&h.loading})]});},p=({type:t2,speed:a2=200,message:r2,duration:c2=2e3,zIndex:o2=9999,className:n2,style:p2,isUseEnterAnimation:m2=true,promiseOptions:d,toastList:h})=>i({className:"_container_974ly_1",isSingle:true,style:{zIndex:o2},content:(i2)=>(s(()=>{},[h]),e.jsx(l,{className:n2,style:p2,type:t2,message:r2,speed:a2,duration:c2,isUseEnterAnimation:m2,promiseOptions:d,handleDestroy:i2,toastList:h}))}),m={success:(e2)=>{r.push({type:"success",message:e2}),p("string"==typeof e2 ?{type:"success",message:e2,toastList:r}:{type:"success",...e2,toastList:r});},error:(e2)=>{r.push({type:"error",message:e2}),p("string"==typeof e2 ?{type:"error",message:e2,toastList:r}:{type:"error",...e2,toastList:r});},warning:(e2)=>{r.push({type:"warning",message:e2}),p("string"==typeof e2 ?{type:"warning",message:e2,toastList:r}:{type:"warning",...e2,toastList:r});},promise:(e2,s2)=>{r.push({type:"promise",message:e2}),p({type:"promise",message:e2,promiseOptions:s2,toastList:r});}};export{m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{u as t}from "./useClickOutSide.tsx-CMvd2uTW.js";import{createPopper as r}from "@popperjs/core";import{useState as n,useRef as o,useEffect as c}from "react";let s=null,l=null;const i=({children:i2,content:p,onOpenChange:u,trigger:a="hover",placement:m="top",popperOptions:d={},className:f,style:h,isShowArrow:x=true,sameWidth:w,autoAdjustOverflow:j=true})=>{const [v,y]=n(false),g=o(null),k=o(null),b=(e2)=>{u==null ? void 0:u(e2),y(e2);};return t(k,()=>{"click"!==a&&"contextmenu"!==a||b(false);},{event:["click","contextmenu"],deps:[a,u]}),c(()=>{(()=>{if(!k.current)return;const e2=Array.from(k.current.children);if(e2.length>1)throw new Error("Tooltip only support one child");k.current.style.width=e2[0].getBoundingClientRect().width+"px";})();},[k,i2]),c(()=>{k.current&&("hover"===a ?(k.current.onmouseenter=()=>b(true),k.current.onmouseleave=()=>b(false)):"click"===a ? k.current.onclick=()=>b(!v):"focus"===a ?(k.current.onfocus=()=>b(true),k.current.onblur=()=>b(false)):k.current.oncontextmenu=()=>b(!v)),v&&k.current&&g.current ? l=r(k.current,g.current,{placement:m,modifiers:[{name:"offset",options:{offset:[0,6]}},w ?{name:"sameWidth",enabled:true,phase:"beforeWrite",requires:["computeStyles"],fn({state:e2}){e2.styles.popper.width=`${e2.rects.reference.width}px`;},effect({state:e2}){e2.elements.popper.style.width=`${e2.elements.reference.offsetWidth}px`;}}:{},j ?{name:"flip",enabled:true}:{}],...d}):l&&(l.destroy(),l=null,s&&s.remove(),s=null);},[v,k,g]),e.jsxs(e.Fragment,{children:[v&&e.jsxs("div",{ref:g,style:h,className:["ono-tooltip-popper",f].join(" "),"data-popper-placement":d.placement||m,children:[e.jsx("div",{children:p instanceof Function ? p():p}),x&&e.jsx("div",{className:"ono-tooltip-popper-arrow","data-popper-arrow":true})]}),e.jsx("div",{ref:k,children:i2 instanceof Function ? i2():i2})]});};export{i as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{u as t}from "./useEventListener.tsx-BBGVcI5T.js";import{t as r}from "./common.ts-BbDnZ7vC.js";import{memo as i,useState as n,useMemo as l,useRef as a,useEffect as s}from "react";const d=i(({containerClassName:i2,dataSource:d2,containerStyle:c2={},onEndCallback:o,refreshSpeed:h=50,wrapperClassName:u,wrapperStyle:p={},estimatedSize:f=35,updateDataSourceScroll2Top:v,direction:g="vertical"})=>{const [m,x]=n({viewSize:0,startIndex:0,listSize:0,renderCount:0,prevLen:0}),[S,z]=n([]),w="number"==typeof f ? f:f(),I=l(()=>Math.min(d2.length,m.startIndex+m.renderCount),[d2,m]),y=l(()=>{var _a;return m.startIndex>0 ?(_a=S[m.startIndex-1])==null ? void 0:_a.end:0;},[m.startIndex,S]),j=l(()=>d2.slice(m.startIndex,I).map(({id:t2,data:r2})=>e.jsx("li",{"data-virtual-id":t2,style:"vertical"===g ?{width:"100%"}:{height:"100%"},children:r2},t2)),[I,d2,m.startIndex,g]),C=l(()=>({display:"flex",listStyle:"none",flexDirection:"vertical"===g ? "column":"row",height:"vertical"===g ? m.listSize-y+"px":"100%",width:"vertical"===g ? "auto":m.listSize-y+"px",transform:"vertical"===g ? `translate3d(0,${y}px,0)`:`translate3d(${y}px,0,0)`}),[m.listSize,y,g]),L=a(null),N=a(null),b=(e2)=>x((t2)=>({...t2,...e2})),E=r(()=>{const{scrollTop:e2,clientHeight:t2,scrollHeight:r2,scrollLeft:i3,clientWidth:n2,scrollWidth:l2}=L.current,a2="vertical"===g ? r2-t2-e2:l2-n2-i3;b({startIndex:A(S,"vertical"===g ? e2:i3)}),("vertical"===g ? e2===w/2:i3===w/2)&&b({startIndex:0}),a2<=20&&o&&o();},h),A=(e2,t2)=>{let r2=0,i3=e2.length-1,n2=-1;for(;r2<=i3;){const l2=r2+Math.floor((i3-r2)/2),a2=e2[l2].end;if(a2===t2)return l2+1;a2<t2 ? r2=l2+1:((-1===n2||n2>l2)&&(n2=l2),i3=l2-1);}return n2;};return t("scroll",E,{target:L.current,deps:[S,g]}),s(()=>{(()=>{if(!L.current)return;const e2=("vertical"===g ? L.current.offsetHeight:L.current.offsetWidth)||0;b({viewSize:e2,renderCount:Math.ceil(e2/w)+1});})();},[L,g]),s(()=>{d2.length&&N&&(()=>{var _a;const e2=[],t2=d2.length-m.prevLen,r2=t2>0 ? S.length:0,i3=r2>0 ? S[r2-1].end:0;for(let r3=0;r3<(t2>0 ? t2:d2.length);r3++){const n2=d2[(t2>0 ? m.prevLen:0)+r3];e2.push({index:n2.id,size:w,start:i3 ? i3+r3*w:n2.id*w,end:i3 ? i3+(r3+1)*w:(n2.id+1)*w,dSize:0});}z((r3)=>[...t2>0 ? r3:[],...e2]),b({prevLen:d2.length}),v&&((_a=L.current)==null ? void 0:_a.scrollTo(0,0));})();},[N,d2,v]),s(()=>{(()=>{if(!N.current||0===S.length)return;const e2=Array.from(N.current.childNodes);if(!e2.length)return;e2.forEach((e3)=>{const t3=e3.getBoundingClientRect(),r3=+e3.getAttribute("data-virtual-id"),i4=S[r3],n2=i4.size-("vertical"===g ? t3.height:t3.width);n2&&(i4.size="vertical"===g ? t3.height:t3.width,i4.end=i4.end-n2,i4.dSize=n2);});const t2=+e2[0].getAttribute("data-virtual-id"),r2=S.length;let i3=S[t2].dSize;S[t2].dSize=0;for(let e3=t2+1;e3<r2;e3++){const t3=S[e3];t3.start=S[e3-1].end,t3.end=t3.end-i3,t3.dSize&&(i3+=t3.dSize,t3.dSize=0);}b({listSize:S[r2-1].end});})();},[N,S,m.startIndex,g]),e.jsx("div",{ref:L,className:i2,style:{width:"100%",height:"100%",overflow:"auto",...c2},children:e.jsx("ul",{ref:N,className:u,style:{...C,...p},children:j})});}),c=(e2,t2)=>e2.map((e3,r2)=>({id:r2,data:t2(e3,r2)}));export{d as E,c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from "./dependencies-CbQbPZZ-.js";import{u as t}from "./useEventListener.tsx-BBGVcI5T.js";import{t as a}from "./common.ts-BbDnZ7vC.js";import{useState as i,useRef as n,useCallback as o,useEffect as r}from "react";const s=({options:s2,pageSize:l,children:d,request:m,reloadData:c,className:g,style:p,updateData:h,loading:u=true,bottomThreshold:f=50})=>{const [x,y]=i({page:1,reloadData:c,loading:false,isFinish:false,gap:"number"==typeof s2 ? 0:s2.gap,imageWidth:"number"==typeof s2 ? s2:0,columns:"number"==typeof s2 ? 0:s2.columns,imageList:[]}),[w,W]=i([]),[j,b]=i([]),v=n(null),L=n(null),D=n(null),N=(e2)=>y((t2)=>({...t2,...e2})),E=async(e2,t2)=>{const a2=c&&x.reloadData!==c;if(x.isFinish)return;N({loading:true});const i2=await m(e2,t2);F(i2),N({isFinish:!i2.length,imageList:a2 ? [...i2]:[...x.imageList,...i2],page:e2+1,loading:false});},F=(e2)=>y((t2)=>{const a2=c&&x.reloadData!==c,i2=a2 ? []:[...j],n2=a2 ? Array(t2.columns).fill(0):[..."[]"!==JSON.stringify(w)? w:Array(t2.columns).fill(0)];return e2.forEach((e3)=>{const a3=((e4)=>{let t3=0,a4=0;return t3=e4.indexOf(Math.min(...e4)),a4=e4[t3],{index:t3,height:a4};})(n2),o2=Math.floor(e3.height*t2.imageWidth/e3.width);i2.push({x:a3.index%t2.columns!==0 ? a3.index*t2.imageWidth+t2.gap*a3.index:a3.index*t2.imageWidth,y:a3.height}),n2[a3.index]+=o2+t2.gap,W(n2);}),b(i2),t2;}),M=o(()=>{if(!D.current)return;const e2=D.current.clientWidth;let t2=0,a2=x.page;if(c&&x.reloadData!==c&&(y({page:1,reloadData:c,loading:false,isFinish:false,gap:"number"==typeof s2 ? 0:s2.gap,imageWidth:"number"==typeof s2 ? s2:0,columns:"number"==typeof s2 ? 0:s2.columns,imageList:[]}),W([]),b([]),a2=1),"number"==typeof s2){const a3=Math.floor(e2/x.imageWidth);t2=a3-1;const i2=t2 ?(e2-a3*x.imageWidth)/t2:0;N({columns:a3,gap:i2});}else{t2=x.columns-1;const a3=(e2-t2*x.gap)/x.columns;N({imageWidth:a3});}E(a2,l);},[x,c]),T=()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(M,50);},z=a(()=>{const{scrollTop:e2,clientHeight:t2,scrollHeight:a2}=L.current;a2-t2-e2>f||!x.loading&&E(x.page,l);},50);return t("scroll",z,{target:L.current,deps:[x.loading,x.page]}),r(()=>(M(),window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T);}),[D,c]),r(()=>{h&&E(x.page,l);},[h,x.loading,x.page,L.current]),e.jsxs("div",{className:"ono-waterfall-container",children:[e.jsx("div",{ref:L,className:[g,"ono-waterfall-content"].join(" ").trim(),style:p,children:e.jsx("div",{ref:D,className:"ono-waterfall-wrapper",style:{height:Math.max(...w)-x.gap+"px"},children:x.imageList.map((t2,a2)=>e.jsx("div",{className:"ono-waterfall-item",style:{width:`${x.imageWidth}px`,transform:`translate(${j[a2].x}px,${j[a2].y}px)`},children:d(t2,a2)},t2.id))})}),x.loading&&("function"==typeof u ? u():u&&"boolean"==typeof u ? e.jsx("div",{className:"ono-waterfall-loading",children:"loading..."}):u)]});};export{s as W};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=/\d+/g,r=(r2)=>{const e2=r2.match(t),a2=(t2)=>Number(t2).toString(16).padStart(2,"0"),n2=(t2)=>t2.reduce((t3,r3)=>t3+a2(r3),"#"),s2=(t2)=>{const r3=t2,e3=1!==Number(t2[t2.length-1])? Number(t2[t2.length-1]):100;return r3.pop(),n2(r3)+a2(2.56*e3);};return 3===e2.length ? n2(e2):5===e2.length ? s2([e2[0],e2[1],e2[2],10*Number(e2[e2.length-1])]):s2(e2);},e=(t2)=>{const r2=t2.split("#")[1],e2=(t3)=>[parseInt(t3.slice(0,2),16),parseInt(t3.slice(2,4),16),parseInt(t3.slice(4,6),16)];if(8===r2.length){const t3=parseInt(r2.slice(-2),16)/256,a2=e2(r2.slice(0,-2));return a2.push(t3),"rgba("+a2.join(",")+")";}return "rgb("+e2(r2).join(",")+")";},a=(r2)=>{const e2=r2.match(t),a2=Number(e2[0])/255,n2=Number(e2[1])/255,s2=Number(e2[2])/255,h2=Math.min(a2,n2,s2),i2=Math.max(a2,n2,s2);let u2=0,o2=0,l2=(i2+h2)/2;if(i2===h2)u2=o2=0;else{const t2=i2-h2;switch(o2=l2>0.5 ? t2/(2-i2-h2):t2/(i2+h2),i2){case a2:u2=(n2-s2)/t2+(n2<s2 ? 6:0);break;case n2:u2=(s2-a2)/t2+2;break;case s2:u2=(a2-n2)/t2+4;}u2/=6;}return `hsl(${Math.round(360*u2)},${Math.round(100*o2)}%,${Math.round(100*l2)}%)`;},n=(r2)=>{const e2=r2.match(t),a2=Number(e2[0])/360,n2=Number(e2[1])/100,s2=Number(e2[2])/100;let h2,i2,u2;function o2(t2,r3,e3){return e3<0&&(e3+=1),e3>1&&(e3-=1),e3<1/6 ? t2+6*(r3-t2)*e3:e3<0.5 ? r3:e3<2/3 ? t2+(r3-t2)*(2/3-e3)*6:t2;}let l2=s2<0.5 ? s2*(1+n2):s2+n2-s2*n2,c2=2*s2-l2;return h2=o2(c2,l2,a2+1/3),i2=o2(c2,l2,a2),u2=o2(c2,l2,a2-1/3),`rgb(${Math.round(255*h2)},${Math.round(255*i2)},${Math.round(255*u2)})`;},s=(t2)=>a(e(t2)),h=(t2)=>r(n(t2)),i=(r2)=>{const e2=r2.match(t);let a2=Number(e2[0])/255,n2=Number(e2[1])/255,s2=Number(e2[2])/255;const h2=Math.max(a2,n2,s2),i2=Math.min(a2,n2,s2);let u2=0,o2=0,l2=h2;const c2=h2-i2;if(o2=0===h2 ? 0:c2/h2,h2===i2)u2=0;else{switch(h2){case a2:u2=(n2-s2)/c2+(n2<s2 ? 6:0);break;case n2:u2=(s2-a2)/c2+2;break;case s2:u2=(a2-n2)/c2+4;}u2/=6;}return `hsv(${360*u2},${100*o2},${100*l2})`;},u=(r2)=>{const e2=r2.match(t);let a2,n2,s2,h2,i2,u2,o2,l2,c2=Number(e2[0])/360,m=Number(e2[1])/100,b=Number(e2[2])/100;if(c2&&0===m)a2=n2=s2=b;else switch(c2/=60,h2=Math.floor(c2),i2=c2-h2,u2=b*(1-m),o2=b*(1-m*i2),l2=b*(1-m*(1-i2)),h2){case 0:a2=b,n2=l2,s2=u2;break;case 1:a2=o2,n2=b,s2=u2;break;case 2:a2=u2,n2=b,s2=l2;break;case 3:a2=u2,n2=o2,s2=b;break;case 4:a2=l2,n2=u2,s2=b;break;default:a2=b,n2=u2,s2=o2;}return `rgb(${Math.round(255*a2)},${Math.round(255*n2)},${Math.round(255*s2)})`;},o=(t2)=>/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t2)? "hex":/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t2)? "rgb":"unknown",l=(r2,e2,n2)=>{let i2=[];if(r2.includes("#"))i2=s(r2).match(t);else if(r2.includes("rgb"))i2=a(r2).match(t);else{if(!r2.includes("hsl"))throw new Error("颜色格式错误");i2=r2.match(t);}return h(`${i2[0]},${i2[1]}%,${"light"===e2 ? Number(i2[2])+n2>100 ? 100:Number(i2[2])+n2:Number(i2[2])-n2<0 ? 0:Number(i2[2])-n2}%`);},c={randomColor:()=>"#"+Math.random().toString(16).slice(2,8).padEnd(6,"0"),rgb2hex:r,hex2rgb:e,rgb2rgba:(t2,r2)=>{if(!r2)return t2;if(t2.includes("rgba")){const e2=t2.split(",");return e2.pop(),e2.push(r2+")"),e2.join(",");}if(t2.includes("rgb")){const e2=t2.split(","),a2="rgba("+e2[0].split("(")[1],n2=e2[e2.length-1].split(")")[0];return [a2,e2[1],n2," "+r2+")"].join(",");}},rgb2hsl:a,hsl2rgb:n,hex2hsl:s,hsl2hex:h,rgb2hsv:i,hsv2rgb:u,hex2hsv:(t2)=>i(e(t2)),hsv2hex:(t2)=>r(u(t2)),formatColor:(e2,n2,s2="rgba")=>{const h2=e2.match(t);let i2=Number(h2[0])/255,u2=Number(h2[1])/255,o2=Number(h2[2])/255;return "rgba"===s2 ? `rgba(${i2},${u2},${o2},${n2})`:"rgb"===s2 ? e2:"hex"===s2 ? r(e2):"hsl"===s2 ? a(`rgba(${i2},${u2},${o2},${n2})`):`rgba(${i2},${u2},${o2},${n2})`;},getContrastColor:(t2)=>{const r2=(function(t3){if(t3.startsWith("#"))return 4===t3.length&&(t3=`#${t3.slice(1).repeat(2)}`),[parseInt(t3.substr(1,2),16),parseInt(t3.substr(3,2),16),parseInt(t3.substr(5,2),16)];if(t3.startsWith("rgb")){const r3=t3.match(/\d+/g);return [parseInt(r3[0]),parseInt(r3[1]),parseInt(r3[2])];}return null;})(t2);return null===r2 ? null:(299*(e2=r2)[0]+587*e2[1]+114*e2[2])/1e3>128 ? "#000":"#fff";var e2;},adjustColor:(t2,r2,e2)=>{const a2=o(t2);if("hex"===a2){const a3=t2.replace("#",""),n2=parseInt(a3.slice(0,2),16),s2=parseInt(a3.slice(2,4),16),h2=parseInt(a3.slice(4,6),16);if("lighten"===r2){const t3=Math.min(255,Math.max(0,n2+(255-n2)*e2/100)),r3=Math.min(255,Math.max(0,s2+(255-s2)*e2/100)),a4=Math.min(255,Math.max(0,h2+(255-h2)*e2/100));return `#${t3.toString(16).padStart(2,"0")}${r3.toString(16).padStart(2,"0")}${a4.toString(16).padStart(2,"0")}`;}if("darken"===r2){const t3=Math.min(255,Math.max(0,n2-n2*e2/100)),r3=Math.min(255,Math.max(0,s2-s2*e2/100)),a4=Math.min(255,Math.max(0,h2-h2*e2/100));return `#${t3.toString(16).padStart(2,"0")}${r3.toString(16).padStart(2,"0")}${a4.toString(16).padStart(2,"0")}`;}}else if("rgb"===a2){const a3=t2.match(/\d+/g),n2=parseInt(a3[0]),s2=parseInt(a3[1]),h2=parseInt(a3[2]);if("lighten"===r2)return `rgb(${Math.min(255,Math.max(0,n2+(255-n2)*e2/100))},${Math.min(255,Math.max(0,s2+(255-s2)*e2/100))},${Math.min(255,Math.max(0,h2+(255-h2)*e2/100))})`;if("darken"===r2)return `rgb(${Math.min(255,Math.max(0,n2-n2*e2/100))},${Math.min(255,Math.max(0,s2-s2*e2/100))},${Math.min(255,Math.max(0,h2-h2*e2/100))})`;}return t2;},isValidColor:(t2)=>!(!/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(t2)&&!/^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/.test(t2)),getColorType:o,hex3To6:(t2)=>{const r2=t2.replace("#","").split("");return `#${r2[0]+r2[0]+r2[1]+r2[1]+r2[2]+r2[2]}`;},adjustingColors:l};export{l as a,c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=(t2,e2,n2=t2.length)=>(e2<0&&(e2=Math.max(0,e2+t2.length)),n2<0&&(n2=t2.length+n2),e2>n2&&([e2,n2]=[n2,e2]),e2>=t2.length ? t2:(e2=Math.max(0,Math.min(e2,t2.length)),(n2=Math.max(0,Math.min(n2,t2.length)))-e2>3 ? t2.substring(0,e2)+"..."+t2.substring(n2):t2)),e=(t2)=>/^\d+$/.test(t2),n=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+])[\da-zA-Z]{8,}$/,o=(t2)=>t2<=11 ? Math.random().toString(36).substring(2,2+t2).padEnd(t2,"0"):o(11)+o(t2-11),r=({el:t2,str:e2="hello world",speed:n2=100,isExtendStr:o2=true,onDone:r2})=>{let s2=0,a2=null;t2.textContent&&o2&&(s2=t2.textContent.length,e2=t2.textContent+e2);const i2=()=>{clearTimeout(a2);const o3=e2.substring(0,s2+1);t2.textContent=o3,s2++,s2!==e2.length ? a2=setTimeout(i2,n2):r2&&r2();};i2();},s=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),a=async(t2,e2)=>{const n2=(t3,e3)=>{const n3=window.URL.createObjectURL(t3),o2=document.createElement("a");o2.href=n3,o2.download=encodeURIComponent(e3),document.body.appendChild(o2),o2.click(),document.body.removeChild(o2),window.URL.revokeObjectURL(n3);};try{if("string"==typeof t2){const o2=await fetch(t2);if(!o2.ok)throw new Error(`Network response was not ok:${o2.statusText}`);n2(await o2.blob(),e2);}else n2(t2,e2);}catch(t3){console.error("文件下载失败:",t3 instanceof Error ? t3.message:String(t3));}},i=(t2,e2)=>{t2.toString().startsWith("2")? e2.onSuccess&&e2.onSuccess():(t2.toString().startsWith("4")||t2.toString().startsWith("5"))&&e2.onFail&&e2.onFail();},l=(t2)=>{const e2=t2.getBoundingClientRect();return{x:e2.left+e2.width/2,y:e2.top+e2.height/2};},c=(t2,e2,n2)=>{const o2=new IntersectionObserver(e2,n2);t2 instanceof HTMLElement ? o2.observe(t2):t2.forEach((t3)=>o2.observe(t3));},u=(t2)=>{const e2=Math.floor(t2/3600),n2=Math.floor(t2%3600/60),o2=Math.floor(t2%60),r2=(t3)=>t3.toString().padStart(2,"0");return(e2>0 ? `${r2(e2)}:${r2(n2)}:${r2(o2)}`:`${r2(n2)}:${r2(o2)}`)+(t2<10 ? ".00":t2<100 ? ".0":"");},d=(t2)=>{if(t2.length<2)return t2;const e2=t2[0],n2=t2.slice(1).filter((t3)=>t3<=e2),o2=t2.slice(1).filter((t3)=>t3>e2);return [...d(n2),e2,...d(o2)];},h=(t2,e2)=>{const n2=["B","KB","MB","GB","TB"],o2=1024;let r2=n2.indexOf((e2==null ? void 0:e2.unit)?? "B");if(-1===r2)throw new Error("Invalid unit");if(!(e2==null ? void 0:e2.unit))for(;t2/Math.pow(o2,r2)>=o2;)r2++;return `${(t2/Math.pow(o2,r2)).toFixed((e2==null ? void 0:e2.decimalPlaces)?? 0)}${n2[r2]}`;},g=(t2,e2)=>`${Math.floor(t2/f(t2,e2))}:${Math.floor(e2/f(t2,e2))}`,f=(t2,e2)=>{for(;0!==e2;){const n2=e2;e2=t2%e2,t2=n2;}return t2;},m=(t2,e2,n2)=>{t2.muted=true,t2.play();const o2=new AudioContext(),r2="running"===o2.state;o2.close(),r2 ?(t2.muted=false,e2==null ? void 0:e2()):n2==null ? void 0:n2();},p=(t2)=>new URLSearchParams(window.location.search).get(t2),w=(t2)=>{let e2;const n2=new Proxy(t2,{construct:(t3,n3)=>(e2||(e2=Reflect.construct(t3,n3)),e2)});return n2.prototype.construct=n2,n2;},b=(t2)=>"string"!=typeof t2||0===t2.length ? "":t2.charAt(0).toUpperCase()+t2.slice(1),y=(t2)=>{if("object"!=typeof t2||null===t2)return t2;const e2=Array.isArray(t2)? []:{};for(const n2 in t2)Object.prototype.hasOwnProperty.call(t2,n2)&&(e2[n2]=y(t2[n2]));return e2;},S=(t2)=>new Promise((e2)=>{const n2=new Image();n2.src="string"==typeof t2 ? t2:URL.createObjectURL(t2),n2.onload=()=>e2({width:n2.width,height:n2.height});}),x=(t2,e2)=>{let n2=0;const o2=(r2)=>{n2||(n2=r2),r2-n2>=e2 ? t2():requestAnimationFrame(o2);};requestAnimationFrame(o2);},M=(t2,e2,n2)=>{const o2=t2[e2];t2[e2]=function(t3){o2&&"function"==typeof o2&&o2.call(this,t3),n2.call(this,t3);};},C=(t2)=>{if("number"!=typeof t2||isNaN(t2))throw new Error("请输入有效的数字");const e2=t2.toString().split(".");return e2[0]=e2[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e2.join(".");},O=(t2)=>parseFloat(t2.replace(/[^0-9.]/g,"")),T=(t2,e2,n2,o2)=>Math.sqrt((t2-n2)**2+(e2-o2)**2),E=(t2)=>navigator.clipboard.writeText(t2),A=(t2)=>Math.ceil((t2.getTime()-new Date(t2.getFullYear(),0,1).getTime())/864e5),I=(t2,e2,n2)=>0.2126*t2+0.7152*e2+0.0722*n2,P=(t2)=>{const e2={};return t2.replace(/([^?=&]+)=([^&]+)/g,(t3,n2,o2)=>e2[n2]=o2),e2;},$=(t2,...e2)=>Object.fromEntries(Object.entries(t2).filter(([t3])=>e2.includes(t3))),v=(t2)=>{if(!t2)return "";const e2=t2.lastIndexOf(".");return-1===e2 ? v(t2.substring(t2.lastIndexOf("/")+1)):t2.substring(0,e2);},F=(t2)=>{if(!t2)return "";const e2=t2.lastIndexOf(".");return t2.substring(e2+1);},R=(t2,e2)=>{let n2=null;return(...o2)=>{n2&&clearTimeout(n2),n2=setTimeout(()=>{t2(...o2),n2=null;},e2);};};function k(t2,e2,n2={}){let o2,r2=null,s2=null,a2=0;const i2=false!==n2.leading,l2=false!==n2.trailing;function c2(){s2&&(t2.apply(o2,s2),s2=null);}function u2(){const t3=Date.now();t3-a2>=e2 ?(l2&&s2&&c2(),r2=null):r2=setTimeout(u2,e2-(t3-a2));}const d2=function(...t3){const n3=Date.now();s2=t3,o2=this,n3-a2>=e2 ? r2||(a2=n3,i2 ? c2():l2&&(r2=setTimeout(u2,e2))):!r2&&l2&&(r2=setTimeout(u2,e2-(n3-a2)));};return d2.cancel=function(){r2&&(clearTimeout(r2),r2=null),a2=0,s2=null;},d2;}const B={addCommasToNumber:C,addEventWithOriginHandler:M,calculateAspectRatio:g,checkDeviceIsMobile:s,checkStatusCode:i,copy2Clipboard:E,createIntersectionObserver:c,dayOfYear:A,deepCopy:y,downloadFile:a,formatFileSize:h,formatSecondes:u,getElementCenterPosition:l,getFileName:v,getFileSuffix:F,getImageSIze:S,getPointDistance:T,getURLSearchParams:p,grayColor:I,mediaAutoplayPolicies:m,parseQuery:P,passwordStrength:n,pick:$,printStr:r,pureNumber:O,quickSort:d,rafTimeout:x,randomString:o,safeCapitalizeWord:b,singleton:w,throttle:k,debounce:R,ellipsisString:t,isPureNumber:e};export{P as A,n as B,$ as C,r as D,d as E,x as F,o as G,b as H,w as I,C as a,M as b,g as c,s as d,i as e,B as f,l as g,E as h,c as i,A as j,R as k,y as l,a as m,t as n,h as o,O as p,u as q,v as r,F as s,k as t,S as u,T as v,p as w,I as x,e as y,m as z};
|