@kingsimba/nc-ui 0.1.47 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.js +109 -105
- package/dist/style.css +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var ht = Object.defineProperty;
|
|
2
2
|
var mt = (e, t, n) => t in e ? ht(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var se = (e, t, n) => mt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { jsx as s, jsxs as A, Fragment as
|
|
4
|
+
import { jsx as s, jsxs as A, Fragment as Ee } from "react/jsx-runtime";
|
|
5
5
|
import { d as Le, E as gt, R as bt, V as vt, k as wt, Y as yt, b as xt, a as kt, c as Nt } from "./GeneratedIcons-eOaZDTB3.js";
|
|
6
|
-
import ze, { useState as
|
|
6
|
+
import ze, { useState as P, useRef as j, useEffect as V, useMemo as $e, createContext as be, useContext as ae, Children as At, isValidElement as St, forwardRef as Ct, useImperativeHandle as Mt, useCallback as X, Suspense as $t } from "react";
|
|
7
7
|
import { createPortal as Ae } from "react-dom";
|
|
8
8
|
import { useTranslation as oe } from "react-i18next";
|
|
9
9
|
import It from "i18next";
|
|
@@ -98,7 +98,7 @@ function Un({
|
|
|
98
98
|
className: c = "",
|
|
99
99
|
style: l
|
|
100
100
|
}) {
|
|
101
|
-
const u = i ?? /* @__PURE__ */ A(
|
|
101
|
+
const u = i ?? /* @__PURE__ */ A(Ee, { children: [
|
|
102
102
|
e !== void 0 && /* @__PURE__ */ s("span", { className: "nc-alert-code", children: e }),
|
|
103
103
|
t
|
|
104
104
|
] });
|
|
@@ -136,7 +136,7 @@ function qn({
|
|
|
136
136
|
const o = Math.max(0, Math.min(1, Number(e) || 0)), i = o === 0 ? "-" : String(Math.round(o * 100));
|
|
137
137
|
let a;
|
|
138
138
|
r ? o < 0.1 ? a = "var(--nc-danger)" : o < 0.2 ? a = "var(--nc-warning)" : a = "var(--nc-success)" : a = n ? "rgba(255,255,255,0.35)" : "#000000";
|
|
139
|
-
const c = "var(--nc-battery-shell-bg)", l = 24, u = 14, p = 2, w = 0, d = 12, g = 0, k = 0, b = 0, v = l, y = u, h = y - g * 2, f = v - g * 2, m = Math.max(1, Math.min(4, y / 4)), N = o === 0 ? 0 : 0.05 + o * 0.95, C = l + p + d,
|
|
139
|
+
const c = "var(--nc-battery-shell-bg)", l = 24, u = 14, p = 2, w = 0, d = 12, g = 0, k = 0, b = 0, v = l, y = u, h = y - g * 2, f = v - g * 2, m = Math.max(1, Math.min(4, y / 4)), N = o === 0 ? 0 : 0.05 + o * 0.95, C = l + p + d, E = 20, B = 0.65, S = Math.max(u, E * B), L = l + p + 1, x = (u - E * B) / 2;
|
|
140
140
|
return /* @__PURE__ */ A(
|
|
141
141
|
"svg",
|
|
142
142
|
{
|
|
@@ -224,7 +224,7 @@ function Xn({
|
|
|
224
224
|
);
|
|
225
225
|
}) });
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Pt({ size: e }) {
|
|
228
228
|
return /* @__PURE__ */ s("svg", { className: `nc-checkbox-icon ${e === "small" ? "nc-small" : e === "tiny" ? "nc-tiny" : ""}`, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ s(
|
|
229
229
|
"path",
|
|
230
230
|
{
|
|
@@ -257,7 +257,7 @@ function Jn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
257
257
|
onKeyDown: (p) => {
|
|
258
258
|
n || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), t(!e));
|
|
259
259
|
},
|
|
260
|
-
children: e && /* @__PURE__ */ s(
|
|
260
|
+
children: e && /* @__PURE__ */ s(Pt, { size: o })
|
|
261
261
|
}
|
|
262
262
|
),
|
|
263
263
|
r && /* @__PURE__ */ s("span", { className: "nc-checkbox-text", style: i ? { color: i } : void 0, children: r })
|
|
@@ -265,7 +265,7 @@ function Jn({ checked: e, onChange: t, disabled: n, label: r, size: o = "default
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Et({ option: e, onChange: t, selected: n, highlighted: r, small: o, renderOption: i, index: a }) {
|
|
269
269
|
const c = j(null), { t: l } = oe(), u = e.disabled === !0;
|
|
270
270
|
return V(() => {
|
|
271
271
|
r && c.current && c.current.scrollIntoView({ block: "nearest" });
|
|
@@ -285,7 +285,7 @@ function Pt({ option: e, onChange: t, selected: n, highlighted: r, small: o, ren
|
|
|
285
285
|
opacity: u ? 0.4 : void 0,
|
|
286
286
|
background: r && !u ? "rgba(59,130,246,0.18)" : n && !u ? "rgba(59,130,246,0.12)" : void 0
|
|
287
287
|
},
|
|
288
|
-
children: i ? i(e, a, !!r) : /* @__PURE__ */ A(
|
|
288
|
+
children: i ? i(e, a, !!r) : /* @__PURE__ */ A(Ee, { children: [
|
|
289
289
|
e.label,
|
|
290
290
|
e.default && /* @__PURE__ */ A("span", { style: { fontSize: "0.85em", color: "var(--nc-text-weak)", marginLeft: 6 }, children: [
|
|
291
291
|
"(",
|
|
@@ -307,7 +307,7 @@ function Lt({
|
|
|
307
307
|
highlightedIndex: c = -1,
|
|
308
308
|
renderOption: l
|
|
309
309
|
}) {
|
|
310
|
-
const [u, p] =
|
|
310
|
+
const [u, p] = P({ top: 0, left: 0, width: 0 }), [w, d] = P(o), { t: g } = oe();
|
|
311
311
|
if (V(() => {
|
|
312
312
|
if (e && i.current) {
|
|
313
313
|
const b = i.current.getBoundingClientRect();
|
|
@@ -338,7 +338,7 @@ function Lt({
|
|
|
338
338
|
maxHeight: 300,
|
|
339
339
|
overflowY: "auto"
|
|
340
340
|
},
|
|
341
|
-
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${a ? "nc-small" : ""}`, children: g("common.noResults") }) : t.map((b, v) => /* @__PURE__ */ s(
|
|
341
|
+
children: t.length === 0 ? /* @__PURE__ */ s("div", { className: `nc-combo-dropdown-option nc-no-results ${a ? "nc-small" : ""}`, children: g("common.noResults") }) : t.map((b, v) => /* @__PURE__ */ s(Et, { option: b, onChange: n, selected: b.value === r, highlighted: v === c, small: a, renderOption: l, index: v }, b.value))
|
|
342
342
|
}
|
|
343
343
|
);
|
|
344
344
|
return Ae(k, document.body);
|
|
@@ -392,7 +392,7 @@ function Qn({
|
|
|
392
392
|
style: v,
|
|
393
393
|
className: y
|
|
394
394
|
}) {
|
|
395
|
-
const [h, f] =
|
|
395
|
+
const [h, f] = P(!1), [m, N] = P(""), [C, E] = P(-1), B = j(null), S = j(null), L = j(null), x = g === "small", { t: M } = oe(), z = !!o, F = w || z, [I, T] = P([]), [H, q] = P(() => {
|
|
396
396
|
if (r && e) {
|
|
397
397
|
const R = r.find((Y) => Y.value === e);
|
|
398
398
|
return R ? R.label : "";
|
|
@@ -415,7 +415,7 @@ function Qn({
|
|
|
415
415
|
const W = async () => {
|
|
416
416
|
try {
|
|
417
417
|
const U = await o(R);
|
|
418
|
-
T(U),
|
|
418
|
+
T(U), E(-1);
|
|
419
419
|
} catch {
|
|
420
420
|
T([]);
|
|
421
421
|
}
|
|
@@ -427,7 +427,7 @@ function Qn({
|
|
|
427
427
|
return F ? (r || []).filter((Y) => Y.label.toLowerCase().includes(R)) : r || [];
|
|
428
428
|
}, [r, m, F, z, I]);
|
|
429
429
|
V(() => {
|
|
430
|
-
h &&
|
|
430
|
+
h && E(-1);
|
|
431
431
|
}, [h, _]), V(() => {
|
|
432
432
|
if (!p && !e && r && r.length > 0 && t) {
|
|
433
433
|
const R = r.find((Y) => Y.default) || r[0];
|
|
@@ -440,7 +440,7 @@ function Qn({
|
|
|
440
440
|
}
|
|
441
441
|
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
442
442
|
}, []);
|
|
443
|
-
const D = c ?? (r ? r.find((R) => R.value === e) : e ? { label: H, value: e } : void 0), J = D && p, le = !l && !J,
|
|
443
|
+
const D = c ?? (r ? r.find((R) => R.value === e) : e ? { label: H, value: e } : void 0), J = D && p, le = !l && !J, fe = `nc-align-${b}`, de = !(h && F) && !!D, ue = (R, Y, W = !1) => {
|
|
444
444
|
var U;
|
|
445
445
|
q(Y), t == null || t(R), f(!1), N(""), W && ((U = B.current) == null || U.blur());
|
|
446
446
|
}, we = () => {
|
|
@@ -466,26 +466,26 @@ function Qn({
|
|
|
466
466
|
};
|
|
467
467
|
switch (R.key) {
|
|
468
468
|
case "ArrowDown":
|
|
469
|
-
R.preventDefault(),
|
|
469
|
+
R.preventDefault(), E((W) => {
|
|
470
470
|
const U = W + 1, G = U >= _.length ? 0 : U;
|
|
471
471
|
return Y(G, 1);
|
|
472
472
|
});
|
|
473
473
|
break;
|
|
474
474
|
case "ArrowUp":
|
|
475
|
-
R.preventDefault(),
|
|
475
|
+
R.preventDefault(), E((W) => {
|
|
476
476
|
const U = W - 1, G = U < 0 ? _.length - 1 : U;
|
|
477
477
|
return Y(G, -1);
|
|
478
478
|
});
|
|
479
479
|
break;
|
|
480
480
|
case "Enter":
|
|
481
|
-
R.preventDefault(), C >= 0 && C < _.length && !_[C].disabled &&
|
|
481
|
+
R.preventDefault(), C >= 0 && C < _.length && !_[C].disabled && ue(_[C].value, _[C].label, !0);
|
|
482
482
|
break;
|
|
483
483
|
case "Escape":
|
|
484
484
|
R.preventDefault(), f(!1), N("");
|
|
485
485
|
break;
|
|
486
486
|
}
|
|
487
487
|
};
|
|
488
|
-
return /* @__PURE__ */ A("div", { className: `nc-combo-container ${k === "transparent" ? "nc-transparent" : ""} ${k === "plain" ? "nc-plain" : ""} ${h ? "nc-open" : ""} ${
|
|
488
|
+
return /* @__PURE__ */ A("div", { className: `nc-combo-container ${k === "transparent" ? "nc-transparent" : ""} ${k === "plain" ? "nc-plain" : ""} ${h ? "nc-open" : ""} ${fe} ${y || ""}`.trim(), style: { position: "relative", ...v }, children: [
|
|
489
489
|
u && /* @__PURE__ */ s("span", { className: `nc-label ${x ? "nc-small" : ""}`, children: u }),
|
|
490
490
|
/* @__PURE__ */ A(
|
|
491
491
|
"div",
|
|
@@ -509,7 +509,7 @@ function Qn({
|
|
|
509
509
|
"input",
|
|
510
510
|
{
|
|
511
511
|
ref: B,
|
|
512
|
-
className: `nc-input ${x ? "nc-small" : ""}
|
|
512
|
+
className: `nc-input ${x ? "nc-small" : ""} ${de ? "nc-value-under-overlay" : ""}`.trim(),
|
|
513
513
|
placeholder: n,
|
|
514
514
|
onFocus: () => {
|
|
515
515
|
if (!l && F) {
|
|
@@ -533,28 +533,32 @@ function Qn({
|
|
|
533
533
|
paddingRight: le || J ? x ? 32 : 44 : 12,
|
|
534
534
|
caretColor: w ? void 0 : "transparent",
|
|
535
535
|
cursor: w ? void 0 : "pointer",
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
// The input text is invisible behind the overlay, so it must not be selectable
|
|
537
|
+
// (its selection highlight would be painted over the overlay text).
|
|
538
|
+
userSelect: de ? "none" : void 0,
|
|
539
|
+
color: de ? "transparent" : "var(--nc-text)"
|
|
538
540
|
}
|
|
539
541
|
}
|
|
540
542
|
),
|
|
541
|
-
|
|
543
|
+
de && /* @__PURE__ */ s(
|
|
542
544
|
"div",
|
|
543
545
|
{
|
|
544
546
|
"aria-hidden": !0,
|
|
545
|
-
className: `nc-combo-overlay ${
|
|
547
|
+
className: `nc-combo-overlay ${fe}`,
|
|
546
548
|
style: {
|
|
547
549
|
position: "absolute",
|
|
548
550
|
left: x ? 8 : 12,
|
|
549
551
|
right: le || J ? x ? 12 : 24 : x ? 8 : 12,
|
|
550
552
|
top: "50%",
|
|
551
553
|
transform: "translateY(-50%)",
|
|
552
|
-
|
|
554
|
+
// The overlay carries the visible text, so it is the layer that can be selected/copied.
|
|
555
|
+
userSelect: "text",
|
|
556
|
+
cursor: w ? void 0 : "pointer",
|
|
553
557
|
display: "flex",
|
|
554
558
|
alignItems: "center",
|
|
555
559
|
gap: 6
|
|
556
560
|
},
|
|
557
|
-
children: a && D ? a(D) : /* @__PURE__ */ A(
|
|
561
|
+
children: a && D ? a(D) : /* @__PURE__ */ A(Ee, { children: [
|
|
558
562
|
/* @__PURE__ */ s("span", { className: `nc-combo-overlay-text ${x ? "nc-small" : ""}`, children: D == null ? void 0 : D.label }),
|
|
559
563
|
(D == null ? void 0 : D.default) && /* @__PURE__ */ A("span", { className: `nc-combo-overlay-default ${x ? "nc-small" : ""}`, children: [
|
|
560
564
|
"(",
|
|
@@ -569,7 +573,7 @@ function Qn({
|
|
|
569
573
|
]
|
|
570
574
|
}
|
|
571
575
|
),
|
|
572
|
-
/* @__PURE__ */ s(Lt, { isOpen: h, options: _, onSelect:
|
|
576
|
+
/* @__PURE__ */ s(Lt, { isOpen: h, options: _, onSelect: ue, selectedValue: e, placement: d, anchorRef: S, small: x, highlightedIndex: C, renderOption: i })
|
|
573
577
|
] });
|
|
574
578
|
}
|
|
575
579
|
function Zn({ onClick: e, loading: t = !1, disabled: n = !1, size: r = "default", title: o, "aria-label": i }) {
|
|
@@ -650,7 +654,7 @@ function rr({
|
|
|
650
654
|
anchor: o,
|
|
651
655
|
preferredDirection: i = "down"
|
|
652
656
|
}) {
|
|
653
|
-
const a = j(null), [c, l] =
|
|
657
|
+
const a = j(null), [c, l] = P({ top: 0, left: 0 }), u = o || (r == null ? void 0 : r.current);
|
|
654
658
|
if (V(() => {
|
|
655
659
|
if (!e || !u || !a.current) return;
|
|
656
660
|
const d = u.getBoundingClientRect(), g = a.current.getBoundingClientRect(), k = window.innerHeight, b = window.innerWidth, v = d.bottom + 8, y = v + g.height <= k - 8;
|
|
@@ -728,14 +732,14 @@ function rr({
|
|
|
728
732
|
document.body
|
|
729
733
|
);
|
|
730
734
|
}
|
|
731
|
-
const et =
|
|
735
|
+
const et = be(null);
|
|
732
736
|
function Dt() {
|
|
733
737
|
const e = ae(et);
|
|
734
738
|
if (!e)
|
|
735
739
|
throw new Error("useDialog must be used inside a Dialog component");
|
|
736
740
|
return e;
|
|
737
741
|
}
|
|
738
|
-
function
|
|
742
|
+
function he({ children: e, onClick: t, ...n }) {
|
|
739
743
|
const { close: r } = Dt(), { t: o } = oe();
|
|
740
744
|
return /* @__PURE__ */ s(ne, { onClick: (a) => {
|
|
741
745
|
t == null || t(a), r();
|
|
@@ -778,34 +782,34 @@ function or({
|
|
|
778
782
|
S.disconnect();
|
|
779
783
|
};
|
|
780
784
|
}, [y]), !e) return null;
|
|
781
|
-
const
|
|
785
|
+
const E = () => {
|
|
782
786
|
switch (i) {
|
|
783
787
|
case "ok":
|
|
784
788
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(ne, { variant: "primary", onClick: c ?? t, disabled: g, children: m("common.ok") }) });
|
|
785
789
|
case "ok-cancel":
|
|
786
790
|
return /* @__PURE__ */ A("div", { className: "nc-dialog-footer", children: [
|
|
787
|
-
/* @__PURE__ */ s(
|
|
791
|
+
/* @__PURE__ */ s(he, { onClick: p, children: m("common.cancel") }),
|
|
788
792
|
/* @__PURE__ */ s(ne, { variant: "primary", onClick: c ?? t, disabled: g, children: m("common.ok") })
|
|
789
793
|
] });
|
|
790
794
|
case "save-cancel":
|
|
791
795
|
return /* @__PURE__ */ A("div", { className: "nc-dialog-footer", children: [
|
|
792
|
-
/* @__PURE__ */ s(
|
|
796
|
+
/* @__PURE__ */ s(he, { onClick: p, children: m("common.cancel") }),
|
|
793
797
|
/* @__PURE__ */ s(ne, { variant: "primary", onClick: l, disabled: g, children: m("common.save") })
|
|
794
798
|
] });
|
|
795
799
|
case "delete-cancel":
|
|
796
800
|
return /* @__PURE__ */ A("div", { className: "nc-dialog-footer", children: [
|
|
797
|
-
/* @__PURE__ */ s(
|
|
801
|
+
/* @__PURE__ */ s(he, { onClick: p, children: m("common.cancel") }),
|
|
798
802
|
/* @__PURE__ */ s(ne, { variant: "danger", onClick: u, disabled: g, children: m("common.delete") })
|
|
799
803
|
] });
|
|
800
804
|
case "connect":
|
|
801
805
|
return /* @__PURE__ */ A("div", { className: "nc-dialog-footer", children: [
|
|
802
|
-
/* @__PURE__ */ s(
|
|
806
|
+
/* @__PURE__ */ s(he, { onClick: p, children: m("common.cancel") }),
|
|
803
807
|
/* @__PURE__ */ s(ne, { variant: "primary", onClick: w, disabled: g, children: m("common.connect") })
|
|
804
808
|
] });
|
|
805
809
|
case "close":
|
|
806
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(
|
|
810
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(he, { variant: "primary" }) });
|
|
807
811
|
case "gotit":
|
|
808
|
-
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(
|
|
812
|
+
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: /* @__PURE__ */ s(he, { variant: "primary", children: m("common.gotit") }) });
|
|
809
813
|
case "custom":
|
|
810
814
|
return /* @__PURE__ */ s("div", { className: "nc-dialog-footer", children: a });
|
|
811
815
|
case "none":
|
|
@@ -829,7 +833,7 @@ function or({
|
|
|
829
833
|
/* @__PURE__ */ s(Ze, { onClick: t, "aria-label": "Close dialog" })
|
|
830
834
|
] }),
|
|
831
835
|
/* @__PURE__ */ s("div", { ref: f, className: "nc-dialog-content", children: r }),
|
|
832
|
-
|
|
836
|
+
E()
|
|
833
837
|
]
|
|
834
838
|
}
|
|
835
839
|
) }) });
|
|
@@ -915,13 +919,13 @@ function sr({
|
|
|
915
919
|
validator: f,
|
|
916
920
|
showErrorMessage: m = !0
|
|
917
921
|
}) {
|
|
918
|
-
const N = j(null), C = j(null),
|
|
922
|
+
const N = j(null), C = j(null), E = j(!1), [B, S] = P(!1), [L, x] = P(!1), [M, z] = P(!1), F = e !== void 0, [I, T] = P(t), H = F ? e : I, [q, O] = P(H), _ = f ? f(H) : null, D = !!_, J = !y && g === "plain", le = J && L, fe = le ? q : H;
|
|
919
923
|
V(() => {
|
|
920
924
|
le || O(H);
|
|
921
925
|
}, [H, le]);
|
|
922
|
-
const
|
|
926
|
+
const de = p === "password", ue = de && v && !c && !y, we = u && fe && !c && (L || M), ye = d === "small" ? 32 : 44;
|
|
923
927
|
let R = 12;
|
|
924
|
-
we &&
|
|
928
|
+
we && ue ? R = ye * 2 : (we || ue) && (R = ye);
|
|
925
929
|
const W = b ? d === "small" ? 28 : 34 : void 0, U = () => {
|
|
926
930
|
if (!J)
|
|
927
931
|
return H;
|
|
@@ -938,12 +942,12 @@ function sr({
|
|
|
938
942
|
F || T(""), n == null || n(""), i == null || i(), y ? (ee = C.current) == null || ee.focus() : (je = N.current) == null || je.focus();
|
|
939
943
|
}, He = (Q) => {
|
|
940
944
|
if (J && Q.key === "Escape") {
|
|
941
|
-
Q.preventDefault(),
|
|
945
|
+
Q.preventDefault(), E.current = !0, G(), Q.currentTarget.blur();
|
|
942
946
|
return;
|
|
943
947
|
}
|
|
944
948
|
if (Q.key === "Enter" && !y) {
|
|
945
949
|
const ee = J ? U() : H;
|
|
946
|
-
J && (Q.preventDefault(),
|
|
950
|
+
J && (Q.preventDefault(), E.current = !0, Q.currentTarget.blur()), o == null || o(ee);
|
|
947
951
|
}
|
|
948
952
|
}, Ve = (Q) => {
|
|
949
953
|
const ee = Q.target.value;
|
|
@@ -955,8 +959,8 @@ function sr({
|
|
|
955
959
|
}, Fe = () => {
|
|
956
960
|
x(!0), J && O(H);
|
|
957
961
|
}, Oe = () => {
|
|
958
|
-
if (J &&
|
|
959
|
-
|
|
962
|
+
if (J && E.current) {
|
|
963
|
+
E.current = !1, x(!1);
|
|
960
964
|
return;
|
|
961
965
|
}
|
|
962
966
|
J && U(), x(!1);
|
|
@@ -978,7 +982,7 @@ function sr({
|
|
|
978
982
|
ref: C,
|
|
979
983
|
className: Ye,
|
|
980
984
|
placeholder: a,
|
|
981
|
-
value:
|
|
985
|
+
value: fe,
|
|
982
986
|
onChange: Ve,
|
|
983
987
|
onKeyDown: He,
|
|
984
988
|
onFocus: Fe,
|
|
@@ -997,10 +1001,10 @@ function sr({
|
|
|
997
1001
|
"input",
|
|
998
1002
|
{
|
|
999
1003
|
ref: N,
|
|
1000
|
-
type:
|
|
1004
|
+
type: de && B ? "text" : p,
|
|
1001
1005
|
className: Ye,
|
|
1002
1006
|
placeholder: a,
|
|
1003
|
-
value:
|
|
1007
|
+
value: fe,
|
|
1004
1008
|
onChange: Ve,
|
|
1005
1009
|
onKeyDown: He,
|
|
1006
1010
|
onFocus: Fe,
|
|
@@ -1015,8 +1019,8 @@ function sr({
|
|
|
1015
1019
|
}
|
|
1016
1020
|
}
|
|
1017
1021
|
),
|
|
1018
|
-
we && /* @__PURE__ */ s(Wt, { onClick: ft, size: d, rightOffset:
|
|
1019
|
-
|
|
1022
|
+
we && /* @__PURE__ */ s(Wt, { onClick: ft, size: d, rightOffset: ue ? ye + 4 : 4 }),
|
|
1023
|
+
ue && /* @__PURE__ */ s(Ht, { visible: B, onClick: () => S(!B), size: d })
|
|
1020
1024
|
] }),
|
|
1021
1025
|
D && m && /* @__PURE__ */ s("span", { className: "nc-error-message", children: _ })
|
|
1022
1026
|
]
|
|
@@ -1054,7 +1058,7 @@ function ir({
|
|
|
1054
1058
|
...o
|
|
1055
1059
|
},
|
|
1056
1060
|
className: `nc-list-group-item ${t ? "nc-list-group-item-clickable" : ""} ${i ? "nc-list-group-item-active" : ""}`,
|
|
1057
|
-
children: /* @__PURE__ */ s("div", { style: { flex: 1 }, children: e })
|
|
1061
|
+
children: /* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: e })
|
|
1058
1062
|
}
|
|
1059
1063
|
);
|
|
1060
1064
|
}
|
|
@@ -1074,7 +1078,7 @@ function cr({ title: e, titleTools: t, children: n, style: r }) {
|
|
|
1074
1078
|
] });
|
|
1075
1079
|
}
|
|
1076
1080
|
function ar({ values: e, onChange: t, options: n, placeholder: r = "Select…", label: o }) {
|
|
1077
|
-
const [i, a] =
|
|
1081
|
+
const [i, a] = P(!1), [c, l] = P(""), u = j(null), p = $e(() => n.filter((d) => d.label.toLowerCase().includes(c.toLowerCase())), [n, c]);
|
|
1078
1082
|
V(() => {
|
|
1079
1083
|
function d(g) {
|
|
1080
1084
|
!(g.target instanceof Node) || !u.current || u.current.contains(g.target) || a(!1);
|
|
@@ -1167,7 +1171,7 @@ function lr({
|
|
|
1167
1171
|
disabled: i = !1,
|
|
1168
1172
|
size: a = "default"
|
|
1169
1173
|
}) {
|
|
1170
|
-
const [c, l] =
|
|
1174
|
+
const [c, l] = P(!1), [u, p] = P(""), [w, d] = P(""), [g, k] = P({ top: 0, left: 0, width: 0, right: void 0 }), b = j(null), v = j(null);
|
|
1171
1175
|
V(() => {
|
|
1172
1176
|
if (c && b.current) {
|
|
1173
1177
|
const x = b.current.getBoundingClientRect(), z = Math.max(x.width, 400);
|
|
@@ -1201,7 +1205,7 @@ function lr({
|
|
|
1201
1205
|
return;
|
|
1202
1206
|
const z = Ne(u), F = Ne(w);
|
|
1203
1207
|
z && F && (n == null || n(z, F)), l(!1);
|
|
1204
|
-
}, m = e && t ? `${Ge(e)} - ${Ge(t)}` : "Select month range", N = Se(u), C = Se(w),
|
|
1208
|
+
}, m = e && t ? `${Ge(e)} - ${Ge(t)}` : "Select month range", N = Se(u), C = Se(w), E = Ne(u), B = Ne(w), S = E && B && E > B, L = c ? Ae(
|
|
1205
1209
|
/* @__PURE__ */ s(
|
|
1206
1210
|
"div",
|
|
1207
1211
|
{
|
|
@@ -1280,7 +1284,7 @@ function lr({
|
|
|
1280
1284
|
}
|
|
1281
1285
|
const Vt = 5, Ft = 3;
|
|
1282
1286
|
function dr({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disabled: a, className: c = "", style: l, size: u = "default" }) {
|
|
1283
|
-
const p = u === "small", w = (String(o).split(".")[1] || "").length, d = j(null), g = j(!1), k = j(null), [b, v] =
|
|
1287
|
+
const p = u === "small", w = (String(o).split(".")[1] || "").length, d = j(null), g = j(!1), k = j(null), [b, v] = P(!1), [y, h] = P(() => String(e)), f = (I) => parseFloat(I.toFixed(w)), m = (I) => {
|
|
1284
1288
|
const T = f(I);
|
|
1285
1289
|
h(String(T)), t(T);
|
|
1286
1290
|
}, N = () => {
|
|
@@ -1289,7 +1293,7 @@ function dr({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1289
1293
|
}, C = () => {
|
|
1290
1294
|
const I = e + o;
|
|
1291
1295
|
r !== void 0 && I > r || m(parseFloat(I.toFixed(10)));
|
|
1292
|
-
},
|
|
1296
|
+
}, E = (I) => {
|
|
1293
1297
|
const T = I.target.value;
|
|
1294
1298
|
if (h(T), T === "") return;
|
|
1295
1299
|
const H = parseFloat(T);
|
|
@@ -1344,7 +1348,7 @@ function dr({ value: e, onChange: t, min: n, max: r, step: o = 1, label: i, disa
|
|
|
1344
1348
|
className: `nc-input nc-number-input ${p ? "nc-small" : ""} ${F ? "nc-error" : ""}`,
|
|
1345
1349
|
type: "number",
|
|
1346
1350
|
value: y,
|
|
1347
|
-
onChange:
|
|
1351
|
+
onChange: E,
|
|
1348
1352
|
onBlur: B,
|
|
1349
1353
|
min: n,
|
|
1350
1354
|
max: r,
|
|
@@ -1469,7 +1473,7 @@ function pr({ active: e, children: t, keepMounted: n = !1, className: r = "", st
|
|
|
1469
1473
|
return /* @__PURE__ */ s("div", { className: `nc-tab-panels ${r}`, style: o, children: a });
|
|
1470
1474
|
}
|
|
1471
1475
|
function fr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, className: i, toolbar: a, multiline: c, orientation: l = "horizontal", style: u }) {
|
|
1472
|
-
const p = j(null), [w, d] =
|
|
1476
|
+
const p = j(null), [w, d] = P(!1), [g, k] = P(!1), b = l === "verticalLeft" || l === "verticalRight", v = j(!1), y = j(0), h = j(0), f = j(!1);
|
|
1473
1477
|
V(() => {
|
|
1474
1478
|
const S = () => {
|
|
1475
1479
|
if (p.current)
|
|
@@ -1494,7 +1498,7 @@ function fr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1494
1498
|
Math.abs(x) > 3 && (f.current = !0), b ? p.current.scrollTop = h.current + x : p.current.scrollLeft = h.current + x;
|
|
1495
1499
|
}, C = () => {
|
|
1496
1500
|
p.current && (v.current = !1, p.current.style.cursor = "", p.current.style.userSelect = "");
|
|
1497
|
-
},
|
|
1501
|
+
}, E = () => {
|
|
1498
1502
|
C();
|
|
1499
1503
|
};
|
|
1500
1504
|
V(() => {
|
|
@@ -1521,7 +1525,7 @@ function fr({ tabs: e, active: t, onChange: n, onClose: r, permanentTabs: o, cla
|
|
|
1521
1525
|
onMouseDown: m,
|
|
1522
1526
|
onMouseMove: N,
|
|
1523
1527
|
onMouseUp: C,
|
|
1524
|
-
onMouseLeave:
|
|
1528
|
+
onMouseLeave: E,
|
|
1525
1529
|
style: { cursor: "grab" },
|
|
1526
1530
|
children: e.map((S) => {
|
|
1527
1531
|
const L = typeof S == "string" ? S : S.id, x = typeof S == "string" ? S : S.label, M = r && !(o != null && o.includes(L));
|
|
@@ -1674,8 +1678,8 @@ const mr = Ct(
|
|
|
1674
1678
|
if (!N) return;
|
|
1675
1679
|
const C = Gt(t, h, f, m);
|
|
1676
1680
|
N.focus(), N.setSelectionRange(C, C);
|
|
1677
|
-
const
|
|
1678
|
-
N.scrollTop = (Math.max(1, h) - 1) *
|
|
1681
|
+
const E = parseFloat(getComputedStyle(N).lineHeight) || 18;
|
|
1682
|
+
N.scrollTop = (Math.max(1, h) - 1) * E, k(), g();
|
|
1679
1683
|
}
|
|
1680
1684
|
}), [t]);
|
|
1681
1685
|
const g = X(() => {
|
|
@@ -1705,9 +1709,9 @@ const mr = Ct(
|
|
|
1705
1709
|
`).map((m, N) => {
|
|
1706
1710
|
const C = m.split(" ");
|
|
1707
1711
|
return /* @__PURE__ */ A("div", { className: `nc-csv-line ${l === N + 1 ? "nc-csv-highlight" : ""}`, children: [
|
|
1708
|
-
C.map((
|
|
1712
|
+
C.map((E, B) => /* @__PURE__ */ A("span", { children: [
|
|
1709
1713
|
B > 0 && /* @__PURE__ */ s("span", { className: "nc-csv-tab-char", children: " " }),
|
|
1710
|
-
/* @__PURE__ */ s("span", { style: { color: _e[B % _e.length] }, children:
|
|
1714
|
+
/* @__PURE__ */ s("span", { style: { color: _e[B % _e.length] }, children: E })
|
|
1711
1715
|
] }, B)),
|
|
1712
1716
|
m === "" && `
|
|
1713
1717
|
`
|
|
@@ -1740,10 +1744,10 @@ const mr = Ct(
|
|
|
1740
1744
|
] });
|
|
1741
1745
|
}
|
|
1742
1746
|
);
|
|
1743
|
-
let
|
|
1747
|
+
let pe = { notifications: [] };
|
|
1744
1748
|
const Re = /* @__PURE__ */ new Set(), Ue = /* @__PURE__ */ new Map();
|
|
1745
1749
|
function Te() {
|
|
1746
|
-
const e =
|
|
1750
|
+
const e = pe.notifications.slice();
|
|
1747
1751
|
for (const t of Array.from(Re))
|
|
1748
1752
|
try {
|
|
1749
1753
|
t(e);
|
|
@@ -1753,7 +1757,7 @@ function Te() {
|
|
|
1753
1757
|
function _t(e) {
|
|
1754
1758
|
Re.add(e);
|
|
1755
1759
|
try {
|
|
1756
|
-
e(
|
|
1760
|
+
e(pe.notifications.slice());
|
|
1757
1761
|
} catch {
|
|
1758
1762
|
}
|
|
1759
1763
|
return () => {
|
|
@@ -1768,16 +1772,16 @@ function Ut(e) {
|
|
|
1768
1772
|
type: r === "error" ? "danger" : r ?? "info",
|
|
1769
1773
|
duration: n ?? 5e3
|
|
1770
1774
|
};
|
|
1771
|
-
return
|
|
1775
|
+
return pe.notifications = [i, ...pe.notifications], Te(), i.duration && i.duration > 0 && setTimeout(() => {
|
|
1772
1776
|
tt(t);
|
|
1773
1777
|
}, i.duration), t;
|
|
1774
1778
|
}
|
|
1775
1779
|
function tt(e) {
|
|
1776
|
-
const t =
|
|
1780
|
+
const t = pe.notifications.find((r) => r.id === e);
|
|
1777
1781
|
if (!t) return;
|
|
1778
1782
|
t.isRemoving = !0, Te();
|
|
1779
1783
|
const n = window.setTimeout(() => {
|
|
1780
|
-
|
|
1784
|
+
pe.notifications = pe.notifications.filter((r) => r.id !== e), Te(), Ue.delete(e);
|
|
1781
1785
|
}, 300);
|
|
1782
1786
|
Ue.set(e, n);
|
|
1783
1787
|
}
|
|
@@ -1862,7 +1866,7 @@ function Xt({ notification: e }) {
|
|
|
1862
1866
|
);
|
|
1863
1867
|
}
|
|
1864
1868
|
function gr() {
|
|
1865
|
-
const [e, t] =
|
|
1869
|
+
const [e, t] = P([]), [n, r] = P(/* @__PURE__ */ new Map()), [o, i] = P(/* @__PURE__ */ new Set()), a = j(null), c = j([]);
|
|
1866
1870
|
return V(() => _t((u) => {
|
|
1867
1871
|
const p = new Set(c.current.map((d) => d.id)), w = u.filter((d) => !p.has(d.id)).map((d) => d.id);
|
|
1868
1872
|
w.length > 0 ? (t(u), i(new Set(w)), requestAnimationFrame(() => {
|
|
@@ -1993,7 +1997,7 @@ class Qt {
|
|
|
1993
1997
|
return this.apps.has(t);
|
|
1994
1998
|
}
|
|
1995
1999
|
}
|
|
1996
|
-
const
|
|
2000
|
+
const ge = new Qt(), qe = "nc-ui-app-state";
|
|
1997
2001
|
class Zt {
|
|
1998
2002
|
constructor() {
|
|
1999
2003
|
se(this, "state");
|
|
@@ -2059,7 +2063,7 @@ class en {
|
|
|
2059
2063
|
*/
|
|
2060
2064
|
async launchApp(t, n) {
|
|
2061
2065
|
const { launchInBackground: r = !1 } = n || {};
|
|
2062
|
-
if (!
|
|
2066
|
+
if (!ge.has(t))
|
|
2063
2067
|
return console.error(`Cannot launch app "${t}": not registered`), null;
|
|
2064
2068
|
const o = this.apps.find((a) => a.appId === t);
|
|
2065
2069
|
if (o)
|
|
@@ -2135,7 +2139,7 @@ class en {
|
|
|
2135
2139
|
* Get the currently active app definition.
|
|
2136
2140
|
*/
|
|
2137
2141
|
getActiveApp() {
|
|
2138
|
-
return this.activeAppId ?
|
|
2142
|
+
return this.activeAppId ? ge.get(this.activeAppId) ?? null : null;
|
|
2139
2143
|
}
|
|
2140
2144
|
/**
|
|
2141
2145
|
* Get all running apps.
|
|
@@ -2161,7 +2165,7 @@ class en {
|
|
|
2161
2165
|
this.listeners.forEach((t) => t());
|
|
2162
2166
|
}
|
|
2163
2167
|
}
|
|
2164
|
-
const Z = new en(), nt =
|
|
2168
|
+
const Z = new en(), nt = be(null);
|
|
2165
2169
|
function tn() {
|
|
2166
2170
|
const e = ae(nt);
|
|
2167
2171
|
if (!e)
|
|
@@ -2226,7 +2230,7 @@ class on extends ze.Component {
|
|
|
2226
2230
|
}
|
|
2227
2231
|
}
|
|
2228
2232
|
function rt({ appId: e, isActive: t, onClose: n }) {
|
|
2229
|
-
const { t: r } = oe(), o =
|
|
2233
|
+
const { t: r } = oe(), o = ge.get(e), [i, a] = P(""), [c, l] = P(null), [u, p] = P(null), [w, d] = P(!1), [g, k] = P(!1);
|
|
2230
2234
|
ze.useEffect(() => {
|
|
2231
2235
|
o != null && o.titleKey && a(r(o.titleKey));
|
|
2232
2236
|
}, [o, r]);
|
|
@@ -2256,7 +2260,7 @@ function rt({ appId: e, isActive: t, onClose: n }) {
|
|
|
2256
2260
|
}), [b, v, y, h, f, m, N, n]);
|
|
2257
2261
|
if (!o)
|
|
2258
2262
|
return null;
|
|
2259
|
-
const
|
|
2263
|
+
const E = o.component, B = !o.hideTitleBar && !g;
|
|
2260
2264
|
return /* @__PURE__ */ A(
|
|
2261
2265
|
"div",
|
|
2262
2266
|
{
|
|
@@ -2284,7 +2288,7 @@ function rt({ appId: e, isActive: t, onClose: n }) {
|
|
|
2284
2288
|
$t,
|
|
2285
2289
|
{
|
|
2286
2290
|
fallback: /* @__PURE__ */ s("div", { className: "nc-app-loading", children: /* @__PURE__ */ s(Qe, {}) }),
|
|
2287
|
-
children: /* @__PURE__ */ s(
|
|
2291
|
+
children: /* @__PURE__ */ s(E, {})
|
|
2288
2292
|
}
|
|
2289
2293
|
) }) })
|
|
2290
2294
|
}
|
|
@@ -2299,9 +2303,9 @@ const Ce = 768, Me = 1024, ot = {
|
|
|
2299
2303
|
isDesktop: !0,
|
|
2300
2304
|
width: typeof window < "u" ? window.innerWidth : 1024,
|
|
2301
2305
|
height: typeof window < "u" ? window.innerHeight : 768
|
|
2302
|
-
}, st =
|
|
2306
|
+
}, st = be(ot);
|
|
2303
2307
|
function wr({ children: e }) {
|
|
2304
|
-
const [t, n] =
|
|
2308
|
+
const [t, n] = P(() => {
|
|
2305
2309
|
if (typeof window > "u") return ot;
|
|
2306
2310
|
const r = window.innerWidth, o = window.innerHeight;
|
|
2307
2311
|
return {
|
|
@@ -2372,9 +2376,9 @@ const Be = "-", sn = (e) => {
|
|
|
2372
2376
|
validators: []
|
|
2373
2377
|
};
|
|
2374
2378
|
return dn(Object.entries(e.classGroups), n).forEach(([i, a]) => {
|
|
2375
|
-
|
|
2379
|
+
Pe(a, r, i, t);
|
|
2376
2380
|
}), r;
|
|
2377
|
-
},
|
|
2381
|
+
}, Pe = (e, t, n, r) => {
|
|
2378
2382
|
e.forEach((o) => {
|
|
2379
2383
|
if (typeof o == "string") {
|
|
2380
2384
|
const i = o === "" ? t : Je(t, o);
|
|
@@ -2383,7 +2387,7 @@ const Be = "-", sn = (e) => {
|
|
|
2383
2387
|
}
|
|
2384
2388
|
if (typeof o == "function") {
|
|
2385
2389
|
if (ln(o)) {
|
|
2386
|
-
|
|
2390
|
+
Pe(o(r), t, n, r);
|
|
2387
2391
|
return;
|
|
2388
2392
|
}
|
|
2389
2393
|
t.validators.push({
|
|
@@ -2393,7 +2397,7 @@ const Be = "-", sn = (e) => {
|
|
|
2393
2397
|
return;
|
|
2394
2398
|
}
|
|
2395
2399
|
Object.entries(o).forEach(([i, a]) => {
|
|
2396
|
-
|
|
2400
|
+
Pe(a, Je(t, i), n, r);
|
|
2397
2401
|
});
|
|
2398
2402
|
});
|
|
2399
2403
|
}, Je = (e, t) => {
|
|
@@ -2549,16 +2553,16 @@ function vn(e, ...t) {
|
|
|
2549
2553
|
const K = (e) => {
|
|
2550
2554
|
const t = (n) => n[e] || [];
|
|
2551
2555
|
return t.isThemeGetter = !0, t;
|
|
2552
|
-
}, dt = /^\[(?:([a-z-]+):)?(.+)\]$/i, wn = /^\d+\/\d+$/, yn = /* @__PURE__ */ new Set(["px", "full", "screen"]), xn = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, kn = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Nn = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, An = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Sn = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, te = (e) =>
|
|
2556
|
+
}, dt = /^\[(?:([a-z-]+):)?(.+)\]$/i, wn = /^\d+\/\d+$/, yn = /* @__PURE__ */ new Set(["px", "full", "screen"]), xn = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, kn = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Nn = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, An = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Sn = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, te = (e) => me(e) || yn.has(e) || wn.test(e), ie = (e) => ve(e, "length", En), me = (e) => !!e && !Number.isNaN(Number(e)), Ie = (e) => ve(e, "number", me), xe = (e) => !!e && Number.isInteger(Number(e)), Cn = (e) => e.endsWith("%") && me(e.slice(0, -1)), $ = (e) => dt.test(e), ce = (e) => xn.test(e), Mn = /* @__PURE__ */ new Set(["length", "size", "percentage"]), $n = (e) => ve(e, Mn, ut), In = (e) => ve(e, "position", ut), Rn = /* @__PURE__ */ new Set(["image", "url"]), Tn = (e) => ve(e, Rn, zn), Pn = (e) => ve(e, "", Ln), ke = () => !0, ve = (e, t, n) => {
|
|
2553
2557
|
const r = dt.exec(e);
|
|
2554
2558
|
return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
|
|
2555
|
-
},
|
|
2559
|
+
}, En = (e) => (
|
|
2556
2560
|
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
2557
2561
|
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
2558
2562
|
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
2559
2563
|
kn.test(e) && !Nn.test(e)
|
|
2560
2564
|
), ut = () => !1, Ln = (e) => An.test(e), zn = (e) => Sn.test(e), Bn = () => {
|
|
2561
|
-
const e = K("colors"), t = K("spacing"), n = K("blur"), r = K("brightness"), o = K("borderColor"), i = K("borderRadius"), a = K("borderSpacing"), c = K("borderWidth"), l = K("contrast"), u = K("grayscale"), p = K("hueRotate"), w = K("invert"), d = K("gap"), g = K("gradientColorStops"), k = K("gradientColorStopPositions"), b = K("inset"), v = K("margin"), y = K("opacity"), h = K("padding"), f = K("saturate"), m = K("scale"), N = K("sepia"), C = K("skew"),
|
|
2565
|
+
const e = K("colors"), t = K("spacing"), n = K("blur"), r = K("brightness"), o = K("borderColor"), i = K("borderRadius"), a = K("borderSpacing"), c = K("borderWidth"), l = K("contrast"), u = K("grayscale"), p = K("hueRotate"), w = K("invert"), d = K("gap"), g = K("gradientColorStops"), k = K("gradientColorStopPositions"), b = K("inset"), v = K("margin"), y = K("opacity"), h = K("padding"), f = K("saturate"), m = K("scale"), N = K("sepia"), C = K("skew"), E = K("space"), B = K("translate"), S = () => ["auto", "contain", "none"], L = () => ["auto", "hidden", "clip", "visible", "scroll"], x = () => ["auto", $, t], M = () => [$, t], z = () => ["", te, ie], F = () => ["auto", me, $], I = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], T = () => ["solid", "dashed", "dotted", "double", "none"], H = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], q = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], O = () => ["", "0", $], _ = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], D = () => [me, $];
|
|
2562
2566
|
return {
|
|
2563
2567
|
cacheSize: 500,
|
|
2564
2568
|
separator: ":",
|
|
@@ -3152,7 +3156,7 @@ const K = (e) => {
|
|
|
3152
3156
|
* @see https://tailwindcss.com/docs/space
|
|
3153
3157
|
*/
|
|
3154
3158
|
"space-x": [{
|
|
3155
|
-
"space-x": [
|
|
3159
|
+
"space-x": [E]
|
|
3156
3160
|
}],
|
|
3157
3161
|
/**
|
|
3158
3162
|
* Space Between X Reverse
|
|
@@ -3164,7 +3168,7 @@ const K = (e) => {
|
|
|
3164
3168
|
* @see https://tailwindcss.com/docs/space
|
|
3165
3169
|
*/
|
|
3166
3170
|
"space-y": [{
|
|
3167
|
-
"space-y": [
|
|
3171
|
+
"space-y": [E]
|
|
3168
3172
|
}],
|
|
3169
3173
|
/**
|
|
3170
3174
|
* Space Between Y Reverse
|
|
@@ -3297,7 +3301,7 @@ const K = (e) => {
|
|
|
3297
3301
|
* @see https://tailwindcss.com/docs/line-clamp
|
|
3298
3302
|
*/
|
|
3299
3303
|
"line-clamp": [{
|
|
3300
|
-
"line-clamp": ["none",
|
|
3304
|
+
"line-clamp": ["none", me, Ie]
|
|
3301
3305
|
}],
|
|
3302
3306
|
/**
|
|
3303
3307
|
* Line Height
|
|
@@ -3931,7 +3935,7 @@ const K = (e) => {
|
|
|
3931
3935
|
* @see https://tailwindcss.com/docs/box-shadow
|
|
3932
3936
|
*/
|
|
3933
3937
|
shadow: [{
|
|
3934
|
-
shadow: ["", "inner", "none", ce,
|
|
3938
|
+
shadow: ["", "inner", "none", ce, Pn]
|
|
3935
3939
|
}],
|
|
3936
3940
|
/**
|
|
3937
3941
|
* Box Shadow Color
|
|
@@ -4591,7 +4595,7 @@ function Wn(...e) {
|
|
|
4591
4595
|
return Dn(Rt(e));
|
|
4592
4596
|
}
|
|
4593
4597
|
function yr({ autoWidth: e = !0, className: t, style: n }) {
|
|
4594
|
-
const [r, o] =
|
|
4598
|
+
const [r, o] = P(() => re.getActiveAppId()), [i, a] = P(() => Z.getRunningApps()), { isMobile: c } = it();
|
|
4595
4599
|
V(() => {
|
|
4596
4600
|
const v = re.subscribe("activeAppId", (y) => {
|
|
4597
4601
|
o(y);
|
|
@@ -4609,7 +4613,7 @@ function yr({ autoWidth: e = !0, className: t, style: n }) {
|
|
|
4609
4613
|
}, []);
|
|
4610
4614
|
const l = (v) => {
|
|
4611
4615
|
Z.closeApp(v);
|
|
4612
|
-
}, u = r ?
|
|
4616
|
+
}, u = r ? ge.get(r) : null, w = (u == null ? void 0 : u.width) ?? 400, d = r !== null, b = { ...{
|
|
4613
4617
|
overflow: "hidden",
|
|
4614
4618
|
display: d ? "flex" : "none",
|
|
4615
4619
|
flexDirection: "column",
|
|
@@ -4634,7 +4638,7 @@ function xr({
|
|
|
4634
4638
|
side: r = "left",
|
|
4635
4639
|
getBadge: o
|
|
4636
4640
|
}) {
|
|
4637
|
-
const { t: i } = oe(), { isMobile: a } = it(), [c, l] =
|
|
4641
|
+
const { t: i } = oe(), { isMobile: a } = it(), [c, l] = P(() => re.getActiveAppId()), [u, p] = P(() => Z.getRunningApps());
|
|
4638
4642
|
V(() => {
|
|
4639
4643
|
const f = re.subscribe("activeAppId", (m) => {
|
|
4640
4644
|
l(m);
|
|
@@ -4647,7 +4651,7 @@ function xr({
|
|
|
4647
4651
|
}), []);
|
|
4648
4652
|
const w = (f) => {
|
|
4649
4653
|
c === f ? Z.setActiveApp(null) : Z.launchApp(f);
|
|
4650
|
-
}, d = e.map((f) =>
|
|
4654
|
+
}, d = e.map((f) => ge.get(f)).filter((f) => !!f), g = u.filter((f) => !e.includes(f.appId)).map((f) => ({ running: f, def: ge.get(f.appId) })).filter((f) => !!f.def), k = (f) => u.some((m) => m.appId === f), b = (f) => f.titleKey ? String(i(f.titleKey)) : f.id, v = (f) => typeof f == "number" && f > 99 ? "99+" : f, y = (f, m) => {
|
|
4651
4655
|
const N = o == null ? void 0 : o(f, m);
|
|
4652
4656
|
return N ? /* @__PURE__ */ s(
|
|
4653
4657
|
"span",
|
|
@@ -4660,7 +4664,7 @@ function xr({
|
|
|
4660
4664
|
}, h = a ? 24 : 28;
|
|
4661
4665
|
return /* @__PURE__ */ A("div", { className: `nc-app-taskbar ${a ? "nc-mobile" : "nc-desktop"} nc-${r} ${t}`, children: [
|
|
4662
4666
|
d.map((f) => {
|
|
4663
|
-
const m = f.icon, N = c === f.id, C = k(f.id),
|
|
4667
|
+
const m = f.icon, N = c === f.id, C = k(f.id), E = { isActive: N, isRunning: C, isPinned: !0 };
|
|
4664
4668
|
return /* @__PURE__ */ A(
|
|
4665
4669
|
"button",
|
|
4666
4670
|
{
|
|
@@ -4669,7 +4673,7 @@ function xr({
|
|
|
4669
4673
|
title: b(f),
|
|
4670
4674
|
children: [
|
|
4671
4675
|
/* @__PURE__ */ s(m, { size: h }),
|
|
4672
|
-
y(f,
|
|
4676
|
+
y(f, E),
|
|
4673
4677
|
n && C && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4674
4678
|
]
|
|
4675
4679
|
},
|
|
@@ -4678,7 +4682,7 @@ function xr({
|
|
|
4678
4682
|
}),
|
|
4679
4683
|
g.length > 0 && /* @__PURE__ */ s("div", { className: "nc-app-taskbar-separator" }),
|
|
4680
4684
|
g.map(({ running: f, def: m }) => {
|
|
4681
|
-
const N = m.icon, C = c === f.appId,
|
|
4685
|
+
const N = m.icon, C = c === f.appId, E = { isActive: C, isRunning: !0, isPinned: !1 };
|
|
4682
4686
|
return /* @__PURE__ */ A(
|
|
4683
4687
|
"button",
|
|
4684
4688
|
{
|
|
@@ -4687,7 +4691,7 @@ function xr({
|
|
|
4687
4691
|
title: b(m),
|
|
4688
4692
|
children: [
|
|
4689
4693
|
/* @__PURE__ */ s(N, { size: h }),
|
|
4690
|
-
y(m,
|
|
4694
|
+
y(m, E),
|
|
4691
4695
|
n && /* @__PURE__ */ s("span", { className: "nc-app-taskbar-indicator" })
|
|
4692
4696
|
]
|
|
4693
4697
|
},
|
|
@@ -4733,7 +4737,7 @@ function kr({
|
|
|
4733
4737
|
);
|
|
4734
4738
|
return Ae(c, document.body);
|
|
4735
4739
|
}
|
|
4736
|
-
const De =
|
|
4740
|
+
const De = be(null), pt = be(null);
|
|
4737
4741
|
function Nr() {
|
|
4738
4742
|
const e = ae(De);
|
|
4739
4743
|
if (!e)
|
|
@@ -4746,12 +4750,12 @@ function Ar() {
|
|
|
4746
4750
|
throw new Error("useNavView must be used within NavStack");
|
|
4747
4751
|
return e;
|
|
4748
4752
|
}
|
|
4749
|
-
const We =
|
|
4753
|
+
const We = be(null);
|
|
4750
4754
|
function Sr({ rootView: e, children: t }) {
|
|
4751
|
-
const { t: n } = oe(), r = tn(), [o, i] =
|
|
4755
|
+
const { t: n } = oe(), r = tn(), [o, i] = P([e]), [a, c] = P([null]), l = X((m, N) => {
|
|
4752
4756
|
c((C) => {
|
|
4753
|
-
const
|
|
4754
|
-
return
|
|
4757
|
+
const E = [...C];
|
|
4758
|
+
return E[m] = N, E;
|
|
4755
4759
|
});
|
|
4756
4760
|
}, []), u = X((m) => {
|
|
4757
4761
|
c((N) => {
|
|
@@ -4837,7 +4841,7 @@ export {
|
|
|
4837
4841
|
rr as ContextMenu,
|
|
4838
4842
|
mr as CsvTextArea,
|
|
4839
4843
|
or as Dialog,
|
|
4840
|
-
|
|
4844
|
+
he as DialogClose,
|
|
4841
4845
|
er as EditButton,
|
|
4842
4846
|
nr as Hyperlink,
|
|
4843
4847
|
sr as Input,
|
|
@@ -4858,7 +4862,7 @@ export {
|
|
|
4858
4862
|
hr as Toggle,
|
|
4859
4863
|
tr as TrashButton,
|
|
4860
4864
|
wr as ViewportProvider,
|
|
4861
|
-
|
|
4865
|
+
ge as appRegistry,
|
|
4862
4866
|
re as appStateStore,
|
|
4863
4867
|
Wn as cn,
|
|
4864
4868
|
vr as createAppI18nFactory,
|