ono-react-element 0.0.18 → 0.0.20

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 (72) hide show
  1. package/dist/es/AutoSliderList-tkaOmfnx.js +1 -0
  2. package/dist/es/AvatarCrop-DrA-SARP.js +1 -65
  3. package/dist/es/Button-QIC7QPK9.js +1 -0
  4. package/dist/es/Card3D-DMvCSUhe.js +1 -18
  5. package/dist/es/Checkbox-daBabj14.js +1 -19
  6. package/dist/es/InjunctiveBox-DUNoNHCO.js +1 -11
  7. package/dist/es/Input-DLOeg2pz.js +1 -80
  8. package/dist/es/List-UAKCMuGC.js +1 -19
  9. package/dist/es/MenuButton-DHkU5Bq7.js +1 -17
  10. package/dist/es/Message-BGDILiLc.js +1 -105
  11. package/dist/es/Modal-D2289ZPX.js +1 -0
  12. package/dist/es/Pagination-m71H2tfS.js +1 -17
  13. package/dist/es/PortalRenderer-CDAzQJgm.js +1 -19
  14. package/dist/es/Radio-D_GKVoOC.js +1 -25
  15. package/dist/es/ScrollableTabs--449B73p.js +1 -34
  16. package/dist/es/Select-B11NvK-I.js +1 -34
  17. package/dist/es/SvgImg-CZwq2D7J.js +1 -14
  18. package/dist/es/Switch-C61q7rR5.js +1 -0
  19. package/dist/es/TemplateDialog-CAimG5cv.js +1 -0
  20. package/dist/es/Toast-CQEsbqUJ.js +1 -42
  21. package/dist/es/Tooltip-CgttMIcX.js +1 -29
  22. package/dist/es/VirtualList-BAiIymCF.js +1 -0
  23. package/dist/es/Waterfall-C7SWCxJ1.js +1 -0
  24. package/dist/es/colorUtils.ts-DYuRvCXZ.js +1 -145
  25. package/dist/es/common.ts-BbDnZ7vC.js +1 -0
  26. package/dist/es/event-CtX9rswE.js +1 -28
  27. package/dist/es/fileFormatConversion.ts-tUlewYon.js +1 -38
  28. package/dist/es/formatTimeUtils.ts-CkdWJ_Sl.js +1 -32
  29. package/dist/es/index.js +1 -123
  30. package/dist/es/useClickOutSide.tsx-CMvd2uTW.js +1 -15
  31. package/dist/es/useCountdown.tsx-Btzj-keH.js +1 -16
  32. package/dist/es/useEventListener.tsx-BBGVcI5T.js +1 -12
  33. package/dist/es/useGetElementSize.tsx-Dtshth0Y.js +1 -22
  34. package/dist/es/useKeyPress.tsx-Db44HXXz.js +1 -18
  35. package/dist/es/useMouseClick.tsx-C7uAH4n4.js +1 -12
  36. package/dist/es/useTheme.tsx-C5b7BRYz.js +1 -24
  37. package/dist/es/useThemePro.tsx-DQuSI8J7.js +1 -20
  38. package/dist/es/viewTransitionUtils.ts-CHa9uBpi.js +1 -19
  39. package/dist/style/AutoSliderList.css +1 -1
  40. package/dist/style/AvatarCrop.css +1 -1
  41. package/dist/style/Button.css +1 -1
  42. package/dist/style/Card3D.css +1 -1
  43. package/dist/style/Checkbox.css +1 -1
  44. package/dist/style/Input.css +1 -1
  45. package/dist/style/MenuButton.css +1 -1
  46. package/dist/style/Message.css +1 -1
  47. package/dist/style/Modal.css +1 -1
  48. package/dist/style/Pagination.css +1 -1
  49. package/dist/style/Radio.css +1 -1
  50. package/dist/style/ScrollableTabs.css +1 -1
  51. package/dist/style/Select.css +1 -1
  52. package/dist/style/SvgImg.css +1 -1
  53. package/dist/style/Switch.css +1 -1
  54. package/dist/style/TemplateDialog.css +1 -1
  55. package/dist/style/Toast.css +1 -1
  56. package/dist/style/Tooltip.css +1 -1
  57. package/dist/style/Waterfall.css +1 -1
  58. package/dist/style/index.css +1 -1
  59. package/dist/types/index.d.ts +2 -2
  60. package/dist/types/utils/common.d.ts +4 -0
  61. package/dist/umd/index.umd.cjs +1 -1
  62. package/dist/umd/index.umd.cjs.br +0 -0
  63. package/dist/umd/index.umd.cjs.gz +0 -0
  64. package/package.json +1 -1
  65. package/dist/es/AutoSliderList-eb1CVc8b.js +0 -30
  66. package/dist/es/Button-BsWI818a.js +0 -29
  67. package/dist/es/Modal-BsI-8rap.js +0 -37
  68. package/dist/es/Switch-BBHMaxoZ.js +0 -34
  69. package/dist/es/TemplateDialog-PQxjmAJa.js +0 -45
  70. package/dist/es/VirtualList-CdhqyHFQ.js +0 -60
  71. package/dist/es/Waterfall-CY3QkL5m.js +0 -50
  72. package/dist/es/common.ts-vX9A6Rye.js +0 -154
