@vacano/ui 1.10.0 → 1.11.0
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/README.md +1 -1
- package/dist/index.cjs +26 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +152 -144
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -153,10 +153,10 @@ var Do = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|def
|
|
|
153
153
|
if (a !== void 0 && f.push("label:" + a + ";"), h[0] == null || h[0].raw === void 0)
|
|
154
154
|
f.push.apply(f, h);
|
|
155
155
|
else {
|
|
156
|
-
var
|
|
157
|
-
f.push(
|
|
158
|
-
for (var z = h.length,
|
|
159
|
-
f.push(h[
|
|
156
|
+
var $ = h[0];
|
|
157
|
+
f.push($[0]);
|
|
158
|
+
for (var z = h.length, y = 1; y < z; y++)
|
|
159
|
+
f.push(h[y], $[y]);
|
|
160
160
|
}
|
|
161
161
|
var x = Io(function(m, v, w) {
|
|
162
162
|
var b = g && m.as || i, C = "", O = [], L = m;
|
|
@@ -565,9 +565,9 @@ const jo = p.span`
|
|
|
565
565
|
onChange: g,
|
|
566
566
|
onSearch: h,
|
|
567
567
|
debounceMs: f = 300,
|
|
568
|
-
minChars:
|
|
568
|
+
minChars: $ = 1,
|
|
569
569
|
noResultsMessage: z = "No results found",
|
|
570
|
-
|
|
570
|
+
...y
|
|
571
571
|
}) => {
|
|
572
572
|
const [x, m] = _((u == null ? void 0 : u.value) ?? ""), [v, w] = _([]), [b, C] = _(!1), [O, L] = _(!1), [W, I] = _(!1), Y = U(null), V = U(null);
|
|
573
573
|
ne(() => {
|
|
@@ -575,7 +575,7 @@ const jo = p.span`
|
|
|
575
575
|
}, [u == null ? void 0 : u.value]);
|
|
576
576
|
const R = N(
|
|
577
577
|
async (A) => {
|
|
578
|
-
if (A.length <
|
|
578
|
+
if (A.length < $) {
|
|
579
579
|
w([]), I(!1);
|
|
580
580
|
return;
|
|
581
581
|
}
|
|
@@ -589,7 +589,7 @@ const jo = p.span`
|
|
|
589
589
|
C(!1);
|
|
590
590
|
}
|
|
591
591
|
},
|
|
592
|
-
[h,
|
|
592
|
+
[h, $]
|
|
593
593
|
), M = N(
|
|
594
594
|
(A) => {
|
|
595
595
|
const j = A.target.value;
|
|
@@ -624,7 +624,7 @@ const jo = p.span`
|
|
|
624
624
|
/* @__PURE__ */ s(
|
|
625
625
|
Go,
|
|
626
626
|
{
|
|
627
|
-
|
|
627
|
+
...y,
|
|
628
628
|
ref: a,
|
|
629
629
|
type: "text",
|
|
630
630
|
value: x,
|
|
@@ -905,13 +905,13 @@ const jo = p.span`
|
|
|
905
905
|
keyBindings: g = [],
|
|
906
906
|
size: h = "default",
|
|
907
907
|
type: f = "button",
|
|
908
|
-
variant:
|
|
908
|
+
variant: $ = "normal",
|
|
909
909
|
...z
|
|
910
910
|
}) => {
|
|
911
|
-
const
|
|
912
|
-
Ao(u, () =>
|
|
911
|
+
const y = U(null);
|
|
912
|
+
Ao(u, () => y.current, []), vo(g, () => {
|
|
913
913
|
var m;
|
|
914
|
-
(m =
|
|
914
|
+
(m = y.current) == null || m.click();
|
|
915
915
|
});
|
|
916
916
|
const x = te(() => {
|
|
917
917
|
switch (f) {
|
|
@@ -926,11 +926,11 @@ const jo = p.span`
|
|
|
926
926
|
{
|
|
927
927
|
...z,
|
|
928
928
|
onClick: d,
|
|
929
|
-
ref:
|
|
929
|
+
ref: y,
|
|
930
930
|
type: x,
|
|
931
931
|
disabled: n,
|
|
932
932
|
className: tr("container", t),
|
|
933
|
-
$variant:
|
|
933
|
+
$variant: $,
|
|
934
934
|
$size: h,
|
|
935
935
|
$fullWidth: !!i,
|
|
936
936
|
$iconOnly: !!a && !(e || (g == null ? void 0 : g.length) > 0),
|
|
@@ -938,7 +938,7 @@ const jo = p.span`
|
|
|
938
938
|
c && /* @__PURE__ */ s(ci, { $size: h }),
|
|
939
939
|
a && !c && /* @__PURE__ */ s(li, { $size: h, children: a }),
|
|
940
940
|
e && /* @__PURE__ */ s(di, { className: tr("label", o == null ? void 0 : o.label), children: e }),
|
|
941
|
-
/* @__PURE__ */ s(gi, { keys: g, variant:
|
|
941
|
+
/* @__PURE__ */ s(gi, { keys: g, variant: $ === "system" ? "light" : "dark" })
|
|
942
942
|
]
|
|
943
943
|
}
|
|
944
944
|
);
|
|
@@ -1311,7 +1311,7 @@ const jo = p.span`
|
|
|
1311
1311
|
...u
|
|
1312
1312
|
}) => {
|
|
1313
1313
|
const g = (h, f) => {
|
|
1314
|
-
i(f ? [...d, h] : d.filter((
|
|
1314
|
+
i(f ? [...d, h] : d.filter(($) => $ !== h));
|
|
1315
1315
|
};
|
|
1316
1316
|
return /* @__PURE__ */ S(Ei, { ...u, ref: c, className: $t("container", e), children: [
|
|
1317
1317
|
n && /* @__PURE__ */ s(Ti, { className: $t("label", t == null ? void 0 : t.label), $disabled: o, children: n }),
|
|
@@ -1460,7 +1460,7 @@ const jo = p.span`
|
|
|
1460
1460
|
align-items: center;
|
|
1461
1461
|
gap: 8px;
|
|
1462
1462
|
`, Bi = ({ confirmation: e, onDone: t }) => {
|
|
1463
|
-
const [o, n] = _(!1), [i, a] = _(!1), { message: c, onConfirm: d, onCancel: u, options: g } = e, h = g.confirmLabel || Li, f = g.cancelLabel || Ai,
|
|
1463
|
+
const [o, n] = _(!1), [i, a] = _(!1), { message: c, onConfirm: d, onCancel: u, options: g } = e, h = g.confirmLabel || Li, f = g.cancelLabel || Ai, $ = N(
|
|
1464
1464
|
(x) => {
|
|
1465
1465
|
n(!0), setTimeout(() => {
|
|
1466
1466
|
x == null || x(), t();
|
|
@@ -1477,19 +1477,19 @@ const jo = p.span`
|
|
|
1477
1477
|
a(!1);
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
|
-
|
|
1481
|
-
}, [
|
|
1482
|
-
i ||
|
|
1483
|
-
}, [
|
|
1480
|
+
$();
|
|
1481
|
+
}, [$, d]), y = N(() => {
|
|
1482
|
+
i || $(u);
|
|
1483
|
+
}, [$, i, u]);
|
|
1484
1484
|
return ne(() => {
|
|
1485
1485
|
const x = (m) => {
|
|
1486
|
-
m.key === "Escape" && !i &&
|
|
1486
|
+
m.key === "Escape" && !i && y();
|
|
1487
1487
|
};
|
|
1488
1488
|
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
1489
|
-
}, [
|
|
1489
|
+
}, [y, i]), /* @__PURE__ */ S(Di, { $isExiting: o, children: [
|
|
1490
1490
|
/* @__PURE__ */ s(Fi, { children: c }),
|
|
1491
1491
|
/* @__PURE__ */ S(Mi, { children: [
|
|
1492
|
-
/* @__PURE__ */ s(at, { variant: "system", size: "compact", onClick:
|
|
1492
|
+
/* @__PURE__ */ s(at, { variant: "system", size: "compact", onClick: y, disabled: i, children: f }),
|
|
1493
1493
|
/* @__PURE__ */ s(at, { variant: "danger", size: "compact", onClick: z, loading: i, children: h })
|
|
1494
1494
|
] })
|
|
1495
1495
|
] });
|
|
@@ -1604,12 +1604,12 @@ const jo = p.span`
|
|
|
1604
1604
|
focus: l(r.red, 30)
|
|
1605
1605
|
}
|
|
1606
1606
|
}, se = 36, ut = 2, ji = 12, Wi = (e, t, o = "en") => {
|
|
1607
|
-
const n = e.getFullYear(), i = e.getMonth(), a = e.getDate(), c = e.getHours(), d = e.getMinutes(), u = e.getSeconds(), g = c % 12 || 12, h = c >= 12, f = new Intl.DateTimeFormat(o, { month: "long" }).format(e),
|
|
1607
|
+
const n = e.getFullYear(), i = e.getMonth(), a = e.getDate(), c = e.getHours(), d = e.getMinutes(), u = e.getSeconds(), g = c % 12 || 12, h = c >= 12, f = new Intl.DateTimeFormat(o, { month: "long" }).format(e), $ = new Intl.DateTimeFormat(o, { month: "short" }).format(e), z = new Intl.DateTimeFormat(o, { weekday: "long" }).format(e), y = new Intl.DateTimeFormat(o, { weekday: "short" }).format(e), x = (C) => C.toString().padStart(2, "0"), m = (C) => C.toString().padStart(2, " "), v = (C) => `\0${C}\0`, w = [
|
|
1608
1608
|
["2006", "YEARFOUR", n.toString()],
|
|
1609
1609
|
["January", "MONTHLONG", f],
|
|
1610
1610
|
["Monday", "WEEKDAYLONG", z],
|
|
1611
|
-
["Jan", "MONTHSHORT",
|
|
1612
|
-
["Mon", "WEEKDAYSHORT",
|
|
1611
|
+
["Jan", "MONTHSHORT", $],
|
|
1612
|
+
["Mon", "WEEKDAYSHORT", y],
|
|
1613
1613
|
["06", "YEARTWO", n.toString().slice(-2)],
|
|
1614
1614
|
["01", "MONTHPAD", x(i + 1)],
|
|
1615
1615
|
["_2", "DAYSPACE", m(a)],
|
|
@@ -1921,9 +1921,9 @@ const jo = p.span`
|
|
|
1921
1921
|
size: g = "default",
|
|
1922
1922
|
variant: h = "normal",
|
|
1923
1923
|
disabled: f = !1,
|
|
1924
|
-
fullWidth:
|
|
1924
|
+
fullWidth: $ = !1,
|
|
1925
1925
|
label: z,
|
|
1926
|
-
portalRenderNode:
|
|
1926
|
+
portalRenderNode: y,
|
|
1927
1927
|
open: x,
|
|
1928
1928
|
onOpen: m,
|
|
1929
1929
|
onClose: v,
|
|
@@ -1939,14 +1939,14 @@ const jo = p.span`
|
|
|
1939
1939
|
var Ne;
|
|
1940
1940
|
if (!T.current) return;
|
|
1941
1941
|
const P = T.current.getBoundingClientRect(), X = ((Ne = B.current) == null ? void 0 : Ne.offsetHeight) ?? xn, Re = window.innerHeight - P.bottom - Ke, Ue = P.top - Ke, ke = Re < X && Ue > Re ? "top" : "bottom";
|
|
1942
|
-
if (M(ke),
|
|
1942
|
+
if (M(ke), y) {
|
|
1943
1943
|
const qe = ke === "bottom" ? P.bottom + Ke : P.top - X - Ke;
|
|
1944
1944
|
V({
|
|
1945
1945
|
top: qe,
|
|
1946
1946
|
left: P.left
|
|
1947
1947
|
});
|
|
1948
1948
|
}
|
|
1949
|
-
}, [
|
|
1949
|
+
}, [y]), Wt = N(() => {
|
|
1950
1950
|
if (f) return;
|
|
1951
1951
|
J || I(!0), m == null || m(), D(o === "year" ? "years" : o === "month" ? "months" : "days");
|
|
1952
1952
|
const P = e ?? L;
|
|
@@ -1998,18 +1998,18 @@ const jo = p.span`
|
|
|
1998
1998
|
}, [Q, Ce]), ne(() => {
|
|
1999
1999
|
const P = (ke) => {
|
|
2000
2000
|
const Ne = ke.target, qe = q.current && !q.current.contains(Ne), $o = B.current && !B.current.contains(Ne);
|
|
2001
|
-
|
|
2001
|
+
y ? qe && $o && re() : qe && re();
|
|
2002
2002
|
}, X = (ke) => {
|
|
2003
2003
|
ke.key === "Escape" && re();
|
|
2004
2004
|
}, Re = () => {
|
|
2005
|
-
Q &&
|
|
2005
|
+
Q && y && Ce();
|
|
2006
2006
|
}, Ue = () => {
|
|
2007
|
-
Q &&
|
|
2007
|
+
Q && y && Ce();
|
|
2008
2008
|
};
|
|
2009
|
-
return Q && (document.addEventListener("mousedown", P), document.addEventListener("keydown", X),
|
|
2009
|
+
return Q && (document.addEventListener("mousedown", P), document.addEventListener("keydown", X), y && (window.addEventListener("scroll", Re, !0), window.addEventListener("resize", Ue))), () => {
|
|
2010
2010
|
document.removeEventListener("mousedown", P), document.removeEventListener("keydown", X), window.removeEventListener("scroll", Re, !0), window.removeEventListener("resize", Ue);
|
|
2011
2011
|
};
|
|
2012
|
-
}, [Q, re,
|
|
2012
|
+
}, [Q, re, y, Ce]);
|
|
2013
2013
|
const ho = nt[g].iconSize, go = () => /* @__PURE__ */ S(it, { children: [
|
|
2014
2014
|
/* @__PURE__ */ S(vt, { className: ee("header", b == null ? void 0 : b.header), children: [
|
|
2015
2015
|
/* @__PURE__ */ s(wt, { onClick: Xt, type: "button", children: new Intl.DateTimeFormat(a, { month: "long", year: "numeric" }).format(E) }),
|
|
@@ -2104,7 +2104,7 @@ const jo = p.span`
|
|
|
2104
2104
|
case "years":
|
|
2105
2105
|
return fo();
|
|
2106
2106
|
}
|
|
2107
|
-
}, xo =
|
|
2107
|
+
}, xo = y ? we(
|
|
2108
2108
|
/* @__PURE__ */ s(
|
|
2109
2109
|
ln,
|
|
2110
2110
|
{
|
|
@@ -2116,7 +2116,7 @@ const jo = p.span`
|
|
|
2116
2116
|
children: Ut()
|
|
2117
2117
|
}
|
|
2118
2118
|
),
|
|
2119
|
-
|
|
2119
|
+
y
|
|
2120
2120
|
) : /* @__PURE__ */ s(
|
|
2121
2121
|
an,
|
|
2122
2122
|
{
|
|
@@ -2132,7 +2132,7 @@ const jo = p.span`
|
|
|
2132
2132
|
{
|
|
2133
2133
|
...O,
|
|
2134
2134
|
ref: C ?? q,
|
|
2135
|
-
$fullWidth:
|
|
2135
|
+
$fullWidth: $,
|
|
2136
2136
|
className: ee("container", w),
|
|
2137
2137
|
children: [
|
|
2138
2138
|
z && /* @__PURE__ */ s(tn, { children: z }),
|
|
@@ -2274,7 +2274,7 @@ const jo = p.span`
|
|
|
2274
2274
|
trigger: h,
|
|
2275
2275
|
...f
|
|
2276
2276
|
}) => {
|
|
2277
|
-
const [
|
|
2277
|
+
const [$, z] = _(!1), [y, x] = _({ top: 0, left: 0 }), [m, v] = _("bottom"), w = U(null), b = U(null), C = U(null), O = d !== void 0, L = O ? d : $, W = N(() => {
|
|
2278
2278
|
var H, q;
|
|
2279
2279
|
if (!b.current) return;
|
|
2280
2280
|
const M = b.current.getBoundingClientRect(), k = ((H = C.current) == null ? void 0 : H.offsetHeight) ?? Pn, D = ((q = C.current) == null ? void 0 : q.offsetWidth) ?? 160, E = window.innerHeight - M.bottom - Je, A = M.top - Je, j = E < k && A > E ? "top" : "bottom";
|
|
@@ -2319,7 +2319,7 @@ const jo = p.span`
|
|
|
2319
2319
|
$open: L,
|
|
2320
2320
|
$position: m,
|
|
2321
2321
|
className: Ze("content", i == null ? void 0 : i.content),
|
|
2322
|
-
style: { top:
|
|
2322
|
+
style: { top: y.top, left: y.left },
|
|
2323
2323
|
onClick: V,
|
|
2324
2324
|
children: o
|
|
2325
2325
|
}
|
|
@@ -2392,26 +2392,26 @@ const jo = p.span`
|
|
|
2392
2392
|
const [d, u] = _(!1), g = U(null), h = U(null), f = N(() => {
|
|
2393
2393
|
var x;
|
|
2394
2394
|
u(!1);
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2395
|
+
const y = ((x = h.current) == null ? void 0 : x.textContent) || "";
|
|
2396
|
+
y !== e && t(y);
|
|
2397
2397
|
}, [t, e]);
|
|
2398
2398
|
ne(() => {
|
|
2399
2399
|
if (d && h.current) {
|
|
2400
2400
|
h.current.focus();
|
|
2401
|
-
const
|
|
2402
|
-
|
|
2401
|
+
const y = document.createRange(), x = window.getSelection();
|
|
2402
|
+
y.selectNodeContents(h.current), y.collapse(!1), x == null || x.removeAllRanges(), x == null || x.addRange(y);
|
|
2403
2403
|
}
|
|
2404
2404
|
}, [d]), ne(() => {
|
|
2405
2405
|
if (!d) return;
|
|
2406
|
-
const
|
|
2406
|
+
const y = (x) => {
|
|
2407
2407
|
g.current && !g.current.contains(x.target) && f();
|
|
2408
2408
|
};
|
|
2409
|
-
return document.addEventListener("mousedown",
|
|
2409
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
2410
2410
|
}, [d, f]);
|
|
2411
|
-
const
|
|
2411
|
+
const $ = () => {
|
|
2412
2412
|
o || u(!0);
|
|
2413
|
-
}, z = (
|
|
2414
|
-
|
|
2413
|
+
}, z = (y) => {
|
|
2414
|
+
y.key === "Enter" && y.metaKey ? (y.preventDefault(), f()) : y.key === "Escape" && (h.current && (h.current.textContent = e), u(!1));
|
|
2415
2415
|
};
|
|
2416
2416
|
return /* @__PURE__ */ S(En, { ref: g, className: i, "data-test-id": c, children: [
|
|
2417
2417
|
/* @__PURE__ */ s(
|
|
@@ -2432,7 +2432,7 @@ const jo = p.span`
|
|
|
2432
2432
|
type: "button",
|
|
2433
2433
|
className: a == null ? void 0 : a.button,
|
|
2434
2434
|
$disabled: o && !d,
|
|
2435
|
-
onClick: d ? f :
|
|
2435
|
+
onClick: d ? f : $,
|
|
2436
2436
|
disabled: o && !d,
|
|
2437
2437
|
"aria-label": d ? "Save" : "Edit",
|
|
2438
2438
|
children: d ? /* @__PURE__ */ s(Yt, { size: 16 }) : /* @__PURE__ */ s(Co, { size: 14 })
|
|
@@ -2897,9 +2897,9 @@ const ea = (e) => {
|
|
|
2897
2897
|
config: { ...Ft.config, ...e },
|
|
2898
2898
|
css: Jn(t)
|
|
2899
2899
|
}), ra = (e, t) => {
|
|
2900
|
-
var
|
|
2900
|
+
var $;
|
|
2901
2901
|
const o = e(), n = document.querySelector(
|
|
2902
|
-
`.${(
|
|
2902
|
+
`.${($ = o.css) == null ? void 0 : $.body[0]}`
|
|
2903
2903
|
);
|
|
2904
2904
|
if (!n)
|
|
2905
2905
|
return o.frame;
|
|
@@ -3047,7 +3047,7 @@ const na = (e) => {
|
|
|
3047
3047
|
const n = $e("previewImage", t.css);
|
|
3048
3048
|
n && (n.style.marginLeft = `-${e.left}px`, n.style.marginTop = `-${e.top}px`);
|
|
3049
3049
|
}, kt = 1, Ca = (e) => {
|
|
3050
|
-
var z,
|
|
3050
|
+
var z, y;
|
|
3051
3051
|
const t = e(), o = document.createElement("canvas"), n = t.frame.width || kt, i = t.frame.height || kt, a = t.sourceWidth / n, c = t.sourceHeight / i, d = t.portal.left * a, u = t.portal.top * c, g = Math.max(
|
|
3052
3052
|
t.portal.size * Math.min(a, c),
|
|
3053
3053
|
kt
|
|
@@ -3056,7 +3056,7 @@ const na = (e) => {
|
|
|
3056
3056
|
const f = document.querySelector(
|
|
3057
3057
|
`.${(z = t.css) == null ? void 0 : z.sourceImage[0]}`
|
|
3058
3058
|
);
|
|
3059
|
-
f && ((
|
|
3059
|
+
f && ((y = o.getContext("2d")) == null || y.drawImage(
|
|
3060
3060
|
f,
|
|
3061
3061
|
d,
|
|
3062
3062
|
u,
|
|
@@ -3067,7 +3067,7 @@ const na = (e) => {
|
|
|
3067
3067
|
h,
|
|
3068
3068
|
h
|
|
3069
3069
|
));
|
|
3070
|
-
const
|
|
3070
|
+
const $ = o.toDataURL(
|
|
3071
3071
|
`image/${t.config.type}`,
|
|
3072
3072
|
t.config.compression
|
|
3073
3073
|
);
|
|
@@ -3083,7 +3083,7 @@ const na = (e) => {
|
|
|
3083
3083
|
);
|
|
3084
3084
|
return;
|
|
3085
3085
|
}
|
|
3086
|
-
x([
|
|
3086
|
+
x([$, v]);
|
|
3087
3087
|
},
|
|
3088
3088
|
`image/${t.config.type}`,
|
|
3089
3089
|
t.config.compression
|
|
@@ -3095,8 +3095,8 @@ const na = (e) => {
|
|
|
3095
3095
|
}, Ra = (e, t, o) => {
|
|
3096
3096
|
const { emitted: n, portal: i, frame: a, config: c } = t();
|
|
3097
3097
|
let d = n.left - n.X + e.clientX, u = n.top - n.Y + e.clientY;
|
|
3098
|
-
const g = c.framePadding, h = a.width - c.framePadding - i.size, f = c.framePadding,
|
|
3099
|
-
d < g && (d = g), d > h && (d = h), u < f && (u = f), u >
|
|
3098
|
+
const g = c.framePadding, h = a.width - c.framePadding - i.size, f = c.framePadding, $ = a.height - c.framePadding - i.size;
|
|
3099
|
+
d < g && (d = g), d > h && (d = h), u < f && (u = f), u > $ && (u = $), o({
|
|
3100
3100
|
portal: {
|
|
3101
3101
|
...i,
|
|
3102
3102
|
left: d,
|
|
@@ -3127,24 +3127,24 @@ const na = (e) => {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
case de.RESIZE_TL: {
|
|
3129
3129
|
const h = Math.min(u, g);
|
|
3130
|
-
let f = i.size - h,
|
|
3130
|
+
let f = i.size - h, $ = i.left + h, z = i.top + h;
|
|
3131
3131
|
if (f < d.minPortalSize) {
|
|
3132
|
-
const
|
|
3133
|
-
f = d.minPortalSize,
|
|
3132
|
+
const y = i.size - d.minPortalSize;
|
|
3133
|
+
f = d.minPortalSize, $ = i.left + y, z = i.top + y;
|
|
3134
3134
|
}
|
|
3135
3135
|
if (z < d.framePadding) {
|
|
3136
|
-
const
|
|
3137
|
-
z = d.framePadding,
|
|
3136
|
+
const y = d.framePadding - z;
|
|
3137
|
+
z = d.framePadding, $ = $ + y, f = f - y;
|
|
3138
3138
|
}
|
|
3139
|
-
if (
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3139
|
+
if ($ < d.framePadding) {
|
|
3140
|
+
const y = d.framePadding - $;
|
|
3141
|
+
$ = d.framePadding, z = z + y, f = f - y;
|
|
3142
3142
|
}
|
|
3143
3143
|
return o({
|
|
3144
3144
|
portal: {
|
|
3145
3145
|
...a,
|
|
3146
3146
|
top: z,
|
|
3147
|
-
left:
|
|
3147
|
+
left: $,
|
|
3148
3148
|
size: f
|
|
3149
3149
|
}
|
|
3150
3150
|
});
|
|
@@ -3189,13 +3189,13 @@ const na = (e) => {
|
|
|
3189
3189
|
pageY: t.pageY
|
|
3190
3190
|
};
|
|
3191
3191
|
}, Ia = (e, t) => {
|
|
3192
|
-
var
|
|
3192
|
+
var $, z, y;
|
|
3193
3193
|
const o = e(), n = document.querySelector(
|
|
3194
|
-
`.${(
|
|
3194
|
+
`.${($ = o.css) == null ? void 0 : $.portal[0]}`
|
|
3195
3195
|
), i = document.querySelector(
|
|
3196
3196
|
`.${(z = o.css) == null ? void 0 : z.portalArea[0]}`
|
|
3197
3197
|
), a = document.querySelector(
|
|
3198
|
-
`.${(
|
|
3198
|
+
`.${(y = o.css) == null ? void 0 : y.root[0]}`
|
|
3199
3199
|
);
|
|
3200
3200
|
let c = null, d = null;
|
|
3201
3201
|
const u = (x) => {
|
|
@@ -3272,14 +3272,14 @@ const na = (e) => {
|
|
|
3272
3272
|
return;
|
|
3273
3273
|
}
|
|
3274
3274
|
const f = new FileReader();
|
|
3275
|
-
let
|
|
3275
|
+
let $ = null;
|
|
3276
3276
|
const z = () => {
|
|
3277
3277
|
var b;
|
|
3278
3278
|
const v = t(), w = document.querySelector(
|
|
3279
3279
|
`.${(b = v.css) == null ? void 0 : b.root[0]}`
|
|
3280
3280
|
);
|
|
3281
|
-
w && (w.remove(), document.removeEventListener("keydown",
|
|
3282
|
-
},
|
|
3281
|
+
w && (w.remove(), document.removeEventListener("keydown", y), $ == null || $(), za(), a(), o(Ft));
|
|
3282
|
+
}, y = (v) => {
|
|
3283
3283
|
v.key === "Escape" && t().sourceBase64 && x(v);
|
|
3284
3284
|
}, x = (v) => {
|
|
3285
3285
|
v.preventDefault(), z();
|
|
@@ -3313,7 +3313,7 @@ const na = (e) => {
|
|
|
3313
3313
|
sourceBase64: (O = v.target) == null ? void 0 : O.result,
|
|
3314
3314
|
sourceHeight: w.height,
|
|
3315
3315
|
sourceWidth: w.width
|
|
3316
|
-
}),
|
|
3316
|
+
}), $ = Ia(t, o), document.addEventListener("keydown", y);
|
|
3317
3317
|
};
|
|
3318
3318
|
}, f.onerror = () => {
|
|
3319
3319
|
d("Failed to read file");
|
|
@@ -3422,8 +3422,8 @@ const na = (e) => {
|
|
|
3422
3422
|
} = e, f = U(null);
|
|
3423
3423
|
return { open: N(() => {
|
|
3424
3424
|
f.current || (Da(), f.current = Oa(
|
|
3425
|
-
(z,
|
|
3426
|
-
|
|
3425
|
+
(z, y, x) => {
|
|
3426
|
+
y && (c == null || c({ base64: z, blob: y, state: x }));
|
|
3427
3427
|
},
|
|
3428
3428
|
{
|
|
3429
3429
|
portalSize: g,
|
|
@@ -3465,9 +3465,9 @@ const na = (e) => {
|
|
|
3465
3465
|
onError: g,
|
|
3466
3466
|
outputSize: h,
|
|
3467
3467
|
portalSize: f,
|
|
3468
|
-
previewSize:
|
|
3468
|
+
previewSize: $ = 120,
|
|
3469
3469
|
ref: z,
|
|
3470
|
-
type:
|
|
3470
|
+
type: y,
|
|
3471
3471
|
value: x,
|
|
3472
3472
|
...m
|
|
3473
3473
|
}) => {
|
|
@@ -3483,17 +3483,17 @@ const na = (e) => {
|
|
|
3483
3483
|
onError: g,
|
|
3484
3484
|
outputSize: h,
|
|
3485
3485
|
portalSize: f,
|
|
3486
|
-
type:
|
|
3486
|
+
type: y
|
|
3487
3487
|
});
|
|
3488
3488
|
return /* @__PURE__ */ S(Ln, { ...m, ref: z, className: St("container", i), children: [
|
|
3489
|
-
/* @__PURE__ */ s(An, { $size:
|
|
3489
|
+
/* @__PURE__ */ s(An, { $size: $, className: St("preview", a == null ? void 0 : a.preview), children: v ? /* @__PURE__ */ s("img", { src: v, alt: "Preview" }) : /* @__PURE__ */ s(On, { children: "No image" }) }),
|
|
3490
3490
|
/* @__PURE__ */ s(
|
|
3491
3491
|
at,
|
|
3492
3492
|
{
|
|
3493
3493
|
variant: "system",
|
|
3494
3494
|
onClick: b,
|
|
3495
3495
|
className: St("button", a == null ? void 0 : a.button),
|
|
3496
|
-
style: { width:
|
|
3496
|
+
style: { width: $ },
|
|
3497
3497
|
children: o
|
|
3498
3498
|
}
|
|
3499
3499
|
)
|
|
@@ -3745,11 +3745,11 @@ const na = (e) => {
|
|
|
3745
3745
|
placeholder: g = "Select...",
|
|
3746
3746
|
ref: h,
|
|
3747
3747
|
searchPlaceholder: f = "Search...",
|
|
3748
|
-
value:
|
|
3748
|
+
value: $,
|
|
3749
3749
|
variant: z = "normal",
|
|
3750
|
-
|
|
3750
|
+
...y
|
|
3751
3751
|
}) => {
|
|
3752
|
-
const [x, m] = _(!1), [v, w] = _(""), b = te(() => u.filter((R) =>
|
|
3752
|
+
const [x, m] = _(!1), [v, w] = _(""), b = te(() => u.filter((R) => $.includes(R.value)), [u, $]), C = te(() => {
|
|
3753
3753
|
if (!v.trim()) return u;
|
|
3754
3754
|
const R = v.toLowerCase().trim();
|
|
3755
3755
|
return u.filter((M) => M.label.toLowerCase().includes(R));
|
|
@@ -3758,11 +3758,11 @@ const na = (e) => {
|
|
|
3758
3758
|
}, I = () => {
|
|
3759
3759
|
m(!1), w("");
|
|
3760
3760
|
}, Y = (R) => {
|
|
3761
|
-
|
|
3761
|
+
$.includes(R) ? d($.filter((M) => M !== R)) : d([...$, R]);
|
|
3762
3762
|
}, V = (R) => {
|
|
3763
|
-
d(
|
|
3763
|
+
d($.filter((M) => M !== R));
|
|
3764
3764
|
};
|
|
3765
|
-
return /* @__PURE__ */ S(Ua, {
|
|
3765
|
+
return /* @__PURE__ */ S(Ua, { ...y, ref: h, className: ae("container", e), children: [
|
|
3766
3766
|
i && /* @__PURE__ */ s(qa, { $variant: z, className: ae("label", t == null ? void 0 : t.trigger), children: i }),
|
|
3767
3767
|
/* @__PURE__ */ s(
|
|
3768
3768
|
Ga,
|
|
@@ -3826,7 +3826,7 @@ const na = (e) => {
|
|
|
3826
3826
|
/* @__PURE__ */ s(
|
|
3827
3827
|
Ht,
|
|
3828
3828
|
{
|
|
3829
|
-
checked:
|
|
3829
|
+
checked: $.includes(R.value),
|
|
3830
3830
|
disabled: R.disabled,
|
|
3831
3831
|
onChange: () => Y(R.value)
|
|
3832
3832
|
}
|
|
@@ -4098,14 +4098,14 @@ const na = (e) => {
|
|
|
4098
4098
|
variant: h = "normal",
|
|
4099
4099
|
...f
|
|
4100
4100
|
}) => {
|
|
4101
|
-
const
|
|
4101
|
+
const $ = U([]);
|
|
4102
4102
|
ne(() => {
|
|
4103
|
-
e &&
|
|
4103
|
+
e && $.current[0] && $.current[0].focus();
|
|
4104
4104
|
}, [e]);
|
|
4105
4105
|
const z = N((v) => {
|
|
4106
|
-
const w =
|
|
4106
|
+
const w = $.current[v];
|
|
4107
4107
|
w && (w.focus(), w.select());
|
|
4108
|
-
}, []),
|
|
4108
|
+
}, []), y = N(
|
|
4109
4109
|
(v, w) => {
|
|
4110
4110
|
const C = w.target.value.replace(/\D/g, "").slice(-1);
|
|
4111
4111
|
if (!C) return;
|
|
@@ -4144,7 +4144,7 @@ const na = (e) => {
|
|
|
4144
4144
|
fl,
|
|
4145
4145
|
{
|
|
4146
4146
|
ref: (b) => {
|
|
4147
|
-
|
|
4147
|
+
$.current[w] = b;
|
|
4148
4148
|
},
|
|
4149
4149
|
type: "text",
|
|
4150
4150
|
inputMode: "numeric",
|
|
@@ -4152,7 +4152,7 @@ const na = (e) => {
|
|
|
4152
4152
|
maxLength: 2,
|
|
4153
4153
|
disabled: n,
|
|
4154
4154
|
value: g[w] ?? "",
|
|
4155
|
-
onChange: (b) =>
|
|
4155
|
+
onChange: (b) => y(w, b),
|
|
4156
4156
|
onKeyDown: (b) => x(w, b),
|
|
4157
4157
|
onPaste: m,
|
|
4158
4158
|
onFocus: (b) => b.target.select(),
|
|
@@ -4767,6 +4767,13 @@ const na = (e) => {
|
|
|
4767
4767
|
&:hover:not(:disabled) {
|
|
4768
4768
|
background: ${l(r.black, 8)};
|
|
4769
4769
|
}
|
|
4770
|
+
|
|
4771
|
+
& > span {
|
|
4772
|
+
overflow: hidden;
|
|
4773
|
+
text-overflow: ellipsis;
|
|
4774
|
+
white-space: nowrap;
|
|
4775
|
+
min-width: 0;
|
|
4776
|
+
}
|
|
4770
4777
|
`, Ul = p.span`
|
|
4771
4778
|
display: flex;
|
|
4772
4779
|
align-items: center;
|
|
@@ -4786,10 +4793,10 @@ const na = (e) => {
|
|
|
4786
4793
|
ref: g,
|
|
4787
4794
|
size: h = "default",
|
|
4788
4795
|
value: f,
|
|
4789
|
-
variant:
|
|
4796
|
+
variant: $ = "normal",
|
|
4790
4797
|
...z
|
|
4791
4798
|
}) => {
|
|
4792
|
-
const [
|
|
4799
|
+
const [y, x] = _(!1), [m, v] = _({
|
|
4793
4800
|
top: 0,
|
|
4794
4801
|
left: 0,
|
|
4795
4802
|
width: 0
|
|
@@ -4810,12 +4817,12 @@ const na = (e) => {
|
|
|
4810
4817
|
var D;
|
|
4811
4818
|
a == null || a(k), x(!1), (D = b.current) == null || D.focus();
|
|
4812
4819
|
}, V = (k) => {
|
|
4813
|
-
o || (k.key === "Enter" || k.key === " " ? (k.preventDefault(), x((D) => !D)) : k.key === "Escape" &&
|
|
4820
|
+
o || c.length === 0 || (k.key === "Enter" || k.key === " " ? (k.preventDefault(), x((D) => !D)) : k.key === "Escape" && y ? (k.preventDefault(), x(!1)) : k.key === "ArrowDown" && !y && (k.preventDefault(), x(!0)));
|
|
4814
4821
|
};
|
|
4815
4822
|
pt(() => {
|
|
4816
|
-
|
|
4817
|
-
}, [
|
|
4818
|
-
if (
|
|
4823
|
+
y && u && I();
|
|
4824
|
+
}, [y, u, L, c.length]), ne(() => {
|
|
4825
|
+
if (!y) return;
|
|
4819
4826
|
const k = (A) => {
|
|
4820
4827
|
const j = A.target, H = w.current && !w.current.contains(j), q = C.current && !C.current.contains(j);
|
|
4821
4828
|
u ? H && q && x(!1) : H && x(!1);
|
|
@@ -4827,7 +4834,7 @@ const na = (e) => {
|
|
|
4827
4834
|
return document.addEventListener("mousedown", k), u && (window.addEventListener("scroll", D, !0), window.addEventListener("resize", E)), () => {
|
|
4828
4835
|
document.removeEventListener("mousedown", k), window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", E);
|
|
4829
4836
|
};
|
|
4830
|
-
}, [
|
|
4837
|
+
}, [y, u]);
|
|
4831
4838
|
const R = () => c.map((k) => /* @__PURE__ */ S(
|
|
4832
4839
|
Xl,
|
|
4833
4840
|
{
|
|
@@ -4881,29 +4888,36 @@ const na = (e) => {
|
|
|
4881
4888
|
$fullWidth: n,
|
|
4882
4889
|
className: Pe("container", e),
|
|
4883
4890
|
children: [
|
|
4884
|
-
i && /* @__PURE__ */ s(
|
|
4891
|
+
i && /* @__PURE__ */ s(
|
|
4892
|
+
Bl,
|
|
4893
|
+
{
|
|
4894
|
+
variant: $ === "error" ? "error" : "normal",
|
|
4895
|
+
className: Pe("label", t == null ? void 0 : t.label),
|
|
4896
|
+
children: i
|
|
4897
|
+
}
|
|
4898
|
+
),
|
|
4885
4899
|
/* @__PURE__ */ S(
|
|
4886
4900
|
Yl,
|
|
4887
4901
|
{
|
|
4888
4902
|
ref: b,
|
|
4889
4903
|
type: "button",
|
|
4890
4904
|
$size: h,
|
|
4891
|
-
$variant:
|
|
4905
|
+
$variant: $,
|
|
4892
4906
|
$disabled: o,
|
|
4893
4907
|
$hasValue: !!O,
|
|
4894
4908
|
disabled: o,
|
|
4895
|
-
onClick: () => !o && x((k) => !k),
|
|
4909
|
+
onClick: () => !o && c.length > 0 && x((k) => !k),
|
|
4896
4910
|
onKeyDown: V,
|
|
4897
4911
|
"aria-haspopup": "listbox",
|
|
4898
|
-
"aria-expanded":
|
|
4912
|
+
"aria-expanded": y,
|
|
4899
4913
|
className: Pe("trigger", t == null ? void 0 : t.trigger),
|
|
4900
4914
|
children: [
|
|
4901
4915
|
/* @__PURE__ */ s(Vl, { children: (O == null ? void 0 : O.label) ?? d }),
|
|
4902
|
-
/* @__PURE__ */ s(Hl, { $open:
|
|
4916
|
+
/* @__PURE__ */ s(Hl, { $open: y, children: /* @__PURE__ */ s(_r, { size: 16 }) })
|
|
4903
4917
|
]
|
|
4904
4918
|
}
|
|
4905
4919
|
),
|
|
4906
|
-
|
|
4920
|
+
y && M
|
|
4907
4921
|
]
|
|
4908
4922
|
}
|
|
4909
4923
|
);
|
|
@@ -5067,14 +5081,14 @@ const na = (e) => {
|
|
|
5067
5081
|
$orientation: n,
|
|
5068
5082
|
className: Ye("container", e),
|
|
5069
5083
|
children: a.map((g, h) => {
|
|
5070
|
-
const f = g.value === c,
|
|
5084
|
+
const f = g.value === c, $ = h < u, z = h === a.length - 1;
|
|
5071
5085
|
return /* @__PURE__ */ S(rd, { $orientation: n, children: [
|
|
5072
5086
|
/* @__PURE__ */ S(
|
|
5073
5087
|
od,
|
|
5074
5088
|
{
|
|
5075
5089
|
type: "button",
|
|
5076
5090
|
$active: f,
|
|
5077
|
-
$completed:
|
|
5091
|
+
$completed: $,
|
|
5078
5092
|
$clickable: !!o,
|
|
5079
5093
|
onClick: () => o == null ? void 0 : o(g.value),
|
|
5080
5094
|
className: Ye("step", t == null ? void 0 : t.step),
|
|
@@ -5083,7 +5097,7 @@ const na = (e) => {
|
|
|
5083
5097
|
id,
|
|
5084
5098
|
{
|
|
5085
5099
|
$active: f,
|
|
5086
|
-
$completed:
|
|
5100
|
+
$completed: $,
|
|
5087
5101
|
className: Ye("circle", t == null ? void 0 : t.circle),
|
|
5088
5102
|
children: h + 1
|
|
5089
5103
|
}
|
|
@@ -5092,7 +5106,7 @@ const na = (e) => {
|
|
|
5092
5106
|
nd,
|
|
5093
5107
|
{
|
|
5094
5108
|
$active: f,
|
|
5095
|
-
$completed:
|
|
5109
|
+
$completed: $,
|
|
5096
5110
|
className: Ye("label", t == null ? void 0 : t.label),
|
|
5097
5111
|
children: g.label
|
|
5098
5112
|
}
|
|
@@ -5103,7 +5117,7 @@ const na = (e) => {
|
|
|
5103
5117
|
!z && /* @__PURE__ */ s(
|
|
5104
5118
|
ad,
|
|
5105
5119
|
{
|
|
5106
|
-
$completed:
|
|
5120
|
+
$completed: $,
|
|
5107
5121
|
$orientation: n,
|
|
5108
5122
|
className: Ye("line", t == null ? void 0 : t.line)
|
|
5109
5123
|
}
|
|
@@ -5246,20 +5260,20 @@ const na = (e) => {
|
|
|
5246
5260
|
placeholder: g = "Add tag...",
|
|
5247
5261
|
portalRenderNode: h,
|
|
5248
5262
|
ref: f,
|
|
5249
|
-
value:
|
|
5263
|
+
value: $,
|
|
5250
5264
|
variant: z = "normal",
|
|
5251
|
-
|
|
5265
|
+
...y
|
|
5252
5266
|
}) => {
|
|
5253
5267
|
const x = U(null), m = U(null), v = U(null), w = U(null), [b, C] = _(""), [O, L] = _(!1), [W, I] = _("bottom"), [Y, V] = _({
|
|
5254
5268
|
top: 0,
|
|
5255
5269
|
left: 0,
|
|
5256
5270
|
width: 0
|
|
5257
5271
|
}), R = te(() => {
|
|
5258
|
-
const T = u.filter((J) =>
|
|
5272
|
+
const T = u.filter((J) => !$.includes(J.value));
|
|
5259
5273
|
if (!b.trim()) return T;
|
|
5260
5274
|
const B = b.toLowerCase().trim();
|
|
5261
5275
|
return T.filter((J) => J.label.toLowerCase().includes(B));
|
|
5262
|
-
}, [u,
|
|
5276
|
+
}, [u, $, b]), M = O && u.length > 0, k = N(() => {
|
|
5263
5277
|
var We;
|
|
5264
5278
|
if (!m.current) return;
|
|
5265
5279
|
const T = m.current.getBoundingClientRect(), B = ((We = v.current) == null ? void 0 : We.offsetHeight) ?? 200, J = window.innerHeight - T.bottom - ot, Q = T.top - ot, me = J < B && Q > J ? "top" : "bottom";
|
|
@@ -5281,9 +5295,9 @@ const na = (e) => {
|
|
|
5281
5295
|
const D = N(
|
|
5282
5296
|
(T) => {
|
|
5283
5297
|
const B = T.trim();
|
|
5284
|
-
return !B ||
|
|
5298
|
+
return !B || $.includes(B) ? !1 : (d([...$, B]), C(""), !0);
|
|
5285
5299
|
},
|
|
5286
|
-
[
|
|
5300
|
+
[$, d]
|
|
5287
5301
|
), E = (T) => {
|
|
5288
5302
|
if (T.key === o && b.trim())
|
|
5289
5303
|
if (T.preventDefault(), a)
|
|
@@ -5294,12 +5308,12 @@ const na = (e) => {
|
|
|
5294
5308
|
);
|
|
5295
5309
|
B && D(B.value);
|
|
5296
5310
|
}
|
|
5297
|
-
else T.key === "Backspace" && !b &&
|
|
5311
|
+
else T.key === "Backspace" && !b && $.length > 0 && d($.slice(0, -1));
|
|
5298
5312
|
}, A = (T) => {
|
|
5299
5313
|
var B;
|
|
5300
5314
|
D(T), (B = w.current) == null || B.focus();
|
|
5301
5315
|
}, j = (T) => {
|
|
5302
|
-
d(
|
|
5316
|
+
d($.filter((B) => B !== T));
|
|
5303
5317
|
}, H = () => {
|
|
5304
5318
|
var T;
|
|
5305
5319
|
n || (T = w.current) == null || T.focus();
|
|
@@ -5307,7 +5321,7 @@ const na = (e) => {
|
|
|
5307
5321
|
const B = u.find((J) => J.value === T);
|
|
5308
5322
|
return (B == null ? void 0 : B.label) ?? T;
|
|
5309
5323
|
};
|
|
5310
|
-
return /* @__PURE__ */ S(ld, {
|
|
5324
|
+
return /* @__PURE__ */ S(ld, { ...y, ref: f, className: le("container", e), children: [
|
|
5311
5325
|
c && /* @__PURE__ */ s(dd, { $variant: z, className: le("label"), children: c }),
|
|
5312
5326
|
/* @__PURE__ */ S("div", { ref: x, style: { position: "relative" }, children: [
|
|
5313
5327
|
/* @__PURE__ */ S(
|
|
@@ -5320,7 +5334,7 @@ const na = (e) => {
|
|
|
5320
5334
|
onClick: H,
|
|
5321
5335
|
className: le("trigger", t == null ? void 0 : t.trigger),
|
|
5322
5336
|
children: [
|
|
5323
|
-
|
|
5337
|
+
$.map((T) => /* @__PURE__ */ s(
|
|
5324
5338
|
Dt,
|
|
5325
5339
|
{
|
|
5326
5340
|
deletable: !n,
|
|
@@ -5340,7 +5354,7 @@ const na = (e) => {
|
|
|
5340
5354
|
onFocus: () => L(!0),
|
|
5341
5355
|
onBlur: () => setTimeout(() => L(!1), 150),
|
|
5342
5356
|
onKeyDown: E,
|
|
5343
|
-
placeholder:
|
|
5357
|
+
placeholder: $.length === 0 ? g : "",
|
|
5344
5358
|
disabled: n,
|
|
5345
5359
|
$disabled: n,
|
|
5346
5360
|
className: le("input", t == null ? void 0 : t.input)
|
|
@@ -5662,7 +5676,7 @@ const na = (e) => {
|
|
|
5662
5676
|
font-weight: 500;
|
|
5663
5677
|
white-space: nowrap;
|
|
5664
5678
|
margin-left: auto;
|
|
5665
|
-
`, Ar = ({ toast: e,
|
|
5679
|
+
`, Ar = ({ toast: e, onHide: t }) => {
|
|
5666
5680
|
const [o, n] = _(!1), i = () => {
|
|
5667
5681
|
n(!0), setTimeout(() => {
|
|
5668
5682
|
t(e.id);
|
|
@@ -5679,17 +5693,17 @@ const na = (e) => {
|
|
|
5679
5693
|
/* @__PURE__ */ s(md, { children: e.message }),
|
|
5680
5694
|
/* @__PURE__ */ s(kd, { onClick: i, children: /* @__PURE__ */ s(dt, { style: { width: 16, height: 16 } }) })
|
|
5681
5695
|
] });
|
|
5682
|
-
}, Pd = ({ toasts: e, queueCount: t,
|
|
5696
|
+
}, Pd = ({ toasts: e, queueCount: t, onHide: o }) => {
|
|
5683
5697
|
if (e.length === 0)
|
|
5684
5698
|
return null;
|
|
5685
5699
|
const n = e.length - 1;
|
|
5686
5700
|
return /* @__PURE__ */ s(vd, { children: e.map((i, a) => a === n && t > 0 ? /* @__PURE__ */ S(Sd, { children: [
|
|
5687
|
-
/* @__PURE__ */ s(Ar, { toast: i,
|
|
5701
|
+
/* @__PURE__ */ s(Ar, { toast: i, onHide: o }),
|
|
5688
5702
|
/* @__PURE__ */ S(zd, { children: [
|
|
5689
5703
|
"+",
|
|
5690
5704
|
t
|
|
5691
5705
|
] })
|
|
5692
|
-
] }, i.id) : /* @__PURE__ */ s(Ar, { toast: i,
|
|
5706
|
+
] }, i.id) : /* @__PURE__ */ s(Ar, { toast: i, onHide: o }, i.id)) });
|
|
5693
5707
|
}, bc = ({ children: e }) => {
|
|
5694
5708
|
const [t, o] = Dr($d, yd), n = N(
|
|
5695
5709
|
(a, c = "default", d) => {
|
|
@@ -5711,21 +5725,14 @@ const na = (e) => {
|
|
|
5711
5725
|
payload: a
|
|
5712
5726
|
});
|
|
5713
5727
|
}, []);
|
|
5714
|
-
return /* @__PURE__ */ S(Jr.Provider, { value: {
|
|
5728
|
+
return /* @__PURE__ */ S(Jr.Provider, { value: { show: n, hide: i }, children: [
|
|
5715
5729
|
e,
|
|
5716
|
-
/* @__PURE__ */ s(
|
|
5717
|
-
Pd,
|
|
5718
|
-
{
|
|
5719
|
-
toasts: t.toasts,
|
|
5720
|
-
queueCount: t.queue.length,
|
|
5721
|
-
removeToast: i
|
|
5722
|
-
}
|
|
5723
|
-
)
|
|
5730
|
+
/* @__PURE__ */ s(Pd, { toasts: t.toasts, queueCount: t.queue.length, onHide: i })
|
|
5724
5731
|
] });
|
|
5725
5732
|
}, fc = () => {
|
|
5726
5733
|
const e = st(Jr);
|
|
5727
5734
|
if (!e)
|
|
5728
|
-
throw new Error("
|
|
5735
|
+
throw new Error("useToastr must be used within ToastProvider");
|
|
5729
5736
|
return e;
|
|
5730
5737
|
}, Or = {
|
|
5731
5738
|
dark: {
|
|
@@ -5869,6 +5876,7 @@ const na = (e) => {
|
|
|
5869
5876
|
`, Cd = p.div`
|
|
5870
5877
|
position: relative;
|
|
5871
5878
|
display: inline-block;
|
|
5879
|
+
width: fit-content;
|
|
5872
5880
|
`, Rd = (e) => {
|
|
5873
5881
|
switch (e) {
|
|
5874
5882
|
case "top":
|
|
@@ -5917,7 +5925,7 @@ const na = (e) => {
|
|
|
5917
5925
|
variant: u = "dark",
|
|
5918
5926
|
...g
|
|
5919
5927
|
}) => {
|
|
5920
|
-
const [h, f] = _(!1), [
|
|
5928
|
+
const [h, f] = _(!1), [$, z] = _(null), [y, x] = _(a), [m, v] = _({ top: 0, left: 0 }), w = U(null), b = U(null), C = N(() => {
|
|
5921
5929
|
var A, j;
|
|
5922
5930
|
if (!w.current) return;
|
|
5923
5931
|
const I = w.current.getBoundingClientRect(), Y = ((A = b.current) == null ? void 0 : A.offsetWidth) ?? 100, V = ((j = b.current) == null ? void 0 : j.offsetHeight) ?? 30, R = I.top - be, M = window.innerHeight - I.bottom - be, k = I.left - be, D = window.innerWidth - I.right - be;
|
|
@@ -5953,14 +5961,14 @@ const na = (e) => {
|
|
|
5953
5961
|
}, i);
|
|
5954
5962
|
z(I);
|
|
5955
5963
|
}, L = () => {
|
|
5956
|
-
|
|
5964
|
+
$ && (clearTimeout($), z(null)), f(!1);
|
|
5957
5965
|
}, W = c ? we(
|
|
5958
5966
|
/* @__PURE__ */ s(
|
|
5959
5967
|
Id,
|
|
5960
5968
|
{
|
|
5961
5969
|
ref: b,
|
|
5962
5970
|
className: At("content", o == null ? void 0 : o.content),
|
|
5963
|
-
$placement:
|
|
5971
|
+
$placement: y,
|
|
5964
5972
|
$variant: u,
|
|
5965
5973
|
$visible: h,
|
|
5966
5974
|
style: { top: m.top, left: m.left },
|
|
@@ -5973,7 +5981,7 @@ const na = (e) => {
|
|
|
5973
5981
|
{
|
|
5974
5982
|
ref: b,
|
|
5975
5983
|
className: At("content", o == null ? void 0 : o.content),
|
|
5976
|
-
$placement:
|
|
5984
|
+
$placement: y,
|
|
5977
5985
|
$variant: u,
|
|
5978
5986
|
$visible: h,
|
|
5979
5987
|
children: n
|
|
@@ -6056,6 +6064,6 @@ export {
|
|
|
6056
6064
|
vo as useKeyBinding,
|
|
6057
6065
|
tc as useNotification,
|
|
6058
6066
|
dc as useSaveProgress,
|
|
6059
|
-
fc as
|
|
6067
|
+
fc as useToastr
|
|
6060
6068
|
};
|
|
6061
6069
|
//# sourceMappingURL=index.js.map
|