ono-react-element 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/es/{AutoSliderList-eb1CVc8b.js → AutoSliderList-tkaOmfnx.js} +1 -1
  2. package/dist/es/{Button-BsWI818a.js → Button-QIC7QPK9.js} +1 -1
  3. package/dist/es/{Modal-BsI-8rap.js → Modal-D2289ZPX.js} +1 -1
  4. package/dist/es/{Switch-BBHMaxoZ.js → Switch-C61q7rR5.js} +1 -1
  5. package/dist/es/{TemplateDialog-PQxjmAJa.js → TemplateDialog-CAimG5cv.js} +1 -1
  6. package/dist/es/{VirtualList-CdhqyHFQ.js → VirtualList-BAiIymCF.js} +1 -1
  7. package/dist/es/{Waterfall-CY3QkL5m.js → Waterfall-C7SWCxJ1.js} +1 -1
  8. package/dist/es/common.ts-BbDnZ7vC.js +1 -0
  9. package/dist/es/index.js +1 -1
  10. package/dist/style/AutoSliderList.css +1 -1
  11. package/dist/style/AvatarCrop.css +1 -1
  12. package/dist/style/Button.css +1 -1
  13. package/dist/style/Card3D.css +1 -1
  14. package/dist/style/Checkbox.css +1 -1
  15. package/dist/style/Input.css +1 -1
  16. package/dist/style/MenuButton.css +1 -1
  17. package/dist/style/Message.css +1 -1
  18. package/dist/style/Modal.css +1 -1
  19. package/dist/style/Pagination.css +1 -1
  20. package/dist/style/Radio.css +1 -1
  21. package/dist/style/ScrollableTabs.css +1 -1
  22. package/dist/style/Select.css +1 -1
  23. package/dist/style/SvgImg.css +1 -1
  24. package/dist/style/Switch.css +1 -1
  25. package/dist/style/TemplateDialog.css +1 -1
  26. package/dist/style/Toast.css +1 -1
  27. package/dist/style/Tooltip.css +1 -1
  28. package/dist/style/Waterfall.css +1 -1
  29. package/dist/style/index.css +1 -1
  30. package/dist/types/index.d.ts +2 -2
  31. package/dist/types/utils/common.d.ts +4 -0
  32. package/dist/umd/index.umd.cjs +1 -1
  33. package/dist/umd/index.umd.cjs.br +0 -0
  34. package/dist/umd/index.umd.cjs.gz +0 -0
  35. package/package.json +1 -1
  36. package/dist/es/common.ts-vX9A6Rye.js +0 -1
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ono-react-element",
3
3
  "private": false,
4
- "version": "0.0.17",
4
+ "version": "0.0.19",
5
5
  "description": "Component library by React + Typescript",
6
6
  "type": "module",
7
7
  "main": "./dist/umd/index.umd.cjs",
@@ -1 +0,0 @@
1
- const t=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+])[\da-zA-Z]{8,}$/,e=(t2)=>t2<=11 ? Math.random().toString(36).substring(2,2+t2).padEnd(t2,"0"):e(11)+e(t2-11),n=({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();},o=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),r=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));}},s=(t2,e2)=>{t2.toString().startsWith("2")? e2.onSuccess&&e2.onSuccess():(t2.toString().startsWith("4")||t2.toString().startsWith("5"))&&e2.onFail&&e2.onFail();},a=(t2)=>{const e2=t2.getBoundingClientRect();return{x:e2.left+e2.width/2,y:e2.top+e2.height/2};},i=(t2,e2,n2)=>{const o2=new IntersectionObserver(e2,n2);t2 instanceof HTMLElement ? o2.observe(t2):t2.forEach((t3)=>o2.observe(t3));},c=(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":"");},l=(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 [...l(n2),e2,...l(o2)];},u=(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]}`;},d=(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;},g=(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();},h=(t2)=>new URLSearchParams(window.location.search).get(t2),p=(t2)=>{let e2;const n2=new Proxy(t2,{construct:(t3,n3)=>(e2||(e2=Reflect.construct(t3,n3)),e2)});return n2.prototype.construct=n2,n2;},m=(t2)=>"string"!=typeof t2||0===t2.length ? "":t2.charAt(0).toUpperCase()+t2.slice(1),w=(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]=w(t2[n2]));return e2;},b=(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});}),y=(t2,e2)=>{let n2=0;const o2=(r2)=>{n2||(n2=r2),r2-n2>=e2 ? t2():requestAnimationFrame(o2);};requestAnimationFrame(o2);},S=(t2,e2,n2)=>{const o2=t2[e2];t2[e2]=function(t3){o2&&"function"==typeof o2&&o2.call(this,t3),n2.call(this,t3);};},x=(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(".");},C=(t2)=>parseFloat(t2.replace(/[^0-9.]/g,"")),O=(t2,e2,n2,o2)=>Math.sqrt((t2-n2)**2+(e2-o2)**2),T=(t2)=>navigator.clipboard.writeText(t2),M=(t2)=>Math.ceil((t2.getTime()-new Date(t2.getFullYear(),0,1).getTime())/864e5),E=(t2,e2,n2)=>0.2126*t2+0.7152*e2+0.0722*n2,A=(t2)=>{const e2={};return t2.replace(/([^?=&]+)=([^&]+)/g,(t3,n2,o2)=>e2[n2]=o2),e2;},v=(t2,...e2)=>Object.fromEntries(Object.entries(t2).filter(([t3])=>e2.includes(t3))),F=(t2)=>{if(!t2)return "";const e2=t2.lastIndexOf(".");return-1===e2 ? F(t2.substring(t2.lastIndexOf("/")+1)):t2.substring(0,e2);},I=(t2)=>{if(!t2)return "";const e2=t2.lastIndexOf(".");return t2.substring(e2+1);},P=(t2,e2)=>{let n2=null;return(...o2)=>{n2&&clearTimeout(n2),n2=setTimeout(()=>{t2(...o2),n2=null;},e2);};};function R(t2,e2,n2={}){let o2,r2=null,s2=null,a2=0;const i2=false!==n2.leading,c2=false!==n2.trailing;function l2(){s2&&(t2.apply(o2,s2),s2=null);}function u2(){const t3=Date.now();t3-a2>=e2 ?(c2&&s2&&l2(),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 ? l2():c2&&(r2=setTimeout(u2,e2))):!r2&&c2&&(r2=setTimeout(u2,e2-(n3-a2)));};return d2.cancel=function(){r2&&(clearTimeout(r2),r2=null),a2=0,s2=null;},d2;}const $={addCommasToNumber:x,addEventWithOriginHandler:S,calculateAspectRatio:d,checkDeviceIsMobile:o,checkStatusCode:s,copy2Clipboard:T,createIntersectionObserver:i,dayOfYear:M,deepCopy:w,downloadFile:r,formatFileSize:u,formatSecondes:c,getElementCenterPosition:a,getFileName:F,getFileSuffix:I,getImageSIze:b,getPointDistance:O,getURLSearchParams:h,grayColor:E,mediaAutoplayPolicies:g,parseQuery:A,passwordStrength:t,pick:v,printStr:n,pureNumber:C,quickSort:l,rafTimeout:y,randomString:e,safeCapitalizeWord:m,singleton:p,throttle:R,debounce:P};export{v as A,n as B,l as C,y as D,e as E,m as F,p as G,x as a,S as b,d as c,o as d,s as e,$ as f,a as g,T as h,i,M as j,P as k,w as l,r as m,u as n,c as o,C as p,F as q,I as r,b as s,R as t,O as u,h as v,E as w,g as x,A as y,t as z};