ono-react-element 0.0.12 → 0.0.13

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 (53) hide show
  1. package/dist/es/{AutoSliderList-DCpCHe1X.js → AutoSliderList-w9mw0JCN.js} +9 -9
  2. package/dist/es/InjunctiveBox-DUNoNHCO.js +11 -0
  3. package/dist/es/{Input-CYA8Q8B5.js → Input-DLOeg2pz.js} +30 -30
  4. package/dist/es/Message-BGDILiLc.js +105 -0
  5. package/dist/es/{Modal-D4gV43Cy.js → Modal-BIFxRjSt.js} +10 -10
  6. package/dist/es/{Select-CJuIMAoG.js → Select-DAU6TuBu.js} +6 -6
  7. package/dist/es/{Switch-CN3M5pXb.js → Switch-CRJejHP9.js} +13 -13
  8. package/dist/es/{TemplateDialog-DKEBuvXA.js → TemplateDialog-dD8BcnbA.js} +9 -9
  9. package/dist/es/{Toast-DHu6WOZ0.js → Toast-CQEsbqUJ.js} +27 -27
  10. package/dist/es/{Tooltip-Dj8ZeMVG.js → Tooltip-j2AKREfX.js} +13 -13
  11. package/dist/es/VirtualList-w16-kBkT.js +65 -0
  12. package/dist/es/{Waterfall-Ce9ZeKxm.js → Waterfall-CFVkuuCO.js} +17 -17
  13. package/dist/es/colorUtils.ts-DYuRvCXZ.js +145 -0
  14. package/dist/es/common.ts-DQOEx8k3.js +126 -0
  15. package/dist/es/fileFormatConversion.ts-tUlewYon.js +38 -0
  16. package/dist/es/formatTimeUtils.ts-CkdWJ_Sl.js +32 -0
  17. package/dist/es/index.js +96 -185
  18. package/dist/es/useClickOutSide.tsx-CMvd2uTW.js +15 -0
  19. package/dist/es/useCountdown.tsx-Btzj-keH.js +16 -0
  20. package/dist/es/useEventListener.tsx-BBGVcI5T.js +12 -0
  21. package/dist/es/useGetElementSize.tsx-Dtshth0Y.js +22 -0
  22. package/dist/es/useKeyPress.tsx-Db44HXXz.js +18 -0
  23. package/dist/es/useMouseClick.tsx-C7uAH4n4.js +12 -0
  24. package/dist/es/useTheme.tsx-C5b7BRYz.js +24 -0
  25. package/dist/es/useThemePro.tsx-DQuSI8J7.js +20 -0
  26. package/dist/es/viewTransitionUtils.ts-CHa9uBpi.js +19 -0
  27. package/dist/index.css +1 -1
  28. package/dist/style/Button.css +1 -1
  29. package/dist/style/Message.css +1 -1
  30. package/dist/style/Modal.css +1 -1
  31. package/dist/style/Toast.css +1 -1
  32. package/dist/style/index.css +1 -1
  33. package/dist/types/hooks/useClickOutSide.d.ts +2 -2
  34. package/dist/types/hooks/useCountdown.d.ts +2 -1
  35. package/dist/types/hooks/useEventListener.d.ts +2 -2
  36. package/dist/types/hooks/useGetElementSize.d.ts +2 -1
  37. package/dist/types/hooks/useKeyPress.d.ts +2 -2
  38. package/dist/types/hooks/useMouseClick.d.ts +2 -1
  39. package/dist/types/hooks/useTheme.d.ts +2 -2
  40. package/dist/types/hooks/useThemePro.d.ts +2 -2
  41. package/dist/types/index.d.ts +8 -1
  42. package/dist/umd/index.css +1 -1
  43. package/dist/umd/index.css.br +0 -0
  44. package/dist/umd/index.css.gz +0 -0
  45. package/dist/umd/index.umd.cjs +393 -393
  46. package/dist/umd/index.umd.cjs.br +0 -0
  47. package/dist/umd/index.umd.cjs.gz +0 -0
  48. package/package.json +1 -1
  49. package/dist/es/InjunctiveBox-DsntB_UW.js +0 -11
  50. package/dist/es/Message-GvTC61N0.js +0 -68
  51. package/dist/es/VirtualList-BBvdkGKk.js +0 -65
  52. package/dist/es/utils-BxXROOPY.js +0 -394
  53. package/dist/types/hooks/index.d.ts +0 -8
@@ -1,13 +1,13 @@
1
1
  import { j as t } from "./dependencies-CbQbPZZ-.js";
