ono-react-element 0.0.16 → 0.0.18
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-w9mw0JCN.js → AutoSliderList-eb1CVc8b.js} +1 -1
- package/dist/es/Button-BsWI818a.js +29 -0
- package/dist/es/Modal-BsI-8rap.js +37 -0
- package/dist/es/ScrollableTabs--449B73p.js +34 -0
- package/dist/es/Select-B11NvK-I.js +34 -0
- package/dist/es/{Switch-CRJejHP9.js → Switch-BBHMaxoZ.js} +1 -1
- package/dist/es/{TemplateDialog-dD8BcnbA.js → TemplateDialog-PQxjmAJa.js} +1 -1
- package/dist/es/{Tooltip-j2AKREfX.js → Tooltip-CgttMIcX.js} +4 -4
- package/dist/es/VirtualList-CdhqyHFQ.js +60 -0
- package/dist/es/Waterfall-CY3QkL5m.js +50 -0
- package/dist/es/common.ts-vX9A6Rye.js +154 -0
- package/dist/es/event-CtX9rswE.js +28 -0
- package/dist/es/index.js +40 -34
- package/dist/index.css +1 -1
- package/dist/style/Button.css +1 -1
- package/dist/style/Modal.css +1 -1
- package/dist/style/ScrollableTabs.css +1 -0
- package/dist/style/Select.css +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/Button/types.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +0 -1
- package/dist/types/components/ScrollableTabs/ScrollableTab.d.ts +2 -0
- package/dist/types/components/ScrollableTabs/ScrollableTabs.d.ts +2 -0
- package/dist/types/components/ScrollableTabs/index.d.ts +1 -0
- package/dist/types/components/ScrollableTabs/types.d.ts +17 -0
- package/dist/types/components/Select/Option.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Select/types.d.ts +12 -12
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/event/createEventEmitter.d.ts +2 -0
- package/dist/types/event/eventEmitter.d.ts +7 -0
- package/dist/types/event/index.d.ts +1 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/utils/common.d.ts +22 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.br +0 -0
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +1 -16584
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/Button-C89izu2m.js +0 -26
- package/dist/es/Modal-BIFxRjSt.js +0 -32
- package/dist/es/Select-DAU6TuBu.js +0 -23
- package/dist/es/VirtualList-w16-kBkT.js +0 -65
- package/dist/es/Waterfall-CFVkuuCO.js +0 -55
- package/dist/es/common.ts-DQOEx8k3.js +0 -126
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as t } from "./dependencies-CbQbPZZ-.js";
|
|
2
2
|
import { u as e } from "./useGetElementSize.tsx-Dtshth0Y.js";
|
|
3
|
-
import { p as i } from "./common.ts-
|
|
3
|
+
import { p as i } from "./common.ts-vX9A6Rye.js";
|
|
4
4
|
import { useState as o, useRef as r, useMemo as n, useEffect as s, cloneElement as l } from "react";
|
|
5
5
|
var a = ((t2) => (t2.Horizontal = "Horizontal", t2.Vertical = "Vertical", t2))(a || {});
|
|
6
6
|
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" }) => {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { j as n } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
+
import { t as o } from "./common.ts-vX9A6Rye.js";
|
|
3
|
+
import { forwardRef as t, useState as e, useRef as i, useEffect as r } from "react";
|
|
4
|
+
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) => {
|
|
5
|
+
const [j, y] = e(false), x = i(null), C = i(null), v = t2 ? o(t2, m ? "number" == typeof m ? m : 500 : 0) : void 0;
|
|
6
|
+
return r(() => {
|
|
7
|
+
(() => {
|
|
8
|
+
if (!C.current) return;
|
|
9
|
+
const n2 = C.current;
|
|
10
|
+
a ? (y(true), n2.classList.add("ono-loading-start")) : (setTimeout(() => {
|
|
11
|
+
y(false);
|
|
12
|
+
}, 300), n2.classList.remove("ono-loading-start"), n2.classList.add("ono-loading-end"));
|
|
13
|
+
})();
|
|
14
|
+
}, [a, C]), r(() => {
|
|
15
|
+
(() => {
|
|
16
|
+
if (!x.current) return;
|
|
17
|
+
const n2 = x.current, o2 = n2.getBoundingClientRect();
|
|
18
|
+
n2.style.setProperty("--btn-height", o2.height + "px");
|
|
19
|
+
})();
|
|
20
|
+
}, [x]), r(() => {
|
|
21
|
+
b && x && ("function" == typeof b ? b(x.current) : b.current = x.current);
|
|
22
|
+
}, [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: [(() => {
|
|
23
|
+
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" }) }) }) });
|
|
24
|
+
return a || j ? o2 : g ? n.jsx("span", { children: g }) : n.jsx(n.Fragment, {});
|
|
25
|
+
})(), s2] });
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
s as B
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as o } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
+
import { a as e } from "./colorUtils.ts-DYuRvCXZ.js";
|
|
3
|
+
import { useState as n, useRef as l, useEffect as a } from "react";
|
|
4
|
+
import { p as t } from "./PortalRenderer-CDAzQJgm.js";
|
|
5
|
+
import { B as r } from "./Button-BsWI818a.js";
|
|
6
|
+
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 }) => {
|
|
7
|
+
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 = () => {
|
|
8
|
+
if (x) {
|
|
9
|
+
if (!N.current) return;
|
|
10
|
+
N.current.classList.remove("ono-modal-enter"), N.current.classList.add("ono-modal-leave"), setTimeout(() => {
|
|
11
|
+
B();
|
|
12
|
+
}, 300);
|
|
13
|
+
} else B();
|
|
14
|
+
};
|
|
15
|
+
return a(() => (k.current && (u ? k.current.showModal() : k.current.show()), () => {
|
|
16
|
+
k.current && k.current.close();
|
|
17
|
+
}), [k.current, u]), a(() => {
|
|
18
|
+
(() => {
|
|
19
|
+
if (!N.current) return;
|
|
20
|
+
const o2 = N.current.style;
|
|
21
|
+
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));
|
|
22
|
+
})();
|
|
23
|
+
}, [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 () => {
|
|
24
|
+
w(true);
|
|
25
|
+
try {
|
|
26
|
+
const o2 = b == null ? void 0 : b();
|
|
27
|
+
o2 instanceof Promise && await o2;
|
|
28
|
+
} finally {
|
|
29
|
+
w(false), T();
|
|
30
|
+
}
|
|
31
|
+
}, children: c ?? "Confirm" }), CancelBtn: () => o.jsx(r, { className: "ono-modal-box-footer-cancelBtn", disabled: h || g, onClick: () => {
|
|
32
|
+
f == null ? void 0 : f(), T();
|
|
33
|
+
}, children: d ?? "Cancel" }), handleClose: () => T() }) })] }) });
|
|
34
|
+
}, i = (o2) => t(s, o2, "ono-modal");
|
|
35
|
+
export {
|
|
36
|
+
i as M
|
|
37
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
+
import { forwardRef as t, useState as r, useRef as n, useEffect as l } from "react";
|
|
3
|
+
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) => {
|
|
4
|
+
const [h, u] = r(0), m = n(null);
|
|
5
|
+
return l(() => {
|
|
6
|
+
const e2 = m.current;
|
|
7
|
+
if (!e2 || h < 0) return;
|
|
8
|
+
const r2 = e2.offsetWidth, n2 = Array.from(e2.children);
|
|
9
|
+
if (h >= n2.length) return;
|
|
10
|
+
const l2 = parseInt(((a == null ? void 0 : a.gap) || getComputedStyle(e2).gap || "0").toString(), 10) || 0;
|
|
11
|
+
let o2 = 0;
|
|
12
|
+
switch (n2.slice(0, h + 1).forEach((e3) => o2 += e3.offsetWidth + l2), i) {
|
|
13
|
+
case "start":
|
|
14
|
+
e2.scrollLeft = o2 - n2[h].offsetWidth - l2;
|
|
15
|
+
break;
|
|
16
|
+
case "end":
|
|
17
|
+
e2.scrollLeft = o2 - r2;
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
o2 -= n2[h].offsetWidth / 2 + (t2 !== n2.length - 1 ? l2 : 0), e2.scrollLeft = o2 - r2 / 2;
|
|
21
|
+
}
|
|
22
|
+
}, [m, s2, t2, i]), l(() => {
|
|
23
|
+
u(t2 || 0);
|
|
24
|
+
}, [t2]), l(() => {
|
|
25
|
+
d && ("function" == typeof d ? d(m.current) : d.current = m.current);
|
|
26
|
+
}, [d]), e.jsx("ul", { ref: m, className: ["ono-scrollable-tabs", c].filter(Boolean).join(" "), style: a, onClick: (e2) => {
|
|
27
|
+
m.current && Array.from(m.current.children).some((t3, r2) => {
|
|
28
|
+
if (t3.contains(e2.target)) return u(r2), f == null ? void 0 : f(r2), true;
|
|
29
|
+
});
|
|
30
|
+
}, children: s2(o) });
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
s as S
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
-
import { p as n } from "./common.ts-
|
|
2
|
+
import { p as n } from "./common.ts-vX9A6Rye.js";
|
|
3
3
|
import { useRef as r, useEffect as c } from "react";
|
|
4
4
|
const t = ({ id: t2, text: i, style: s, color: l, checked: o, onChange: a, name: d = "", className: h, disabled: u = false }) => {
|
|
5
5
|
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" }];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
-
import { g as t } from "./common.ts-
|
|
2
|
+
import { g as t } from "./common.ts-vX9A6Rye.js";
|
|
3
3
|
import { useState as o, useRef as n, useEffect as r, useCallback as s } from "react";
|
|
4
4
|
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 }) => {
|
|
5
5
|
const [f, k] = o(false), g = n(null), x = () => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
-
import { u as
|
|
3
|
-
import { createPopper as
|
|
2
|
+
import { u as t } from "./useClickOutSide.tsx-CMvd2uTW.js";
|
|
3
|
+
import { createPopper as r } from "@popperjs/core";
|
|
4
4
|
import { useState as n, useRef as o, useEffect as c } from "react";
|
|
5
5
|
let s = null, l = null;
|
|
6
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
7
|
const [v, y] = n(false), g = o(null), k = o(null), b = (e2) => {
|
|
8
8
|
u == null ? void 0 : u(e2), y(e2);
|
|
9
9
|
};
|
|
10
|
-
return
|
|
10
|
+
return t(k, () => {
|
|
11
11
|
"click" !== a && "contextmenu" !== a || b(false);
|
|
12
12
|
}, { event: ["click", "contextmenu"], deps: [a, u] }), c(() => {
|
|
13
13
|
(() => {
|
|
@@ -17,7 +17,7 @@ const i = ({ children: i2, content: p, onOpenChange: u, trigger: a = "hover", pl
|
|
|
17
17
|
k.current.style.width = e2[0].getBoundingClientRect().width + "px";
|
|
18
18
|
})();
|
|
19
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 =
|
|
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
21
|
e2.styles.popper.width = `${e2.rects.reference.width}px`;
|
|
22
22
|
}, effect({ state: e2 }) {
|
|
23
23
|
e2.elements.popper.style.width = `${e2.elements.reference.offsetWidth}px`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
+
import { u as t } from "./useEventListener.tsx-BBGVcI5T.js";
|
|
3
|
+
import { t as r } from "./common.ts-vX9A6Rye.js";
|
|
4
|
+
import { memo as i, useState as n, useMemo as l, useRef as a, useEffect as s } from "react";
|
|
5
|
+
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" }) => {
|
|
6
|
+
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(() => {
|
|
7
|
+
var _a;
|
|
8
|
+
return m.startIndex > 0 ? (_a = S[m.startIndex - 1]) == null ? void 0 : _a.end : 0;
|
|
9
|
+
}, [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(() => {
|
|
10
|
+
const { scrollTop: e2, clientHeight: t2, scrollHeight: r2, scrollLeft: i3, clientWidth: n2, scrollWidth: l2 } = L.current, a2 = "vertical" === g ? r2 - t2 - e2 : l2 - n2 - i3;
|
|
11
|
+
b({ startIndex: A(S, "vertical" === g ? e2 : i3) }), ("vertical" === g ? e2 === w / 2 : i3 === w / 2) && b({ startIndex: 0 }), a2 <= 20 && o && o();
|
|
12
|
+
}, h), A = (e2, t2) => {
|
|
13
|
+
let r2 = 0, i3 = e2.length - 1, n2 = -1;
|
|
14
|
+
for (; r2 <= i3; ) {
|
|
15
|
+
const l2 = r2 + Math.floor((i3 - r2) / 2), a2 = e2[l2].end;
|
|
16
|
+
if (a2 === t2) return l2 + 1;
|
|
17
|
+
a2 < t2 ? r2 = l2 + 1 : ((-1 === n2 || n2 > l2) && (n2 = l2), i3 = l2 - 1);
|
|
18
|
+
}
|
|
19
|
+
return n2;
|
|
20
|
+
};
|
|
21
|
+
return t("scroll", E, { target: L.current, deps: [S, g] }), s(() => {
|
|
22
|
+
(() => {
|
|
23
|
+
if (!L.current) return;
|
|
24
|
+
const e2 = ("vertical" === g ? L.current.offsetHeight : L.current.offsetWidth) || 0;
|
|
25
|
+
b({ viewSize: e2, renderCount: Math.ceil(e2 / w) + 1 });
|
|
26
|
+
})();
|
|
27
|
+
}, [L, g]), s(() => {
|
|
28
|
+
d2.length && N && (() => {
|
|
29
|
+
var _a;
|
|
30
|
+
const e2 = [], t2 = d2.length - m.prevLen, r2 = t2 > 0 ? S.length : 0, i3 = r2 > 0 ? S[r2 - 1].end : 0;
|
|
31
|
+
for (let r3 = 0; r3 < (t2 > 0 ? t2 : d2.length); r3++) {
|
|
32
|
+
const n2 = d2[(t2 > 0 ? m.prevLen : 0) + r3];
|
|
33
|
+
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 });
|
|
34
|
+
}
|
|
35
|
+
z((r3) => [...t2 > 0 ? r3 : [], ...e2]), b({ prevLen: d2.length }), v && ((_a = L.current) == null ? void 0 : _a.scrollTo(0, 0));
|
|
36
|
+
})();
|
|
37
|
+
}, [N, d2, v]), s(() => {
|
|
38
|
+
(() => {
|
|
39
|
+
if (!N.current || 0 === S.length) return;
|
|
40
|
+
const e2 = Array.from(N.current.childNodes);
|
|
41
|
+
if (!e2.length) return;
|
|
42
|
+
e2.forEach((e3) => {
|
|
43
|
+
const t3 = e3.getBoundingClientRect(), r3 = +e3.getAttribute("data-virtual-id"), i4 = S[r3], n2 = i4.size - ("vertical" === g ? t3.height : t3.width);
|
|
44
|
+
n2 && (i4.size = "vertical" === g ? t3.height : t3.width, i4.end = i4.end - n2, i4.dSize = n2);
|
|
45
|
+
});
|
|
46
|
+
const t2 = +e2[0].getAttribute("data-virtual-id"), r2 = S.length;
|
|
47
|
+
let i3 = S[t2].dSize;
|
|
48
|
+
S[t2].dSize = 0;
|
|
49
|
+
for (let e3 = t2 + 1; e3 < r2; e3++) {
|
|
50
|
+
const t3 = S[e3];
|
|
51
|
+
t3.start = S[e3 - 1].end, t3.end = t3.end - i3, t3.dSize && (i3 += t3.dSize, t3.dSize = 0);
|
|
52
|
+
}
|
|
53
|
+
b({ listSize: S[r2 - 1].end });
|
|
54
|
+
})();
|
|
55
|
+
}, [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 }) });
|
|
56
|
+
}), c = (e2, t2) => e2.map((e3, r2) => ({ id: r2, data: t2(e3, r2) }));
|
|
57
|
+
export {
|
|
58
|
+
d as E,
|
|
59
|
+
c
|
|
60
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { j as e } from "./dependencies-CbQbPZZ-.js";
|
|
2
|
+
import { u as t } from "./useEventListener.tsx-BBGVcI5T.js";
|
|
3
|
+
import { t as a } from "./common.ts-vX9A6Rye.js";
|
|
4
|
+
import { useState as i, useRef as n, useCallback as o, useEffect as r } from "react";
|
|
5
|
+
const s = ({ options: s2, pageSize: l, children: d, request: m, reloadData: c, className: g, style: p, updateData: h, loading: u = true, bottomThreshold: f = 50 }) => {
|
|
6
|
+
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) => {
|
|
7
|
+
const a2 = c && x.reloadData !== c;
|
|
8
|
+
if (x.isFinish) return;
|
|
9
|
+
N({ loading: true });
|
|
10
|
+
const i2 = await m(e2, t2);
|
|
11
|
+
F(i2), N({ isFinish: !i2.length, imageList: a2 ? [...i2] : [...x.imageList, ...i2], page: e2 + 1, loading: false });
|
|
12
|
+
}, F = (e2) => y((t2) => {
|
|
13
|
+
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)];
|
|
14
|
+
return e2.forEach((e3) => {
|
|
15
|
+
const a3 = ((e4) => {
|
|
16
|
+
let t3 = 0, a4 = 0;
|
|
17
|
+
return t3 = e4.indexOf(Math.min(...e4)), a4 = e4[t3], { index: t3, height: a4 };
|
|
18
|
+
})(n2), o2 = Math.floor(e3.height * t2.imageWidth / e3.width);
|
|
19
|
+
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);
|
|
20
|
+
}), b(i2), t2;
|
|
21
|
+
}), M = o(() => {
|
|
22
|
+
if (!D.current) return;
|
|
23
|
+
const e2 = D.current.clientWidth;
|
|
24
|
+
let t2 = 0, a2 = x.page;
|
|
25
|
+
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) {
|
|
26
|
+
const a3 = Math.floor(e2 / x.imageWidth);
|
|
27
|
+
t2 = a3 - 1;
|
|
28
|
+
const i2 = t2 ? (e2 - a3 * x.imageWidth) / t2 : 0;
|
|
29
|
+
N({ columns: a3, gap: i2 });
|
|
30
|
+
} else {
|
|
31
|
+
t2 = x.columns - 1;
|
|
32
|
+
const a3 = (e2 - t2 * x.gap) / x.columns;
|
|
33
|
+
N({ imageWidth: a3 });
|
|
34
|
+
}
|
|
35
|
+
E(a2, l);
|
|
36
|
+
}, [x, c]), T = () => {
|
|
37
|
+
v.current && clearTimeout(v.current), v.current = setTimeout(M, 50);
|
|
38
|
+
}, z = a(() => {
|
|
39
|
+
const { scrollTop: e2, clientHeight: t2, scrollHeight: a2 } = L.current;
|
|
40
|
+
a2 - t2 - e2 > f || !x.loading && E(x.page, l);
|
|
41
|
+
}, 50);
|
|
42
|
+
return t("scroll", z, { target: L.current, deps: [x.loading, x.page] }), r(() => (M(), window.addEventListener("resize", T), () => {
|
|
43
|
+
window.removeEventListener("resize", T);
|
|
44
|
+
}), [D, c]), r(() => {
|
|
45
|
+
h && E(x.page, l);
|
|
46
|
+
}, [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)] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
s as W
|
|
50
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
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 }) => {
|
|
2
|
+
let s2 = 0, a2 = null;
|
|
3
|
+
t2.textContent && o2 && (s2 = t2.textContent.length, e2 = t2.textContent + e2);
|
|
4
|
+
const i2 = () => {
|
|
5
|
+
clearTimeout(a2);
|
|
6
|
+
const o3 = e2.substring(0, s2 + 1);
|
|
7
|
+
t2.textContent = o3, s2++, s2 !== e2.length ? a2 = setTimeout(i2, n2) : r2 && r2();
|
|
8
|
+
};
|
|
9
|
+
i2();
|
|
10
|
+
}, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), r = async (t2, e2) => {
|
|
11
|
+
const n2 = (t3, e3) => {
|
|
12
|
+
const n3 = window.URL.createObjectURL(t3), o2 = document.createElement("a");
|
|
13
|
+
o2.href = n3, o2.download = encodeURIComponent(e3), document.body.appendChild(o2), o2.click(), document.body.removeChild(o2), window.URL.revokeObjectURL(n3);
|
|
14
|
+
};
|
|
15
|
+
try {
|
|
16
|
+
if ("string" == typeof t2) {
|
|
17
|
+
const o2 = await fetch(t2);
|
|
18
|
+
if (!o2.ok) throw new Error(`Network response was not ok: ${o2.statusText}`);
|
|
19
|
+
n2(await o2.blob(), e2);
|
|
20
|
+
} else n2(t2, e2);
|
|
21
|
+
} catch (t3) {
|
|
22
|
+
console.error("文件下载失败:", t3 instanceof Error ? t3.message : String(t3));
|
|
23
|
+
}
|
|
24
|
+
}, s = (t2, e2) => {
|
|
25
|
+
t2.toString().startsWith("2") ? e2.onSuccess && e2.onSuccess() : (t2.toString().startsWith("4") || t2.toString().startsWith("5")) && e2.onFail && e2.onFail();
|
|
26
|
+
}, a = (t2) => {
|
|
27
|
+
const e2 = t2.getBoundingClientRect();
|
|
28
|
+
return { x: e2.left + e2.width / 2, y: e2.top + e2.height / 2 };
|
|
29
|
+
}, i = (t2, e2, n2) => {
|
|
30
|
+
const o2 = new IntersectionObserver(e2, n2);
|
|
31
|
+
t2 instanceof HTMLElement ? o2.observe(t2) : t2.forEach((t3) => o2.observe(t3));
|
|
32
|
+
}, c = (t2) => {
|
|
33
|
+
const e2 = Math.floor(t2 / 3600), n2 = Math.floor(t2 % 3600 / 60), o2 = Math.floor(t2 % 60), r2 = (t3) => t3.toString().padStart(2, "0");
|
|
34
|
+
return (e2 > 0 ? `${r2(e2)}:${r2(n2)}:${r2(o2)}` : `${r2(n2)}:${r2(o2)}`) + (t2 < 10 ? ".00" : t2 < 100 ? ".0" : "");
|
|
35
|
+
}, l = (t2) => {
|
|
36
|
+
if (t2.length < 2) return t2;
|
|
37
|
+
const e2 = t2[0], n2 = t2.slice(1).filter((t3) => t3 <= e2), o2 = t2.slice(1).filter((t3) => t3 > e2);
|
|
38
|
+
return [...l(n2), e2, ...l(o2)];
|
|
39
|
+
}, u = (t2, e2) => {
|
|
40
|
+
const n2 = ["B", "KB", "MB", "GB", "TB"], o2 = 1024;
|
|
41
|
+
let r2 = n2.indexOf((e2 == null ? void 0 : e2.unit) ?? "B");
|
|
42
|
+
if (-1 === r2) throw new Error("Invalid unit");
|
|
43
|
+
if (!(e2 == null ? void 0 : e2.unit)) for (; t2 / Math.pow(o2, r2) >= o2; ) r2++;
|
|
44
|
+
return `${(t2 / Math.pow(o2, r2)).toFixed((e2 == null ? void 0 : e2.decimalPlaces) ?? 0)} ${n2[r2]}`;
|
|
45
|
+
}, d = (t2, e2) => `${Math.floor(t2 / f(t2, e2))}:${Math.floor(e2 / f(t2, e2))}`, f = (t2, e2) => {
|
|
46
|
+
for (; 0 !== e2; ) {
|
|
47
|
+
const n2 = e2;
|
|
48
|
+
e2 = t2 % e2, t2 = n2;
|
|
49
|
+
}
|
|
50
|
+
return t2;
|
|
51
|
+
}, g = (t2, e2, n2) => {
|
|
52
|
+
t2.muted = true, t2.play();
|
|
53
|
+
const o2 = new AudioContext(), r2 = "running" === o2.state;
|
|
54
|
+
o2.close(), r2 ? (t2.muted = false, e2 == null ? void 0 : e2()) : n2 == null ? void 0 : n2();
|
|
55
|
+
}, h = (t2) => new URLSearchParams(window.location.search).get(t2), p = (t2) => {
|
|
56
|
+
let e2;
|
|
57
|
+
const n2 = new Proxy(t2, { construct: (t3, n3) => (e2 || (e2 = Reflect.construct(t3, n3)), e2) });
|
|
58
|
+
return n2.prototype.construct = n2, n2;
|
|
59
|
+
}, m = (t2) => "string" != typeof t2 || 0 === t2.length ? "" : t2.charAt(0).toUpperCase() + t2.slice(1), w = (t2) => {
|
|
60
|
+
if ("object" != typeof t2 || null === t2) return t2;
|
|
61
|
+
const e2 = Array.isArray(t2) ? [] : {};
|
|
62
|
+
for (const n2 in t2) Object.prototype.hasOwnProperty.call(t2, n2) && (e2[n2] = w(t2[n2]));
|
|
63
|
+
return e2;
|
|
64
|
+
}, b = (t2) => new Promise((e2) => {
|
|
65
|
+
const n2 = new Image();
|
|
66
|
+
n2.src = "string" == typeof t2 ? t2 : URL.createObjectURL(t2), n2.onload = () => e2({ width: n2.width, height: n2.height });
|
|
67
|
+
}), y = (t2, e2) => {
|
|
68
|
+
let n2 = 0;
|
|
69
|
+
const o2 = (r2) => {
|
|
70
|
+
n2 || (n2 = r2), r2 - n2 >= e2 ? t2() : requestAnimationFrame(o2);
|
|
71
|
+
};
|
|
72
|
+
requestAnimationFrame(o2);
|
|
73
|
+
}, S = (t2, e2, n2) => {
|
|
74
|
+
const o2 = t2[e2];
|
|
75
|
+
t2[e2] = function(t3) {
|
|
76
|
+
o2 && "function" == typeof o2 && o2.call(this, t3), n2.call(this, t3);
|
|
77
|
+
};
|
|
78
|
+
}, x = (t2) => {
|
|
79
|
+
if ("number" != typeof t2 || isNaN(t2)) throw new Error("请输入有效的数字");
|
|
80
|
+
const e2 = t2.toString().split(".");
|
|
81
|
+
return e2[0] = e2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), e2.join(".");
|
|
82
|
+
}, 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) => {
|
|
83
|
+
const e2 = {};
|
|
84
|
+
return t2.replace(/([^?=&]+)=([^&]+)/g, (t3, n2, o2) => e2[n2] = o2), e2;
|
|
85
|
+
}, v = (t2, ...e2) => Object.fromEntries(Object.entries(t2).filter(([t3]) => e2.includes(t3))), F = (t2) => {
|
|
86
|
+
if (!t2) return "";
|
|
87
|
+
const e2 = t2.lastIndexOf(".");
|
|
88
|
+
return -1 === e2 ? F(t2.substring(t2.lastIndexOf("/") + 1)) : t2.substring(0, e2);
|
|
89
|
+
}, I = (t2) => {
|
|
90
|
+
if (!t2) return "";
|
|
91
|
+
const e2 = t2.lastIndexOf(".");
|
|
92
|
+
return t2.substring(e2 + 1);
|
|
93
|
+
}, P = (t2, e2) => {
|
|
94
|
+
let n2 = null;
|
|
95
|
+
return (...o2) => {
|
|
96
|
+
n2 && clearTimeout(n2), n2 = setTimeout(() => {
|
|
97
|
+
t2(...o2), n2 = null;
|
|
98
|
+
}, e2);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
function R(t2, e2, n2 = {}) {
|
|
102
|
+
let o2, r2 = null, s2 = null, a2 = 0;
|
|
103
|
+
const i2 = false !== n2.leading, c2 = false !== n2.trailing;
|
|
104
|
+
function l2() {
|
|
105
|
+
s2 && (t2.apply(o2, s2), s2 = null);
|
|
106
|
+
}
|
|
107
|
+
function u2() {
|
|
108
|
+
const t3 = Date.now();
|
|
109
|
+
t3 - a2 >= e2 ? (c2 && s2 && l2(), r2 = null) : r2 = setTimeout(u2, e2 - (t3 - a2));
|
|
110
|
+
}
|
|
111
|
+
const d2 = function(...t3) {
|
|
112
|
+
const n3 = Date.now();
|
|
113
|
+
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)));
|
|
114
|
+
};
|
|
115
|
+
return d2.cancel = function() {
|
|
116
|
+
r2 && (clearTimeout(r2), r2 = null), a2 = 0, s2 = null;
|
|
117
|
+
}, d2;
|
|
118
|
+
}
|
|
119
|
+
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 };
|
|
120
|
+
export {
|
|
121
|
+
v as A,
|
|
122
|
+
n as B,
|
|
123
|
+
l as C,
|
|
124
|
+
y as D,
|
|
125
|
+
e as E,
|
|
126
|
+
m as F,
|
|
127
|
+
p as G,
|
|
128
|
+
x as a,
|
|
129
|
+
S as b,
|
|
130
|
+
d as c,
|
|
131
|
+
o as d,
|
|
132
|
+
s as e,
|
|
133
|
+
$ as f,
|
|
134
|
+
a as g,
|
|
135
|
+
T as h,
|
|
136
|
+
i,
|
|
137
|
+
M as j,
|
|
138
|
+
P as k,
|
|
139
|
+
w as l,
|
|
140
|
+
r as m,
|
|
141
|
+
u as n,
|
|
142
|
+
c as o,
|
|
143
|
+
C as p,
|
|
144
|
+
F as q,
|
|
145
|
+
I as r,
|
|
146
|
+
b as s,
|
|
147
|
+
R as t,
|
|
148
|
+
O as u,
|
|
149
|
+
h as v,
|
|
150
|
+
E as w,
|
|
151
|
+
g as x,
|
|
152
|
+
A as y,
|
|
153
|
+
t as z
|
|
154
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
};
|
package/dist/es/index.js
CHANGED
|
@@ -7,31 +7,33 @@ import { u as u6 } from "./useMouseClick.tsx-C7uAH4n4.js";
|
|
|
7
7
|
import { u as u7 } from "./useTheme.tsx-C5b7BRYz.js";
|
|
8
8
|
import { u as u8 } from "./useThemePro.tsx-DQuSI8J7.js";
|
|
9
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,
|
|
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
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
12
|
import { c as c4, f as f3, l as l2, s as s2 } from "./formatTimeUtils.ts-CkdWJ_Sl.js";
|
|
13
|
-
import {
|
|
13
|
+
import { c as c5 } from "./event-CtX9rswE.js";
|
|
14
|
+
import { A as A2, D as D2 } from "./AutoSliderList-eb1CVc8b.js";
|
|
14
15
|
import { A as A3 } from "./AvatarCrop-DrA-SARP.js";
|
|
15
16
|
import { A as A4, L } from "./List-UAKCMuGC.js";
|
|
16
|
-
import { B as B2 } from "./Button-
|
|
17
|
+
import { B as B2 } from "./Button-BsWI818a.js";
|
|
17
18
|
import { C as C2 } from "./Card3D-DMvCSUhe.js";
|
|
18
19
|
import { C as C3 } from "./Checkbox-daBabj14.js";
|
|
19
|
-
import { E as E2, c as
|
|
20
|
+
import { E as E2, c as c6 } from "./VirtualList-CdhqyHFQ.js";
|
|
20
21
|
import { i as i2 } from "./InjunctiveBox-DUNoNHCO.js";
|
|
21
22
|
import { M } from "./MenuButton-DHkU5Bq7.js";
|
|
22
23
|
import { m as m2 } from "./Message-BGDILiLc.js";
|
|
23
|
-
import { M as M2 } from "./Modal-
|
|
24
|
+
import { M as M2 } from "./Modal-BsI-8rap.js";
|
|
24
25
|
import { O, a as a4 } from "./Input-DLOeg2pz.js";
|
|
25
|
-
import { O as O2 } from "./Select-
|
|
26
|
+
import { O as O2 } from "./Select-B11NvK-I.js";
|
|
26
27
|
import { P } from "./Pagination-m71H2tfS.js";
|
|
27
28
|
import { p as p2 } from "./PortalRenderer-CDAzQJgm.js";
|
|
28
29
|
import { R, a as a5 } from "./Radio-D_GKVoOC.js";
|
|
29
|
-
import { S } from "./
|
|
30
|
-
import { S as S2 } from "./
|
|
31
|
-
import {
|
|
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";
|
|
32
34
|
import { t as t2 } from "./Toast-CQEsbqUJ.js";
|
|
33
|
-
import { T as T2 } from "./Tooltip-
|
|
34
|
-
import { W } from "./Waterfall-
|
|
35
|
+
import { T as T2 } from "./Tooltip-CgttMIcX.js";
|
|
36
|
+
import { W } from "./Waterfall-CY3QkL5m.js";
|
|
35
37
|
export {
|
|
36
38
|
A2 as AutoSliderList,
|
|
37
39
|
A3 as AvatarCrop,
|
|
@@ -50,8 +52,9 @@ export {
|
|
|
50
52
|
P as Pagination,
|
|
51
53
|
R as Radio,
|
|
52
54
|
a5 as RadioGroup,
|
|
53
|
-
S as
|
|
54
|
-
S2 as
|
|
55
|
+
S as ScrollableTabs,
|
|
56
|
+
S2 as SvgImg,
|
|
57
|
+
S3 as Switch,
|
|
55
58
|
T as TemplateDialog,
|
|
56
59
|
T2 as Tooltip,
|
|
57
60
|
W as Waterfall,
|
|
@@ -69,39 +72,42 @@ export {
|
|
|
69
72
|
f as common,
|
|
70
73
|
c4 as convertSecondToOtherTime,
|
|
71
74
|
h as copy2Clipboard,
|
|
72
|
-
|
|
75
|
+
c6 as createDataSource,
|
|
76
|
+
c5 as createEventEmitter,
|
|
73
77
|
i as createIntersectionObserver,
|
|
74
78
|
j as dayOfYear,
|
|
75
|
-
k as
|
|
76
|
-
l as
|
|
79
|
+
k as debounce,
|
|
80
|
+
l as deepCopy,
|
|
81
|
+
m as downloadFile,
|
|
77
82
|
f2 as fileToBase64,
|
|
78
83
|
e2 as fileToBlob,
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
n as formatFileSize,
|
|
85
|
+
o as formatSecondes,
|
|
81
86
|
f3 as formatTime,
|
|
82
87
|
g as getElementCenterPosition,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
q as getFileName,
|
|
89
|
+
r as getFileSuffix,
|
|
90
|
+
s as getImageSIze,
|
|
91
|
+
u9 as getPointDistance,
|
|
92
|
+
v as getURLSearchParams,
|
|
93
|
+
w as grayColor,
|
|
89
94
|
i2 as injunctiveBox,
|
|
90
95
|
l2 as localFormat,
|
|
91
|
-
|
|
96
|
+
x as mediaAutoplayPolicies,
|
|
92
97
|
m2 as message,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
y as parseQuery,
|
|
99
|
+
z as passwordStrength,
|
|
100
|
+
A as pick,
|
|
96
101
|
p2 as portalRenderer,
|
|
97
|
-
|
|
102
|
+
B as printStr,
|
|
98
103
|
p as pureNumber,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
C as quickSort,
|
|
105
|
+
D as rafTimeout,
|
|
106
|
+
E as randomString,
|
|
107
|
+
F as safeCapitalizeWord,
|
|
103
108
|
s2 as second2Day,
|
|
104
|
-
|
|
109
|
+
G as singleton,
|
|
110
|
+
t as throttle,
|
|
105
111
|
t2 as toast,
|
|
106
112
|
u10 as urlToBase64,
|
|
107
113
|
g2 as urlToBlob,
|