@@ -1,34 +1 @@
1
- import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { useState as o, useEffect as n } from "react";
3
- import { T as t } from "./Tooltip-CgttMIcX.js";
4
- import { O as l } from "./Input-DLOeg2pz.js";
5
- import { L as a } from "./List-UAKCMuGC.js";
6
- 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 }) => {
7
- const [w, N] = o(""), [L, V] = o(""), [B, S] = o(""), [k, M] = o(false), [O, y] = o(false), [R, A] = o(""), E = (e2) => {
8
- const o2 = s2.find((o3) => o3.value === e2);
9
- N(o2 ? o2.label : "");
10
- }, F = (e2) => {
11
- v == null ? void 0 : v(e2), A(e2), E(e2);
12
- };
13
- return n(() => {
14
- c && E(c);
15
- }, [c]), n(() => {
16
- var _a;
17
- if (s2.length > 0) {
18
- if (c) {
19
- const e2 = s2.find((e3) => e3.value === c);
20
- e2 && V(e2.label);
21
- } else e: for (let e2 = 0; e2 < s2.length; e2++) if (true !== ((_a = s2[e2]) == null ? void 0 : _a.disabled)) {
22
- V(s2[0].label);
23
- break e;
24
- }
25
- }
26
- }, [s2, c]), e.jsx(t, { sameWidth: true, trigger: "click", placement: "bottom", isShowArrow: m, className: ["ono-option-container", b].filter(Boolean).join(" "), onOpenChange: (e2) => {
27
- y(e2), x && B && !e2 && S("");
28
- }, 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: () => {
29
- C == null ? void 0 : C(), v == null ? void 0 : v(""), A(""), N(""), S("");
30
- }, onChange: (e2) => S(e2.target.value) }) }) });
31
- }, 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" }) });
32
- export {
33
- s as O
34
- };
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,14 +1 @@
1
- import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { useRef as r, useEffect as s } from "react";
3
- const a = ({ w: a2, h: n, src: t, clr: l, className: c, onClick: o }) => {
4
- const m = r(null), i = [{ value: a2, name: "w" }, { value: n, name: "h" }, { value: l, name: "clr" }];
5
- return s(() => {
6
- m.current && i.forEach((e2) => {
7
- var r2, s2, a3;
8
- 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`));
9
- });
10
- }, [m, l]), e.jsx("div", { ref: m, className: ["ono-svg-img", c].join(" "), onClick: o, children: e.jsx("img", { src: t, alt: "" }) });
11
- };
12
- export {
13
- a as S
14
- };
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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,42 +1 @@
1
- import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { useEffect as s, useRef as t } from "react";
3
- import { i } from "./InjunctiveBox-DUNoNHCO.js";
4
- const a = "_enter_974ly_32";
5
- let r = [];
6
- 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) => {
7
- switch (s2) {
8
- case "success":
9
- 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" }) });
10
- case "error":
11
- 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" }) });
12
- case "warning":
13
- 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" }) });
14
- }
15
- }, l = ({ type: i2, speed: r2 = 200, message: c2, duration: o2 = 2e3, className: l2, style: m2, isUseEnterAnimation: d = true, promiseOptions: h, toastList: u, handleDestroy: g }) => {
16
- const y = t(null);
17
- return s(() => {
18
- y.current && (y.current.style.setProperty("--speed", r2 / 1e3 + "s"), d && y.current.classList.add(a), "promise" !== i2 && setTimeout(() => {
19
- var _a, _b;
20
- (_a = y.current) == null ? void 0 : _a.classList.remove(a), (_b = y.current) == null ? void 0 : _b.classList.add("_leave_974ly_36");
21
- }, o2 - r2));
22
- }, [y]), s(() => {
23
- "promise" === i2 ? ("function" == typeof c2 ? c2() : c2).then((e2) => setTimeout(() => {
24
- 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 });
25
- }, r2)).catch((e2) => setTimeout(() => {
26
- 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 });
27
- }, r2)) : setTimeout(() => g(() => u = []), o2);
28
- }, [i2]), e.jsxs("div", { ref: y, className: ["promise" === i2 ? "_promise_974ly_15" : "_base_974ly_15", l2].join(" "), style: m2, onClick: () => {
29
- }, children: [e.jsx("div", { className: "_icon_974ly_40", children: n(i2) }), e.jsx("p", { children: "string" == typeof c2 ? c2 : h && h.loading })] });
30
- }, 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(() => {
31
- }, [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) => {
32
- r.push({ type: "success", message: e2 }), p("string" == typeof e2 ? { type: "success", message: e2, toastList: r } : { type: "success", ...e2, toastList: r });
33
- }, error: (e2) => {
34
- r.push({ type: "error", message: e2 }), p("string" == typeof e2 ? { type: "error", message: e2, toastList: r } : { type: "error", ...e2, toastList: r });
35
- }, warning: (e2) => {
36
- r.push({ type: "warning", message: e2 }), p("string" == typeof e2 ? { type: "warning", message: e2, toastList: r } : { type: "warning", ...e2, toastList: r });
37
- }, promise: (e2, s2) => {
38
- r.push({ type: "promise", message: e2 }), p({ type: "promise", message: e2, promiseOptions: s2, toastList: r });
39
- } };
40
- export {
41
- m as t
42
- };
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,29 +1 @@
1
- import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { u as t } from "./useClickOutSide.tsx-CMvd2uTW.js";
3
- import { createPopper as r } from "@popperjs/core";
4
- import { useState as n, useRef as o, useEffect as c } from "react";
5
- let s = null, l = null;
6
- 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 }) => {
7
- const [v, y] = n(false), g = o(null), k = o(null), b = (e2) => {
8
- u == null ? void 0 : u(e2), y(e2);
9
- };
10
- return t(k, () => {
11
- "click" !== a && "contextmenu" !== a || b(false);
12
- }, { event: ["click", "contextmenu"], deps: [a, u] }), c(() => {
13
- (() => {
14
- if (!k.current) return;
15
- const e2 = Array.from(k.current.children);
16
- if (e2.length > 1) throw new Error("Tooltip only support one child");
17
- k.current.style.width = e2[0].getBoundingClientRect().width + "px";
18
- })();
19
- }, [k, i2]), c(() => {
20
- 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 }) {
21
- e2.styles.popper.width = `${e2.rects.reference.width}px`;
22
- }, effect({ state: e2 }) {
23
- e2.elements.popper.style.width = `${e2.elements.reference.offsetWidth}px`;
24
- } } : {}, j ? { name: "flip", enabled: true } : {}], ...d }) : l && (l.destroy(), l = null, s && s.remove(), s = null);
25
- }, [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 })] });
26
- };
27
- export {
28
- i as T
29
- };
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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,145 +1 @@
1
- const t = /\d+/g, r = (r2) => {
2
- 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) => {
3
- const r3 = t2, e3 = 1 !== Number(t2[t2.length - 1]) ? Number(t2[t2.length - 1]) : 100;
4
- return r3.pop(), n2(r3) + a2(2.56 * e3);
5
- };
6
- return 3 === e2.length ? n2(e2) : 5 === e2.length ? s2([e2[0], e2[1], e2[2], 10 * Number(e2[e2.length - 1])]) : s2(e2);
7
- }, e = (t2) => {
8
- 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)];
9
- if (8 === r2.length) {
10
- const t3 = parseInt(r2.slice(-2), 16) / 256, a2 = e2(r2.slice(0, -2));
11
- return a2.push(t3), "rgba(" + a2.join(", ") + ")";
12
- }
13
- return "rgb(" + e2(r2).join(", ") + ")";
14
- }, a = (r2) => {
15
- 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);
16
- let u2 = 0, o2 = 0, l2 = (i2 + h2) / 2;
17
- if (i2 === h2) u2 = o2 = 0;
18
- else {
19
- const t2 = i2 - h2;
20
- switch (o2 = l2 > 0.5 ? t2 / (2 - i2 - h2) : t2 / (i2 + h2), i2) {
21
- case a2:
22
- u2 = (n2 - s2) / t2 + (n2 < s2 ? 6 : 0);
23
- break;
24
- case n2:
25
- u2 = (s2 - a2) / t2 + 2;
26
- break;
27
- case s2:
28
- u2 = (a2 - n2) / t2 + 4;
29
- }
30
- u2 /= 6;
31
- }
32
- return `hsl(${Math.round(360 * u2)}, ${Math.round(100 * o2)}%, ${Math.round(100 * l2)}%)`;
33
- }, n = (r2) => {
34
- const e2 = r2.match(t), a2 = Number(e2[0]) / 360, n2 = Number(e2[1]) / 100, s2 = Number(e2[2]) / 100;
35
- let h2, i2, u2;
36
- function o2(t2, r3, e3) {
37
- 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;
38
- }
39
- let l2 = s2 < 0.5 ? s2 * (1 + n2) : s2 + n2 - s2 * n2, c2 = 2 * s2 - l2;
40
- 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)})`;
41
- }, s = (t2) => a(e(t2)), h = (t2) => r(n(t2)), i = (r2) => {
42
- const e2 = r2.match(t);
43
- let a2 = Number(e2[0]) / 255, n2 = Number(e2[1]) / 255, s2 = Number(e2[2]) / 255;
44
- const h2 = Math.max(a2, n2, s2), i2 = Math.min(a2, n2, s2);
45
- let u2 = 0, o2 = 0, l2 = h2;
46
- const c2 = h2 - i2;
47
- if (o2 = 0 === h2 ? 0 : c2 / h2, h2 === i2) u2 = 0;
48
- else {
49
- switch (h2) {
50
- case a2:
51
- u2 = (n2 - s2) / c2 + (n2 < s2 ? 6 : 0);
52
- break;
53
- case n2:
54
- u2 = (s2 - a2) / c2 + 2;
55
- break;
56
- case s2:
57
- u2 = (a2 - n2) / c2 + 4;
58
- }
59
- u2 /= 6;
60
- }
61
- return `hsv(${360 * u2}, ${100 * o2}, ${100 * l2})`;
62
- }, u = (r2) => {
63
- const e2 = r2.match(t);
64
- let a2, n2, s2, h2, i2, u2, o2, l2, c2 = Number(e2[0]) / 360, m = Number(e2[1]) / 100, b = Number(e2[2]) / 100;
65
- if (c2 && 0 === m) a2 = n2 = s2 = b;
66
- 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) {
67
- case 0:
68
- a2 = b, n2 = l2, s2 = u2;
69
- break;
70
- case 1:
71
- a2 = o2, n2 = b, s2 = u2;
72
- break;
73
- case 2:
74
- a2 = u2, n2 = b, s2 = l2;
75
- break;
76
- case 3:
77
- a2 = u2, n2 = o2, s2 = b;
78
- break;
79
- case 4:
80
- a2 = l2, n2 = u2, s2 = b;
81
- break;
82
- default:
83
- a2 = b, n2 = u2, s2 = o2;
84
- }
85
- return `rgb(${Math.round(255 * a2)}, ${Math.round(255 * n2)}, ${Math.round(255 * s2)})`;
86
- }, 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) => {
87
- let i2 = [];
88
- if (r2.includes("#")) i2 = s(r2).match(t);
89
- else if (r2.includes("rgb")) i2 = a(r2).match(t);
90
- else {
91
- if (!r2.includes("hsl")) throw new Error("颜色格式错误");
92
- i2 = r2.match(t);
93
- }
94
- 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}%`);
95
- }, c = { randomColor: () => "#" + Math.random().toString(16).slice(2, 8).padEnd(6, "0"), rgb2hex: r, hex2rgb: e, rgb2rgba: (t2, r2) => {
96
- if (!r2) return t2;
97
- if (t2.includes("rgba")) {
98
- const e2 = t2.split(",");
99
- return e2.pop(), e2.push(r2 + ")"), e2.join(",");
100
- }
101
- if (t2.includes("rgb")) {
102
- const e2 = t2.split(","), a2 = "rgba(" + e2[0].split("(")[1], n2 = e2[e2.length - 1].split(")")[0];
103
- return [a2, e2[1], n2, " " + r2 + ")"].join(",");
104
- }
105
- }, 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") => {
106
- const h2 = e2.match(t);
107
- let i2 = Number(h2[0]) / 255, u2 = Number(h2[1]) / 255, o2 = Number(h2[2]) / 255;
108
- 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})`;
109
- }, getContrastColor: (t2) => {
110
- const r2 = (function(t3) {
111
- 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)];
112
- if (t3.startsWith("rgb")) {
113
- const r3 = t3.match(/\d+/g);
114
- return [parseInt(r3[0]), parseInt(r3[1]), parseInt(r3[2])];
115
- }
116
- return null;
117
- })(t2);
118
- return null === r2 ? null : (299 * (e2 = r2)[0] + 587 * e2[1] + 114 * e2[2]) / 1e3 > 128 ? "#000" : "#fff";
119
- var e2;
120
- }, adjustColor: (t2, r2, e2) => {
121
- const a2 = o(t2);
122
- if ("hex" === a2) {
123
- 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);
124
- if ("lighten" === r2) {
125
- 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));
126
- return `#${t3.toString(16).padStart(2, "0")}${r3.toString(16).padStart(2, "0")}${a4.toString(16).padStart(2, "0")}`;
127
- }
128
- if ("darken" === r2) {
129
- 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));
130
- return `#${t3.toString(16).padStart(2, "0")}${r3.toString(16).padStart(2, "0")}${a4.toString(16).padStart(2, "0")}`;
131
- }
132
- } else if ("rgb" === a2) {
133
- const a3 = t2.match(/\d+/g), n2 = parseInt(a3[0]), s2 = parseInt(a3[1]), h2 = parseInt(a3[2]);
134
- 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))})`;
135
- 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))})`;
136
- }
137
- return t2;
138
- }, 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) => {
139
- const r2 = t2.replace("#", "").split("");
140
- return `#${r2[0] + r2[0] + r2[1] + r2[1] + r2[2] + r2[2]}`;
141
- }, adjustingColors: l };
142
- export {
143
- l as a,
144
- c
145
- };
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};
@@ -0,0 +1 @@
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};
@@ -1,28 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- class e {
5
- constructor(e2) {
6
- __publicField(this, "events", {});
7
- e2.forEach((e3) => {
8
- this.events[e3] = /* @__PURE__ */ new Set();
9
- });
10
- }
11
- emit(e2, ...t2) {
12
- if (!this.events[e2]) throw new Error(`Event ${e2} does not exist`);
13
- this.events[e2].forEach((e3) => {
14
- e3(...t2);
15
- });
16
- }
17
- on(e2, t2) {
18
- this.events[e2] || (this.events[e2] = /* @__PURE__ */ new Set()), this.events[e2].add(t2);
19
- }
20
- cancel(e2, t2) {
21
- this.events[e2] && this.events[e2].delete(t2);
22
- }
23
- }
24
- let t = null;
25
- const s = (s2) => (t || (t = new e(s2)), t);
26
- export {
27
- s as c
28
- };
1
+ var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj ? __defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!=="symbol" ? key+"":key,value);class e{constructor(e2){__publicField(this,"events",{});e2.forEach((e3)=>{this.events[e3]=new Set();});}emit(e2,...t2){if(!this.events[e2])throw new Error(`Event ${e2}does not exist`);this.events[e2].forEach((e3)=>{e3(...t2);});}on(e2,t2){this.events[e2]||(this.events[e2]=new Set()),this.events[e2].add(t2);}cancel(e2,t2){this.events[e2]&&this.events[e2].delete(t2);}}let t=null;const s=(s2)=>(t||(t=new e(s2)),t);export{s as c};
@@ -1,38 +1 @@
1
- const t = (t2) => {
2
- const e2 = t2.split(","), a2 = e2[0].match(/:(.*?);/)[1], s2 = atob(e2[1]);
3
- let n2 = s2.length;
4
- const o2 = new Uint8Array(n2);
5
- for (; n2--; ) o2[n2] = s2.charCodeAt(n2);
6
- return new Blob([o2], { type: a2 });
7
- }, e = (t2, e2) => {
8
- const a2 = t2.split(","), s2 = a2[0].match(/:(.*?);/u)[1], n2 = atob(a2[1]);
9
- let o2 = n2.length, i2 = "jpeg" === s2.split("/")[1] ? ".jpg" : "." + s2.split("/")[1];
10
- const r2 = new Uint8Array(o2);
11
- for (; o2--; ) r2[o2] = n2.charCodeAt(o2);
12
- const l2 = new Blob([r2], { type: s2 });
13
- return new File([l2], e2 + i2, { type: s2, lastModified: (/* @__PURE__ */ new Date()).getTime() });
14
- }, a = (t2) => new Promise((e2) => {
15
- const a2 = new FileReader();
16
- a2.readAsDataURL(t2), a2.onload = (t3) => {
17
- var _a;
18
- const a3 = (_a = t3.target) == null ? void 0 : _a.result, s2 = a3.split(",")[1];
19
- e2(s2);
20
- };
21
- }), s = (t2, e2 = "abc.jpg") => new File([t2], e2, { type: t2.type }), n = (t2) => new Promise((e2) => {
22
- const a2 = new FileReader();
23
- a2.readAsDataURL(t2), a2.onload = (t3) => {
24
- var _a;
25
- return e2((_a = t3.target) == null ? void 0 : _a.result);
26
- };
27
- }), o = (t2) => t2.slice(0, t2.size, t2.type), i = async (t2) => await (await fetch(t2)).blob(), r = async (t2) => s(await i(t2)), l = async (t2) => await a(await i(t2));
28
- export {
29
- e as a,
30
- t as b,
31
- a as c,
32
- s as d,
33
- o as e,
34
- n as f,
35
- i as g,
36
- r as h,
37
- l as u
38
- };
1
+ const t=(t2)=>{const e2=t2.split(","),a2=e2[0].match(/:(.*?);/)[1],s2=atob(e2[1]);let n2=s2.length;const o2=new Uint8Array(n2);for(;n2--;)o2[n2]=s2.charCodeAt(n2);return new Blob([o2],{type:a2});},e=(t2,e2)=>{const a2=t2.split(","),s2=a2[0].match(/:(.*?);/u)[1],n2=atob(a2[1]);let o2=n2.length,i2="jpeg"===s2.split("/")[1] ? ".jpg":"."+s2.split("/")[1];const r2=new Uint8Array(o2);for(;o2--;)r2[o2]=n2.charCodeAt(o2);const l2=new Blob([r2],{type:s2});return new File([l2],e2+i2,{type:s2,lastModified:(new Date()).getTime()});},a=(t2)=>new Promise((e2)=>{const a2=new FileReader();a2.readAsDataURL(t2),a2.onload=(t3)=>{var _a;const a3=(_a=t3.target)==null ? void 0:_a.result,s2=a3.split(",")[1];e2(s2);};}),s=(t2,e2="abc.jpg")=>new File([t2],e2,{type:t2.type}),n=(t2)=>new Promise((e2)=>{const a2=new FileReader();a2.readAsDataURL(t2),a2.onload=(t3)=>{var _a;return e2((_a=t3.target)==null ? void 0:_a.result);};}),o=(t2)=>t2.slice(0,t2.size,t2.type),i=async(t2)=>await(await fetch(t2)).blob(),r=async(t2)=>s(await i(t2)),l=async(t2)=>await a(await i(t2));export{e as a,t as b,a as c,s as d,o as e,n as f,i as g,r as h,l as u};
@@ -1,32 +1 @@
1
- const t = (t2) => t2 < 10 ? `0${t2}` : `${t2}`, e = (t2) => t2.toString().length > 13 ? new Date(Number(t2.toString().substring(0, 13))) : 13 === t2.toString().length ? new Date(t2) : t2.toString().length < 13 && t2.toString().length > 10 ? new Date(Number((t2.toString() + "000").substring(0, 13))) : 10 === t2.toString().length ? new Date(1e3 * t2) : new Date(Number((t2.toString() + "000000000000").substring(0, 13))), n = (n2, r2 = "YY-MM-DD hh:mm:ss") => {
2
- const s2 = ["YY", "MM", "DD", "hh", "mm", "ss"], u2 = [], o = e(n2);
3
- u2.push(o.getFullYear().toString()), u2.push(t(o.getMonth() + 1)), u2.push(t(o.getDate())), u2.push(t(o.getHours())), u2.push(t(o.getMinutes())), u2.push(t(o.getSeconds()));
4
- for (let t2 in u2) r2 = r2.replace(s2[t2], u2[t2]);
5
- return r2;
6
- }, r = (n2, r2 = "YY-MM-DD hh:mm:ss", s2 = "cn") => {
7
- const u2 = ["YY", "MM", "DD", "hh", "mm", "ss"], o = [], h = e(n2);
8
- o.push(((t2, e2) => {
9
- const n3 = { en: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], cn: ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"] };
10
- return t2.split("").map((t3) => n3[e2][Number(t3)]).join("");
11
- })(h.getFullYear().toString(), s2)), o.push(((t2, e2) => ({ en: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"], cn: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"] })[e2][Number(t2) - 1])(t(h.getMonth() + 1), s2)), o.push(((t2, e2) => {
12
- let n3;
13
- return "en" === e2 ? n3 = "01" === t2 || "21" === t2 || "31" === t2 ? Number(t2) + "st" : "02" === t2 || "22" === t2 ? Number(t2) + "nd" : "03" === t2 || "23" === t2 ? Number(t2) + "rd" : Number(t2) + "th" : "01" === t2 ? n3 = "一日" : "02" === t2 ? n3 = "二日" : "03" === t2 ? n3 = "三日" : "04" === t2 ? n3 = "四日" : "05" === t2 ? n3 = "五日" : "06" === t2 ? n3 = "六日" : "07" === t2 ? n3 = "七日" : "08" === t2 ? n3 = "八日" : "09" === t2 ? n3 = "九日" : "10" === t2 ? n3 = "十日" : "11" === t2 ? n3 = "十一日" : "12" === t2 ? n3 = "十二日" : "13" === t2 ? n3 = "十三日" : "14" === t2 ? n3 = "十四日" : "15" === t2 ? n3 = "十五日" : "16" === t2 ? n3 = "十六日" : "17" === t2 ? n3 = "十七日" : "18" === t2 ? n3 = "十八日" : "19" === t2 ? n3 = "十九日" : "20" === t2 ? n3 = "二十日" : "21" === t2 ? n3 = "二十一日" : "22" === t2 ? n3 = "二十二日" : "23" === t2 ? n3 = "二十三日" : "24" === t2 ? n3 = "二十四日" : "25" === t2 ? n3 = "二十五日" : "26" === t2 ? n3 = "二十六日" : "27" === t2 ? n3 = "二十七日" : "28" === t2 ? n3 = "二十八日" : "29" === t2 ? n3 = "二十九日" : "30" === t2 ? n3 = "三十日" : "31" === t2 && (n3 = "三十一日"), n3 ?? t2;
14
- })(t(h.getDate()), s2)), o.push(t(h.getHours())), o.push(t(h.getMinutes())), o.push(t(h.getSeconds()));
15
- for (let t2 in o) r2 = r2.replace(u2[t2], o[t2]);
16
- return r2;
17
- }, s = (e2, n2) => {
18
- const r2 = ["DD", "hh", "mm", "ss"], s2 = [];
19
- s2.push(Math.floor(e2 / 86400)), s2.push(t(Math.floor(e2 % 86400 / 3600))), s2.push(t(Math.floor(e2 % 3600 / 60))), s2.push(t(e2 % 60));
20
- for (let t2 = 0; t2 < r2.length; t2++) n2 = n2.replace(r2[t2], s2[t2].toString());
21
- return n2;
22
- }, u = (t2, e2) => {
23
- const n2 = { year: 31536e3, month: 2592e3, day: 86400, hour: 3600, minute: 60, second: 1 };
24
- if (!n2[e2]) throw new Error('Invalid type. Please use "day", "hour", "minute", or "second".');
25
- return Math.floor(t2 / n2[e2]);
26
- };
27
- export {
28
- u as c,
29
- n as f,
30
- r as l,
31
- s
32
- };
1
+ const t=(t2)=>t2<10 ? `0${t2}`:`${t2}`,e=(t2)=>t2.toString().length>13 ? new Date(Number(t2.toString().substring(0,13))):13===t2.toString().length ? new Date(t2):t2.toString().length<13&&t2.toString().length>10 ? new Date(Number((t2.toString()+"000").substring(0,13))):10===t2.toString().length ? new Date(1e3*t2):new Date(Number((t2.toString()+"000000000000").substring(0,13))),n=(n2,r2="YY-MM-DD hh:mm:ss")=>{const s2=["YY","MM","DD","hh","mm","ss"],u2=[],o=e(n2);u2.push(o.getFullYear().toString()),u2.push(t(o.getMonth()+1)),u2.push(t(o.getDate())),u2.push(t(o.getHours())),u2.push(t(o.getMinutes())),u2.push(t(o.getSeconds()));for(let t2 in u2)r2=r2.replace(s2[t2],u2[t2]);return r2;},r=(n2,r2="YY-MM-DD hh:mm:ss",s2="cn")=>{const u2=["YY","MM","DD","hh","mm","ss"],o=[],h=e(n2);o.push(((t2,e2)=>{const n3={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return t2.split("").map((t3)=>n3[e2][Number(t3)]).join("");})(h.getFullYear().toString(),s2)),o.push(((t2,e2)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[e2][Number(t2)-1])(t(h.getMonth()+1),s2)),o.push(((t2,e2)=>{let n3;return "en"===e2 ? n3="01"===t2||"21"===t2||"31"===t2 ? Number(t2)+"st":"02"===t2||"22"===t2 ? Number(t2)+"nd":"03"===t2||"23"===t2 ? Number(t2)+"rd":Number(t2)+"th":"01"===t2 ? n3="一日":"02"===t2 ? n3="二日":"03"===t2 ? n3="三日":"04"===t2 ? n3="四日":"05"===t2 ? n3="五日":"06"===t2 ? n3="六日":"07"===t2 ? n3="七日":"08"===t2 ? n3="八日":"09"===t2 ? n3="九日":"10"===t2 ? n3="十日":"11"===t2 ? n3="十一日":"12"===t2 ? n3="十二日":"13"===t2 ? n3="十三日":"14"===t2 ? n3="十四日":"15"===t2 ? n3="十五日":"16"===t2 ? n3="十六日":"17"===t2 ? n3="十七日":"18"===t2 ? n3="十八日":"19"===t2 ? n3="十九日":"20"===t2 ? n3="二十日":"21"===t2 ? n3="二十一日":"22"===t2 ? n3="二十二日":"23"===t2 ? n3="二十三日":"24"===t2 ? n3="二十四日":"25"===t2 ? n3="二十五日":"26"===t2 ? n3="二十六日":"27"===t2 ? n3="二十七日":"28"===t2 ? n3="二十八日":"29"===t2 ? n3="二十九日":"30"===t2 ? n3="三十日":"31"===t2&&(n3="三十一日"),n3 ?? t2;})(t(h.getDate()),s2)),o.push(t(h.getHours())),o.push(t(h.getMinutes())),o.push(t(h.getSeconds()));for(let t2 in o)r2=r2.replace(u2[t2],o[t2]);return r2;},s=(e2,n2)=>{const r2=["DD","hh","mm","ss"],s2=[];s2.push(Math.floor(e2/86400)),s2.push(t(Math.floor(e2%86400/3600))),s2.push(t(Math.floor(e2%3600/60))),s2.push(t(e2%60));for(let t2=0;t2<r2.length;t2++)n2=n2.replace(r2[t2],s2[t2].toString());return n2;},u=(t2,e2)=>{const n2={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!n2[e2])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(t2/n2[e2]);};export{u as c,n as f,r as l,s};
package/dist/es/index.js CHANGED
@@ -1,123 +1 @@
1
- import { u } from "./useClickOutSide.tsx-CMvd2uTW.js";
2
- import { u as u2 } from "./useCountdown.tsx-Btzj-keH.js";
3
- import { u as u3 } from "./useEventListener.tsx-BBGVcI5T.js";
4
- import { u as u4 } from "./useGetElementSize.tsx-Dtshth0Y.js";
5
- import { u as u5 } from "./useKeyPress.tsx-Db44HXXz.js";
6
- import { u as u6 } from "./useMouseClick.tsx-C7uAH4n4.js";
7
- import { u as u7 } from "./useTheme.tsx-C5b7BRYz.js";
8
- import { u as u8 } from "./useThemePro.tsx-DQuSI8J7.js";
9
- import { a, c } from "./colorUtils.ts-DYuRvCXZ.js";
10
- import { a as a2, b, c as c2, d, e, f, h, i, j, k, l, m, n, o, g, q, r, s, u as u9, v, w, x, y, z, A, B, p, C, D, E, F, G, t } from "./common.ts-vX9A6Rye.js";
11
- import { b as b2, a as a3, c as c3, d as d2, f as f2, e as e2, u as u10, g as g2, h as h2 } from "./fileFormatConversion.ts-tUlewYon.js";
12
- import { c as c4, f as f3, l as l2, s as s2 } from "./formatTimeUtils.ts-CkdWJ_Sl.js";
13
- import { c as c5 } from "./event-CtX9rswE.js";
14
- import { A as A2, D as D2 } from "./AutoSliderList-eb1CVc8b.js";
15
- import { A as A3 } from "./AvatarCrop-DrA-SARP.js";
16
- import { A as A4, L } from "./List-UAKCMuGC.js";
17
- import { B as B2 } from "./Button-BsWI818a.js";
18
- import { C as C2 } from "./Card3D-DMvCSUhe.js";
19
- import { C as C3 } from "./Checkbox-daBabj14.js";
20
- import { E as E2, c as c6 } from "./VirtualList-CdhqyHFQ.js";
21
- import { i as i2 } from "./InjunctiveBox-DUNoNHCO.js";
22
- import { M } from "./MenuButton-DHkU5Bq7.js";
23
- import { m as m2 } from "./Message-BGDILiLc.js";
24
- import { M as M2 } from "./Modal-BsI-8rap.js";
25
- import { O, a as a4 } from "./Input-DLOeg2pz.js";
26
- import { O as O2 } from "./Select-B11NvK-I.js";
27
- import { P } from "./Pagination-m71H2tfS.js";
28
- import { p as p2 } from "./PortalRenderer-CDAzQJgm.js";
29
- import { R, a as a5 } from "./Radio-D_GKVoOC.js";
30
- import { S } from "./ScrollableTabs--449B73p.js";
31
- import { S as S2 } from "./SvgImg-CZwq2D7J.js";
32
- import { S as S3 } from "./Switch-BBHMaxoZ.js";
33
- import { T } from "./TemplateDialog-PQxjmAJa.js";
34
- import { t as t2 } from "./Toast-CQEsbqUJ.js";
35
- import { T as T2 } from "./Tooltip-CgttMIcX.js";
36
- import { W } from "./Waterfall-CY3QkL5m.js";
37
- export {
38
- A2 as AutoSliderList,
39
- A3 as AvatarCrop,
40
- A4 as AwaitList,
41
- B2 as Button,
42
- C2 as Card3D,
43
- C3 as Checkbox,
44
- D2 as Direction,
45
- E2 as EstimatedVirtualList,
46
- L as List,
47
- M as MenuButton,
48
- M2 as Modal,
49
- O as OnoInput,
50
- O2 as OnoSelect,
51
- a4 as OnoTextarea,
52
- P as Pagination,
53
- R as Radio,
54
- a5 as RadioGroup,
55
- S as ScrollableTabs,
56
- S2 as SvgImg,
57
- S3 as Switch,
58
- T as TemplateDialog,
59
- T2 as Tooltip,
60
- W as Waterfall,
61
- a2 as addCommasToNumber,
62
- b as addEventWithOriginHandler,
63
- a as adjustingColors,
64
- b2 as base64ToBlob,
65
- a3 as base64ToFile,
66
- c3 as blobToBase64,
67
- d2 as blobToFile,
68
- c2 as calculateAspectRatio,
69
- d as checkDeviceIsMobile,
70
- e as checkStatusCode,
71
- c as colorUtils,
72
- f as common,
73
- c4 as convertSecondToOtherTime,
74
- h as copy2Clipboard,
75
- c6 as createDataSource,
76
- c5 as createEventEmitter,
77
- i as createIntersectionObserver,
78
- j as dayOfYear,
79
- k as debounce,
80
- l as deepCopy,
81
- m as downloadFile,
82
- f2 as fileToBase64,
83
- e2 as fileToBlob,
84
- n as formatFileSize,
85
- o as formatSecondes,
86
- f3 as formatTime,
87
- g as getElementCenterPosition,
88
- q as getFileName,
89
- r as getFileSuffix,
90
- s as getImageSIze,
91
- u9 as getPointDistance,
92
- v as getURLSearchParams,
93
- w as grayColor,
94
- i2 as injunctiveBox,
95
- l2 as localFormat,
96
- x as mediaAutoplayPolicies,
97
- m2 as message,
98
- y as parseQuery,
99
- z as passwordStrength,
100
- A as pick,
101
- p2 as portalRenderer,
102
- B as printStr,
103
- p as pureNumber,
104
- C as quickSort,
105
- D as rafTimeout,
106
- E as randomString,
107
- F as safeCapitalizeWord,
108
- s2 as second2Day,
109
- G as singleton,
110
- t as throttle,
111
- t2 as toast,
112
- u10 as urlToBase64,
113
- g2 as urlToBlob,
114
- h2 as urlToFile,
115
- u as useClickOutSide,
116
- u2 as useCountdown,
117
- u3 as useEventListener,
118
- u4 as useGetElementSize,
119
- u5 as useKeyPress,
120
- u6 as useMouseClick,
121
- u7 as useTheme,
122
- u8 as useThemePro
123
- };
1
+ import{u}from "./useClickOutSide.tsx-CMvd2uTW.js";import{u as u2}from "./useCountdown.tsx-Btzj-keH.js";import{u as u3}from "./useEventListener.tsx-BBGVcI5T.js";import{u as u4}from "./useGetElementSize.tsx-Dtshth0Y.js";import{u as u5}from "./useKeyPress.tsx-Db44HXXz.js";import{u as u6}from "./useMouseClick.tsx-C7uAH4n4.js";import{u as u7}from "./useTheme.tsx-C5b7BRYz.js";import{u as u8}from "./useThemePro.tsx-DQuSI8J7.js";import{a,c}from "./colorUtils.ts-DYuRvCXZ.js";import{a as a2,b,c as c2,d,e,f,h,i,j,k,l,m,n,o,q,g,r,s,u as u9,v,w,x,y,z,A,B,C,D,p,E,F,G,H,I,t}from "./common.ts-BbDnZ7vC.js";import{b as b2,a as a3,c as c3,d as d2,f as f2,e as e2,u as u10,g as g2,h as h2}from "./fileFormatConversion.ts-tUlewYon.js";import{c as c4,f as f3,l as l2,s as s2}from "./formatTimeUtils.ts-CkdWJ_Sl.js";import{c as c5}from "./event-CtX9rswE.js";import{A as A2,D as D2}from "./AutoSliderList-tkaOmfnx.js";import{A as A3}from "./AvatarCrop-DrA-SARP.js";import{A as A4,L}from "./List-UAKCMuGC.js";import{B as B2}from "./Button-QIC7QPK9.js";import{C as C2}from "./Card3D-DMvCSUhe.js";import{C as C3}from "./Checkbox-daBabj14.js";import{E as E2,c as c6}from "./VirtualList-BAiIymCF.js";import{i as i2}from "./InjunctiveBox-DUNoNHCO.js";import{M}from "./MenuButton-DHkU5Bq7.js";import{m as m2}from "./Message-BGDILiLc.js";import{M as M2}from "./Modal-D2289ZPX.js";import{O,a as a4}from "./Input-DLOeg2pz.js";import{O as O2}from "./Select-B11NvK-I.js";import{P}from "./Pagination-m71H2tfS.js";import{p as p2}from "./PortalRenderer-CDAzQJgm.js";import{R,a as a5}from "./Radio-D_GKVoOC.js";import{S}from "./ScrollableTabs--449B73p.js";import{S as S2}from "./SvgImg-CZwq2D7J.js";import{S as S3}from "./Switch-C61q7rR5.js";import{T}from "./TemplateDialog-CAimG5cv.js";import{t as t2}from "./Toast-CQEsbqUJ.js";import{T as T2}from "./Tooltip-CgttMIcX.js";import{W}from "./Waterfall-C7SWCxJ1.js";export{A2 as AutoSliderList,A3 as AvatarCrop,A4 as AwaitList,B2 as Button,C2 as Card3D,C3 as Checkbox,D2 as Direction,E2 as EstimatedVirtualList,L as List,M as MenuButton,M2 as Modal,O as OnoInput,O2 as OnoSelect,a4 as OnoTextarea,P as Pagination,R as Radio,a5 as RadioGroup,S as ScrollableTabs,S2 as SvgImg,S3 as Switch,T as TemplateDialog,T2 as Tooltip,W as Waterfall,a2 as addCommasToNumber,b as addEventWithOriginHandler,a as adjustingColors,b2 as base64ToBlob,a3 as base64ToFile,c3 as blobToBase64,d2 as blobToFile,c2 as calculateAspectRatio,d as checkDeviceIsMobile,e as checkStatusCode,c as colorUtils,f as common,c4 as convertSecondToOtherTime,h as copy2Clipboard,c6 as createDataSource,c5 as createEventEmitter,i as createIntersectionObserver,j as dayOfYear,k as debounce,l as deepCopy,m as downloadFile,n as ellipsisString,f2 as fileToBase64,e2 as fileToBlob,o as formatFileSize,q as formatSecondes,f3 as formatTime,g as getElementCenterPosition,r as getFileName,s as getFileSuffix,u9 as getImageSIze,v as getPointDistance,w as getURLSearchParams,x as grayColor,i2 as injunctiveBox,y as isPureNumber,l2 as localFormat,z as mediaAutoplayPolicies,m2 as message,A as parseQuery,B as passwordStrength,C as pick,p2 as portalRenderer,D as printStr,p as pureNumber,E as quickSort,F as rafTimeout,G as randomString,H as safeCapitalizeWord,s2 as second2Day,I as singleton,t as throttle,t2 as toast,u10 as urlToBase64,g2 as urlToBlob,h2 as urlToFile,u as useClickOutSide,u2 as useCountdown,u3 as useEventListener,u4 as useGetElementSize,u5 as useKeyPress,u6 as useMouseClick,u7 as useTheme,u8 as useThemePro};