2
- import { p as e } from "./utils-BxXROOPY.js";
3
- import { useState as i, useRef as o, useMemo as r, useEffect as n, cloneElement as s } from "react";
4
- import { useGetElementSize as l } from "./index.js";
2
+ import { u as e } from "./useGetElementSize.tsx-Dtshth0Y.js";
3
+ import { p as i } from "./common.ts-DQOEx8k3.js";
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
- 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: g = "ease-in-out" }) => {
7
- const [z, H] = i(false), [T, $] = i(0), [v, A] = i({ t: 0, l: 0 }), [C, N] = i({ w: 0, h: 0 }), b = o(null), B = o(null), k = r(() => ["width", "height", "transform"].map((t2) => `${t2} ${x / 1e3}s ${g}`).join(","), [j, x, g]), D = r(() => ({ width: C.w, height: C.h, transition: z ? k : "initial", transform: `translate(${v.l}px, ${v.t}px)` }), [C, v]), { w: I, h: L } = l();
8
- return n(() => {
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" }) => {
7
+ const [g, H] = o(false), [T, $] = o(0), [v, A] = o({ t: 0, l: 0 }), [C, N] = o({ w: 0, h: 0 }), b = r(null), B = r(null), S = n(() => ["width", "height", "transform"].map((t2) => `${t2} ${x / 1e3}s ${z}`).join(","), [j, x, z]), k = n(() => ({ width: C.w, height: C.h, transition: g ? S : "initial", transform: `translate(${v.l}px, ${v.t}px)` }), [C, v]), { w: D, h: E } = e();
8
+ return s(() => {
9
9
  $(y);
10
- }, [y]), n(() => {
10
+ }, [y]), s(() => {
11
11
  (() => {
12
12
  if ("number" != typeof T) return;
13
13
  if (!b.current || !B.current) return;
@@ -15,10 +15,10 @@ const c = ({ list: c2, style: d, disable: f, children: m, sliderBox: u, classNam
15
15
  t2.forEach((t3) => {
16
16
  t3.style.position = "relative", t3.style.cursor = f ? "not-allowed" : "pointer", t3.style.zIndex = "1";
17
17
  });
18
- const i2 = window.getComputedStyle(b.current), o2 = { t: "Horizontal" === j ? e(i2.paddingTop) : t2[T].offsetTop, l: "Horizontal" === j ? t2[T].offsetLeft : e(i2.paddingLeft) };
18
+ const e2 = window.getComputedStyle(b.current), o2 = { t: "Horizontal" === j ? i(e2.paddingTop) : t2[T].offsetTop, l: "Horizontal" === j ? t2[T].offsetLeft : i(e2.paddingLeft) };
19
19
  A(o2), N({ w: t2[T].offsetWidth, h: t2[T].offsetHeight }), setTimeout(() => H(true), x);
20
20
  })();
21
- }, [T, I, L, f]), t.jsxs("ul", { ref: b, className: ["ono-auto-slider-list-container", p, f ? "ono-auto-slider-list-is-disable" : ""].filter(Boolean).join(" "), style: { flexDirection: "Horizontal" === j ? "row" : "column", ...d }, children: [t.jsx("li", { ref: B, className: ["ono-auto-slider-list-slider", w].filter(Boolean).join(" "), style: { ...h, ...D }, children: u }), c2.map((t2, e2) => s(m({ item: t2, index: e2, isActive: e2 === T }), { onClick: (i2) => {
21
+ }, [T, D, E, f]), t.jsxs("ul", { ref: b, className: ["ono-auto-slider-list-container", p, f ? "ono-auto-slider-list-is-disable" : ""].filter(Boolean).join(" "), style: { flexDirection: "Horizontal" === j ? "row" : "column", ...d }, children: [t.jsx("li", { ref: B, className: ["ono-auto-slider-list-slider", w].filter(Boolean).join(" "), style: { ...h, ...k }, children: u }), c2.map((t2, e2) => l(m({ item: t2, index: e2, isActive: e2 === T }), { onClick: (i2) => {
22
22
  if (f) return;
23
23
  const o2 = m({ item: t2, index: e2, isActive: e2 === T }).props.onClick;
24
24
  o2 && o2(i2), $(e2);
@@ -0,0 +1,11 @@
1
+ import { j as e, R as o } from "./dependencies-CbQbPZZ-.js";
2
+ import { u as n } from "./useEventListener.tsx-BBGVcI5T.js";
3
+ let s, t = null;
4
+ const l = ({ className: o2, content: s2, style: l2, onClick: u2, onDoubleClick: i2, onContextMenu: c, onMouseDown: r, onMouseUp: a, onMouseEnter: M, onMouseLeave: d, onMouseMove: m, isClickBoxToClose: p }) => (n("click", () => {
5
+ p && t && (t.remove(), t = null);
6
+ }), e.jsx("div", { className: o2, style: l2, onClick: u2, onDoubleClick: i2, onContextMenu: c, onMouseDown: r, onMouseUp: a, onMouseEnter: M, onMouseLeave: d, onMouseMove: m, children: "function" == typeof s2 ? s2((e2) => {
7
+ t && (t.remove(), t = null, e2 && e2());
8
+ }) : s2 })), u = (o2) => (i(o2.isSingle || false).render(e.jsx(l, { ...o2 })), t), i = (e2) => (e2 && t && s || (t = document.createElement("div"), document.body.appendChild(t), s = o.createRoot(t)), s);
9
+ export {
10
+ u as i
11
+ };
@@ -1,32 +1,32 @@
1
1
  import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { useState as o, useRef as n, useEffect as t } from "react";
3
- import { useKeyPress as a } from "./index.js";
4
- const r = () => e.jsx("svg", { className: "ono-input-icon", viewBox: "64 64 896 896", focusable: "false", "data-icon": "close-circle", fill: "currentColor", "aria-hidden": "true", children: e.jsx("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }) }), s = ({ open: o2 }) => e.jsx("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": o2 ? "eye" : "eye-invisible", fill: "currentColor", "aria-hidden": "true", className: "ono-input-icon", children: o2 ? e.jsx("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" }) : e.jsxs(e.Fragment, { children: [e.jsx("path", { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" }), e.jsx("path", { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" })] }) }), l = ({ id: a2, name: l2, max: i2, min: c, maxLength: d, minLength: u, type: p = "text", className: m, defaultValue: h, placeholder: x, readonly: f, autocomplete: y = "off", autofocus: g, form: v, disabled: b, clearable: C, showPassword: j, prepend: w, append: N, prefix: L, suffix: z, showCount: S, border: B = "1px solid #5644b8", boxShadow: M = "0 0 0 2px #7969d11a", value: k = "", onChange: P, onFocus: F, onBlur: E, onClear: O }) => {
5
- const [q, D] = o(k), [Q, R] = o(false), [Y, V] = o(false), W = n(null), $ = C && !b && q, A = j && !b;
6
- return t(() => {
2
+ import { useState as o, useRef as t, useEffect as n } from "react";
3
+ import { u as a } from "./useKeyPress.tsx-Db44HXXz.js";
4
+ const s = () => e.jsx("svg", { className: "ono-input-icon", viewBox: "64 64 896 896", focusable: "false", "data-icon": "close-circle", fill: "currentColor", "aria-hidden": "true", children: e.jsx("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }) }), r = ({ open: o2 }) => e.jsx("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": o2 ? "eye" : "eye-invisible", fill: "currentColor", "aria-hidden": "true", className: "ono-input-icon", children: o2 ? e.jsx("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" }) : e.jsxs(e.Fragment, { children: [e.jsx("path", { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" }), e.jsx("path", { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" })] }) }), l = ({ id: a2, name: l2, max: i2, min: c, maxLength: d, minLength: u, type: p = "text", className: m, defaultValue: h, placeholder: x, readonly: f, autocomplete: y = "off", autofocus: g, form: v, disabled: b, clearable: C, showPassword: j, prepend: w, append: N, prefix: L, suffix: z, showCount: S, border: B = "1px solid #5644b8", boxShadow: M = "0 0 0 2px #7969d11a", value: P = "", onChange: k, onFocus: F, onBlur: E, onClear: O }) => {
5
+ const [q, D] = o(P), [Q, R] = o(false), [Y, V] = o(false), W = t(null), $ = C && !b && q, A = j && !b;
6
+ return n(() => {
7
7
  W.current && (W.current.style.setProperty("--ono-input-border", B), W.current.style.setProperty("--ono-input-box-shadow", M));
8
- }, [W]), t(() => {
9
- D(k);
10
- }, [k]), e.jsxs("div", { className: ["ono-input", "ono-input-border", b ? "ono-input-is-disabled" : ""].filter(Boolean).join(" "), children: [w && e.jsx("div", { className: "ono-prepend", children: w }), e.jsxs("div", { ref: W, className: ["ono-input-wrapper", Q ? "ono-input-is-focus" : "", m].filter(Boolean).join(" "), onMouseDown: (e2) => {
8
+ }, [W]), n(() => {
9
+ D(P);
10
+ }, [P]), e.jsxs("div", { className: ["ono-input", "ono-input-border", b ? "ono-input-is-disabled" : ""].filter(Boolean).join(" "), children: [w && e.jsx("div", { className: "ono-prepend", children: w }), e.jsxs("div", { ref: W, className: ["ono-input-wrapper", Q ? "ono-input-is-focus" : "", m].filter(Boolean).join(" "), onMouseDown: (e2) => {
11
11
  "INPUT" !== e2.target.tagName && e2.preventDefault();
12
12
  }, children: [L && e.jsx("span", { className: "ono-prefix", children: L }), e.jsx("input", { id: a2, max: i2, min: c, name: l2, maxLength: d, minLength: u, defaultValue: h, className: "ono-input-inner", type: j ? Y ? "text" : "password" : p, placeholder: x, readOnly: f, autoComplete: y, autoFocus: g, form: v, disabled: b, onFocus: (e2) => {
13
13
  F == null ? void 0 : F(e2), R(true);
14
14
  }, onBlur: (e2) => {
15
15
  E == null ? void 0 : E(e2), R(false);
16
16
  }, value: q, onChange: (e2) => {
17
- P == null ? void 0 : P(e2), D(e2.target.value);
17
+ k == null ? void 0 : k(e2), D(e2.target.value);
18
18
  } }), (z || $ || A || S) && e.jsxs("span", { className: "ono-suffix", children: [z, $ && e.jsx("button", { className: "ono-clear-icon", onClick: () => {
19
19
  O == null ? void 0 : O(), D("");
20
- }, children: e.jsx(r, {}) }), A && e.jsx("button", { className: "ono-eye-icon", onClick: () => V(!Y), children: e.jsx(s, { open: Y }) }), S && d && e.jsxs("p", { className: "ono-count", children: [q.length, "/", d] })] })] }), N && e.jsx("div", { className: "ono-append", children: N })] });
21
- }, i = ({ id: r2, name: s2, rows: l2, maxLength: i2, minLength: c, className: d, placeholder: u, readonly: p, resize: m = true, autocomplete: h = "off", autofocus: x, form: f, disabled: y, autoSize: g, showCount: v, border: b = "1px solid #5644b8", boxShadow: C = "0 0 0 2px #7969d11a", value: j = "", onChange: w }) => {
22
- const [N, L] = o(j), [z, S] = o(false), [B, M] = o([j]), [k, P] = o(0), F = n(null), E = (e2) => {
23
- const o2 = B.slice(0, k + 1);
24
- o2.push(e2), M(o2), P(o2.length - 1);
20
+ }, children: e.jsx(s, {}) }), A && e.jsx("button", { className: "ono-eye-icon", onClick: () => V(!Y), children: e.jsx(r, { open: Y }) }), S && d && e.jsxs("p", { className: "ono-count", children: [q.length, "/", d] })] })] }), N && e.jsx("div", { className: "ono-append", children: N })] });
21
+ }, i = ({ id: s2, name: r2, rows: l2, maxLength: i2, minLength: c, className: d, placeholder: u, readonly: p, resize: m = true, autocomplete: h = "off", autofocus: x, form: f, disabled: y, autoSize: g, showCount: v, border: b = "1px solid #5644b8", boxShadow: C = "0 0 0 2px #7969d11a", value: j = "", onChange: w }) => {
22
+ const [N, L] = o(j), [z, S] = o(false), [B, M] = o([j]), [P, k] = o(0), F = t(null), E = (e2) => {
23
+ const o2 = B.slice(0, P + 1);
24
+ o2.push(e2), M(o2), k(o2.length - 1);
25
25
  }, O = [{ key: "CommandOrControl+z", handler: (e2) => {
26
26
  document.activeElement === F.current && (e2.preventDefault(), (() => {
27
- if (k > 0 && F.current) {
28
- const e3 = k - 1, o2 = B[e3];
29
- if (F.current.value = o2, L(o2), P(e3), w) {
27
+ if (P > 0 && F.current) {
28
+ const e3 = P - 1, o2 = B[e3];
29
+ if (F.current.value = o2, L(o2), k(e3), w) {
30
30
  const e4 = { target: F.current };
31
31
  w(e4);
32
32
  }
@@ -36,8 +36,8 @@ const r = () => e.jsx("svg", { className: "ono-input-icon", viewBox: "64 64 896
36
36
  if (F.current && document.activeElement === F.current) {
37
37
  e2.preventDefault();
38
38
  const o2 = ((e3) => {
39
- const { value: o3, selectionStart: n2, selectionEnd: t2 } = e3, a2 = o3.substring(0, n2) + o3.substring(t2);
40
- return e3.value = a2, e3.setSelectionRange(n2, n2), a2;
39
+ const { value: o3, selectionStart: t2, selectionEnd: n2 } = e3, a2 = o3.substring(0, t2) + o3.substring(n2);
40
+ return e3.value = a2, e3.setSelectionRange(t2, t2), a2;
41
41
  })(F.current);
42
42
  if (L(o2), E(o2), w) {
43
43
  const e3 = { target: F.current };
@@ -45,32 +45,32 @@ const r = () => e.jsx("svg", { className: "ono-input-icon", viewBox: "64 64 896
45
45
  }
46
46
  }
47
47
  }, deps: [B] }];
48
- return O.forEach(({ key: e2, handler: o2, deps: n2 }) => a(e2, o2, { target: F.current, deps: n2 })), t(() => {
48
+ return O.forEach(({ key: e2, handler: o2, deps: t2 }) => a(e2, o2, { target: F.current, deps: t2 })), n(() => {
49
49
  L(j);
50
- }, [j]), t(() => {
50
+ }, [j]), n(() => {
51
51
  (() => {
52
52
  if (!F.current) return;
53
53
  const e2 = F.current;
54
- ((e3, o2, n2, t2, a2) => {
55
- const r3 = e3.parentNode;
56
- e3.style.resize = o2 ? "none" : n2 ? "vertical" : "none", r3.style.setProperty("--ono-input-border", t2), r3.style.setProperty("--ono-input-box-shadow", a2), r3.style.setProperty("--ono-input-height", "auto");
54
+ ((e3, o2, t2, n2, a2) => {
55
+ const s3 = e3.parentNode;
56
+ e3.style.resize = o2 ? "none" : t2 ? "vertical" : "none", s3.style.setProperty("--ono-input-border", n2), s3.style.setProperty("--ono-input-box-shadow", a2), s3.style.setProperty("--ono-input-height", "auto");
57
57
  })(e2, g || false, m, b, C), g && ((e3, o2) => {
58
- const { minRows: n2 = 2, maxRows: t2 } = "object" == typeof o2 ? o2 : {}, a2 = document.createElement("div");
58
+ const { minRows: t2 = 2, maxRows: n2 } = "object" == typeof o2 ? o2 : {}, a2 = document.createElement("div");
59
59
  a2.style.position = "absolute", a2.style.visibility = "hidden", a2.style.whiteSpace = "pre-wrap", a2.style.wordWrap = "break-word", a2.style.width = `${e3.clientWidth}px`, a2.style.font = getComputedStyle(e3).font, a2.style.padding = getComputedStyle(e3).padding, a2.style.border = getComputedStyle(e3).border, a2.style.boxSizing = "border-box", document.body.appendChild(a2);
60
- const r3 = 34 * n2;
61
- let s3 = r3;
60
+ const s3 = 34 * t2;
61
+ let r3 = s3;
62
62
  if (e3.value) {
63
63
  a2.textContent = e3.value;
64
64
  const o3 = a2.offsetHeight;
65
- s3 = Math.max(r3, o3), t2 && s3 > 34 * t2 ? (s3 = 34 * t2, e3.style.overflowY = "auto") : e3.style.overflowY = "hidden";
65
+ r3 = Math.max(s3, o3), n2 && r3 > 34 * n2 ? (r3 = 34 * n2, e3.style.overflowY = "auto") : e3.style.overflowY = "hidden";
66
66
  } else e3.style.overflowY = "hidden";
67
- e3.style.height = `${s3}px`, e3.style.resize = o2 ? "none" : "vertical", document.body.removeChild(a2), Math.floor(s3 / 34);
67
+ e3.style.height = `${r3}px`, e3.style.resize = o2 ? "none" : "vertical", document.body.removeChild(a2), Math.floor(r3 / 34);
68
68
  })(e2, g);
69
69
  })();
70
70
  }, [F, g, N]), e.jsxs("div", { className: ["ono-textarea", y ? "ono-input-is-disabled" : ""].filter(Boolean).join(" "), children: [e.jsx("div", { className: ["ono-textarea-wrapper", z ? "none" === b ? "" : "ono-input-is-focus" : "", d].filter(Boolean).join(" "), onClick: () => {
71
71
  var _a;
72
72
  return (_a = F.current) == null ? void 0 : _a.focus();
73
- }, children: e.jsx("textarea", { ref: F, className: "ono-textarea-inner", id: r2, rows: l2, name: s2, maxLength: i2, minLength: c, placeholder: u, readOnly: p, autoComplete: h, autoFocus: x, form: f, disabled: y, onFocus: () => S(true), onBlur: () => S(false), value: N, onChange: (e2) => {
73
+ }, children: e.jsx("textarea", { ref: F, className: "ono-textarea-inner", id: s2, rows: l2, name: r2, maxLength: i2, minLength: c, placeholder: u, readOnly: p, autoComplete: h, autoFocus: x, form: f, disabled: y, onFocus: () => S(true), onBlur: () => S(false), value: N, onChange: (e2) => {
74
74
  L(e2.target.value), E(e2.target.value), w == null ? void 0 : w(e2);
75
75
  } }) }), v && i2 && e.jsx("p", { className: "ono-count-bar", onClick: (e2) => e2.stopPropagation(), children: N.length + "/" + i2 })] });
76
76
  };
@@ -0,0 +1,105 @@
1
+ import { j as e } from "./dependencies-CbQbPZZ-.js";
2
+ import { useState as s, useRef as o, useMemo as t, useCallback as n, useEffect as r } from "react";
3
+ import { p as a } from "./PortalRenderer-CDAzQJgm.js";
4
+ let i = 1;
5
+ const c = [], l = (e2, s2, o2) => (0 === c.length && (i = 1), p(s2.instancesKey || "", e2, { id: `${o2}-${i++}`, key: s2.instancesKey || "", reactNode: e2, props: s2, offsetOptions: { topOffset: 0, height: 0, bottomOffset: 0 } }), c), d = (e2) => {
6
+ const s2 = c.findIndex((s3) => s3.id === e2);
7
+ return s2 <= 0 ? 0 : c[s2 - 1].offsetOptions.bottomOffset;
8
+ }, p = (e2, s2, o2) => {
9
+ const t2 = (e3) => a(s2, { zIndex: 999 + i - 1, ...e3.props, id: e3.id }, e3.id, "ono-message-root");
10
+ if (!e2) {
11
+ const e3 = t2(o2);
12
+ c.push({ ...o2, props: { ...o2.props, id: o2.id, destroy: e3 }, destroy: e3 });
13
+ }
14
+ let n2 = false;
15
+ const r2 = c.map((s3) => {
16
+ if (s3.key === e2) {
17
+ n2 = true;
18
+ const e3 = { ...s3.props, ...o2.props };
19
+ return { ...s3, props: e3 };
20
+ }
21
+ {
22
+ const e3 = t2(s3);
23
+ return { ...s3, props: { ...s3.props, id: s3.id, destroy: e3 }, destroy: e3 };
24
+ }
25
+ });
26
+ if (Object.assign(c, r2), !n2) {
27
+ const e3 = t2(o2);
28
+ c.push({ ...o2, props: { ...o2.props, id: o2.id, destroy: e3 }, destroy: e3 });
29
+ }
30
+ }, f = { info: { light: "#1677ff", dark: "#1677ff" }, success: { light: "#52c41a", dark: "#49aa19" }, error: { light: "#ff4d4f", dark: "#a61d24" }, warning: { light: "#faad14", dark: "#d89614" }, loading: { light: "#9254de", dark: "#f5f5f5" } }, u = (e2, s2) => f[e2][s2], m = (s2) => {
31
+ switch (s2) {
32
+ case "success":
33
+ return e.jsx("svg", { className: "ono-type-icon", viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "check-circle", fill: u(s2, "light"), "aria-hidden": "true", children: e.jsx("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" }) });
34
+ case "error":
35
+ return e.jsx("svg", { className: "ono-type-icon", viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "close-circle", fill: u(s2, "light"), "aria-hidden": "true", children: e.jsx("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }) });
36
+ case "loading":
37
+ return e.jsx("svg", { className: ["ono-info-icon", "ono-loading"].join(" "), viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "loading", fill: u(s2, "light"), "aria-hidden": "true", children: e.jsx("path", { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }) });
38
+ default:
39
+ return e.jsx("svg", { className: "ono-info-icon", viewBox: "64 64 896 896", focusable: "false", "data-icon": "exclamation-circle", fill: u(s2, "light"), "aria-hidden": "true", children: e.jsx("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" }) });
40
+ }
41
+ }, g = ({ handleDestroy: s2 }) => e.jsx("button", { onClick: s2, children: e.jsx("svg", { className: "ono-clear-icon", viewBox: "64 64 896 896", focusable: "false", "data-icon": "close-circle", fill: "currentColor", "aria-hidden": "true", children: e.jsx("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }) }) }), h = ({ id: a2, instancesKey: i2, duration: l2 = 3e3, speed: p2 = 300, offset: f2 = 20, message: u2, type: h2, plain: y2 = true, showClose: x2 = false, zIndex: j, onClose: v = () => {
42
+ }, destroy: C }) => {
43
+ const [, w] = s(false), [z, k] = s(0), [L, O] = s(((e2) => {
44
+ const s2 = c.findIndex((s3) => s3.id === e2);
45
+ return s2 <= 0 ? 0 : c[s2 - 1].offsetOptions.topOffset;
46
+ })(a2)), [b, B] = s({ duration: l2, speed: p2, message: u2, type: h2, showClose: x2, onClose: v }), I = o(null), M = o(null), N = o(null), $ = L + z, K = t(() => ({ transform: `translate(-50%, ${L}px)`, transition: `transform ${p2}ms ease-in-out`, zIndex: j }), [L, p2]), S = () => {
47
+ N.current && (N.current.classList.remove("ono-message-enter"), N.current.classList.add("ono-message-leave"), N.current.style.transform = `translate(-50%, ${d(a2) - z}px)`, ((e2) => {
48
+ const s2 = c.findIndex((s3) => s3.id === e2);
49
+ -1 !== s2 && c.splice(s2, 1);
50
+ })(a2), setTimeout(() => C(b.onClose), p2));
51
+ }, T = (e2, s2, o2) => {
52
+ "loading" !== e2 && (I.current = setTimeout(S, s2 - o2));
53
+ }, D = () => {
54
+ const e2 = d(a2);
55
+ w((s2) => (s2 && O(e2 + f2), true)), requestAnimationFrame(D);
56
+ }, F = n(() => {
57
+ if ("loading" === b.type) {
58
+ if (M.current) return;
59
+ M.current = setTimeout(() => {
60
+ var _a;
61
+ M.current = null;
62
+ const e2 = (s2 = i2 || "") ? (_a = c.find((e3) => e3.key === s2)) == null ? void 0 : _a.props : null;
63
+ var s2;
64
+ e2 && (((e3) => {
65
+ B((s3) => ({ ...s3, ...e3 }));
66
+ })({ ...e2 }), T(b.type, e2.duration || b.duration, e2.speed || b.speed), F());
67
+ }, 100);
68
+ }
69
+ }, [b]);
70
+ return r(() => {
71
+ T(b.type, b.duration, b.speed), D(), F();
72
+ }, [b.type, b.duration, b.speed]), r(() => {
73
+ (() => {
74
+ if (!N.current) return;
75
+ const { height: e2 } = N.current.getBoundingClientRect();
76
+ N.current.style.setProperty("--speed", `${b.speed}ms`), k(e2);
77
+ })();
78
+ }, [N]), r(() => {
79
+ ((e2, s2) => {
80
+ const o2 = c.findIndex((s3) => s3.id === e2);
81
+ o2 < 0 || (c[o2].offsetOptions = s2);
82
+ })(a2, { topOffset: L, height: z, bottomOffset: $ });
83
+ }, [$]), e.jsx("div", { ref: N, className: ["ono-message", `ono-message-${b.type}`, "ono-message-enter", y2 ? "" : "ono-message-color"].filter(Boolean).join(" "), style: K, onMouseEnter: () => {
84
+ I.current && (clearTimeout(I.current), I.current = null);
85
+ }, onMouseLeave: () => T(b.type, b.duration, b.speed), children: "function" == typeof b.message ? b.message(m(b.type), b.showClose && e.jsx(g, { handleDestroy: S })) : e.jsxs(e.Fragment, { children: [m(b.type), e.jsx("div", { children: b.message }), b.showClose && e.jsx(g, { handleDestroy: S })] }) });
86
+ }, y = (e2) => {
87
+ if ("string" == typeof e2) return { message: e2 };
88
+ {
89
+ const s2 = { ...e2, instancesKey: e2.key };
90
+ return delete s2.key, { ...s2 };
91
+ }
92
+ }, x = { info: (e2) => {
93
+ l(h, { ...y(e2), type: "info" }, "ono-message");
94
+ }, success: (e2) => {
95
+ l(h, { ...y(e2), type: "success" }, "ono-message");
96
+ }, warning: (e2) => {
97
+ l(h, { ...y(e2), type: "warning" }, "ono-message");
98
+ }, error: (e2) => {
99
+ l(h, { ...y(e2), type: "error" }, "ono-message");
100
+ }, loading: (e2) => {
101
+ l(h, { ...y(e2), type: "loading" }, "ono-message");
102
+ } };
103
+ export {
104
+ x as m
105
+ };
@@ -1,27 +1,27 @@
1
1
  import { j as o } from "./dependencies-CbQbPZZ-.js";
2
- import { f as e } from "./utils-BxXROOPY.js";
3
- import { useRef as n, useEffect as l } from "react";
2
+ import { a as e } from "./colorUtils.ts-DYuRvCXZ.js";
3
+ import { useRef as l, useEffect as n } from "react";
4
4
  import { p as a } from "./PortalRenderer-CDAzQJgm.js";
5
5
  const t = ({ title: a2 = "This is a modal title", icon: t2, content: r2 = "This is a modal content", okText: s = "confirm", cancelText: i = "cancel", isLoading: c, confirmDisabled: d, cancelDisabled: m, position: x, onConfirm: h = () => {
6
6
  }, onCancel: b = () => {
7
- }, mask: u = true, maskClosable: f = false, width: j, btnClr: p, footer: C = ({ OkBtn: e2, CancelBtn: n2 }) => o.jsxs(o.Fragment, { children: [o.jsx(n2, {}), o.jsx(e2, {})] }), modalBody: v, destroy: y }) => {
8
- const g = n(null), B = n(null), w = [{ label: "themeColor", value: p || "" }, { label: "themeHoverColor", value: p && e(p, "light", 10) || "" }, { label: "themeActiveColor", value: p && e(p, "dark", 20) || "" }, { label: "themeDisabledClr", value: p && e(p, "light", 20) || "" }], N = () => {
7
+ }, mask: u = true, maskClosable: f = false, width: j, btnClr: p, footer: C = ({ OkBtn: e2, CancelBtn: l2 }) => o.jsxs(o.Fragment, { children: [o.jsx(l2, {}), o.jsx(e2, {})] }), modalBody: v, destroy: g }) => {
8
+ const y = l(null), B = l(null), w = [{ label: "themeColor", value: p || "" }, { label: "themeHoverColor", value: p && e(p, "light", 10) || "" }, { label: "themeActiveColor", value: p && e(p, "dark", 20) || "" }, { label: "themeDisabledClr", value: p && e(p, "light", 20) || "" }], N = () => {
9
9
  if (x) {
10
10
  if (!B.current) return;
11
11
  B.current.classList.remove("ono-modal-enter"), B.current.classList.add("ono-modal-leave"), setTimeout(() => {
12
- y();
12
+ g();
13
13
  }, 300);
14
- } else y();
14
+ } else g();
15
15
  };
16
- return l(() => (g.current && (u ? g.current.showModal() : g.current.show()), () => {
17
- g.current && g.current.close();
18
- }), [g.current, u]), l(() => {
16
+ return n(() => (y.current && (u ? y.current.showModal() : y.current.show()), () => {
17
+ y.current && y.current.close();
18
+ }), [y.current, u]), n(() => {
19
19
  (() => {
20
20
  if (!B.current) return;
21
21
  const o2 = B.current.style;
22
22
  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) + "%")), p && w.forEach((e2) => o2.setProperty(`--${e2.label}`, e2.value));
23
23
  })();
24
- }, [B]), o.jsx("dialog", { ref: g, className: "ono-modal", onClick: () => f && N(), children: v ? v(N) : o.jsxs("div", { ref: B, className: ["ono-modal-box", x ? "ono-modal-enter" : ""].join(" "), onClick: (o2) => o2.stopPropagation(), children: [o.jsxs("div", { className: "ono-modal-box-body", children: [t2 ?? 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: a2 }), o.jsx("p", { className: "ono-modal-box-body-contentBar-content", children: r2 })] })] }), C && o.jsx("div", { className: "ono-modal-box-footer", children: C({ OkBtn: () => o.jsxs("button", { className: "ono-modal-box-footer-confirmBtn", disabled: d || c, onClick: () => {
24
+ }, [B]), o.jsx("dialog", { ref: y, className: "ono-modal", onClick: () => f && N(), children: v ? v(N) : o.jsxs("div", { ref: B, className: ["ono-modal-box", x ? "ono-modal-enter" : ""].join(" "), onClick: (o2) => o2.stopPropagation(), children: [o.jsxs("div", { className: "ono-modal-box-body", children: [t2 ?? 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: a2 }), o.jsx("p", { className: "ono-modal-box-body-contentBar-content", children: r2 })] })] }), C && o.jsx("div", { className: "ono-modal-box-footer", children: C({ OkBtn: () => o.jsxs("button", { className: "ono-modal-box-footer-confirmBtn", disabled: d || c, onClick: () => {
25
25
  h(), N();
26
26
  }, children: [c && o.jsx("svg", { className: "ono-modal-box-footer-confirmBtn-loading", viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "loading", fill: "currentColor", "aria-hidden": "true", children: o.jsx("path", { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }) }), s ?? "Confirm"] }), CancelBtn: () => o.jsx("button", { className: "ono-modal-box-footer-cancelBtn", disabled: m || c, onClick: () => {
27
27
  b(), N();
@@ -1,9 +1,9 @@
1
1
  import { j as e } from "./dependencies-CbQbPZZ-.js";
2
2
  import { useState as o, useEffect as n } from "react";
3
- import { T as a } from "./Tooltip-Dj8ZeMVG.js";
4
- import { O as t } from "./Input-CYA8Q8B5.js";
3
+ import { T as a } from "./Tooltip-j2AKREfX.js";
4
+ import { O as t } from "./Input-DLOeg2pz.js";
5
5
  import { L as l } from "./List-UAKCMuGC.js";
6
- const i = ({ label: o2, value: n2, disabled: a2, onChange: t2, optionRender: l2, currentValue: i2 }) => e.jsx("button", { role: "option", "aria-label": o2, disabled: a2, className: "ono-option-item", onClick: () => t2 == null ? void 0 : t2(n2), children: l2 ? l2({ label: o2, value: n2, disabled: a2 }, i2 === o2) : e.jsx("div", { className: ["ono-option-item-content", i2 === o2 ? "ono-option-item-content-active" : "", a2 ? "ono-option-item-content-disabled" : ""].filter(Boolean).join(" "), children: o2 }) }), s = ({ options: s2, defaultValue: c, placeholder: d, inputBorder: p, isShowArrow: m, disabled: u, clearable: h, selectClassName: f, optionsClassName: j, filterable: b, notFoundContent: x, optionRender: v, onClear: C, onChange: g, filterMethod: w }) => {
6
+ const i = ({ label: o2, value: n2, disabled: a2, onChange: t2, optionRender: l2, currentValue: i2 }) => e.jsx("button", { role: "option", "aria-label": o2, disabled: a2, className: "ono-option-item", onClick: () => t2 == null ? void 0 : t2(n2), children: l2 ? l2({ label: o2, value: n2, disabled: a2 }, i2 === o2) : e.jsx("div", { className: ["ono-option-item-content", i2 === o2 ? "ono-option-item-content-active" : "", a2 ? "ono-option-item-content-disabled" : ""].filter(Boolean).join(" "), children: o2 }) }), s = ({ options: s2, defaultValue: c, placeholder: d, inputBorder: m, isShowArrow: p, disabled: u, clearable: h, selectClassName: b, optionsClassName: f, filterable: j, notFoundContent: x, optionRender: v, onClear: C, onChange: g, filterMethod: w }) => {
7
7
  const [N, L] = o(""), [B, S] = o(""), [V, k] = o(false), [M, y] = o(false), [O, R] = o(""), A = (e2) => {
8
8
  const o2 = s2.find((o3) => o3.value === e2);
9
9
  L(o2 ? o2.label : "");
@@ -12,9 +12,9 @@ const i = ({ label: o2, value: n2, disabled: a2, onChange: t2, optionRender: l2,
12
12
  };
13
13
  return n(() => {
14
14
  c && A(c);
15
- }, [c, s2]), e.jsx(a, { sameWidth: true, trigger: "click", placement: "bottom", isShowArrow: m, className: ["ono-option-container", j].filter(Boolean).join(" "), onOpenChange: (e2) => {
16
- y(e2), b && B && !e2 && S("");
17
- }, content: e.jsx(l, { list: b ? w && "function" == typeof w ? w(B, s2) : s2.filter((e2) => e2.label.toLocaleLowerCase().includes(B.toLocaleLowerCase())) : s2, fallback: x ?? e.jsx("div", { className: "ono-option-item", children: e.jsx("div", { className: "ono-option-item-content-no-data", onClick: (e2) => e2.stopPropagation(), children: "No Data" }) }), children: (o2) => e.jsx(i, { ...o2, onChange: F, currentValue: N.toString(), optionRender: v }, o2.value) }), children: e.jsx("div", { className: "ono-select", onMouseEnter: () => k(true), onMouseLeave: () => k(false), children: e.jsx(t, { className: [b ? "" : "ono-select-readonly", f].filter(Boolean).join(" "), border: p, disabled: u, placeholder: b && O ? N.toString() || "" : d, readonly: !b, value: b && M ? B : N.toString(), clearable: V && h, suffix: V && h && N || h && B && b ? e.jsx(e.Fragment, {}) : e.jsx(r, { isVisible: M }), onClear: () => {
15
+ }, [c, s2]), e.jsx(a, { sameWidth: true, trigger: "click", placement: "bottom", isShowArrow: p, className: ["ono-option-container", f].filter(Boolean).join(" "), onOpenChange: (e2) => {
16
+ y(e2), j && B && !e2 && S("");
17
+ }, content: e.jsx(l, { list: j ? w && "function" == typeof w ? w(B, s2) : s2.filter((e2) => e2.label.toLocaleLowerCase().includes(B.toLocaleLowerCase())) : s2, fallback: x ?? e.jsx("div", { className: "ono-option-item", children: e.jsx("div", { className: "ono-option-item-content-no-data", onClick: (e2) => e2.stopPropagation(), children: "No Data" }) }), children: (o2) => e.jsx(i, { ...o2, onChange: F, currentValue: N.toString(), optionRender: v }, o2.value) }), children: e.jsx("div", { className: "ono-select", onMouseEnter: () => k(true), onMouseLeave: () => k(false), children: e.jsx(t, { className: [j ? "" : "ono-select-readonly", b].filter(Boolean).join(" "), border: m, disabled: u, placeholder: j && O ? N.toString() || "" : d, readonly: !j, value: j && M ? B : N.toString(), clearable: V && h, suffix: V && h && N || h && B && j ? e.jsx(e.Fragment, {}) : e.jsx(r, { isVisible: M }), onClear: () => {
18
18
  C == null ? void 0 : C(), g == null ? void 0 : g(""), R(""), L(""), S("");
19
19
  }, onChange: (e2) => S(e2.target.value) }) }) });
20
20
  }, 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" }) });
@@ -1,34 +1,34 @@
1
1
  import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { p as n } from "./utils-BxXROOPY.js";
3
- import { useRef as r, useEffect as t } from "react";
4
- const c = ({ id: c2, text: i, style: s, color: l, checked: a, onChange: o, name: d = "", className: h, disabled: u = false }) => {
2
+ import { p as n } from "./common.ts-DQOEx8k3.js";
3
+ import { useRef as r, useEffect as c } from "react";
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" }];
6
- return t(() => {
6
+ return c(() => {
7
7
  (() => {
8
8
  if (!f.current || !m.current) return;
9
9
  let e2 = 60, r2 = 32;
10
10
  if (h || s) {
11
- const t2 = getComputedStyle(f.current);
12
- e2 = n(t2.width), r2 = n(t2.height);
11
+ const c2 = getComputedStyle(f.current);
12
+ e2 = n(c2.width), r2 = n(c2.height);
13
13
  }
14
14
  [...w, { value: e2, name: "w" }, { value: r2, name: "h" }].forEach(({ value: e3, name: n2 }) => {
15
15
  e3 && ((e4, n3, r3) => {
16
- const t2 = "number" == typeof e4;
17
- r3.style.setProperty(`--${n3}`, t2 ? `${e4}px` : e4);
16
+ const c2 = "number" == typeof e4;
17
+ r3.style.setProperty(`--${n3}`, c2 ? `${e4}px` : e4);
18
18
  })(e3, n2, m.current);
19
19
  }), requestAnimationFrame(() => {
20
20
  p.current && (p.current.style.transition = "transform 0.3s");
21
21
  });
22
22
  })();
23
- }, [f, m, p, h, s, l, i, j, x]), t(() => {
24
- v.current && (v.current.checked = a);
25
- }, [v, a]), e.jsxs("div", { ref: m, className: ["ono-switch", u ? "ono-switch-is-disabled" : ""].filter(Boolean).join(" "), children: [e.jsx("input", { id: c2, name: d, role: "switch", ref: v, type: "checkbox", checked: a, onChange: (e2) => {
26
- u || (o == null ? void 0 : o(e2.currentTarget.checked, e2));
23
+ }, [f, m, p, h, s, l, i, j, x]), c(() => {
24
+ v.current && (v.current.checked = o);
25
+ }, [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) => {
26
+ u || (a == null ? void 0 : a(e2.currentTarget.checked, e2));
27
27
  } }), e.jsx("div", { ref: f, className: ["ono-switch-box", h || ""].filter(Boolean).join(" "), style: s, onClick: () => {
28
28
  var _a;
29
29
  return (_a = v.current) == null ? void 0 : _a.click();
30
30
  }, 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 })] }) })] });
31
31
  };
32
32
  export {
33
- c as S
33
+ t as S
34
34
  };
@@ -1,8 +1,8 @@
1
1
  import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { h as t } from "./utils-BxXROOPY.js";
3
- import { useState as n, useRef as o, useEffect as r, useCallback as s } from "react";
4
- const i = ({ children: i2, animation: a, className: l, duration: c = 300, style: d, maskColor: p = "rgba(0, 0, 0, 0.5)", disableContextMenu: m, maskClickClose: u = true, dialogClose: y }) => {
5
- const [f, k] = n(false), g = o(null), x = () => {
2
+ import { g as t } from "./common.ts-DQOEx8k3.js";
3
+ import { useState as o, useRef as n, useEffect as r, useCallback as s } from "react";
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
+ const [f, k] = o(false), g = n(null), x = () => {
6
6
  if (g.current) if (k(true), a) {
7
7
  const e2 = g.current;
8
8
  e2.classList.remove(`ono-${a.type}-enter`), e2.classList.add(`ono-${a.type}-leave`), setTimeout(y, c);
@@ -11,16 +11,16 @@ const i = ({ children: i2, animation: a, className: l, duration: c = 300, style:
11
11
  r(() => {
12
12
  (() => {
13
13
  if (!a || !g.current) return;
14
- const e2 = g.current.parentElement.style, n2 = g.current.style;
14
+ const e2 = g.current.parentElement.style, o2 = g.current.style;
15
15
  switch (e2.setProperty("--duration", c / 1e3 + "s"), a.type) {
16
16
  case "zoom": {
17
- const { x: e3, y: o2 } = t(a.element), r2 = (e3 / window.innerWidth * 100).toFixed(2) + "%", s2 = (o2 / window.innerHeight * 100).toFixed(2) + "%";
18
- n2.setProperty("--left", r2), n2.setProperty("--top", s2);
17
+ const { x: e3, y: n2 } = t(a.element), r2 = (e3 / window.innerWidth * 100).toFixed(2) + "%", s2 = (n2 / window.innerHeight * 100).toFixed(2) + "%";
18
+ o2.setProperty("--left", r2), o2.setProperty("--top", s2);
19
19
  break;
20
20
  }
21
21
  case "fade": {
22
22
  const e3 = "left-center" === a.direction ? "--left" : "--top";
23
- n2.setProperty(e3, a.startPosition);
23
+ o2.setProperty(e3, a.startPosition);
24
24
  break;
25
25
  }
26
26
  }
@@ -34,7 +34,7 @@ const i = ({ children: i2, animation: a, className: l, duration: c = 300, style:
34
34
  return e.jsx("div", { className: `
35
35
  ono-dialog-mask
36
36
  ono-dialog-mask-${f ? "leave" : "enter"}
37
- `, style: { background: p }, onClick: () => u && x(), onContextMenu: (e2) => m && e2.preventDefault(), children: e.jsx("div", { ref: g, className: `
37
+ `, style: { background: m }, onClick: () => u && x(), onContextMenu: (e2) => p && e2.preventDefault(), children: e.jsx("div", { ref: g, className: `
38
38
  ono-dialog
39
39
  ${l || ""}
40
40
  ${C()}
@@ -1,41 +1,41 @@
1
- import { j as s } from "./dependencies-CbQbPZZ-.js";
2
- import { useEffect as e, useRef as t } from "react";
3
- import { i } from "./InjunctiveBox-DsntB_UW.js";
4
- const a = "_enter_3s92l_32";
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
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 = (s2, e2) => c[s2][e2], n = (e2) => {
7
- switch (e2) {
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
8
  case "success":
9
- return s.jsx("svg", { viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "check-circle", width: "24px", height: "24px", fill: o(e2, "light"), "aria-hidden": "true", children: s.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" }) });
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
10
  case "error":
11
- return s.jsx("svg", { viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "close-circle", width: "24px", height: "24px", fill: o(e2, "light"), "aria-hidden": "true", children: s.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" }) });
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
12
  case "warning":
13
- return s.jsx("svg", { viewBox: "0 0 1024 1024", focusable: "false", "data-icon": "exclamation-circle", width: "24px", height: "24px", fill: o(e2, "light"), "aria-hidden": "true", children: s.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" }) });
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
14
  }
15
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
16
  const y = t(null);
17
- return e(() => {
17
+ return s(() => {
18
18
  y.current && (y.current.style.setProperty("--speed", r2 / 1e3 + "s"), d && y.current.classList.add(a), "promise" !== i2 && setTimeout(() => {
19
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_3s92l_36");
20
+ (_a = y.current) == null ? void 0 : _a.classList.remove(a), (_b = y.current) == null ? void 0 : _b.classList.add("_leave_974ly_36");
21
21
  }, o2 - r2));
22
- }, [y]), e(() => {
23
- "promise" === i2 ? ("function" == typeof c2 ? c2() : c2).then((s2) => setTimeout(() => {
24
- g(), p({ type: "success", message: "function" == typeof (h == null ? void 0 : h.success) ? h.success(s2) : (h == null ? void 0 : h.success) || "", isUseEnterAnimation: false, toastList: u });
25
- }, r2)).catch((s2) => setTimeout(() => {
26
- g(), p({ type: "error", message: "function" == typeof (h == null ? void 0 : h.error) ? h.error(s2) : (h == null ? void 0 : h.error) || "", isUseEnterAnimation: false, toastList: u });
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
27
  }, r2)) : setTimeout(() => g(() => u = []), o2);
28
- }, [i2]), s.jsxs("div", { ref: y, className: ["promise" === i2 ? "_promise_3s92l_15" : "_base_3s92l_15", l2].join(" "), style: m2, onClick: () => {
29
- }, children: [s.jsx("div", { className: "_icon_3s92l_40", children: n(i2) }), s.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_3s92l_1", isSingle: true, style: { zIndex: o2 }, content: (i2) => (e(() => {
31
- }, [h]), s.jsx(l, { className: n2, style: p2, type: t2, message: r2, speed: a2, duration: c2, isUseEnterAnimation: m2, promiseOptions: d, handleDestroy: i2, toastList: h })) }), m = { success: (s2) => {
32
- r.push({ type: "success", message: s2 }), p("string" == typeof s2 ? { type: "success", message: s2, toastList: r } : { type: "success", ...s2, toastList: r });
33
- }, error: (s2) => {
34
- r.push({ type: "error", message: s2 }), p("string" == typeof s2 ? { type: "error", message: s2, toastList: r } : { type: "error", ...s2, toastList: r });
35
- }, warning: (s2) => {
36
- r.push({ type: "warning", message: s2 }), p("string" == typeof s2 ? { type: "warning", message: s2, toastList: r } : { type: "warning", ...s2, toastList: r });
37
- }, promise: (s2, e2) => {
38
- r.push({ type: "promise", message: s2 }), p({ type: "promise", message: s2, promiseOptions: e2, toastList: r });
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
39
  } };
40
40
  export {
41
41
  m as t
@@ -1,28 +1,28 @@
1
1
  import { j as e } from "./dependencies-CbQbPZZ-.js";
2
- import { createPopper as r } from "@popperjs/core";
3
- import { useState as t, useRef as n, useEffect as o } from "react";
4
- import { useClickOutSide as c } from "./index.js";
2
+ import { u as r } from "./useClickOutSide.tsx-CMvd2uTW.js";
3
+ import { createPopper as t } from "@popperjs/core";
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
- const [v, y] = t(false), g = n(null), b = n(null), k = (e2) => {
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 c(b, () => {
11
- "click" !== a && "contextmenu" !== a || k(false);
12
- }, { event: ["click", "contextmenu"], deps: [a, u] }), o(() => {
10
+ return r(k, () => {
11
+ "click" !== a && "contextmenu" !== a || b(false);
12
+ }, { event: ["click", "contextmenu"], deps: [a, u] }), c(() => {
13
13
  (() => {
14
- if (!b.current) return;
15
- const e2 = Array.from(b.current.children);
14
+ if (!k.current) return;
15
+ const e2 = Array.from(k.current.children);
16
16
  if (e2.length > 1) throw new Error("Tooltip only support one child");
17
- b.current.style.width = e2[0].getBoundingClientRect().width + "px";
17
+ k.current.style.width = e2[0].getBoundingClientRect().width + "px";
18
18
  })();
19
- }, [b, i2]), o(() => {
20
- b.current && ("hover" === a ? (b.current.onmouseenter = () => k(true), b.current.onmouseleave = () => k(false)) : "click" === a ? b.current.onclick = () => k(!v) : "focus" === a ? (b.current.onfocus = () => k(true), b.current.onblur = () => k(false)) : b.current.oncontextmenu = () => k(!v)), v && b.current && g.current ? l = r(b.current, g.current, { placement: m, modifiers: [{ name: "offset", options: { offset: [0, 6] } }, w ? { name: "sameWidth", enabled: true, phase: "beforeWrite", requires: ["computeStyles"], fn({ state: e2 }) {
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 = t(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`;
24
24
  } } : {}, j ? { name: "flip", enabled: true } : {}], ...d }) : l && (l.destroy(), l = null, s && s.remove(), s = null);
25
- }, [v, b, 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: b, children: i2 instanceof Function ? i2() : i2 })] });
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
26
  };
27
27
  export {
28
28
  i as T