@skiddph/prui 0.13.2 → 0.13.3
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/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Link as e, NavLink as t, Navigate as o, Outlet as r, Route as p, Routes as u } from "react-router-dom";
|
|
2
|
-
import { A as m, a as P, b as S, c as l, C as h, F as n, R as M, S as R, d as g, e as A, f, g as c, h as d, i as k, r as v, s as N, j as T, k as b, u as w } from "./chunks/auth-shell-
|
|
2
|
+
import { A as m, a as P, b as S, c as l, C as h, F as n, R as M, S as R, d as g, e as A, f, g as c, h as d, i as k, r as v, s as N, j as T, k as b, u as w } from "./chunks/auth-shell-Cjq47nnz.js";
|
|
3
3
|
export {
|
|
4
4
|
m as App,
|
|
5
5
|
P as AppShell,
|
|
@@ -92,24 +92,24 @@ function Yt({ config: t }) {
|
|
|
92
92
|
}
|
|
93
93
|
) : null;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function oe(t, r) {
|
|
96
96
|
return r === "/" ? t === "/" : t === r || t.startsWith(r + "/");
|
|
97
97
|
}
|
|
98
98
|
function Wt({ item: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
99
99
|
var O;
|
|
100
100
|
const { pathname: o } = Oe(), p = De(), d = (t.items ?? []).some(
|
|
101
|
-
(v) => v.href ?
|
|
101
|
+
(v) => v.href ? oe(o, v.href) : (v.items ?? []).some((i) => i.href && oe(o, i.href))
|
|
102
102
|
), [T, k] = l.useState(d || n !== void 0 && o === n);
|
|
103
103
|
l.useEffect(() => {
|
|
104
104
|
d && k(!0);
|
|
105
105
|
}, [d]);
|
|
106
|
-
const x = t.icon, [y,
|
|
106
|
+
const x = t.icon, [y, R] = l.useState(!1), [w, P] = l.useState(null), g = l.useRef(null), u = l.useRef(null), [b, E] = l.useState(-1), M = l.useCallback(() => {
|
|
107
107
|
var i, S;
|
|
108
|
-
|
|
108
|
+
R(!1), E(-1);
|
|
109
109
|
const v = document.activeElement;
|
|
110
110
|
v && ((i = u.current) != null && i.contains(v)) && ((S = g.current) == null || S.focus());
|
|
111
111
|
}, []), { setElement: z, isTop: A } = Mt(y);
|
|
112
|
-
if (jt(y, A, () =>
|
|
112
|
+
if (jt(y, A, () => M()), l.useEffect(() => {
|
|
113
113
|
var v;
|
|
114
114
|
y && ((v = u.current) == null || v.focus());
|
|
115
115
|
}, [y]), a) {
|
|
@@ -129,10 +129,10 @@ function Wt({ item: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
|
129
129
|
top: Math.max(8, Math.min(c.top, window.innerHeight - B - 8))
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
R((B) => !B);
|
|
133
133
|
}, N = (c) => {
|
|
134
134
|
var K, _;
|
|
135
|
-
|
|
135
|
+
E(c);
|
|
136
136
|
const h = (K = u.current) == null ? void 0 : K.querySelectorAll("[role='menuitem']");
|
|
137
137
|
if (!h) return;
|
|
138
138
|
(_ = Array.from(h)[c]) == null || _.focus();
|
|
@@ -152,7 +152,7 @@ function Wt({ item: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
|
152
152
|
c.preventDefault(), N(Pt(h));
|
|
153
153
|
break;
|
|
154
154
|
case "Tab":
|
|
155
|
-
|
|
155
|
+
M();
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
158
|
};
|
|
@@ -179,7 +179,7 @@ function Wt({ item: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
|
179
179
|
),
|
|
180
180
|
y && w ? ot(
|
|
181
181
|
/* @__PURE__ */ m(Pe, { children: [
|
|
182
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-[var(--prui-z-flyout)]", onClick: () =>
|
|
182
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-[var(--prui-z-flyout)]", onClick: () => M(), "data-testid": "rail-flyout-backdrop" }),
|
|
183
183
|
/* @__PURE__ */ m(
|
|
184
184
|
"div",
|
|
185
185
|
{
|
|
@@ -205,10 +205,10 @@ function Wt({ item: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
|
205
205
|
"data-testid": "rail-flyout-item",
|
|
206
206
|
className: C(
|
|
207
207
|
"flex cursor-pointer items-center rounded-[calc(var(--prui-radius)-1px)] px-3 py-1.5 text-left text-sm",
|
|
208
|
-
c.href &&
|
|
208
|
+
c.href && oe(o, c.href) ? "bg-[var(--prui-brand)]/15 text-[var(--prui-brand)]" : "text-[var(--prui-fg)] hover:bg-[var(--prui-raise)] focus-visible:bg-[var(--prui-raise)] outline-none"
|
|
209
209
|
),
|
|
210
210
|
onClick: () => {
|
|
211
|
-
|
|
211
|
+
M(), r == null || r(), c.href && p(c.href);
|
|
212
212
|
},
|
|
213
213
|
children: c.label
|
|
214
214
|
},
|
|
@@ -269,7 +269,7 @@ function Ee({ nav: t, onNavigate: r, expandAllOn: n, collapsed: a }) {
|
|
|
269
269
|
const { t: o } = X();
|
|
270
270
|
return /* @__PURE__ */ e("nav", { "aria-label": o.mainNavigation, className: "prui-app-nav", children: /* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.map((p) => /* @__PURE__ */ e(_e, { item: p, onNavigate: r, expandAllOn: n, collapsed: a }, p.href ?? p.label)) }) });
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function ae({ brand: t }) {
|
|
273
273
|
if (!t) return null;
|
|
274
274
|
const r = /* @__PURE__ */ m(Pe, { children: [
|
|
275
275
|
t.mark ? /* @__PURE__ */ e("img", { src: t.mark, alt: "", className: "h-6 w-6 rounded-[var(--prui-radius-1)] object-cover" }) : null,
|
|
@@ -284,7 +284,7 @@ function Qt({
|
|
|
284
284
|
placeholder: a,
|
|
285
285
|
onNavigate: o
|
|
286
286
|
}) {
|
|
287
|
-
const { t: p } = X(), [d, T] = l.useState(""), [k, x] = l.useState(0), y = l.useRef(null),
|
|
287
|
+
const { t: p } = X(), [d, T] = l.useState(""), [k, x] = l.useState(0), y = l.useRef(null), R = a ?? p.commandPlaceholder, w = l.useMemo(() => {
|
|
288
288
|
const u = d.trim().toLowerCase();
|
|
289
289
|
return u ? n.filter((b) => b.label.toLowerCase().includes(u)) : n;
|
|
290
290
|
}, [n, d]);
|
|
@@ -323,7 +323,7 @@ function Qt({
|
|
|
323
323
|
"aria-controls": "prui-palette-listbox",
|
|
324
324
|
"aria-label": "Command palette search",
|
|
325
325
|
"aria-activedescendant": w[k] ? `palette-option-${k}` : void 0,
|
|
326
|
-
placeholder:
|
|
326
|
+
placeholder: R,
|
|
327
327
|
value: d,
|
|
328
328
|
onChange: (u) => T(u.target.value),
|
|
329
329
|
onKeyDown: (u) => {
|
|
@@ -372,46 +372,46 @@ function Zt(t) {
|
|
|
372
372
|
pages: k,
|
|
373
373
|
pagesConfig: x,
|
|
374
374
|
expandAllOn: y,
|
|
375
|
-
layoutType:
|
|
375
|
+
layoutType: R = "A",
|
|
376
376
|
sidebarHeader: w,
|
|
377
377
|
sidebarFooter: P,
|
|
378
378
|
children: g
|
|
379
|
-
} = t, { t: u } = X(), b = typeof a == "object" ? a : { enabled: a !== !1 },
|
|
379
|
+
} = t, { t: u } = X(), b = typeof a == "object" ? a : { enabled: a !== !1 }, E = b.enabled !== !1, M = b.hotkey ?? "/", z = d.collapsible !== !1, [A, O] = l.useState(d.defaultOpen === !0), [v, i] = l.useState(!0), [S, N] = l.useState(!1), f = Oe(), c = De(), h = l.useMemo(
|
|
380
380
|
() => p === !1 ? null : p === !0 ? {} : p,
|
|
381
381
|
[p]
|
|
382
382
|
), B = l.useCallback(() => {
|
|
383
383
|
h != null && h.onTimeout ? h.onTimeout() : c((h == null ? void 0 : h.loginPath) ?? "/login");
|
|
384
384
|
}, [h, c]), K = l.useMemo(() => {
|
|
385
385
|
const $ = [];
|
|
386
|
-
for (const
|
|
387
|
-
if (
|
|
388
|
-
for (const F of
|
|
389
|
-
F.href && $.push({ label: `${
|
|
390
|
-
else
|
|
386
|
+
for (const j of n)
|
|
387
|
+
if (j.items)
|
|
388
|
+
for (const F of j.items)
|
|
389
|
+
F.href && $.push({ label: `${j.label} / ${F.label}`, href: F.href, group: j.label });
|
|
390
|
+
else j.href && $.push({ label: j.label, href: j.href });
|
|
391
391
|
return $;
|
|
392
392
|
}, [n]);
|
|
393
393
|
l.useEffect(() => {
|
|
394
|
-
if (!
|
|
395
|
-
const $ = (
|
|
396
|
-
const F =
|
|
397
|
-
|
|
394
|
+
if (!E) return;
|
|
395
|
+
const $ = (j) => {
|
|
396
|
+
const F = j.target, se = F && (F.tagName === "INPUT" || F.tagName === "TEXTAREA" || F.isContentEditable);
|
|
397
|
+
j.key === M && !se && !j.metaKey && !j.ctrlKey && !j.altKey && (j.preventDefault(), N(!0));
|
|
398
398
|
};
|
|
399
399
|
return document.addEventListener("keydown", $), () => document.removeEventListener("keydown", $);
|
|
400
|
-
}, [
|
|
400
|
+
}, [M, E]);
|
|
401
401
|
const _ = l.useRef(f.pathname);
|
|
402
402
|
l.useEffect(() => {
|
|
403
403
|
_.current !== f.pathname && (_.current = f.pathname, O(!1));
|
|
404
404
|
}, [f.pathname]);
|
|
405
|
-
const J = l.useRef(null), { ref:
|
|
405
|
+
const J = l.useRef(null), { ref: ne } = Ae({
|
|
406
406
|
open: A,
|
|
407
407
|
onEscape: () => O(!1),
|
|
408
408
|
initialFocus: J
|
|
409
|
-
}), { mounted:
|
|
409
|
+
}), { mounted: le, shown: I } = Et(A), Y = d.width ?? 240, L = !v && R !== "D";
|
|
410
410
|
return /* @__PURE__ */ m(
|
|
411
411
|
"div",
|
|
412
412
|
{
|
|
413
413
|
className: "prui-app prui-shell min-h-dvh bg-[var(--prui-background)] text-[var(--prui-fg)]",
|
|
414
|
-
"data-layout":
|
|
414
|
+
"data-layout": R,
|
|
415
415
|
"data-collapsed": L ? "true" : void 0,
|
|
416
416
|
style: { "--prui-shell-sidebar": L ? "var(--prui-rail-width, 64px)" : `${Y}px` },
|
|
417
417
|
children: [
|
|
@@ -426,7 +426,7 @@ function Zt(t) {
|
|
|
426
426
|
}
|
|
427
427
|
) : null
|
|
428
428
|
] }),
|
|
429
|
-
|
|
429
|
+
le ? /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ m("div", { ref: ne, className: "md:hidden fixed inset-0 z-[var(--prui-z-drawer)]", "data-testid": "mobile-drawer", children: [
|
|
430
430
|
/* @__PURE__ */ e(
|
|
431
431
|
"div",
|
|
432
432
|
{
|
|
@@ -453,7 +453,7 @@ function Zt(t) {
|
|
|
453
453
|
"aria-label": "Navigation",
|
|
454
454
|
children: [
|
|
455
455
|
/* @__PURE__ */ m("div", { className: C("mb-2 flex h-10 items-center gap-2 px-1", r ? "justify-between" : "justify-end"), children: [
|
|
456
|
-
r ? /* @__PURE__ */ e("div", { className: "min-w-0", onClick: () => O(!1), children: /* @__PURE__ */ e(
|
|
456
|
+
r ? /* @__PURE__ */ e("div", { className: "min-w-0", onClick: () => O(!1), children: /* @__PURE__ */ e(ae, { brand: r }) }) : null,
|
|
457
457
|
/* @__PURE__ */ e(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
@@ -471,12 +471,12 @@ function Zt(t) {
|
|
|
471
471
|
}
|
|
472
472
|
)
|
|
473
473
|
] }) }) : null,
|
|
474
|
-
|
|
474
|
+
R === "C" ? /* @__PURE__ */ e(
|
|
475
475
|
"div",
|
|
476
476
|
{
|
|
477
477
|
"data-testid": "sidebar-header",
|
|
478
478
|
className: "prui-shell-sidehead hidden h-14 items-center gap-2 border-b border-[var(--prui-line)] bg-[var(--prui-surface)] px-4 md:flex",
|
|
479
|
-
children: w ?? /* @__PURE__ */ e(
|
|
479
|
+
children: w ?? /* @__PURE__ */ e(ae, { brand: r })
|
|
480
480
|
}
|
|
481
481
|
) : null,
|
|
482
482
|
/* @__PURE__ */ m(
|
|
@@ -498,7 +498,7 @@ function Zt(t) {
|
|
|
498
498
|
}
|
|
499
499
|
) : null,
|
|
500
500
|
/* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-1 justify-self-start", children: [
|
|
501
|
-
|
|
501
|
+
R !== "D" ? /* @__PURE__ */ e(
|
|
502
502
|
U,
|
|
503
503
|
{
|
|
504
504
|
variant: "ghost",
|
|
@@ -510,9 +510,13 @@ function Zt(t) {
|
|
|
510
510
|
children: L ? /* @__PURE__ */ e(gt, { className: "h-4 w-4", "aria-hidden": !0 }) : /* @__PURE__ */ e(xt, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
511
511
|
}
|
|
512
512
|
) : null,
|
|
513
|
-
|
|
513
|
+
R === "C" ? (
|
|
514
|
+
/* C owns the brand in its sidebar header row on desktop; the
|
|
515
|
+
sidehead is hidden below md, so the topbar carries it there */
|
|
516
|
+
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(ae, { brand: r }) })
|
|
517
|
+
) : /* @__PURE__ */ e(ae, { brand: r })
|
|
514
518
|
] }),
|
|
515
|
-
|
|
519
|
+
E ? /* @__PURE__ */ m(
|
|
516
520
|
"button",
|
|
517
521
|
{
|
|
518
522
|
type: "button",
|
|
@@ -522,7 +526,7 @@ function Zt(t) {
|
|
|
522
526
|
children: [
|
|
523
527
|
/* @__PURE__ */ e(yt, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
524
528
|
/* @__PURE__ */ e("span", { className: "flex-1 text-left", children: b.placeholder ?? `${u.search}...` }),
|
|
525
|
-
/* @__PURE__ */ e("kbd", { className: "ml-auto rounded-[var(--prui-radius-1)] border border-[var(--prui-line)] bg-[var(--prui-raise)] px-1.5 py-0.5 text-xs", children:
|
|
529
|
+
/* @__PURE__ */ e("kbd", { className: "ml-auto rounded-[var(--prui-radius-1)] border border-[var(--prui-line)] bg-[var(--prui-raise)] px-1.5 py-0.5 text-xs", children: M })
|
|
526
530
|
]
|
|
527
531
|
}
|
|
528
532
|
) : null,
|
|
@@ -550,7 +554,7 @@ function Zt(t) {
|
|
|
550
554
|
onTimeout: B
|
|
551
555
|
}
|
|
552
556
|
) }) : null,
|
|
553
|
-
|
|
557
|
+
E ? /* @__PURE__ */ e(Qt, { open: S, onOpenChange: N, entries: K, placeholder: b.placeholder, onNavigate: c }) : null
|
|
554
558
|
]
|
|
555
559
|
}
|
|
556
560
|
);
|
|
@@ -603,10 +607,10 @@ function rr({
|
|
|
603
607
|
error: T,
|
|
604
608
|
className: k
|
|
605
609
|
}) {
|
|
606
|
-
const { t: x } = X(), y = l.useMemo(() => er(t), [t]),
|
|
610
|
+
const { t: x } = X(), y = l.useMemo(() => er(t), [t]), R = r ?? n, [w, P] = l.useState(() => Me(y, R)), [g, u] = l.useState({}), [b, E] = l.useState(null), [M, z] = l.useState(!1);
|
|
607
611
|
l.useEffect(() => {
|
|
608
|
-
P(Me(y,
|
|
609
|
-
}, [JSON.stringify(y), JSON.stringify(
|
|
612
|
+
P(Me(y, R));
|
|
613
|
+
}, [JSON.stringify(y), JSON.stringify(R ?? {})]);
|
|
610
614
|
const A = (i, S) => {
|
|
611
615
|
P((N) => ({ ...N, [i]: S })), u((N) => {
|
|
612
616
|
if (!N[i]) return N;
|
|
@@ -626,17 +630,17 @@ function rr({
|
|
|
626
630
|
c && (S[f.name] = c);
|
|
627
631
|
}
|
|
628
632
|
if (u(S), !(Object.keys(S).length > 0)) {
|
|
629
|
-
|
|
633
|
+
E(null);
|
|
630
634
|
try {
|
|
631
635
|
const f = a == null ? void 0 : a({ ...w });
|
|
632
636
|
f && typeof f.then == "function" && (z(!0), await f);
|
|
633
637
|
} catch (f) {
|
|
634
|
-
|
|
638
|
+
E(f instanceof Error ? f.message : String(f));
|
|
635
639
|
} finally {
|
|
636
640
|
z(!1);
|
|
637
641
|
}
|
|
638
642
|
}
|
|
639
|
-
}, v = d ||
|
|
643
|
+
}, v = d || M;
|
|
640
644
|
return /* @__PURE__ */ m("form", { onSubmit: O, className: C("prui-form flex flex-col gap-4", k), noValidate: !0, children: [
|
|
641
645
|
/* @__PURE__ */ e("div", { className: C("grid gap-4", y.columns === 2 && "md:grid-cols-2"), children: y.fields.map((i) => {
|
|
642
646
|
const S = g[i.name], N = {
|
|
@@ -749,14 +753,14 @@ function Pr({
|
|
|
749
753
|
form: k,
|
|
750
754
|
formSchema: x,
|
|
751
755
|
rowKey: y,
|
|
752
|
-
searchPlaceholder:
|
|
756
|
+
searchPlaceholder: R,
|
|
753
757
|
pageSize: w,
|
|
754
758
|
state: P,
|
|
755
759
|
defaultState: g,
|
|
756
760
|
onStateChange: u,
|
|
757
761
|
onPageChange: b,
|
|
758
|
-
onFilterChange:
|
|
759
|
-
onSortChange:
|
|
762
|
+
onFilterChange: E,
|
|
763
|
+
onSortChange: M,
|
|
760
764
|
onSearchChange: z,
|
|
761
765
|
onPageSizeChange: A,
|
|
762
766
|
onSelectionChange: O,
|
|
@@ -778,12 +782,12 @@ function Pr({
|
|
|
778
782
|
}),
|
|
779
783
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- defaults are read once
|
|
780
784
|
[]
|
|
781
|
-
), [J,
|
|
785
|
+
), [J, ne] = l.useState(_), le = l.useMemo(
|
|
782
786
|
() => ({ ...J, ...Object.fromEntries(Object.entries(P ?? {}).filter(([, s]) => s !== void 0)) }),
|
|
783
787
|
[J, P]
|
|
784
788
|
), I = l.useCallback(
|
|
785
789
|
(s) => {
|
|
786
|
-
|
|
790
|
+
ne((D) => {
|
|
787
791
|
const V = { ...D }, G = P;
|
|
788
792
|
for (const [Q, it] of Object.entries(s))
|
|
789
793
|
G && Q in G && G[Q] !== void 0 || (V[Q] = it);
|
|
@@ -792,27 +796,27 @@ function Pr({
|
|
|
792
796
|
});
|
|
793
797
|
},
|
|
794
798
|
[P, u]
|
|
795
|
-
), { page: Y, pageSize: L, search: $, filters:
|
|
799
|
+
), { page: Y, pageSize: L, search: $, filters: j, sort: F, selection: se, expandedRows: He } = le, [Xe, ue] = l.useState([]), [de, me] = l.useState(null), [Je, pe] = l.useState([null]), [Ye, fe] = l.useState(!0), [he, be] = l.useState(null), [q, ve] = l.useState(null), [We, W] = l.useState(!1), [ge, xe] = l.useState(!1), [ie, Ge] = l.useState($);
|
|
796
800
|
l.useEffect(() => {
|
|
797
801
|
const s = setTimeout(() => Ge($), N);
|
|
798
802
|
return () => clearTimeout(s);
|
|
799
803
|
}, [$, N]);
|
|
800
|
-
const ye = Je[Y - 1] ?? null, we = JSON.stringify(
|
|
804
|
+
const ye = Je[Y - 1] ?? null, we = JSON.stringify(j), Z = l.useCallback(async () => {
|
|
801
805
|
fe(!0), be(null);
|
|
802
806
|
try {
|
|
803
|
-
const s = await n({ search:
|
|
807
|
+
const s = await n({ search: ie, cursor: ye, pageSize: L, sort: F, filters: j });
|
|
804
808
|
ue(s.rows), me(s.nextCursor ?? s.cursor ?? null);
|
|
805
809
|
} catch (s) {
|
|
806
810
|
be(s instanceof Error ? s.message : String(s)), ue([]), me(null);
|
|
807
811
|
} finally {
|
|
808
812
|
fe(!1);
|
|
809
813
|
}
|
|
810
|
-
}, [
|
|
814
|
+
}, [ie, ye, L, F, we, n]);
|
|
811
815
|
l.useEffect(() => {
|
|
812
816
|
Z();
|
|
813
817
|
}, [Z]), l.useEffect(() => {
|
|
814
818
|
I({ page: 1 }), pe([null]);
|
|
815
|
-
}, [
|
|
819
|
+
}, [ie, L, we]);
|
|
816
820
|
const Qe = l.useMemo(
|
|
817
821
|
() => r.filter((s) => s.filter).map((s) => ({
|
|
818
822
|
key: s.key,
|
|
@@ -822,12 +826,12 @@ function Pr({
|
|
|
822
826
|
})),
|
|
823
827
|
[r]
|
|
824
828
|
), Ze = (s, D) => {
|
|
825
|
-
const V = { ...
|
|
826
|
-
I({ filters: V }),
|
|
829
|
+
const V = { ...j, [s]: D };
|
|
830
|
+
I({ filters: V }), E == null || E(V);
|
|
827
831
|
}, et = (s) => {
|
|
828
832
|
I({ search: s }), z == null || z(s);
|
|
829
833
|
}, tt = (s) => {
|
|
830
|
-
I({ sort: s }),
|
|
834
|
+
I({ sort: s }), M == null || M(s);
|
|
831
835
|
}, rt = (s, D) => {
|
|
832
836
|
if (D === "next") {
|
|
833
837
|
const V = de;
|
|
@@ -894,11 +898,11 @@ function Pr({
|
|
|
894
898
|
/* @__PURE__ */ e(
|
|
895
899
|
Lt,
|
|
896
900
|
{
|
|
897
|
-
searchPlaceholder:
|
|
901
|
+
searchPlaceholder: R ?? c.searchEntity.replace("{name}", t),
|
|
898
902
|
searchValue: $,
|
|
899
903
|
onSearchChange: et,
|
|
900
904
|
filters: Qe,
|
|
901
|
-
filterValues:
|
|
905
|
+
filterValues: j,
|
|
902
906
|
onFilterChange: Ze,
|
|
903
907
|
actions: K("create") ? /* @__PURE__ */ m(U, { variant: "primary", size: "sm", onClick: nt, "data-testid": "resource-create", children: [
|
|
904
908
|
/* @__PURE__ */ e(Tt, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
@@ -917,7 +921,7 @@ function Pr({
|
|
|
917
921
|
onSortChange: tt,
|
|
918
922
|
loading: Ye,
|
|
919
923
|
selectable: v,
|
|
920
|
-
selectedRowKeys:
|
|
924
|
+
selectedRowKeys: se,
|
|
921
925
|
onSelectionChange: (s, D) => {
|
|
922
926
|
I({ selection: s }), O == null || O(s, D);
|
|
923
927
|
},
|
|
@@ -1099,30 +1103,30 @@ function ir({
|
|
|
1099
1103
|
title: o = "Session expiring soon",
|
|
1100
1104
|
message: p = "Your session is about to expire due to inactivity."
|
|
1101
1105
|
}) {
|
|
1102
|
-
const d = Math.max(0, t) * 6e4, T = Math.min(Math.max(0, r) * 6e4, d), [k, x] = l.useState(!1), [y,
|
|
1106
|
+
const d = Math.max(0, t) * 6e4, T = Math.min(Math.max(0, r) * 6e4, d), [k, x] = l.useState(!1), [y, R] = l.useState(T), w = l.useRef(null), P = l.useRef(null), g = l.useRef(null), u = l.useRef(!1), b = l.useCallback(() => {
|
|
1103
1107
|
for (const i of [w, P, g])
|
|
1104
1108
|
i.current != null && (clearInterval(i.current), clearTimeout(i.current), i.current = null);
|
|
1105
|
-
}, []),
|
|
1109
|
+
}, []), E = l.useCallback(() => {
|
|
1106
1110
|
b(), x(!1), n == null || n();
|
|
1107
|
-
}, [b, n]),
|
|
1111
|
+
}, [b, n]), M = l.useCallback(() => {
|
|
1108
1112
|
b(), x(!1), u.current = !1, w.current = window.setTimeout(() => {
|
|
1109
|
-
u.current = !0,
|
|
1110
|
-
|
|
1113
|
+
u.current = !0, R(T), x(!0), g.current = window.setInterval(() => {
|
|
1114
|
+
R((i) => i <= 1e3 ? (E(), 0) : i - 1e3);
|
|
1111
1115
|
}, 1e3);
|
|
1112
|
-
}, d - T), P.current = window.setTimeout(
|
|
1113
|
-
}, [b,
|
|
1116
|
+
}, d - T), P.current = window.setTimeout(E, d);
|
|
1117
|
+
}, [b, E, d, T]);
|
|
1114
1118
|
l.useEffect(() => {
|
|
1115
1119
|
const i = () => {
|
|
1116
|
-
u.current ||
|
|
1120
|
+
u.current || M();
|
|
1117
1121
|
};
|
|
1118
1122
|
for (const S of je) document.addEventListener(S, i, { passive: !0 });
|
|
1119
|
-
return
|
|
1123
|
+
return M(), () => {
|
|
1120
1124
|
b();
|
|
1121
1125
|
for (const S of je) document.removeEventListener(S, i);
|
|
1122
1126
|
};
|
|
1123
|
-
}, [
|
|
1127
|
+
}, [M, b]);
|
|
1124
1128
|
const z = () => {
|
|
1125
|
-
a == null || a(),
|
|
1129
|
+
a == null || a(), M();
|
|
1126
1130
|
}, A = Math.floor(y / 6e4), O = Math.floor(y % 6e4 / 1e3), v = `${A}:${String(O).padStart(2, "0")}`;
|
|
1127
1131
|
return /* @__PURE__ */ m(
|
|
1128
1132
|
$e,
|
|
@@ -1139,7 +1143,7 @@ function ir({
|
|
|
1139
1143
|
/* @__PURE__ */ e("div", { className: "py-4 font-mono text-4xl font-bold text-[var(--prui-fg)]", "data-testid": "session-countdown", children: v })
|
|
1140
1144
|
] }),
|
|
1141
1145
|
/* @__PURE__ */ m("div", { className: "flex flex-col gap-2 px-8 pb-8 sm:flex-row", children: [
|
|
1142
|
-
/* @__PURE__ */ e(U, { variant: "default", className: "flex-1", onClick:
|
|
1146
|
+
/* @__PURE__ */ e(U, { variant: "default", className: "flex-1", onClick: E, "data-testid": "session-logout", children: "Log out now" }),
|
|
1143
1147
|
/* @__PURE__ */ e(U, { variant: "primary", className: "flex-1", onClick: z, "data-testid": "session-extend", children: "Continue session" })
|
|
1144
1148
|
] })
|
|
1145
1149
|
]
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { TimePanel as Zo, TimePicker as $o, TimeRangePicker as er, timePickerPro
|
|
|
36
36
|
import { FileUpload as tr, fileUploadPropsMeta as sr } from "./core/file-upload.js";
|
|
37
37
|
import { D as ir, a as Pr, b as mr, c as lr, d as nr, F as dr, N as Mr, P as gr, T as ur, e as cr, f as fr, g as xr } from "./chunks/data-table-toolbar-B-5J2Ozl.js";
|
|
38
38
|
import { Link as Sr, NavLink as br, Navigate as hr, Outlet as Dr, Route as Fr, Routes as Rr } from "react-router-dom";
|
|
39
|
-
import { A as yr, a as Ar, b as Ir, c as vr, C as Cr, F as wr, R as Br, S as Nr, d as Er, e as Or, f as Lr, g as Kr, h as Ur, i as Gr, r as _r, s as Hr, j as Vr, k as jr, u as qr } from "./chunks/auth-shell-
|
|
39
|
+
import { A as yr, a as Ar, b as Ir, c as vr, C as Cr, F as wr, R as Br, S as Nr, d as Er, e as Or, f as Lr, g as Kr, h as Ur, i as Gr, r as _r, s as Hr, j as Vr, k as jr, u as qr } from "./chunks/auth-shell-Cjq47nnz.js";
|
|
40
40
|
import { AdminSetup as Jr, EmptyState as Qr, ErrorPage as Wr, ForgotPasswordPage as Xr, LoginPage as Yr, LogoutPage as Zr, NotFoundPage as $r, OtpPage as ea, PagesRegistry as oa, ProfilePage as ra, RegisterPage as aa, ResetPasswordPage as ta, SettingsPage as sa, adminSetupPropsMeta as pa, emptyStatePropsMeta as ia, errorPagePropsMeta as Pa, forgotPasswordPagePropsMeta as ma, loginPagePropsMeta as la, logoutPagePropsMeta as na, notFoundPagePropsMeta as da, otpPagePropsMeta as Ma, profilePagePropsMeta as ga, registerPagePropsMeta as ua, resetPasswordPagePropsMeta as ca, settingsPagePropsMeta as fa } from "./pages.js";
|
|
41
41
|
import { PRUI_BREAKPOINTS as Ta, PRUI_DESIGN_TOKENS as Sa, PRUI_THEMES as ba, PRUI_TOKENS as ha, applyTheme as Da, applyThemeTokens as Fa, clearAppliedTokens as Ra, defineTheme as ka, isDarkTheme as ya, isLightTheme as Aa, listThemes as Ia, nextTheme as va, readPersistedTheme as Ca, resolveThemeName as wa, restoreAppliedTokens as Ba, themeMeta as Na, themeMode as Ea, useBreakpointAtLeast as Oa } from "./theme.js";
|
|
42
42
|
import { PruiProvider as Ka, defaultDictionary as Ua, getPruiDictionary as Ga, resetPruiDictionary as _a, setPruiDictionary as Ha, usePruiI18n as Va } from "./i18n.js";
|
package/dist/prui.css
CHANGED
|
@@ -229,6 +229,9 @@ body.modal-open { overflow: hidden; }
|
|
|
229
229
|
font-weight: 600;
|
|
230
230
|
}
|
|
231
231
|
.prui-shell[data-collapsed="true"] .prui-shell-sidehead { justify-content: center; padding-inline: 0; }
|
|
232
|
+
/* the sidehead is a sibling of the sidebar, not inside it: its brand label
|
|
233
|
+
needs the same collapse treatment (mark centers, name hides) */
|
|
234
|
+
.prui-shell[data-collapsed="true"] .prui-shell-sidehead .prui-nav-label { display: none; }
|
|
232
235
|
.prui-nav-mono { display: none; }
|
|
233
236
|
|
|
234
237
|
@media (max-width: 47.99rem) {
|
package/dist/theme/base.css
CHANGED
|
@@ -214,6 +214,9 @@ body.modal-open { overflow: hidden; }
|
|
|
214
214
|
font-weight: 600;
|
|
215
215
|
}
|
|
216
216
|
.prui-shell[data-collapsed="true"] .prui-shell-sidehead { justify-content: center; padding-inline: 0; }
|
|
217
|
+
/* the sidehead is a sibling of the sidebar, not inside it: its brand label
|
|
218
|
+
needs the same collapse treatment (mark centers, name hides) */
|
|
219
|
+
.prui-shell[data-collapsed="true"] .prui-shell-sidehead .prui-nav-label { display: none; }
|
|
217
220
|
.prui-nav-mono { display: none; }
|
|
218
221
|
|
|
219
222
|
@media (max-width: 47.99rem) {
|