@opencxh/ui-kit 3.154.0 → 3.159.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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1091 -1066
- package/dist/index.js.map +1 -1
- package/dist/src/content/SettingsPage.d.ts +23 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { clsx as ut } from "clsx";
|
|
2
|
-
import ce, { useState as
|
|
3
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
+
import ce, { useState as F, useLayoutEffect as mt, useRef as te, useEffect as Y, forwardRef as be, useMemo as ge, useCallback as xe, createContext as Xe, useId as ft, useContext as ht, Component as xt } from "react";
|
|
3
|
+
import { jsxs as c, jsx as e, Fragment as Ce } from "react/jsx-runtime";
|
|
4
4
|
import * as bt from "lucide-react";
|
|
5
|
-
import { VideoOff as gt, User as pt, MicOff as vt, Mic as yt, X as
|
|
5
|
+
import { VideoOff as gt, User as pt, MicOff as vt, Mic as yt, X as ke, ChevronDown as $e, ExternalLink as Nt, Calendar as wt, ChevronLeft as Se, ChevronRight as De, ChevronDownIcon as kt, Loader2 as Ct, Search as Ae, Check as He, ChevronUp as St, Ellipsis as Et, FileText as Pe, HardDrive as qe, ArrowLeft as zt, FolderPlus as Mt, Upload as Tt, Folder as Ve, Trash2 as _t, Plus as $t, Sparkles as Dt, ImageOff as At, Pencil as Lt, ArrowUpRight as It } from "lucide-react";
|
|
6
6
|
import Pt from "dompurify";
|
|
7
7
|
import Ot from "react-markdown";
|
|
8
8
|
import jt from "remark-gfm";
|
|
@@ -16,17 +16,17 @@ function Un(t) {
|
|
|
16
16
|
return (r) => t[r] || "";
|
|
17
17
|
}
|
|
18
18
|
function Le(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
19
|
-
const [l, o] =
|
|
19
|
+
const [l, o] = F({});
|
|
20
20
|
return mt(() => {
|
|
21
21
|
if (!t) return;
|
|
22
|
-
const
|
|
22
|
+
const u = () => {
|
|
23
23
|
const d = r.current;
|
|
24
24
|
if (!d) return;
|
|
25
|
-
const v = d.getBoundingClientRect(), h = window.innerHeight - v.bottom,
|
|
26
|
-
w ? (p.bottom = window.innerHeight - v.top + n, p.maxHeight = Math.max(120,
|
|
25
|
+
const v = d.getBoundingClientRect(), h = window.innerHeight - v.bottom, m = v.top, b = a.startsWith("top"), g = b ? m < 200 && h > m : h < 200 && m > h, w = b !== g, p = { position: "fixed" };
|
|
26
|
+
w ? (p.bottom = window.innerHeight - v.top + n, p.maxHeight = Math.max(120, m - n * 2)) : (p.top = v.bottom + n, p.maxHeight = Math.max(120, h - n * 2)), a.endsWith("end") ? p.right = window.innerWidth - v.right : p.left = v.left, s && (p.width = v.width), o(p);
|
|
27
27
|
};
|
|
28
|
-
return
|
|
29
|
-
window.removeEventListener("scroll",
|
|
28
|
+
return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
29
|
+
window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
30
30
|
};
|
|
31
31
|
}, [t, r, n, s, a]), l;
|
|
32
32
|
}
|
|
@@ -66,7 +66,7 @@ function Kn(t) {
|
|
|
66
66
|
for (let n = 0; n < t.length; n++) r = r * 31 + t.charCodeAt(n) >>> 0;
|
|
67
67
|
return Ue[r % Ue.length];
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const Te = (t) => t == null ? "" : String(t), qt = (t) => Te(t).trim().toLowerCase();
|
|
70
70
|
function Gn({ tiles: t, pinned: r, className: n }) {
|
|
71
71
|
if (r)
|
|
72
72
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
|
|
@@ -84,14 +84,14 @@ function Jn({
|
|
|
84
84
|
hasVideo: a,
|
|
85
85
|
videoSlot: l,
|
|
86
86
|
className: o,
|
|
87
|
-
fill:
|
|
87
|
+
fill: u
|
|
88
88
|
}) {
|
|
89
89
|
return /* @__PURE__ */ c(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
92
92
|
className: i(
|
|
93
93
|
"relative rounded-lg overflow-hidden bg-video-surface flex items-center justify-center",
|
|
94
|
-
|
|
94
|
+
u ? "h-full w-full" : "aspect-video",
|
|
95
95
|
s && "ring-2 ring-speaking",
|
|
96
96
|
o
|
|
97
97
|
),
|
|
@@ -106,8 +106,8 @@ function Jn({
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
function Yn({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
109
|
-
const a =
|
|
110
|
-
return
|
|
109
|
+
const a = te(null);
|
|
110
|
+
return Y(() => {
|
|
111
111
|
if (!r || !a.current) return;
|
|
112
112
|
const l = t(a.current);
|
|
113
113
|
return () => {
|
|
@@ -154,7 +154,7 @@ const Vt = {
|
|
|
154
154
|
xl: "h-control-xl w-10",
|
|
155
155
|
"2xl": "h-control-2xl w-12",
|
|
156
156
|
full: "h-control-md w-8"
|
|
157
|
-
},
|
|
157
|
+
}, ne = be(
|
|
158
158
|
({
|
|
159
159
|
variant: t = "primary",
|
|
160
160
|
size: r = "md",
|
|
@@ -163,11 +163,11 @@ const Vt = {
|
|
|
163
163
|
leftIcon: a,
|
|
164
164
|
rightIcon: l,
|
|
165
165
|
iconOnly: o = !1,
|
|
166
|
-
shape:
|
|
166
|
+
shape: u = "default",
|
|
167
167
|
className: d,
|
|
168
168
|
children: v,
|
|
169
169
|
disabled: h,
|
|
170
|
-
...
|
|
170
|
+
...m
|
|
171
171
|
}, b) => {
|
|
172
172
|
const g = h || s;
|
|
173
173
|
return /* @__PURE__ */ c(
|
|
@@ -180,7 +180,7 @@ const Vt = {
|
|
|
180
180
|
// the same weight as an emphasised nav item, and 600 at 12–13px
|
|
181
181
|
// reads as a heavier control than the surrounding chrome.
|
|
182
182
|
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-medium",
|
|
183
|
-
|
|
183
|
+
u === "circle" ? "rounded-full" : "rounded-md",
|
|
184
184
|
"transition-colors duration-fast ease-out",
|
|
185
185
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
186
186
|
"disabled:cursor-not-allowed disabled:border-border-subtle",
|
|
@@ -193,7 +193,7 @@ const Vt = {
|
|
|
193
193
|
),
|
|
194
194
|
disabled: g,
|
|
195
195
|
"aria-busy": s || void 0,
|
|
196
|
-
...
|
|
196
|
+
...m,
|
|
197
197
|
children: [
|
|
198
198
|
s && /* @__PURE__ */ e(
|
|
199
199
|
"span",
|
|
@@ -211,7 +211,7 @@ const Vt = {
|
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
|
-
|
|
214
|
+
ne.displayName = "Button";
|
|
215
215
|
const Xn = ({
|
|
216
216
|
children: t,
|
|
217
217
|
size: r = "md",
|
|
@@ -266,7 +266,7 @@ const Kt = {
|
|
|
266
266
|
onClick: a,
|
|
267
267
|
className: l,
|
|
268
268
|
"aria-label": o,
|
|
269
|
-
...
|
|
269
|
+
...u
|
|
270
270
|
}) => {
|
|
271
271
|
const d = typeof r == "number" ? r : Gt(r), v = i(
|
|
272
272
|
"inline-block shrink-0",
|
|
@@ -285,10 +285,10 @@ const Kt = {
|
|
|
285
285
|
"aria-hidden": o ? void 0 : !0,
|
|
286
286
|
role: s ? "button" : void 0,
|
|
287
287
|
tabIndex: s ? 0 : void 0,
|
|
288
|
-
onKeyDown: s ? (
|
|
289
|
-
(
|
|
288
|
+
onKeyDown: s ? (m) => {
|
|
289
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a?.());
|
|
290
290
|
} : void 0,
|
|
291
|
-
...
|
|
291
|
+
...u
|
|
292
292
|
};
|
|
293
293
|
return /* @__PURE__ */ e(t, { ...h });
|
|
294
294
|
};
|
|
@@ -309,15 +309,15 @@ const et = ({
|
|
|
309
309
|
rootClassName: a,
|
|
310
310
|
triggerClassName: l,
|
|
311
311
|
disabled: o = !1,
|
|
312
|
-
triggerLabel:
|
|
312
|
+
triggerLabel: u
|
|
313
313
|
}) => {
|
|
314
|
-
const [d, v] =
|
|
315
|
-
|
|
314
|
+
const [d, v] = F(!1), h = te(null), m = te(null), b = Le(d, m, { placement: n });
|
|
315
|
+
Y(() => {
|
|
316
316
|
if (!d) return;
|
|
317
|
-
const p = (
|
|
318
|
-
h.current && !h.current.contains(
|
|
319
|
-
}, x = (
|
|
320
|
-
|
|
317
|
+
const p = (C) => {
|
|
318
|
+
h.current && !h.current.contains(C.target) && v(!1);
|
|
319
|
+
}, x = (C) => {
|
|
320
|
+
C.key === "Escape" && v(!1);
|
|
321
321
|
};
|
|
322
322
|
return document.addEventListener("mousedown", p), document.addEventListener("keydown", x), () => {
|
|
323
323
|
document.removeEventListener("mousedown", p), document.removeEventListener("keydown", x);
|
|
@@ -330,11 +330,11 @@ const et = ({
|
|
|
330
330
|
/* @__PURE__ */ e(
|
|
331
331
|
"button",
|
|
332
332
|
{
|
|
333
|
-
ref:
|
|
333
|
+
ref: m,
|
|
334
334
|
type: "button",
|
|
335
335
|
onClick: g,
|
|
336
336
|
disabled: o,
|
|
337
|
-
"aria-label":
|
|
337
|
+
"aria-label": u,
|
|
338
338
|
"aria-expanded": d,
|
|
339
339
|
className: i(
|
|
340
340
|
"inline-flex items-center",
|
|
@@ -388,44 +388,44 @@ function Zt({
|
|
|
388
388
|
size: a = "md",
|
|
389
389
|
active: l = !1,
|
|
390
390
|
caret: o = !1,
|
|
391
|
-
menu:
|
|
391
|
+
menu: u,
|
|
392
392
|
menuClassName: d,
|
|
393
393
|
onClear: v,
|
|
394
394
|
clearLabel: h = "Filter wissen",
|
|
395
|
-
onClick:
|
|
395
|
+
onClick: m,
|
|
396
396
|
title: b,
|
|
397
397
|
className: g
|
|
398
398
|
}) {
|
|
399
|
-
const w = l && !!v, p = s === "pill" ? "rounded-full" : "rounded-md", x = Yt({ active: l, tone: n, shape: s, size: a, className: g }),
|
|
399
|
+
const w = l && !!v, p = s === "pill" ? "rounded-full" : "rounded-md", x = Yt({ active: l, tone: n, shape: s, size: a, className: g }), C = /* @__PURE__ */ c(Ce, { children: [
|
|
400
400
|
r,
|
|
401
401
|
t,
|
|
402
402
|
o && /* @__PURE__ */ e(Z, { icon: $e, size: "xs" })
|
|
403
|
-
] }),
|
|
403
|
+
] }), E = Xt({ shape: s, withClear: w }), j = w && /* @__PURE__ */ e(
|
|
404
404
|
"button",
|
|
405
405
|
{
|
|
406
406
|
type: "button",
|
|
407
407
|
"aria-label": h,
|
|
408
408
|
onClick: v,
|
|
409
409
|
className: i("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
410
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
410
|
+
children: /* @__PURE__ */ e(Z, { icon: ke, size: "xs" })
|
|
411
411
|
}
|
|
412
412
|
);
|
|
413
|
-
return
|
|
413
|
+
return u ? /* @__PURE__ */ c("span", { className: x, title: b, children: [
|
|
414
414
|
/* @__PURE__ */ e(
|
|
415
415
|
et,
|
|
416
416
|
{
|
|
417
|
-
trigger:
|
|
417
|
+
trigger: C,
|
|
418
418
|
rootClassName: "h-full",
|
|
419
|
-
triggerClassName: i(
|
|
419
|
+
triggerClassName: i(E, "h-full"),
|
|
420
420
|
className: i("min-w-menu p-1.5", d),
|
|
421
|
-
children:
|
|
421
|
+
children: u
|
|
422
422
|
}
|
|
423
423
|
),
|
|
424
|
-
|
|
424
|
+
j
|
|
425
425
|
] }) : w ? /* @__PURE__ */ c("span", { className: x, title: b, children: [
|
|
426
|
-
/* @__PURE__ */ e("button", { type: "button", onClick:
|
|
427
|
-
|
|
428
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title: b, onClick:
|
|
426
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: m, className: E, children: C }),
|
|
427
|
+
j
|
|
428
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: b, onClick: m, className: i(x, E), children: C });
|
|
429
429
|
}
|
|
430
430
|
const Qt = {
|
|
431
431
|
xs: "text-xs",
|
|
@@ -459,12 +459,12 @@ const Qt = {
|
|
|
459
459
|
external: a = !1,
|
|
460
460
|
className: l,
|
|
461
461
|
children: o,
|
|
462
|
-
href:
|
|
462
|
+
href: u,
|
|
463
463
|
target: d,
|
|
464
464
|
rel: v,
|
|
465
465
|
...h
|
|
466
466
|
}) => {
|
|
467
|
-
const
|
|
467
|
+
const m = a || u && (u.startsWith("http") || u.startsWith("mailto:")), b = i(
|
|
468
468
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
469
469
|
"transition-colors duration-fast ease-out",
|
|
470
470
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -480,14 +480,14 @@ const Qt = {
|
|
|
480
480
|
l
|
|
481
481
|
), g = {
|
|
482
482
|
...h,
|
|
483
|
-
href: s ? void 0 :
|
|
484
|
-
target:
|
|
485
|
-
rel:
|
|
483
|
+
href: s ? void 0 : u,
|
|
484
|
+
target: m ? "_blank" : d,
|
|
485
|
+
rel: m ? "noopener noreferrer" : v,
|
|
486
486
|
"aria-disabled": s || void 0
|
|
487
487
|
};
|
|
488
488
|
return /* @__PURE__ */ c("a", { className: b, ...g, children: [
|
|
489
489
|
o,
|
|
490
|
-
|
|
490
|
+
m && /* @__PURE__ */ e(Nt, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
491
491
|
] });
|
|
492
492
|
}, rr = {
|
|
493
493
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -501,13 +501,13 @@ function nr({
|
|
|
501
501
|
tone: a = "sunk",
|
|
502
502
|
fullWidth: l = !1,
|
|
503
503
|
className: o,
|
|
504
|
-
"aria-label":
|
|
504
|
+
"aria-label": u
|
|
505
505
|
}) {
|
|
506
506
|
return /* @__PURE__ */ e(
|
|
507
507
|
"div",
|
|
508
508
|
{
|
|
509
509
|
role: "tablist",
|
|
510
|
-
"aria-label":
|
|
510
|
+
"aria-label": u,
|
|
511
511
|
className: i(
|
|
512
512
|
"gap-0.5 rounded-md p-0.5",
|
|
513
513
|
a === "track" ? "bg-surface-track" : "bg-surface-sunk",
|
|
@@ -557,11 +557,11 @@ function tt({
|
|
|
557
557
|
icon: a,
|
|
558
558
|
options: l,
|
|
559
559
|
disabled: o = !1,
|
|
560
|
-
loading:
|
|
560
|
+
loading: u = !1,
|
|
561
561
|
menuPlacement: d = "bottom-end",
|
|
562
562
|
menuLabel: v = "More options"
|
|
563
563
|
}) {
|
|
564
|
-
const h = o ||
|
|
564
|
+
const h = o || u, m = l.length > 0;
|
|
565
565
|
return (
|
|
566
566
|
// De scheiding tussen beide helften is een kier in de vulling, niet een
|
|
567
567
|
// lijn: bij een ink-gevulde knop leest 2px als een spleet. 1px is genoeg
|
|
@@ -569,19 +569,19 @@ function tt({
|
|
|
569
569
|
// eigen randen al en houden de helften tegen elkaar.
|
|
570
570
|
/* @__PURE__ */ c("div", { className: i("inline-flex items-center", n === "primary" && "gap-px"), children: [
|
|
571
571
|
/* @__PURE__ */ e(
|
|
572
|
-
|
|
572
|
+
ne,
|
|
573
573
|
{
|
|
574
574
|
variant: n,
|
|
575
575
|
size: s,
|
|
576
576
|
onClick: r,
|
|
577
577
|
disabled: o,
|
|
578
|
-
loading:
|
|
578
|
+
loading: u,
|
|
579
579
|
leftIcon: a,
|
|
580
|
-
className: i(
|
|
580
|
+
className: i(m && "rounded-r-none"),
|
|
581
581
|
children: t
|
|
582
582
|
}
|
|
583
583
|
),
|
|
584
|
-
|
|
584
|
+
m && /* @__PURE__ */ e(
|
|
585
585
|
et,
|
|
586
586
|
{
|
|
587
587
|
placement: d,
|
|
@@ -602,7 +602,7 @@ function tt({
|
|
|
602
602
|
children: /* @__PURE__ */ e($e, { className: "size-icon-md" })
|
|
603
603
|
}
|
|
604
604
|
),
|
|
605
|
-
children: (b) => /* @__PURE__ */ e(
|
|
605
|
+
children: (b) => /* @__PURE__ */ e(Ce, { children: l.map((g) => /* @__PURE__ */ c(
|
|
606
606
|
"button",
|
|
607
607
|
{
|
|
608
608
|
type: "button",
|
|
@@ -651,11 +651,11 @@ const lr = {
|
|
|
651
651
|
indeterminate: a = !1,
|
|
652
652
|
containerClassName: l,
|
|
653
653
|
labelClassName: o,
|
|
654
|
-
className:
|
|
654
|
+
className: u,
|
|
655
655
|
id: d,
|
|
656
656
|
...v
|
|
657
657
|
}, h) => {
|
|
658
|
-
const
|
|
658
|
+
const m = ce.useId(), b = d || `checkbox-${m}`, g = !!n, w = ce.useRef(null), p = ce.useCallback(
|
|
659
659
|
(x) => {
|
|
660
660
|
w.current = x, typeof h == "function" ? h(x) : h && typeof h == "object" && (h.current = x);
|
|
661
661
|
},
|
|
@@ -683,7 +683,7 @@ const lr = {
|
|
|
683
683
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
684
684
|
lr[s],
|
|
685
685
|
g ? "border-danger-border" : "border-border-strong",
|
|
686
|
-
|
|
686
|
+
u
|
|
687
687
|
),
|
|
688
688
|
...v
|
|
689
689
|
}
|
|
@@ -750,14 +750,14 @@ const ir = {
|
|
|
750
750
|
align: a = "left",
|
|
751
751
|
truncate: l = !1,
|
|
752
752
|
italic: o = !1,
|
|
753
|
-
underline:
|
|
753
|
+
underline: u = !1,
|
|
754
754
|
lineHeight: d = "normal",
|
|
755
755
|
as: v,
|
|
756
756
|
className: h,
|
|
757
|
-
children:
|
|
757
|
+
children: m,
|
|
758
758
|
...b
|
|
759
759
|
}) => {
|
|
760
|
-
const g = v || hr(t), w = t === "caption", p = t === "label", x = t === "code",
|
|
760
|
+
const g = v || hr(t), w = t === "caption", p = t === "label", x = t === "code", C = i(
|
|
761
761
|
"font-sans",
|
|
762
762
|
// Variant — caption and label pin their own size/weight
|
|
763
763
|
w && "text-xs text-text-subtle",
|
|
@@ -772,11 +772,11 @@ const ir = {
|
|
|
772
772
|
// Line height only overrides the body variant
|
|
773
773
|
t === "body" && fr[d],
|
|
774
774
|
o && "italic",
|
|
775
|
-
|
|
775
|
+
u && "underline",
|
|
776
776
|
l && "truncate",
|
|
777
777
|
h
|
|
778
778
|
);
|
|
779
|
-
return /* @__PURE__ */ e(g, { className:
|
|
779
|
+
return /* @__PURE__ */ e(g, { className: C, ...b, children: m });
|
|
780
780
|
};
|
|
781
781
|
function hr(t) {
|
|
782
782
|
return {
|
|
@@ -794,21 +794,21 @@ function es({
|
|
|
794
794
|
maxBytes: a,
|
|
795
795
|
aspect: l = "square",
|
|
796
796
|
helperText: o,
|
|
797
|
-
disabled:
|
|
797
|
+
disabled: u,
|
|
798
798
|
className: d,
|
|
799
799
|
chooseLabel: v = "Choose",
|
|
800
800
|
removeLabel: h = "Remove",
|
|
801
|
-
tooLargeLabel:
|
|
801
|
+
tooLargeLabel: m = "That image is too large."
|
|
802
802
|
}) {
|
|
803
|
-
const b =
|
|
803
|
+
const b = te(null), [g, w] = F(null), p = async (x) => {
|
|
804
804
|
if (!x) return;
|
|
805
805
|
w(null);
|
|
806
|
-
const
|
|
807
|
-
if (a && xr(
|
|
808
|
-
w(
|
|
806
|
+
const C = await br(x, s);
|
|
807
|
+
if (a && xr(C) > a) {
|
|
808
|
+
w(m);
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
|
-
n(
|
|
811
|
+
n(C);
|
|
812
812
|
};
|
|
813
813
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col gap-1.5", d), children: [
|
|
814
814
|
t && /* @__PURE__ */ e("span", { className: "text-sm font-medium text-text", children: t }),
|
|
@@ -826,21 +826,21 @@ function es({
|
|
|
826
826
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
827
827
|
/* @__PURE__ */ c("div", { className: "flex gap-2", children: [
|
|
828
828
|
/* @__PURE__ */ e(
|
|
829
|
-
|
|
829
|
+
ne,
|
|
830
830
|
{
|
|
831
831
|
type: "button",
|
|
832
832
|
variant: "secondary",
|
|
833
|
-
disabled:
|
|
833
|
+
disabled: u,
|
|
834
834
|
onClick: () => b.current?.click(),
|
|
835
835
|
children: v
|
|
836
836
|
}
|
|
837
837
|
),
|
|
838
838
|
r && /* @__PURE__ */ e(
|
|
839
|
-
|
|
839
|
+
ne,
|
|
840
840
|
{
|
|
841
841
|
type: "button",
|
|
842
842
|
variant: "ghost",
|
|
843
|
-
disabled:
|
|
843
|
+
disabled: u,
|
|
844
844
|
onClick: () => {
|
|
845
845
|
w(null), n(void 0);
|
|
846
846
|
},
|
|
@@ -873,19 +873,19 @@ function br(t, r) {
|
|
|
873
873
|
a.onload = () => {
|
|
874
874
|
const l = new Image();
|
|
875
875
|
l.onload = () => {
|
|
876
|
-
const o = Math.min(1, r / Math.max(l.width, l.height)),
|
|
877
|
-
v.width =
|
|
876
|
+
const o = Math.min(1, r / Math.max(l.width, l.height)), u = Math.round(l.width * o), d = Math.round(l.height * o), v = document.createElement("canvas");
|
|
877
|
+
v.width = u, v.height = d;
|
|
878
878
|
const h = v.getContext("2d");
|
|
879
879
|
if (!h) {
|
|
880
880
|
n(a.result);
|
|
881
881
|
return;
|
|
882
882
|
}
|
|
883
|
-
h.drawImage(l, 0, 0,
|
|
883
|
+
h.drawImage(l, 0, 0, u, d), n(v.toDataURL("image/png"));
|
|
884
884
|
}, l.onerror = s, l.src = a.result;
|
|
885
885
|
}, a.onerror = s, a.readAsDataURL(t);
|
|
886
886
|
});
|
|
887
887
|
}
|
|
888
|
-
const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }), pr = () => /* @__PURE__ */ e(Z, { icon:
|
|
888
|
+
const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }), pr = () => /* @__PURE__ */ e(Z, { icon: Se, size: "md", color: "current" }), vr = () => /* @__PURE__ */ e(Z, { icon: De, size: "md", color: "current" }), Fe = be(({
|
|
889
889
|
value: t,
|
|
890
890
|
onChange: r,
|
|
891
891
|
placeholder: n = "Select date",
|
|
@@ -893,38 +893,38 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
893
893
|
required: a = !1,
|
|
894
894
|
size: l = "md",
|
|
895
895
|
className: o,
|
|
896
|
-
minDate:
|
|
896
|
+
minDate: u,
|
|
897
897
|
maxDate: d,
|
|
898
898
|
format: v = "MM/dd/yyyy",
|
|
899
899
|
withTime: h = !1
|
|
900
|
-
},
|
|
901
|
-
const [b, g] =
|
|
902
|
-
|
|
903
|
-
const f = (
|
|
904
|
-
x.current && !x.current.contains(
|
|
900
|
+
}, m) => {
|
|
901
|
+
const [b, g] = F(!1), [w, p] = F(() => t || /* @__PURE__ */ new Date()), x = te(null), C = te(null), E = Le(b, C);
|
|
902
|
+
Y(() => {
|
|
903
|
+
const f = (M) => {
|
|
904
|
+
x.current && !x.current.contains(M.target) && g(!1);
|
|
905
905
|
};
|
|
906
906
|
return b && document.addEventListener("mousedown", f), () => {
|
|
907
907
|
document.removeEventListener("mousedown", f);
|
|
908
908
|
};
|
|
909
909
|
}, [b]);
|
|
910
|
-
const
|
|
910
|
+
const j = (f) => {
|
|
911
911
|
if (!f) return "";
|
|
912
|
-
const
|
|
912
|
+
const M = f.getDate().toString().padStart(2, "0"), y = (f.getMonth() + 1).toString().padStart(2, "0"), $ = f.getFullYear(), N = v === "dd/MM/yyyy" ? `${M}/${y}/${$}` : v === "yyyy-MM-dd" ? `${$}-${y}-${M}` : `${y}/${M}/${$}`;
|
|
913
913
|
return h ? `${N} ${D(f)}` : N;
|
|
914
|
-
}, D = (f) => `${f.getHours().toString().padStart(2, "0")}:${f.getMinutes().toString().padStart(2, "0")}`,
|
|
915
|
-
const [
|
|
916
|
-
if (Number.isNaN(
|
|
914
|
+
}, D = (f) => `${f.getHours().toString().padStart(2, "0")}:${f.getMinutes().toString().padStart(2, "0")}`, U = (f) => {
|
|
915
|
+
const [M, y] = f.split(":").map(Number);
|
|
916
|
+
if (Number.isNaN(M) || Number.isNaN(y)) return;
|
|
917
917
|
const $ = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
918
|
-
$.setHours(
|
|
919
|
-
},
|
|
920
|
-
const f = w.getFullYear(),
|
|
918
|
+
$.setHours(M, y, 0, 0), r?.($);
|
|
919
|
+
}, q = () => {
|
|
920
|
+
const f = w.getFullYear(), M = w.getMonth(), y = new Date(f, M, 1), $ = new Date(y);
|
|
921
921
|
$.setDate($.getDate() - y.getDay());
|
|
922
|
-
const N = [],
|
|
923
|
-
for (let
|
|
924
|
-
N.push(new Date(
|
|
922
|
+
const N = [], J = new Date($);
|
|
923
|
+
for (let se = 0; se < 42; se++)
|
|
924
|
+
N.push(new Date(J)), J.setDate(J.getDate() + 1);
|
|
925
925
|
return N;
|
|
926
|
-
},
|
|
927
|
-
if (f.getMonth() === w.getMonth() && !(
|
|
926
|
+
}, A = (f) => {
|
|
927
|
+
if (f.getMonth() === w.getMonth() && !(u && f < u) && !(d && f > d)) {
|
|
928
928
|
if (h) {
|
|
929
929
|
const y = new Date(f);
|
|
930
930
|
y.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(y);
|
|
@@ -932,13 +932,13 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
932
932
|
}
|
|
933
933
|
r?.(f), g(!1);
|
|
934
934
|
}
|
|
935
|
-
},
|
|
935
|
+
}, R = () => {
|
|
936
936
|
p(new Date(w.getFullYear(), w.getMonth() - 1, 1));
|
|
937
|
-
},
|
|
937
|
+
}, ee = () => {
|
|
938
938
|
p(new Date(w.getFullYear(), w.getMonth() + 1, 1));
|
|
939
|
-
},
|
|
939
|
+
}, K = () => {
|
|
940
940
|
r?.(null), g(!1);
|
|
941
|
-
},
|
|
941
|
+
}, G = i(
|
|
942
942
|
"w-full border border-border-strong rounded-tile transition-colors duration-fast",
|
|
943
943
|
"bg-surface text-text",
|
|
944
944
|
"placeholder:text-text-muted",
|
|
@@ -951,7 +951,7 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
951
951
|
"h-control-md w-full px-3 text-base": l === "full"
|
|
952
952
|
},
|
|
953
953
|
o
|
|
954
|
-
), ie =
|
|
954
|
+
), ie = q(), k = [
|
|
955
955
|
"January",
|
|
956
956
|
"February",
|
|
957
957
|
"March",
|
|
@@ -966,19 +966,19 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
966
966
|
"December"
|
|
967
967
|
];
|
|
968
968
|
return /* @__PURE__ */ c("div", { ref: x, className: "relative", children: [
|
|
969
|
-
/* @__PURE__ */ c("div", { ref:
|
|
969
|
+
/* @__PURE__ */ c("div", { ref: C, className: "relative", children: [
|
|
970
970
|
/* @__PURE__ */ e(
|
|
971
971
|
"input",
|
|
972
972
|
{
|
|
973
|
-
ref:
|
|
973
|
+
ref: m,
|
|
974
974
|
type: "text",
|
|
975
|
-
value:
|
|
975
|
+
value: j(t ?? null),
|
|
976
976
|
placeholder: n,
|
|
977
977
|
disabled: s,
|
|
978
978
|
required: a,
|
|
979
979
|
readOnly: !0,
|
|
980
980
|
onClick: () => !s && g(!b),
|
|
981
|
-
className: i(
|
|
981
|
+
className: i(G, "pr-10 cursor-pointer")
|
|
982
982
|
}
|
|
983
983
|
),
|
|
984
984
|
/* @__PURE__ */ e(
|
|
@@ -992,12 +992,12 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
992
992
|
}
|
|
993
993
|
)
|
|
994
994
|
] }),
|
|
995
|
-
b && /* @__PURE__ */ c("div", { style:
|
|
995
|
+
b && /* @__PURE__ */ c("div", { style: E, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
996
996
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
997
997
|
/* @__PURE__ */ e(
|
|
998
998
|
"button",
|
|
999
999
|
{
|
|
1000
|
-
onClick:
|
|
1000
|
+
onClick: R,
|
|
1001
1001
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
1002
1002
|
children: /* @__PURE__ */ e(pr, {})
|
|
1003
1003
|
}
|
|
@@ -1010,32 +1010,32 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1010
1010
|
/* @__PURE__ */ e(
|
|
1011
1011
|
"button",
|
|
1012
1012
|
{
|
|
1013
|
-
onClick:
|
|
1013
|
+
onClick: ee,
|
|
1014
1014
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
1015
1015
|
children: /* @__PURE__ */ e(vr, {})
|
|
1016
1016
|
}
|
|
1017
1017
|
)
|
|
1018
1018
|
] }),
|
|
1019
1019
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((f) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: f }, f)) }),
|
|
1020
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ie.map((f,
|
|
1021
|
-
const y = f.getMonth() === w.getMonth(), $ = t && f.toDateString() === t.toDateString(), N = f.toDateString() === (/* @__PURE__ */ new Date()).toDateString(),
|
|
1020
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ie.map((f, M) => {
|
|
1021
|
+
const y = f.getMonth() === w.getMonth(), $ = t && f.toDateString() === t.toDateString(), N = f.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), J = !y || u && f < u || d && f > d;
|
|
1022
1022
|
return /* @__PURE__ */ e(
|
|
1023
1023
|
"button",
|
|
1024
1024
|
{
|
|
1025
|
-
onClick: () => !
|
|
1026
|
-
disabled:
|
|
1025
|
+
onClick: () => !J && A(f),
|
|
1026
|
+
disabled: J,
|
|
1027
1027
|
className: i(
|
|
1028
1028
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
1029
1029
|
{
|
|
1030
|
-
"text-text hover:bg-surface-hover": y && !$ && !
|
|
1030
|
+
"text-text hover:bg-surface-hover": y && !$ && !J,
|
|
1031
1031
|
"bg-accent text-accent-fg": $,
|
|
1032
1032
|
"bg-surface-hover text-text": N && !$,
|
|
1033
|
-
"text-text-muted cursor-not-allowed":
|
|
1033
|
+
"text-text-muted cursor-not-allowed": J
|
|
1034
1034
|
}
|
|
1035
1035
|
),
|
|
1036
1036
|
children: f.getDate()
|
|
1037
1037
|
},
|
|
1038
|
-
|
|
1038
|
+
M
|
|
1039
1039
|
);
|
|
1040
1040
|
}) }),
|
|
1041
1041
|
h && /* @__PURE__ */ c("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
@@ -1046,7 +1046,7 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1046
1046
|
id: "datepicker-time",
|
|
1047
1047
|
type: "time",
|
|
1048
1048
|
value: t ? D(t) : "",
|
|
1049
|
-
onChange: (f) =>
|
|
1049
|
+
onChange: (f) => U(f.target.value),
|
|
1050
1050
|
className: "h-control-sm rounded-md border border-border bg-surface-input px-2 text-sm text-text focus-visible:outline-none focus-visible:focus-ring"
|
|
1051
1051
|
}
|
|
1052
1052
|
)
|
|
@@ -1055,7 +1055,7 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1055
1055
|
/* @__PURE__ */ e(
|
|
1056
1056
|
"button",
|
|
1057
1057
|
{
|
|
1058
|
-
onClick:
|
|
1058
|
+
onClick: K,
|
|
1059
1059
|
className: "text-sm text-text-muted hover:text-text",
|
|
1060
1060
|
children: "Clear"
|
|
1061
1061
|
}
|
|
@@ -1076,7 +1076,7 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1076
1076
|
md: "h-control-md px-3 text-sm",
|
|
1077
1077
|
lg: "h-control-lg px-3 text-base",
|
|
1078
1078
|
full: "h-control-md w-full px-3 text-sm"
|
|
1079
|
-
},
|
|
1079
|
+
}, Ee = qt, _e = be(
|
|
1080
1080
|
({
|
|
1081
1081
|
label: t,
|
|
1082
1082
|
helperText: r,
|
|
@@ -1085,94 +1085,94 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1085
1085
|
fullWidth: a = !1,
|
|
1086
1086
|
disabled: l = !1,
|
|
1087
1087
|
options: o,
|
|
1088
|
-
placeholder:
|
|
1088
|
+
placeholder: u,
|
|
1089
1089
|
containerClassName: d,
|
|
1090
1090
|
labelClassName: v,
|
|
1091
1091
|
className: h,
|
|
1092
|
-
id:
|
|
1092
|
+
id: m,
|
|
1093
1093
|
searchable: b,
|
|
1094
1094
|
multiple: g,
|
|
1095
1095
|
value: w,
|
|
1096
1096
|
onChange: p,
|
|
1097
1097
|
allowCreate: x,
|
|
1098
|
-
onCreateOption:
|
|
1099
|
-
...
|
|
1100
|
-
},
|
|
1101
|
-
const D =
|
|
1102
|
-
ce.useImperativeHandle(
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1098
|
+
onCreateOption: C,
|
|
1099
|
+
...E
|
|
1100
|
+
}, j) => {
|
|
1101
|
+
const D = m || `select-${Math.random().toString(36).substr(2, 9)}`, U = !!n, [q, A] = ce.useState(!1), [R, ee] = ce.useState(""), K = ce.useRef(null), G = ce.useRef(null), ie = Le(q, G, { matchWidth: !0 }), [k, f] = ce.useState(o);
|
|
1102
|
+
ce.useImperativeHandle(j, () => K.current), ce.useEffect(() => {
|
|
1103
|
+
const T = (S) => {
|
|
1104
|
+
K.current && !K.current.contains(S.target) && A(!1);
|
|
1105
1105
|
};
|
|
1106
|
-
return document.addEventListener("mousedown",
|
|
1106
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
1107
1107
|
}, []);
|
|
1108
|
-
const
|
|
1109
|
-
(
|
|
1110
|
-
(
|
|
1108
|
+
const M = ce.useCallback(
|
|
1109
|
+
(T, S) => T.some(
|
|
1110
|
+
(L) => Ee(L.value) === Ee(S) || Ee(L.label) === Ee(S)
|
|
1111
1111
|
),
|
|
1112
1112
|
[]
|
|
1113
1113
|
), y = ce.useCallback(
|
|
1114
|
-
(
|
|
1115
|
-
const
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1114
|
+
(T, S) => {
|
|
1115
|
+
const L = [...T], O = (V) => {
|
|
1116
|
+
const _ = Te(V).trim();
|
|
1117
|
+
_ && (M(L, _) || L.push({ value: _, label: _ }));
|
|
1118
1118
|
};
|
|
1119
|
-
return Array.isArray(
|
|
1119
|
+
return Array.isArray(S) ? S.forEach(O) : O(S), L;
|
|
1120
1120
|
},
|
|
1121
|
-
[
|
|
1121
|
+
[M]
|
|
1122
1122
|
);
|
|
1123
1123
|
ce.useEffect(() => {
|
|
1124
|
-
f((
|
|
1125
|
-
const
|
|
1126
|
-
return
|
|
1127
|
-
!
|
|
1128
|
-
}), y(
|
|
1124
|
+
f((T) => {
|
|
1125
|
+
const S = [...o];
|
|
1126
|
+
return T.forEach((L) => {
|
|
1127
|
+
!M(S, L.value) && !M(S, L.label) && S.push(L);
|
|
1128
|
+
}), y(S, w);
|
|
1129
1129
|
});
|
|
1130
|
-
}, [o, w, y,
|
|
1130
|
+
}, [o, w, y, M]);
|
|
1131
1131
|
const $ = ce.useMemo(
|
|
1132
|
-
() => Array.isArray(w) ? w.map(
|
|
1132
|
+
() => Array.isArray(w) ? w.map(Te) : w == null ? void 0 : Te(w),
|
|
1133
1133
|
[w]
|
|
1134
|
-
), N = (
|
|
1134
|
+
), N = (T) => {
|
|
1135
1135
|
if (g) {
|
|
1136
|
-
const
|
|
1137
|
-
p?.(
|
|
1136
|
+
const S = Array.isArray($) ? $ : [], L = S.includes(T) ? S.filter((O) => O !== T) : [...S, T];
|
|
1137
|
+
p?.(L);
|
|
1138
1138
|
} else
|
|
1139
|
-
p?.(
|
|
1140
|
-
},
|
|
1141
|
-
(
|
|
1142
|
-
) : [],
|
|
1143
|
-
(
|
|
1144
|
-
) : k, X = !!x && !!b && !!
|
|
1145
|
-
const
|
|
1146
|
-
if (!
|
|
1147
|
-
const
|
|
1148
|
-
value:
|
|
1149
|
-
label:
|
|
1139
|
+
p?.(T), A(!1), ee("");
|
|
1140
|
+
}, J = g ? null : k.find((T) => T.value === $), se = g ? k.filter(
|
|
1141
|
+
(T) => Array.isArray($) && $.includes(T.value)
|
|
1142
|
+
) : [], re = b && R ? k.filter(
|
|
1143
|
+
(T) => T.label.toLowerCase().includes(R.toLowerCase())
|
|
1144
|
+
) : k, X = !!x && !!b && !!R.trim() && !M(k, R), P = (T) => {
|
|
1145
|
+
const S = T.trim();
|
|
1146
|
+
if (!S) return;
|
|
1147
|
+
const L = C?.(S) ?? {
|
|
1148
|
+
value: S,
|
|
1149
|
+
label: S
|
|
1150
1150
|
};
|
|
1151
|
-
if (
|
|
1152
|
-
N(
|
|
1151
|
+
if (M(k, L.value) || M(k, L.label)) {
|
|
1152
|
+
N(L.value), ee(""), g || A(!1);
|
|
1153
1153
|
return;
|
|
1154
1154
|
}
|
|
1155
|
-
f((O) => [...O,
|
|
1156
|
-
},
|
|
1155
|
+
f((O) => [...O, L]), N(L.value), ee(""), g || A(!1);
|
|
1156
|
+
}, H = () => g ? se.length > 0 ? se.map((T) => T.label).join(", ") : u || "Select options" : J?.label || u || "Select an option";
|
|
1157
1157
|
return /* @__PURE__ */ c(
|
|
1158
1158
|
"div",
|
|
1159
1159
|
{
|
|
1160
|
-
ref:
|
|
1160
|
+
ref: K,
|
|
1161
1161
|
className: i(
|
|
1162
1162
|
"relative flex flex-col",
|
|
1163
1163
|
a && "w-full",
|
|
1164
1164
|
d
|
|
1165
1165
|
),
|
|
1166
|
-
...
|
|
1166
|
+
...E,
|
|
1167
1167
|
children: [
|
|
1168
1168
|
t && /* @__PURE__ */ e(
|
|
1169
1169
|
"label",
|
|
1170
1170
|
{
|
|
1171
1171
|
htmlFor: D,
|
|
1172
|
-
onClick: () =>
|
|
1172
|
+
onClick: () => A(!q),
|
|
1173
1173
|
className: i(
|
|
1174
1174
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
1175
|
-
|
|
1175
|
+
U ? "text-danger-fg" : "text-text-muted",
|
|
1176
1176
|
v
|
|
1177
1177
|
),
|
|
1178
1178
|
children: t
|
|
@@ -1182,45 +1182,45 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1182
1182
|
/* @__PURE__ */ c(
|
|
1183
1183
|
"button",
|
|
1184
1184
|
{
|
|
1185
|
-
ref:
|
|
1185
|
+
ref: G,
|
|
1186
1186
|
type: "button",
|
|
1187
1187
|
id: D,
|
|
1188
1188
|
disabled: l,
|
|
1189
|
-
onClick: () =>
|
|
1189
|
+
onClick: () => A(!q),
|
|
1190
1190
|
className: i(
|
|
1191
1191
|
"flex w-full items-center justify-between gap-2 rounded-tile border transition-colors duration-fast text-left",
|
|
1192
1192
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
1193
1193
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1194
1194
|
"bg-surface",
|
|
1195
1195
|
yr[s],
|
|
1196
|
-
|
|
1196
|
+
U ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
1197
1197
|
h
|
|
1198
1198
|
),
|
|
1199
1199
|
children: [
|
|
1200
|
-
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children:
|
|
1200
|
+
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: H() }),
|
|
1201
1201
|
/* @__PURE__ */ e(
|
|
1202
1202
|
kt,
|
|
1203
1203
|
{
|
|
1204
1204
|
size: 16,
|
|
1205
1205
|
className: i(
|
|
1206
1206
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
1207
|
-
|
|
1207
|
+
q && "rotate-180"
|
|
1208
1208
|
)
|
|
1209
1209
|
}
|
|
1210
1210
|
)
|
|
1211
1211
|
]
|
|
1212
1212
|
}
|
|
1213
1213
|
),
|
|
1214
|
-
|
|
1214
|
+
q && /* @__PURE__ */ c("div", { style: ie, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
1215
1215
|
b && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
1216
1216
|
"input",
|
|
1217
1217
|
{
|
|
1218
1218
|
type: "text",
|
|
1219
1219
|
placeholder: "Search...",
|
|
1220
|
-
value:
|
|
1221
|
-
onChange: (
|
|
1222
|
-
onKeyDown: (
|
|
1223
|
-
|
|
1220
|
+
value: R,
|
|
1221
|
+
onChange: (T) => ee(T.target.value),
|
|
1222
|
+
onKeyDown: (T) => {
|
|
1223
|
+
T.key === "Enter" && X && (T.preventDefault(), P(R));
|
|
1224
1224
|
},
|
|
1225
1225
|
className: i(
|
|
1226
1226
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -1235,51 +1235,51 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1235
1235
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1236
1236
|
"text-info-fg hover:bg-surface-hover"
|
|
1237
1237
|
),
|
|
1238
|
-
onClick: () =>
|
|
1238
|
+
onClick: () => P(R),
|
|
1239
1239
|
children: [
|
|
1240
1240
|
"+: “",
|
|
1241
|
-
|
|
1241
|
+
R.trim(),
|
|
1242
1242
|
"”"
|
|
1243
1243
|
]
|
|
1244
1244
|
}
|
|
1245
1245
|
),
|
|
1246
1246
|
/* @__PURE__ */ c("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
1247
|
-
|
|
1247
|
+
u && !g && /* @__PURE__ */ e(
|
|
1248
1248
|
"li",
|
|
1249
1249
|
{
|
|
1250
1250
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
1251
1251
|
onClick: () => {
|
|
1252
|
-
p?.(""),
|
|
1252
|
+
p?.(""), A(!1);
|
|
1253
1253
|
},
|
|
1254
|
-
children:
|
|
1254
|
+
children: u
|
|
1255
1255
|
}
|
|
1256
1256
|
),
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1257
|
+
re.map((T) => {
|
|
1258
|
+
const S = g ? Array.isArray($) && $.includes(T.value) : $ === T.value;
|
|
1259
1259
|
return /* @__PURE__ */ e(
|
|
1260
1260
|
"li",
|
|
1261
1261
|
{
|
|
1262
|
-
onClick: () => !
|
|
1262
|
+
onClick: () => !T.disabled && N(T.value),
|
|
1263
1263
|
className: i(
|
|
1264
1264
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1265
1265
|
"text-text",
|
|
1266
|
-
|
|
1267
|
-
|
|
1266
|
+
T.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
1267
|
+
S && "bg-accent-soft text-accent font-semibold"
|
|
1268
1268
|
),
|
|
1269
1269
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1270
1270
|
g && /* @__PURE__ */ e(
|
|
1271
1271
|
"input",
|
|
1272
1272
|
{
|
|
1273
1273
|
type: "checkbox",
|
|
1274
|
-
checked:
|
|
1274
|
+
checked: S,
|
|
1275
1275
|
readOnly: !0,
|
|
1276
1276
|
className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
|
|
1277
1277
|
}
|
|
1278
1278
|
),
|
|
1279
|
-
/* @__PURE__ */ e("span", { children:
|
|
1279
|
+
/* @__PURE__ */ e("span", { children: T.label })
|
|
1280
1280
|
] })
|
|
1281
1281
|
},
|
|
1282
|
-
|
|
1282
|
+
T.value
|
|
1283
1283
|
);
|
|
1284
1284
|
})
|
|
1285
1285
|
] })
|
|
@@ -1290,7 +1290,7 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1290
1290
|
{
|
|
1291
1291
|
className: i(
|
|
1292
1292
|
"mt-1 text-xs",
|
|
1293
|
-
|
|
1293
|
+
U ? "text-danger-fg" : "text-text-muted"
|
|
1294
1294
|
),
|
|
1295
1295
|
children: n || r
|
|
1296
1296
|
}
|
|
@@ -1300,13 +1300,13 @@ const gr = () => /* @__PURE__ */ e(Z, { icon: wt, size: "md", color: "current" }
|
|
|
1300
1300
|
);
|
|
1301
1301
|
}
|
|
1302
1302
|
);
|
|
1303
|
-
|
|
1303
|
+
_e.displayName = "Select";
|
|
1304
1304
|
const Nr = {
|
|
1305
1305
|
sm: "h-control-sm px-3 text-sm",
|
|
1306
1306
|
md: "h-control-md px-3 text-base",
|
|
1307
1307
|
lg: "h-control-lg px-3 text-base",
|
|
1308
1308
|
full: "h-control-md px-3 text-base"
|
|
1309
|
-
}, rt = "mb-1.5 block text-sm font-medium", nt = "block w-full rounded-tile border bg-surface-input text-text transition-colors duration-fast ease-out placeholder:text-text-subtle focus-visible:outline-none focus-visible:focus-ring disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled", st = (t) => t ? "border-danger-border bg-danger-soft" : "border-border-strong",
|
|
1309
|
+
}, rt = "mb-1.5 block text-sm font-medium", nt = "block w-full rounded-tile border bg-surface-input text-text transition-colors duration-fast ease-out placeholder:text-text-subtle focus-visible:outline-none focus-visible:focus-ring disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled", st = (t) => t ? "border-danger-border bg-danger-soft" : "border-border-strong", we = be(
|
|
1310
1310
|
({
|
|
1311
1311
|
label: t,
|
|
1312
1312
|
helperText: r,
|
|
@@ -1315,14 +1315,14 @@ const Nr = {
|
|
|
1315
1315
|
fullWidth: a = !1,
|
|
1316
1316
|
startIcon: l,
|
|
1317
1317
|
endIcon: o,
|
|
1318
|
-
loading:
|
|
1318
|
+
loading: u = !1,
|
|
1319
1319
|
containerClassName: d,
|
|
1320
1320
|
labelClassName: v,
|
|
1321
1321
|
className: h,
|
|
1322
|
-
id:
|
|
1322
|
+
id: m,
|
|
1323
1323
|
...b
|
|
1324
1324
|
}, g) => {
|
|
1325
|
-
const w = ce.useId(), p =
|
|
1325
|
+
const w = ce.useId(), p = m || `textfield-${w}`, x = !!n, C = n || r ? `${p}-description` : void 0;
|
|
1326
1326
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col", a && "w-full", d), children: [
|
|
1327
1327
|
t && /* @__PURE__ */ e(
|
|
1328
1328
|
"label",
|
|
@@ -1344,19 +1344,19 @@ const Nr = {
|
|
|
1344
1344
|
ref: g,
|
|
1345
1345
|
id: p,
|
|
1346
1346
|
"aria-invalid": x || void 0,
|
|
1347
|
-
"aria-describedby":
|
|
1347
|
+
"aria-describedby": C,
|
|
1348
1348
|
className: i(
|
|
1349
1349
|
nt,
|
|
1350
1350
|
Nr[s],
|
|
1351
1351
|
l && "pl-9",
|
|
1352
|
-
(o ||
|
|
1352
|
+
(o || u) && "pr-9",
|
|
1353
1353
|
st(x),
|
|
1354
1354
|
h
|
|
1355
1355
|
),
|
|
1356
1356
|
...b
|
|
1357
1357
|
}
|
|
1358
1358
|
),
|
|
1359
|
-
(o ||
|
|
1359
|
+
(o || u) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: u ? /* @__PURE__ */ e(
|
|
1360
1360
|
"span",
|
|
1361
1361
|
{
|
|
1362
1362
|
"aria-hidden": !0,
|
|
@@ -1367,7 +1367,7 @@ const Nr = {
|
|
|
1367
1367
|
(n || r) && /* @__PURE__ */ e(
|
|
1368
1368
|
"p",
|
|
1369
1369
|
{
|
|
1370
|
-
id:
|
|
1370
|
+
id: C,
|
|
1371
1371
|
className: i("mt-1 text-xs", x ? "text-danger-fg" : "text-text-subtle"),
|
|
1372
1372
|
children: n || r
|
|
1373
1373
|
}
|
|
@@ -1375,7 +1375,7 @@ const Nr = {
|
|
|
1375
1375
|
] });
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
|
-
|
|
1378
|
+
we.displayName = "TextField";
|
|
1379
1379
|
function wr({
|
|
1380
1380
|
value: t,
|
|
1381
1381
|
onChange: r,
|
|
@@ -1384,39 +1384,39 @@ function wr({
|
|
|
1384
1384
|
size: a = "md",
|
|
1385
1385
|
placeholder: l,
|
|
1386
1386
|
templatePlaceholder: o,
|
|
1387
|
-
showTemplate:
|
|
1387
|
+
showTemplate: u = !0
|
|
1388
1388
|
}) {
|
|
1389
|
-
const [d, v] =
|
|
1390
|
-
|
|
1391
|
-
let
|
|
1389
|
+
const [d, v] = F([]);
|
|
1390
|
+
Y(() => {
|
|
1391
|
+
let m = !0;
|
|
1392
1392
|
return Promise.resolve(n?.()).then((b) => {
|
|
1393
|
-
|
|
1393
|
+
m && b && v(b.data ?? []);
|
|
1394
1394
|
}).catch(() => {
|
|
1395
1395
|
}), () => {
|
|
1396
|
-
|
|
1396
|
+
m = !1;
|
|
1397
1397
|
};
|
|
1398
1398
|
}, []);
|
|
1399
1399
|
const h = t ?? {};
|
|
1400
1400
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
1401
1401
|
/* @__PURE__ */ e(
|
|
1402
|
-
|
|
1402
|
+
_e,
|
|
1403
1403
|
{
|
|
1404
1404
|
size: a,
|
|
1405
1405
|
fullWidth: !0,
|
|
1406
1406
|
value: h.folderId ?? "",
|
|
1407
|
-
options: d.map((
|
|
1407
|
+
options: d.map((m) => ({ value: m.id, label: m.name })),
|
|
1408
1408
|
placeholder: l ?? "Select a folder",
|
|
1409
|
-
onChange: (
|
|
1409
|
+
onChange: (m) => r?.({ ...h, folderId: m })
|
|
1410
1410
|
}
|
|
1411
1411
|
),
|
|
1412
|
-
|
|
1413
|
-
|
|
1412
|
+
u && /* @__PURE__ */ e(
|
|
1413
|
+
we,
|
|
1414
1414
|
{
|
|
1415
1415
|
size: a,
|
|
1416
1416
|
disabled: s ?? !1,
|
|
1417
1417
|
value: h.pathTemplate ?? "",
|
|
1418
1418
|
placeholder: o ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
1419
|
-
onChange: (
|
|
1419
|
+
onChange: (m) => r?.({ ...h, pathTemplate: m.target.value })
|
|
1420
1420
|
}
|
|
1421
1421
|
)
|
|
1422
1422
|
] });
|
|
@@ -1440,72 +1440,72 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1440
1440
|
fullWidth: a = !1,
|
|
1441
1441
|
startIcon: l = /* @__PURE__ */ e(kr, {}),
|
|
1442
1442
|
loading: o = !1,
|
|
1443
|
-
containerClassName:
|
|
1443
|
+
containerClassName: u,
|
|
1444
1444
|
labelClassName: d,
|
|
1445
1445
|
className: v,
|
|
1446
1446
|
id: h,
|
|
1447
|
-
options:
|
|
1447
|
+
options: m,
|
|
1448
1448
|
onRemoteSearch: b,
|
|
1449
1449
|
onSelect: g,
|
|
1450
1450
|
debounceTime: w = 500,
|
|
1451
1451
|
showAllOnOpen: p = !1,
|
|
1452
1452
|
value: x,
|
|
1453
|
-
onChange:
|
|
1454
|
-
...
|
|
1455
|
-
},
|
|
1456
|
-
const D = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`,
|
|
1457
|
-
|
|
1458
|
-
x !== void 0 &&
|
|
1453
|
+
onChange: C,
|
|
1454
|
+
...E
|
|
1455
|
+
}, j) => {
|
|
1456
|
+
const D = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, q = te(null), A = te(null), [R, ee] = F(x || ""), [K, G] = F(!1), [ie, k] = F(!1), [f, M] = F(!1);
|
|
1457
|
+
Y(() => {
|
|
1458
|
+
x !== void 0 && ee(x);
|
|
1459
1459
|
}, [x]);
|
|
1460
|
-
const y =
|
|
1461
|
-
if (p && !f || !
|
|
1462
|
-
const
|
|
1463
|
-
return
|
|
1464
|
-
(
|
|
1460
|
+
const y = ge(() => {
|
|
1461
|
+
if (p && !f || !R) return m;
|
|
1462
|
+
const P = String(R).toLowerCase();
|
|
1463
|
+
return m.filter(
|
|
1464
|
+
(H) => String(H.label).toLowerCase().includes(P)
|
|
1465
1465
|
);
|
|
1466
|
-
}, [
|
|
1467
|
-
|
|
1468
|
-
if (!b || !
|
|
1466
|
+
}, [R, m, p, f]);
|
|
1467
|
+
Y(() => {
|
|
1468
|
+
if (!b || !R) {
|
|
1469
1469
|
k(!1);
|
|
1470
1470
|
return;
|
|
1471
1471
|
}
|
|
1472
|
-
const
|
|
1472
|
+
const P = setTimeout(async () => {
|
|
1473
1473
|
k(!0);
|
|
1474
1474
|
try {
|
|
1475
|
-
await b(String(
|
|
1476
|
-
} catch (
|
|
1477
|
-
console.error("Remote search failed:",
|
|
1475
|
+
await b(String(R));
|
|
1476
|
+
} catch (H) {
|
|
1477
|
+
console.error("Remote search failed:", H);
|
|
1478
1478
|
} finally {
|
|
1479
1479
|
k(!1);
|
|
1480
1480
|
}
|
|
1481
1481
|
}, w);
|
|
1482
1482
|
return () => {
|
|
1483
|
-
clearTimeout(
|
|
1483
|
+
clearTimeout(P), k(!1);
|
|
1484
1484
|
};
|
|
1485
|
-
}, [
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1485
|
+
}, [R, w, b]), Y(() => {
|
|
1486
|
+
const P = (H) => {
|
|
1487
|
+
q.current && !q.current.contains(H.target) && G(!1);
|
|
1488
1488
|
};
|
|
1489
|
-
return document.addEventListener("mousedown",
|
|
1489
|
+
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
1490
1490
|
}, []);
|
|
1491
|
-
const $ = (
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
}, N = (
|
|
1495
|
-
|
|
1496
|
-
},
|
|
1497
|
-
(
|
|
1498
|
-
},
|
|
1491
|
+
const $ = (P) => {
|
|
1492
|
+
const H = P.target.value;
|
|
1493
|
+
ee(H), G(!0), M(!0), C && C(P);
|
|
1494
|
+
}, N = (P) => {
|
|
1495
|
+
ee(P.label), G(!1), M(!1), g && g(P.value);
|
|
1496
|
+
}, J = () => {
|
|
1497
|
+
(m.length > 0 || b) && (G(!0), M(!1));
|
|
1498
|
+
}, se = o || ie, re = K && (y.length > 0 || se), X = ge(() => j || A, [j]);
|
|
1499
1499
|
return /* @__PURE__ */ c(
|
|
1500
1500
|
"div",
|
|
1501
1501
|
{
|
|
1502
1502
|
className: ve(
|
|
1503
1503
|
"flex flex-col",
|
|
1504
1504
|
a ? "w-full" : "",
|
|
1505
|
-
|
|
1505
|
+
u || "",
|
|
1506
1506
|
"relative"
|
|
1507
1507
|
),
|
|
1508
|
-
ref:
|
|
1508
|
+
ref: q,
|
|
1509
1509
|
children: [
|
|
1510
1510
|
t && /* @__PURE__ */ e(
|
|
1511
1511
|
"label",
|
|
@@ -1513,7 +1513,7 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1513
1513
|
htmlFor: D,
|
|
1514
1514
|
className: ve(
|
|
1515
1515
|
"block text-sm font-medium mb-1",
|
|
1516
|
-
|
|
1516
|
+
U ? "text-danger-fg" : "text-text",
|
|
1517
1517
|
d || ""
|
|
1518
1518
|
),
|
|
1519
1519
|
children: t
|
|
@@ -1526,9 +1526,9 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1526
1526
|
{
|
|
1527
1527
|
ref: X,
|
|
1528
1528
|
id: D,
|
|
1529
|
-
value:
|
|
1529
|
+
value: R,
|
|
1530
1530
|
onChange: $,
|
|
1531
|
-
onFocus:
|
|
1531
|
+
onFocus: J,
|
|
1532
1532
|
className: ve(
|
|
1533
1533
|
// Base styles
|
|
1534
1534
|
"block w-full rounded-tile border bg-surface-input transition-colors duration-fast ease-out",
|
|
@@ -1541,13 +1541,13 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1541
1541
|
"pr-10",
|
|
1542
1542
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
1543
1543
|
// State styles
|
|
1544
|
-
|
|
1544
|
+
U ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
1545
1545
|
v || ""
|
|
1546
1546
|
),
|
|
1547
|
-
...
|
|
1547
|
+
...E
|
|
1548
1548
|
}
|
|
1549
1549
|
),
|
|
1550
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children:
|
|
1550
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: se || o ? (
|
|
1551
1551
|
// Loading Spinner
|
|
1552
1552
|
/* @__PURE__ */ e(
|
|
1553
1553
|
Ct,
|
|
@@ -1564,31 +1564,31 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1564
1564
|
className: ve(
|
|
1565
1565
|
"text-text-muted cursor-pointer transition-transform",
|
|
1566
1566
|
Oe[s],
|
|
1567
|
-
|
|
1567
|
+
K ? "rotate-180" : "rotate-0"
|
|
1568
1568
|
),
|
|
1569
1569
|
onClick: () => {
|
|
1570
|
-
|
|
1570
|
+
G((P) => (P || M(!1), !P));
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
1573
|
)
|
|
1574
1574
|
) })
|
|
1575
1575
|
] }),
|
|
1576
|
-
|
|
1576
|
+
re && /* @__PURE__ */ e(
|
|
1577
1577
|
"ul",
|
|
1578
1578
|
{
|
|
1579
1579
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
1580
1580
|
role: "listbox",
|
|
1581
|
-
children: y.length > 0 ? y.map((
|
|
1581
|
+
children: y.length > 0 ? y.map((P) => /* @__PURE__ */ e(
|
|
1582
1582
|
"li",
|
|
1583
1583
|
{
|
|
1584
1584
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
1585
|
-
onClick: () => N(
|
|
1585
|
+
onClick: () => N(P),
|
|
1586
1586
|
role: "option",
|
|
1587
|
-
"aria-selected":
|
|
1588
|
-
children:
|
|
1587
|
+
"aria-selected": R === P.label,
|
|
1588
|
+
children: P.label
|
|
1589
1589
|
},
|
|
1590
|
-
|
|
1591
|
-
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children:
|
|
1590
|
+
P.value
|
|
1591
|
+
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children: se || o ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
1592
1592
|
}
|
|
1593
1593
|
),
|
|
1594
1594
|
(n || r) && /* @__PURE__ */ e(
|
|
@@ -1596,14 +1596,14 @@ const ve = (...t) => t.filter(Boolean).join(" "), kr = (t) => /* @__PURE__ */ e(
|
|
|
1596
1596
|
{
|
|
1597
1597
|
className: ve(
|
|
1598
1598
|
"mt-1 text-xs",
|
|
1599
|
-
|
|
1599
|
+
U ? "text-danger-fg" : "text-text-muted"
|
|
1600
1600
|
),
|
|
1601
1601
|
children: n || r
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
1604
|
b && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1605
1605
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1606
|
-
String(
|
|
1606
|
+
String(R)
|
|
1607
1607
|
] })
|
|
1608
1608
|
]
|
|
1609
1609
|
}
|
|
@@ -1620,7 +1620,7 @@ const at = be(
|
|
|
1620
1620
|
clearLabel: a = "Clear search",
|
|
1621
1621
|
containerClassName: l,
|
|
1622
1622
|
className: o,
|
|
1623
|
-
disabled:
|
|
1623
|
+
disabled: u,
|
|
1624
1624
|
...d
|
|
1625
1625
|
}, v) => /* @__PURE__ */ c(
|
|
1626
1626
|
"div",
|
|
@@ -1632,7 +1632,7 @@ const at = be(
|
|
|
1632
1632
|
"flex items-center gap-2 rounded-md bg-surface-sunk px-2.5 text-text-muted",
|
|
1633
1633
|
"transition-colors duration-fast ease-out",
|
|
1634
1634
|
s === "sm" ? "h-control-sm" : "h-control-md",
|
|
1635
|
-
|
|
1635
|
+
u && "opacity-60",
|
|
1636
1636
|
l
|
|
1637
1637
|
),
|
|
1638
1638
|
children: [
|
|
@@ -1643,7 +1643,7 @@ const at = be(
|
|
|
1643
1643
|
ref: v,
|
|
1644
1644
|
type: "search",
|
|
1645
1645
|
value: t,
|
|
1646
|
-
disabled:
|
|
1646
|
+
disabled: u,
|
|
1647
1647
|
onChange: (h) => r(h.target.value),
|
|
1648
1648
|
className: i(
|
|
1649
1649
|
// The forms base layer hands every input a white fill, a 1px border
|
|
@@ -1668,7 +1668,7 @@ const at = be(
|
|
|
1668
1668
|
"aria-label": a,
|
|
1669
1669
|
onClick: () => r(""),
|
|
1670
1670
|
className: "grid size-4 shrink-0 cursor-pointer place-items-center rounded-xs text-text-subtle transition-colors duration-fast ease-out hover:text-text focus-visible:outline-none focus-visible:focus-ring",
|
|
1671
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
1671
|
+
children: /* @__PURE__ */ e(Z, { icon: ke, size: "sm", color: "current" })
|
|
1672
1672
|
}
|
|
1673
1673
|
) : n && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: n })
|
|
1674
1674
|
]
|
|
@@ -1678,7 +1678,7 @@ const at = be(
|
|
|
1678
1678
|
at.displayName = "SearchField";
|
|
1679
1679
|
const zr = be(
|
|
1680
1680
|
({ checked: t, onChange: r, label: n, disabled: s = !1, className: a, ...l }, o) => {
|
|
1681
|
-
const
|
|
1681
|
+
const u = /* @__PURE__ */ e(
|
|
1682
1682
|
"span",
|
|
1683
1683
|
{
|
|
1684
1684
|
"aria-hidden": !0,
|
|
@@ -1722,7 +1722,7 @@ const zr = be(
|
|
|
1722
1722
|
...l
|
|
1723
1723
|
}
|
|
1724
1724
|
),
|
|
1725
|
-
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children:
|
|
1725
|
+
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children: u }),
|
|
1726
1726
|
n && /* @__PURE__ */ e("span", { className: "text-sm text-text", children: n })
|
|
1727
1727
|
]
|
|
1728
1728
|
}
|
|
@@ -1738,65 +1738,65 @@ const Mr = ({
|
|
|
1738
1738
|
placement: a = "bottom-start",
|
|
1739
1739
|
disabled: l = !1,
|
|
1740
1740
|
className: o,
|
|
1741
|
-
showCheck:
|
|
1741
|
+
showCheck: u = !0,
|
|
1742
1742
|
header: d
|
|
1743
1743
|
}) => {
|
|
1744
|
-
const [v, h] =
|
|
1745
|
-
|
|
1744
|
+
const [v, h] = F(!1), [m, b] = F(null), [g, w] = F({ top: 0, left: 0 }), p = te(null), x = te(null), C = te(null), E = te(null), j = Le(v, x, { placement: a }), D = te(null), U = () => Array.from(
|
|
1745
|
+
E.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1746
1746
|
);
|
|
1747
|
-
|
|
1748
|
-
v &&
|
|
1747
|
+
Y(() => {
|
|
1748
|
+
v && U()[0]?.focus();
|
|
1749
1749
|
}, [v]);
|
|
1750
|
-
const
|
|
1750
|
+
const q = (f) => {
|
|
1751
1751
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(f.key)) return;
|
|
1752
|
-
const y =
|
|
1752
|
+
const y = U();
|
|
1753
1753
|
if (y.length === 0) return;
|
|
1754
1754
|
f.preventDefault();
|
|
1755
1755
|
const $ = y.indexOf(document.activeElement), N = f.key === "Home" ? 0 : f.key === "End" ? y.length - 1 : f.key === "ArrowDown" ? ($ + 1) % y.length : ($ - 1 + y.length) % y.length;
|
|
1756
1756
|
y[N]?.focus();
|
|
1757
1757
|
};
|
|
1758
|
-
|
|
1759
|
-
const f = (
|
|
1760
|
-
p.current && (!p.current.contains(
|
|
1758
|
+
Y(() => {
|
|
1759
|
+
const f = (M) => {
|
|
1760
|
+
p.current && (!p.current.contains(M.target) || C.current && !C.current.contains(M.target)) && (h(!1), b(null), D.current && (clearTimeout(D.current), D.current = null));
|
|
1761
1761
|
};
|
|
1762
1762
|
return v && document.addEventListener("mousedown", f), () => {
|
|
1763
1763
|
document.removeEventListener("mousedown", f);
|
|
1764
1764
|
};
|
|
1765
|
-
}, [v]),
|
|
1766
|
-
const f = (
|
|
1767
|
-
|
|
1765
|
+
}, [v]), Y(() => {
|
|
1766
|
+
const f = (M) => {
|
|
1767
|
+
M.key === "Escape" && (h(!1), b(null), x.current?.focus(), D.current && (clearTimeout(D.current), D.current = null));
|
|
1768
1768
|
};
|
|
1769
1769
|
return v && document.addEventListener("keydown", f), () => {
|
|
1770
1770
|
document.removeEventListener("keydown", f);
|
|
1771
1771
|
};
|
|
1772
|
-
}, [v]),
|
|
1773
|
-
if (
|
|
1772
|
+
}, [v]), Y(() => {
|
|
1773
|
+
if (m && p.current) {
|
|
1774
1774
|
const f = p.current.querySelector(
|
|
1775
|
-
`[data-option-value="${
|
|
1775
|
+
`[data-option-value="${m}"]`
|
|
1776
1776
|
);
|
|
1777
1777
|
if (f) {
|
|
1778
|
-
const
|
|
1778
|
+
const M = f.getBoundingClientRect();
|
|
1779
1779
|
w({
|
|
1780
|
-
top:
|
|
1781
|
-
left:
|
|
1780
|
+
top: M.top,
|
|
1781
|
+
left: M.right + 8
|
|
1782
1782
|
});
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
1785
|
-
}, [
|
|
1785
|
+
}, [m]), Y(() => () => {
|
|
1786
1786
|
D.current && clearTimeout(D.current);
|
|
1787
1787
|
}, []);
|
|
1788
|
-
const
|
|
1788
|
+
const A = (f) => {
|
|
1789
1789
|
f.stopPropagation(), !l && (h(!v), b(null), D.current && (clearTimeout(D.current), D.current = null));
|
|
1790
|
-
},
|
|
1791
|
-
f.stopPropagation(), !
|
|
1792
|
-
},
|
|
1790
|
+
}, R = (f, M, y) => {
|
|
1791
|
+
f.stopPropagation(), !M.disabled && !M.divider && (!M.children || M.children.length === 0) && (s?.(M.value, y), h(!1), b(null));
|
|
1792
|
+
}, ee = (f) => {
|
|
1793
1793
|
D.current && (clearTimeout(D.current), D.current = null), f.children && f.children.length > 0 ? b(f.value) : b(null);
|
|
1794
|
-
},
|
|
1794
|
+
}, K = (f) => {
|
|
1795
1795
|
f.children && f.children.length > 0 ? D.current = setTimeout(() => {
|
|
1796
1796
|
b(null);
|
|
1797
1797
|
}, 150) : b(null);
|
|
1798
|
-
},
|
|
1799
|
-
f.stopPropagation(), !
|
|
1798
|
+
}, G = (f, M, y) => {
|
|
1799
|
+
f.stopPropagation(), !M.disabled && !M.divider && (s?.(M.value, y), h(!1), b(null));
|
|
1800
1800
|
}, ie = i(
|
|
1801
1801
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1802
1802
|
"max-h-60 overflow-auto"
|
|
@@ -1817,7 +1817,7 @@ const Mr = ({
|
|
|
1817
1817
|
"button",
|
|
1818
1818
|
{
|
|
1819
1819
|
ref: x,
|
|
1820
|
-
onClick:
|
|
1820
|
+
onClick: A,
|
|
1821
1821
|
disabled: l,
|
|
1822
1822
|
"aria-haspopup": "menu",
|
|
1823
1823
|
"aria-expanded": v,
|
|
@@ -1827,18 +1827,18 @@ const Mr = ({
|
|
|
1827
1827
|
children: t
|
|
1828
1828
|
}
|
|
1829
1829
|
),
|
|
1830
|
-
v && /* @__PURE__ */ e("div", { ref:
|
|
1830
|
+
v && /* @__PURE__ */ e("div", { ref: E, className: ie, style: j, onKeyDown: q, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1831
1831
|
d && (typeof d == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: d }) : d),
|
|
1832
|
-
r.map((f,
|
|
1832
|
+
r.map((f, M) => {
|
|
1833
1833
|
if (f.divider)
|
|
1834
1834
|
return /* @__PURE__ */ e(
|
|
1835
1835
|
"div",
|
|
1836
1836
|
{
|
|
1837
1837
|
className: "border-t border-border my-2"
|
|
1838
1838
|
},
|
|
1839
|
-
`divider-${
|
|
1839
|
+
`divider-${M}`
|
|
1840
1840
|
);
|
|
1841
|
-
const y = f.children && f.children.length > 0, $ =
|
|
1841
|
+
const y = f.children && f.children.length > 0, $ = m === f.value;
|
|
1842
1842
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1843
1843
|
/* @__PURE__ */ c(
|
|
1844
1844
|
"button",
|
|
@@ -1846,9 +1846,9 @@ const Mr = ({
|
|
|
1846
1846
|
"data-option-value": f.value,
|
|
1847
1847
|
role: "menuitem",
|
|
1848
1848
|
"aria-haspopup": y ? "menu" : void 0,
|
|
1849
|
-
onClick: (N) =>
|
|
1850
|
-
onMouseEnter: () =>
|
|
1851
|
-
onMouseLeave: () =>
|
|
1849
|
+
onClick: (N) => R(N, f),
|
|
1850
|
+
onMouseEnter: () => ee(f),
|
|
1851
|
+
onMouseLeave: () => K(f),
|
|
1852
1852
|
disabled: f.disabled,
|
|
1853
1853
|
className: i(
|
|
1854
1854
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -1866,7 +1866,7 @@ const Mr = ({
|
|
|
1866
1866
|
] })
|
|
1867
1867
|
] }),
|
|
1868
1868
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1869
|
-
|
|
1869
|
+
u && n === f.value && /* @__PURE__ */ e(He, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1870
1870
|
y && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1871
1871
|
] })
|
|
1872
1872
|
]
|
|
@@ -1875,7 +1875,7 @@ const Mr = ({
|
|
|
1875
1875
|
y && $ && /* @__PURE__ */ e(
|
|
1876
1876
|
"div",
|
|
1877
1877
|
{
|
|
1878
|
-
ref:
|
|
1878
|
+
ref: C,
|
|
1879
1879
|
className: k,
|
|
1880
1880
|
style: {
|
|
1881
1881
|
top: `${g.top}px`,
|
|
@@ -1889,23 +1889,23 @@ const Mr = ({
|
|
|
1889
1889
|
b(null);
|
|
1890
1890
|
}, 150);
|
|
1891
1891
|
},
|
|
1892
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children: f.children.map((N,
|
|
1892
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: f.children.map((N, J) => {
|
|
1893
1893
|
if (N.divider)
|
|
1894
1894
|
return /* @__PURE__ */ e(
|
|
1895
1895
|
"div",
|
|
1896
1896
|
{
|
|
1897
1897
|
className: "border-t border-border my-2"
|
|
1898
1898
|
},
|
|
1899
|
-
`divider-${
|
|
1899
|
+
`divider-${J}`
|
|
1900
1900
|
);
|
|
1901
|
-
const
|
|
1901
|
+
const se = typeof n == "object" && n[f.value] && n[f.value].includes(
|
|
1902
1902
|
N.value
|
|
1903
1903
|
) || n === N.value;
|
|
1904
1904
|
return /* @__PURE__ */ c(
|
|
1905
1905
|
"button",
|
|
1906
1906
|
{
|
|
1907
|
-
onClick: (
|
|
1908
|
-
|
|
1907
|
+
onClick: (re) => G(
|
|
1908
|
+
re,
|
|
1909
1909
|
N,
|
|
1910
1910
|
f.value
|
|
1911
1911
|
),
|
|
@@ -1924,7 +1924,7 @@ const Mr = ({
|
|
|
1924
1924
|
N.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: N.description })
|
|
1925
1925
|
] })
|
|
1926
1926
|
] }),
|
|
1927
|
-
|
|
1927
|
+
u && se && /* @__PURE__ */ e(He, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
|
|
1928
1928
|
]
|
|
1929
1929
|
},
|
|
1930
1930
|
N.value
|
|
@@ -1935,10 +1935,10 @@ const Mr = ({
|
|
|
1935
1935
|
] }, f.value);
|
|
1936
1936
|
}),
|
|
1937
1937
|
(() => {
|
|
1938
|
-
const f = r.reduce((
|
|
1939
|
-
if (y.divider) return
|
|
1938
|
+
const f = r.reduce((M, y) => {
|
|
1939
|
+
if (y.divider) return M;
|
|
1940
1940
|
const $ = y.children ? y.children.filter((N) => !N.divider).length : 0;
|
|
1941
|
-
return
|
|
1941
|
+
return M + 1 + $;
|
|
1942
1942
|
}, 0);
|
|
1943
1943
|
return f > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
1944
1944
|
f,
|
|
@@ -1949,7 +1949,7 @@ const Mr = ({
|
|
|
1949
1949
|
]
|
|
1950
1950
|
}
|
|
1951
1951
|
);
|
|
1952
|
-
},
|
|
1952
|
+
}, Ne = ({
|
|
1953
1953
|
actions: t,
|
|
1954
1954
|
defaultVariant: r = "secondary",
|
|
1955
1955
|
className: n
|
|
@@ -1966,7 +1966,7 @@ const Mr = ({
|
|
|
1966
1966
|
},
|
|
1967
1967
|
s.id
|
|
1968
1968
|
) : /* @__PURE__ */ e(
|
|
1969
|
-
|
|
1969
|
+
ne,
|
|
1970
1970
|
{
|
|
1971
1971
|
variant: s.variant ?? r,
|
|
1972
1972
|
onClick: (a) => {
|
|
@@ -1992,17 +1992,17 @@ const Mr = ({
|
|
|
1992
1992
|
children: l
|
|
1993
1993
|
}) => /* @__PURE__ */ c("div", { className: i("flex items-center gap-2", Tr[a], s), children: [
|
|
1994
1994
|
r && /* @__PURE__ */ e(
|
|
1995
|
-
|
|
1995
|
+
ne,
|
|
1996
1996
|
{
|
|
1997
1997
|
variant: "secondary",
|
|
1998
1998
|
onClick: r,
|
|
1999
1999
|
"aria-label": n,
|
|
2000
|
-
leftIcon: /* @__PURE__ */ e(Z, { icon:
|
|
2000
|
+
leftIcon: /* @__PURE__ */ e(Z, { icon: Se, size: "sm" }),
|
|
2001
2001
|
iconOnly: !0
|
|
2002
2002
|
}
|
|
2003
2003
|
),
|
|
2004
2004
|
l && /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: l }),
|
|
2005
|
-
/* @__PURE__ */ e(
|
|
2005
|
+
/* @__PURE__ */ e(Ne, { actions: t, className: i(!l && "ml-auto") })
|
|
2006
2006
|
] }), rs = (t) => (r) => t(r instanceof Date ? r : null), ns = (t) => (r) => t(typeof r == "string" ? r : ""), _r = {
|
|
2007
2007
|
none: "px-0",
|
|
2008
2008
|
sm: "px-2",
|
|
@@ -2028,17 +2028,17 @@ const Lr = (t) => {
|
|
|
2028
2028
|
Fe,
|
|
2029
2029
|
{
|
|
2030
2030
|
value: t.value,
|
|
2031
|
-
onChange: (
|
|
2031
|
+
onChange: (u) => t.onChange(u),
|
|
2032
2032
|
placeholder: t.placeholder || t.label,
|
|
2033
2033
|
className: i("min-w-40", o && "bg-info-soft text-info-fg")
|
|
2034
2034
|
}
|
|
2035
2035
|
);
|
|
2036
2036
|
}
|
|
2037
|
-
const n = (o) => t.options?.find((
|
|
2037
|
+
const n = (o) => t.options?.find((u) => u.value === o)?.label ?? String(o), s = (o) => Array.isArray(t.value) ? t.value.includes(o) : t.value === o, a = (o) => {
|
|
2038
2038
|
if (!t.multiSelect) return t.onChange(o);
|
|
2039
|
-
const
|
|
2039
|
+
const u = Array.isArray(t.value) ? t.value : [];
|
|
2040
2040
|
t.onChange(
|
|
2041
|
-
|
|
2041
|
+
u.includes(o) ? u.filter((d) => d !== o) : [...u, o]
|
|
2042
2042
|
);
|
|
2043
2043
|
}, l = r.length > 0;
|
|
2044
2044
|
return /* @__PURE__ */ e(
|
|
@@ -2051,24 +2051,24 @@ const Lr = (t) => {
|
|
|
2051
2051
|
label: l ? `${t.label}: ${r.map(n).join(", ")}` : t.label,
|
|
2052
2052
|
title: t.label,
|
|
2053
2053
|
onClear: () => t.onChange(t.multiSelect ? [] : "all"),
|
|
2054
|
-
menu: (o) => /* @__PURE__ */ e("div", { role: "listbox", className: "flex flex-col", children: t.options?.map((
|
|
2054
|
+
menu: (o) => /* @__PURE__ */ e("div", { role: "listbox", className: "flex flex-col", children: t.options?.map((u) => /* @__PURE__ */ e(
|
|
2055
2055
|
"button",
|
|
2056
2056
|
{
|
|
2057
2057
|
type: "button",
|
|
2058
2058
|
role: "option",
|
|
2059
|
-
"aria-selected": s(
|
|
2059
|
+
"aria-selected": s(u.value),
|
|
2060
2060
|
onClick: () => {
|
|
2061
|
-
a(
|
|
2061
|
+
a(u.value), t.multiSelect || o();
|
|
2062
2062
|
},
|
|
2063
2063
|
className: i(
|
|
2064
2064
|
"flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm",
|
|
2065
2065
|
"transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
2066
2066
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2067
|
-
s(
|
|
2067
|
+
s(u.value) ? "font-medium text-text" : "text-text-muted"
|
|
2068
2068
|
),
|
|
2069
|
-
children:
|
|
2069
|
+
children: u.label
|
|
2070
2070
|
},
|
|
2071
|
-
|
|
2071
|
+
u.value
|
|
2072
2072
|
)) })
|
|
2073
2073
|
}
|
|
2074
2074
|
);
|
|
@@ -2080,102 +2080,102 @@ const Lr = (t) => {
|
|
|
2080
2080
|
searchPlaceholder: a = "Search...",
|
|
2081
2081
|
searchValue: l,
|
|
2082
2082
|
onSearchChange: o,
|
|
2083
|
-
filters:
|
|
2083
|
+
filters: u = [],
|
|
2084
2084
|
toolbarActions: d = [],
|
|
2085
2085
|
paginated: v = !1,
|
|
2086
2086
|
defaultPageSize: h = 10,
|
|
2087
|
-
actions:
|
|
2087
|
+
actions: m = [],
|
|
2088
2088
|
onRowClick: b,
|
|
2089
2089
|
selectable: g = !1,
|
|
2090
2090
|
selectedRows: w = [],
|
|
2091
2091
|
onSelectionChange: p,
|
|
2092
|
-
getRowKey: x = (
|
|
2093
|
-
emptyContent:
|
|
2094
|
-
footerSummary:
|
|
2095
|
-
size:
|
|
2092
|
+
getRowKey: x = (ee, K) => K,
|
|
2093
|
+
emptyContent: C,
|
|
2094
|
+
footerSummary: E,
|
|
2095
|
+
size: j = "md",
|
|
2096
2096
|
hoverable: D = !0,
|
|
2097
|
-
padding:
|
|
2098
|
-
className:
|
|
2099
|
-
rowClassName:
|
|
2100
|
-
headerBackground:
|
|
2097
|
+
padding: U = "md",
|
|
2098
|
+
className: q,
|
|
2099
|
+
rowClassName: A,
|
|
2100
|
+
headerBackground: R = !0
|
|
2101
2101
|
}) => {
|
|
2102
|
-
const [
|
|
2102
|
+
const [ee, K] = F(""), G = l !== void 0, ie = G ? l : ee, k = o ?? K, [f, M] = F({
|
|
2103
2103
|
column: null,
|
|
2104
2104
|
direction: null
|
|
2105
|
-
}), [y, $] =
|
|
2105
|
+
}), [y, $] = F({
|
|
2106
2106
|
page: 0,
|
|
2107
2107
|
pageSize: h
|
|
2108
|
-
}), N =
|
|
2109
|
-
let
|
|
2110
|
-
if (s && !
|
|
2111
|
-
const
|
|
2108
|
+
}), N = te(null), J = ge(() => {
|
|
2109
|
+
let z = t;
|
|
2110
|
+
if (s && !G && ie.trim()) {
|
|
2111
|
+
const W = r.filter(
|
|
2112
2112
|
(oe) => oe.searchable !== !1
|
|
2113
|
-
),
|
|
2114
|
-
|
|
2115
|
-
const ue = typeof
|
|
2116
|
-
return String(ue || "").toLowerCase().includes(
|
|
2113
|
+
), ae = ie.toLowerCase();
|
|
2114
|
+
z = z.filter((oe) => W.some((B) => {
|
|
2115
|
+
const ue = typeof B.accessor == "function" ? B.accessor(oe) : oe[B.accessor];
|
|
2116
|
+
return String(ue || "").toLowerCase().includes(ae);
|
|
2117
2117
|
}));
|
|
2118
2118
|
}
|
|
2119
|
-
return
|
|
2120
|
-
|
|
2121
|
-
const oe = r.find((ue) => ue.id ===
|
|
2119
|
+
return u.forEach((W) => {
|
|
2120
|
+
W.value && W.value !== "all" && (z = z.filter((ae) => {
|
|
2121
|
+
const oe = r.find((ue) => ue.id === W.id);
|
|
2122
2122
|
if (!oe) return !0;
|
|
2123
|
-
const
|
|
2124
|
-
return String(
|
|
2123
|
+
const B = typeof oe.accessor == "function" ? oe.accessor(ae) : ae[oe.accessor];
|
|
2124
|
+
return String(B || "") === W.value;
|
|
2125
2125
|
}));
|
|
2126
|
-
}),
|
|
2127
|
-
}, [t, ie,
|
|
2128
|
-
if (!f.column || !f.direction) return
|
|
2129
|
-
const
|
|
2130
|
-
return
|
|
2131
|
-
const oe = typeof
|
|
2126
|
+
}), z;
|
|
2127
|
+
}, [t, ie, G, r, s, u]), se = ge(() => {
|
|
2128
|
+
if (!f.column || !f.direction) return J;
|
|
2129
|
+
const z = r.find((W) => W.id === f.column);
|
|
2130
|
+
return z ? [...J].sort((W, ae) => {
|
|
2131
|
+
const oe = typeof z.accessor == "function" ? z.accessor(W) : W[z.accessor], B = typeof z.accessor == "function" ? z.accessor(ae) : ae[z.accessor];
|
|
2132
2132
|
let ue = 0;
|
|
2133
|
-
return oe <
|
|
2134
|
-
}) :
|
|
2135
|
-
}, [
|
|
2136
|
-
if (!v) return
|
|
2137
|
-
const
|
|
2138
|
-
return
|
|
2139
|
-
}, [
|
|
2140
|
-
(
|
|
2141
|
-
r.find((
|
|
2133
|
+
return oe < B ? ue = -1 : oe > B && (ue = 1), f.direction === "desc" ? -ue : ue;
|
|
2134
|
+
}) : J;
|
|
2135
|
+
}, [J, f, r]), re = ge(() => {
|
|
2136
|
+
if (!v) return se;
|
|
2137
|
+
const z = y.page * y.pageSize, W = z + y.pageSize;
|
|
2138
|
+
return se.slice(z, W);
|
|
2139
|
+
}, [se, y, v]), X = xe(
|
|
2140
|
+
(z) => {
|
|
2141
|
+
r.find((ae) => ae.id === z)?.sortable && M((ae) => ae.column !== z ? { column: z, direction: "asc" } : ae.direction === "asc" ? { column: z, direction: "desc" } : { column: null, direction: null });
|
|
2142
2142
|
},
|
|
2143
2143
|
[r]
|
|
2144
|
-
),
|
|
2145
|
-
$((
|
|
2146
|
-
}, []),
|
|
2147
|
-
(
|
|
2144
|
+
), P = xe((z) => {
|
|
2145
|
+
$((W) => ({ ...W, page: z }));
|
|
2146
|
+
}, []), H = xe(
|
|
2147
|
+
(z, W) => {
|
|
2148
2148
|
if (!p) return;
|
|
2149
|
-
const
|
|
2150
|
-
p(
|
|
2151
|
-
(oe,
|
|
2149
|
+
const ae = x(z, 0);
|
|
2150
|
+
p(W ? [...w, z] : w.filter(
|
|
2151
|
+
(oe, B) => x(w[B], B) !== ae
|
|
2152
2152
|
));
|
|
2153
2153
|
},
|
|
2154
2154
|
[w, p, x]
|
|
2155
|
-
),
|
|
2156
|
-
(
|
|
2157
|
-
p && p(
|
|
2155
|
+
), T = xe(
|
|
2156
|
+
(z) => {
|
|
2157
|
+
p && p(z ? [...re] : []);
|
|
2158
2158
|
},
|
|
2159
|
-
[
|
|
2159
|
+
[re, p]
|
|
2160
2160
|
);
|
|
2161
|
-
|
|
2162
|
-
$((
|
|
2163
|
-
}, [ie, f]),
|
|
2164
|
-
$((
|
|
2165
|
-
}, [
|
|
2166
|
-
const
|
|
2167
|
-
const
|
|
2161
|
+
Y(() => {
|
|
2162
|
+
$((z) => ({ ...z, page: 0 }));
|
|
2163
|
+
}, [ie, f]), Y(() => {
|
|
2164
|
+
$((z) => ({ ...z, page: 0 }));
|
|
2165
|
+
}, [u.map((z) => z.value).join(",")]);
|
|
2166
|
+
const S = se.length, L = Math.ceil(S / y.pageSize), O = y.page * y.pageSize + 1, V = Math.min(O + y.pageSize - 1, S), _ = re.length > 0 && re.every((z) => {
|
|
2167
|
+
const W = x(z, 0);
|
|
2168
2168
|
return w.some(
|
|
2169
|
-
(
|
|
2169
|
+
(ae, oe) => x(ae, oe) === W
|
|
2170
2170
|
);
|
|
2171
|
-
}),
|
|
2172
|
-
const
|
|
2171
|
+
}), I = re.some((z) => {
|
|
2172
|
+
const W = x(z, 0);
|
|
2173
2173
|
return w.some(
|
|
2174
|
-
(
|
|
2174
|
+
(ae, oe) => x(ae, oe) === W
|
|
2175
2175
|
);
|
|
2176
|
-
}), Q = _r[
|
|
2177
|
-
return /* @__PURE__ */ c("div", { className: i("flex min-w-0 flex-col",
|
|
2178
|
-
|
|
2176
|
+
}), Q = _r[U], le = R ? "bg-surface-sunk" : "bg-surface", de = i("text-text", Q), pe = s || u.length > 0 || d.length > 0, he = v && S > 0, Ie = he || E !== void 0;
|
|
2177
|
+
return /* @__PURE__ */ c("div", { className: i("flex min-w-0 flex-col", q), children: [
|
|
2178
|
+
pe && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2 pb-3", children: [
|
|
2179
2179
|
s && /* @__PURE__ */ e(
|
|
2180
2180
|
at,
|
|
2181
2181
|
{
|
|
@@ -2185,8 +2185,8 @@ const Lr = (t) => {
|
|
|
2185
2185
|
containerClassName: "w-full sm:w-66"
|
|
2186
2186
|
}
|
|
2187
2187
|
),
|
|
2188
|
-
|
|
2189
|
-
d.length > 0 && /* @__PURE__ */ e(
|
|
2188
|
+
u.map((z) => /* @__PURE__ */ e(Lr, { ...z }, z.id)),
|
|
2189
|
+
d.length > 0 && /* @__PURE__ */ e(Ne, { actions: d, className: "ml-auto" })
|
|
2190
2190
|
] }),
|
|
2191
2191
|
/* @__PURE__ */ e("div", { className: "relative w-full overflow-x-auto rounded-lg ring-1 ring-border", children: /* @__PURE__ */ c("table", { ref: N, className: "min-w-full border-collapse text-base text-text", children: [
|
|
2192
2192
|
/* @__PURE__ */ e("thead", { className: i(le, "h-control-lg"), children: /* @__PURE__ */ c("tr", { children: [
|
|
@@ -2194,13 +2194,13 @@ const Lr = (t) => {
|
|
|
2194
2194
|
ye,
|
|
2195
2195
|
{
|
|
2196
2196
|
size: "sm",
|
|
2197
|
-
checked:
|
|
2198
|
-
indeterminate:
|
|
2199
|
-
onChange: (
|
|
2197
|
+
checked: _,
|
|
2198
|
+
indeterminate: I && !_,
|
|
2199
|
+
onChange: (z) => T(z.target.checked),
|
|
2200
2200
|
"aria-label": "Select all rows"
|
|
2201
2201
|
}
|
|
2202
2202
|
) }),
|
|
2203
|
-
r.map((
|
|
2203
|
+
r.map((z) => /* @__PURE__ */ e(
|
|
2204
2204
|
"th",
|
|
2205
2205
|
{
|
|
2206
2206
|
className: i(
|
|
@@ -2208,74 +2208,74 @@ const Lr = (t) => {
|
|
|
2208
2208
|
"text-xs font-semibold uppercase tracking-label text-text-muted",
|
|
2209
2209
|
"group",
|
|
2210
2210
|
{
|
|
2211
|
-
"text-left":
|
|
2212
|
-
"text-center":
|
|
2213
|
-
"text-right":
|
|
2214
|
-
"cursor-pointer select-none":
|
|
2215
|
-
[`sticky left-0 ${le}`]:
|
|
2216
|
-
[`sticky right-0 ${le}`]:
|
|
2211
|
+
"text-left": z.align === "left" || !z.align,
|
|
2212
|
+
"text-center": z.align === "center",
|
|
2213
|
+
"text-right": z.align === "right",
|
|
2214
|
+
"cursor-pointer select-none": z.sortable,
|
|
2215
|
+
[`sticky left-0 ${le}`]: z.sticky === "left",
|
|
2216
|
+
[`sticky right-0 ${le}`]: z.sticky === "right"
|
|
2217
2217
|
}
|
|
2218
2218
|
),
|
|
2219
|
-
style: { width:
|
|
2220
|
-
onClick: () =>
|
|
2219
|
+
style: { width: z.width },
|
|
2220
|
+
onClick: () => z.sortable && X(z.id),
|
|
2221
2221
|
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
2222
|
-
|
|
2223
|
-
|
|
2222
|
+
z.headerCell ? z.headerCell() : z.header,
|
|
2223
|
+
z.sortable && /* @__PURE__ */ e(
|
|
2224
2224
|
Z,
|
|
2225
2225
|
{
|
|
2226
|
-
icon: f.column ===
|
|
2226
|
+
icon: f.column === z.id && f.direction === "desc" ? $e : St,
|
|
2227
2227
|
size: "xs",
|
|
2228
2228
|
className: i(
|
|
2229
2229
|
"transition-opacity duration-fast ease-out",
|
|
2230
|
-
f.column ===
|
|
2230
|
+
f.column === z.id ? "text-text opacity-100" : "text-text-subtle opacity-0 group-hover:opacity-100"
|
|
2231
2231
|
)
|
|
2232
2232
|
}
|
|
2233
2233
|
)
|
|
2234
2234
|
] })
|
|
2235
2235
|
},
|
|
2236
|
-
|
|
2236
|
+
z.id
|
|
2237
2237
|
)),
|
|
2238
|
-
|
|
2238
|
+
m.length > 0 && /* @__PURE__ */ e("th", { className: i(de, "w-10"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
2239
2239
|
] }) }),
|
|
2240
|
-
/* @__PURE__ */ e("tbody", { children: n ? Array.from({ length: Dr }).map((
|
|
2240
|
+
/* @__PURE__ */ e("tbody", { children: n ? Array.from({ length: Dr }).map((z, W) => /* @__PURE__ */ c("tr", { className: "animate-pulse border-t border-border-subtle", "aria-hidden": !0, children: [
|
|
2241
2241
|
g && /* @__PURE__ */ e("td", { className: i(de, "h-row-lg"), children: /* @__PURE__ */ e("span", { className: "block size-4 rounded-xs bg-surface-hover" }) }),
|
|
2242
|
-
r.map((
|
|
2242
|
+
r.map((ae, oe) => /* @__PURE__ */ e("td", { className: i(de, "h-row-lg"), style: { width: ae.width }, children: /* @__PURE__ */ e(
|
|
2243
2243
|
"span",
|
|
2244
2244
|
{
|
|
2245
2245
|
className: "block h-3 rounded-xs bg-surface-hover",
|
|
2246
|
-
style: { width: We[(
|
|
2246
|
+
style: { width: We[(W + oe) % We.length] }
|
|
2247
2247
|
}
|
|
2248
|
-
) },
|
|
2249
|
-
|
|
2250
|
-
] }, `skeleton-${
|
|
2248
|
+
) }, ae.id)),
|
|
2249
|
+
m.length > 0 && /* @__PURE__ */ e("td", { className: i(de, "h-row-lg") })
|
|
2250
|
+
] }, `skeleton-${W}`)) : re.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
2251
2251
|
"td",
|
|
2252
2252
|
{
|
|
2253
|
-
colSpan: r.length + (g ? 1 : 0) + (
|
|
2253
|
+
colSpan: r.length + (g ? 1 : 0) + (m.length > 0 ? 1 : 0),
|
|
2254
2254
|
className: i(
|
|
2255
2255
|
de,
|
|
2256
2256
|
"border-t border-border-subtle py-10 text-center text-text-muted"
|
|
2257
2257
|
),
|
|
2258
|
-
children:
|
|
2258
|
+
children: C || "No data available"
|
|
2259
2259
|
}
|
|
2260
|
-
) }) :
|
|
2261
|
-
const
|
|
2262
|
-
(
|
|
2260
|
+
) }) : re.map((z, W) => {
|
|
2261
|
+
const ae = x(z, W), oe = w.some(
|
|
2262
|
+
(B, ue) => x(B, ue) === ae
|
|
2263
2263
|
);
|
|
2264
2264
|
return /* @__PURE__ */ c(
|
|
2265
2265
|
"tr",
|
|
2266
2266
|
{
|
|
2267
2267
|
className: i(
|
|
2268
|
-
$r[
|
|
2268
|
+
$r[j],
|
|
2269
2269
|
// Hairline above every row, including the first: it is
|
|
2270
2270
|
// what separates the body from the column strip.
|
|
2271
2271
|
"border-t border-border-subtle",
|
|
2272
2272
|
D && "transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
2273
2273
|
b && "cursor-pointer",
|
|
2274
2274
|
oe && "bg-accent-soft",
|
|
2275
|
-
|
|
2275
|
+
A?.(z, W)
|
|
2276
2276
|
),
|
|
2277
|
-
onClick: (
|
|
2278
|
-
|
|
2277
|
+
onClick: (B) => {
|
|
2278
|
+
B.stopPropagation(), b?.(z, W);
|
|
2279
2279
|
},
|
|
2280
2280
|
children: [
|
|
2281
2281
|
g && /* @__PURE__ */ e("td", { className: de, children: /* @__PURE__ */ e(
|
|
@@ -2283,98 +2283,98 @@ const Lr = (t) => {
|
|
|
2283
2283
|
{
|
|
2284
2284
|
size: "sm",
|
|
2285
2285
|
checked: oe,
|
|
2286
|
-
onClick: (
|
|
2287
|
-
onChange: (
|
|
2288
|
-
|
|
2286
|
+
onClick: (B) => B.stopPropagation(),
|
|
2287
|
+
onChange: (B) => {
|
|
2288
|
+
B.stopPropagation(), H(z, B.target.checked);
|
|
2289
2289
|
},
|
|
2290
2290
|
"aria-label": "Select row"
|
|
2291
2291
|
}
|
|
2292
2292
|
) }),
|
|
2293
|
-
r.map((
|
|
2294
|
-
const ue = typeof
|
|
2293
|
+
r.map((B) => {
|
|
2294
|
+
const ue = typeof B.accessor == "function" ? B.accessor(z) : z[B.accessor];
|
|
2295
2295
|
return /* @__PURE__ */ e(
|
|
2296
2296
|
"td",
|
|
2297
2297
|
{
|
|
2298
2298
|
className: i(de, {
|
|
2299
|
-
"text-left":
|
|
2300
|
-
"text-center":
|
|
2301
|
-
"text-right":
|
|
2302
|
-
"sticky left-0 bg-surface":
|
|
2303
|
-
"sticky right-0 bg-surface":
|
|
2299
|
+
"text-left": B.align === "left" || !B.align,
|
|
2300
|
+
"text-center": B.align === "center",
|
|
2301
|
+
"text-right": B.align === "right",
|
|
2302
|
+
"sticky left-0 bg-surface": B.sticky === "left",
|
|
2303
|
+
"sticky right-0 bg-surface": B.sticky === "right"
|
|
2304
2304
|
}),
|
|
2305
|
-
children:
|
|
2305
|
+
children: B.cell ? B.cell(ue, z, W) : String(ue || "")
|
|
2306
2306
|
},
|
|
2307
|
-
|
|
2307
|
+
B.id
|
|
2308
2308
|
);
|
|
2309
2309
|
}),
|
|
2310
|
-
|
|
2310
|
+
m.length > 0 && /* @__PURE__ */ e("td", { className: de, children: /* @__PURE__ */ e(
|
|
2311
2311
|
Mr,
|
|
2312
2312
|
{
|
|
2313
2313
|
className: "rounded-md",
|
|
2314
2314
|
trigger: /* @__PURE__ */ e("span", { className: "grid size-7 place-items-center text-text-subtle", children: /* @__PURE__ */ e(Z, { icon: Et, size: "md", color: "current" }) }),
|
|
2315
|
-
options:
|
|
2316
|
-
value:
|
|
2317
|
-
label:
|
|
2318
|
-
icon:
|
|
2319
|
-
disabled:
|
|
2315
|
+
options: m.map((B) => ({
|
|
2316
|
+
value: B.id,
|
|
2317
|
+
label: B.label,
|
|
2318
|
+
icon: B.icon,
|
|
2319
|
+
disabled: B.disabled?.(z)
|
|
2320
2320
|
})),
|
|
2321
|
-
onSelect: (
|
|
2322
|
-
const ue =
|
|
2323
|
-
(dt) => dt.id ===
|
|
2321
|
+
onSelect: (B) => {
|
|
2322
|
+
const ue = m.find(
|
|
2323
|
+
(dt) => dt.id === B
|
|
2324
2324
|
);
|
|
2325
|
-
ue && ue.onClick(
|
|
2325
|
+
ue && ue.onClick(z, W);
|
|
2326
2326
|
},
|
|
2327
2327
|
placement: "bottom-end"
|
|
2328
2328
|
}
|
|
2329
2329
|
) })
|
|
2330
2330
|
]
|
|
2331
2331
|
},
|
|
2332
|
-
|
|
2332
|
+
ae
|
|
2333
2333
|
);
|
|
2334
2334
|
}) })
|
|
2335
2335
|
] }) }),
|
|
2336
2336
|
Ie && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-3 px-1 pt-3 text-xs text-text-muted", children: [
|
|
2337
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children:
|
|
2337
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: E ?? `Showing ${O}–${V} of ${S}` }),
|
|
2338
2338
|
he && /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5", children: [
|
|
2339
2339
|
/* @__PURE__ */ e(
|
|
2340
|
-
|
|
2340
|
+
ne,
|
|
2341
2341
|
{
|
|
2342
2342
|
size: "xs",
|
|
2343
2343
|
variant: "ghost",
|
|
2344
2344
|
iconOnly: !0,
|
|
2345
2345
|
"aria-label": "Previous page",
|
|
2346
|
-
onClick: () =>
|
|
2346
|
+
onClick: () => P(y.page - 1),
|
|
2347
2347
|
disabled: y.page === 0,
|
|
2348
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
2348
|
+
children: /* @__PURE__ */ e(Z, { icon: Se, size: "md", color: "current" })
|
|
2349
2349
|
}
|
|
2350
2350
|
),
|
|
2351
|
-
Ar(y.page,
|
|
2352
|
-
(
|
|
2351
|
+
Ar(y.page, L).map(
|
|
2352
|
+
(z, W) => z === "gap" ? /* @__PURE__ */ e("span", { className: "px-1 text-text-subtle", children: "…" }, `gap-${W}`) : /* @__PURE__ */ e(
|
|
2353
2353
|
"button",
|
|
2354
2354
|
{
|
|
2355
2355
|
type: "button",
|
|
2356
|
-
"aria-current":
|
|
2357
|
-
onClick: () =>
|
|
2356
|
+
"aria-current": z === y.page ? "page" : void 0,
|
|
2357
|
+
onClick: () => P(z),
|
|
2358
2358
|
className: i(
|
|
2359
2359
|
"h-control-xs min-w-6 cursor-pointer rounded-sm px-1.5 tabular-nums",
|
|
2360
2360
|
"transition-colors duration-fast ease-out",
|
|
2361
2361
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2362
|
-
|
|
2362
|
+
z === y.page ? "bg-surface-sunk font-semibold text-text" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
2363
2363
|
),
|
|
2364
|
-
children:
|
|
2364
|
+
children: z + 1
|
|
2365
2365
|
},
|
|
2366
|
-
|
|
2366
|
+
z
|
|
2367
2367
|
)
|
|
2368
2368
|
),
|
|
2369
2369
|
/* @__PURE__ */ e(
|
|
2370
|
-
|
|
2370
|
+
ne,
|
|
2371
2371
|
{
|
|
2372
2372
|
size: "xs",
|
|
2373
2373
|
variant: "ghost",
|
|
2374
2374
|
iconOnly: !0,
|
|
2375
2375
|
"aria-label": "Next page",
|
|
2376
|
-
onClick: () =>
|
|
2377
|
-
disabled: y.page >=
|
|
2376
|
+
onClick: () => P(y.page + 1),
|
|
2377
|
+
disabled: y.page >= L - 1,
|
|
2378
2378
|
children: /* @__PURE__ */ e(Z, { icon: De, size: "md", color: "current" })
|
|
2379
2379
|
}
|
|
2380
2380
|
)
|
|
@@ -2387,13 +2387,13 @@ const Lr = (t) => {
|
|
|
2387
2387
|
onTabChange: n,
|
|
2388
2388
|
className: s
|
|
2389
2389
|
}) => {
|
|
2390
|
-
const [a, l] =
|
|
2390
|
+
const [a, l] = F(t[0]?.id || ""), o = r || a, u = (d) => {
|
|
2391
2391
|
n ? n(d) : l(d);
|
|
2392
2392
|
};
|
|
2393
2393
|
return /* @__PURE__ */ e("div", { className: i("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((d) => /* @__PURE__ */ e(
|
|
2394
2394
|
"button",
|
|
2395
2395
|
{
|
|
2396
|
-
onClick: () => !d.disabled &&
|
|
2396
|
+
onClick: () => !d.disabled && u(d.id),
|
|
2397
2397
|
disabled: d.disabled,
|
|
2398
2398
|
className: i(
|
|
2399
2399
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
@@ -2422,11 +2422,11 @@ const Lr = (t) => {
|
|
|
2422
2422
|
size: l = "md",
|
|
2423
2423
|
className: o
|
|
2424
2424
|
}) => {
|
|
2425
|
-
const [
|
|
2425
|
+
const [u, d] = F(
|
|
2426
2426
|
r || n || t[0]?.id || ""
|
|
2427
|
-
), v = n ||
|
|
2427
|
+
), v = n || u, h = (p) => {
|
|
2428
2428
|
s ? s(p) : d(p);
|
|
2429
|
-
},
|
|
2429
|
+
}, m = {
|
|
2430
2430
|
activeTab: v,
|
|
2431
2431
|
setActiveTab: h
|
|
2432
2432
|
}, b = t.find((p) => p.id === v), g = i(
|
|
@@ -2439,11 +2439,11 @@ const Lr = (t) => {
|
|
|
2439
2439
|
},
|
|
2440
2440
|
o
|
|
2441
2441
|
), w = (p, x) => {
|
|
2442
|
-
const
|
|
2442
|
+
const C = "transition-colors duration-fast font-medium", E = {
|
|
2443
2443
|
"text-xs px-2 py-1": l === "sm",
|
|
2444
2444
|
"text-sm px-3 py-2": l === "md",
|
|
2445
2445
|
"text-base px-4 py-3": l === "lg"
|
|
2446
|
-
},
|
|
2446
|
+
}, j = {
|
|
2447
2447
|
// Default variant
|
|
2448
2448
|
"border-b-2 -mb-px": a === "default",
|
|
2449
2449
|
// Pills variant
|
|
@@ -2453,17 +2453,17 @@ const Lr = (t) => {
|
|
|
2453
2453
|
}, D = {
|
|
2454
2454
|
"opacity-50 cursor-not-allowed": p.disabled,
|
|
2455
2455
|
"cursor-pointer": !p.disabled
|
|
2456
|
-
},
|
|
2456
|
+
}, U = x ? {
|
|
2457
2457
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2458
2458
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2459
|
-
} : {},
|
|
2459
|
+
} : {}, q = !x && !p.disabled ? {
|
|
2460
2460
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2461
2461
|
"text-text-muted hover:text-text": a === "pills",
|
|
2462
2462
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2463
2463
|
} : {};
|
|
2464
|
-
return i(
|
|
2464
|
+
return i(C, E, j, D, U, q);
|
|
2465
2465
|
};
|
|
2466
|
-
return /* @__PURE__ */ e(Ir.Provider, { value:
|
|
2466
|
+
return /* @__PURE__ */ e(Ir.Provider, { value: m, children: /* @__PURE__ */ c("div", { children: [
|
|
2467
2467
|
/* @__PURE__ */ e("div", { className: g, role: "tablist", children: t.map((p) => /* @__PURE__ */ e(
|
|
2468
2468
|
"button",
|
|
2469
2469
|
{
|
|
@@ -2507,19 +2507,19 @@ function lt({
|
|
|
2507
2507
|
closeOnBackdropClick: a = !0,
|
|
2508
2508
|
closeOnEscape: l = !0,
|
|
2509
2509
|
className: o,
|
|
2510
|
-
backdropClassName:
|
|
2510
|
+
backdropClassName: u,
|
|
2511
2511
|
children: d,
|
|
2512
2512
|
footer: v,
|
|
2513
2513
|
showCloseButton: h = !0
|
|
2514
2514
|
}) {
|
|
2515
|
-
const
|
|
2516
|
-
|
|
2515
|
+
const m = te(null), b = te(null);
|
|
2516
|
+
Y(() => {
|
|
2517
2517
|
if (!t || !l) return;
|
|
2518
2518
|
const w = (p) => {
|
|
2519
2519
|
p.key === "Escape" && r();
|
|
2520
2520
|
};
|
|
2521
2521
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
2522
|
-
}, [t, l, r]),
|
|
2522
|
+
}, [t, l, r]), Y(() => (t ? (b.current = document.activeElement, m.current && m.current.focus(), document.body.style.overflow = "hidden") : (b.current && b.current.focus(), document.body.style.overflow = ""), () => {
|
|
2523
2523
|
document.body.style.overflow = "";
|
|
2524
2524
|
}), [t]);
|
|
2525
2525
|
const g = (w) => {
|
|
@@ -2532,13 +2532,13 @@ function lt({
|
|
|
2532
2532
|
"fixed inset-0 z-modal flex items-center justify-center p-4",
|
|
2533
2533
|
"bg-scrim",
|
|
2534
2534
|
// 'animate-fade-in',
|
|
2535
|
-
|
|
2535
|
+
u
|
|
2536
2536
|
),
|
|
2537
2537
|
onClick: g,
|
|
2538
2538
|
children: /* @__PURE__ */ c(
|
|
2539
2539
|
"div",
|
|
2540
2540
|
{
|
|
2541
|
-
ref:
|
|
2541
|
+
ref: m,
|
|
2542
2542
|
className: i(
|
|
2543
2543
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2544
2544
|
// 'animate-scale-in',
|
|
@@ -2566,7 +2566,7 @@ function lt({
|
|
|
2566
2566
|
onClick: r,
|
|
2567
2567
|
className: "p-1 text-text-muted hover:text-text transition-colors",
|
|
2568
2568
|
"aria-label": "Close modal",
|
|
2569
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
2569
|
+
children: /* @__PURE__ */ e(Z, { icon: ke, size: "lg", color: "current" })
|
|
2570
2570
|
}
|
|
2571
2571
|
)
|
|
2572
2572
|
] }),
|
|
@@ -2586,202 +2586,202 @@ const jr = ({
|
|
|
2586
2586
|
error: a,
|
|
2587
2587
|
disabled: l,
|
|
2588
2588
|
accept: o,
|
|
2589
|
-
onListFiles:
|
|
2589
|
+
onListFiles: u,
|
|
2590
2590
|
onListMounts: d,
|
|
2591
2591
|
onUploadFile: v,
|
|
2592
2592
|
onDownloadFile: h,
|
|
2593
|
-
onRegisterFile:
|
|
2593
|
+
onRegisterFile: m
|
|
2594
2594
|
}) => {
|
|
2595
|
-
const [b, g] =
|
|
2595
|
+
const [b, g] = F(!1), [w, p] = F([]), [x, C] = F(null), [E, j] = F("/"), [D, U] = F([]), [q, A] = F(!1), [R, ee] = F(""), [K, G] = F(
|
|
2596
2596
|
typeof t == "object" ? t : null
|
|
2597
|
-
), [ie, k] =
|
|
2598
|
-
|
|
2597
|
+
), [ie, k] = F(!1), [f, M] = F(""), y = te(null);
|
|
2598
|
+
Y(() => {
|
|
2599
2599
|
b && $();
|
|
2600
|
-
}, [b]),
|
|
2600
|
+
}, [b]), Y(() => {
|
|
2601
2601
|
b && x && N();
|
|
2602
|
-
}, [b, x,
|
|
2602
|
+
}, [b, x, E, R]);
|
|
2603
2603
|
const $ = async () => {
|
|
2604
|
-
|
|
2604
|
+
A(!0);
|
|
2605
2605
|
try {
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
} catch (
|
|
2609
|
-
console.error("Failed to load mounts",
|
|
2606
|
+
const _ = await d?.();
|
|
2607
|
+
_?.data && p(_.data);
|
|
2608
|
+
} catch (_) {
|
|
2609
|
+
console.error("Failed to load mounts", _);
|
|
2610
2610
|
} finally {
|
|
2611
|
-
|
|
2611
|
+
A(!1);
|
|
2612
2612
|
}
|
|
2613
2613
|
}, N = async () => {
|
|
2614
2614
|
if (x) {
|
|
2615
|
-
|
|
2615
|
+
A(!0);
|
|
2616
2616
|
try {
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2619
|
-
} catch (
|
|
2620
|
-
console.error("Failed to load files",
|
|
2617
|
+
const _ = await u?.({ mountId: x.id, name: R, path: E });
|
|
2618
|
+
_?.data && U(_.data);
|
|
2619
|
+
} catch (_) {
|
|
2620
|
+
console.error("Failed to load files", _);
|
|
2621
2621
|
} finally {
|
|
2622
|
-
|
|
2622
|
+
A(!1);
|
|
2623
2623
|
}
|
|
2624
2624
|
}
|
|
2625
|
-
},
|
|
2626
|
-
const
|
|
2627
|
-
if (
|
|
2628
|
-
|
|
2625
|
+
}, J = async (_) => {
|
|
2626
|
+
const I = _.target.files?.[0];
|
|
2627
|
+
if (I) {
|
|
2628
|
+
A(!0);
|
|
2629
2629
|
try {
|
|
2630
|
-
const Q = await
|
|
2630
|
+
const Q = await I.arrayBuffer(), le = new Uint8Array(Q), de = {
|
|
2631
2631
|
id: `local-${Date.now()}`,
|
|
2632
|
-
name:
|
|
2632
|
+
name: I.name,
|
|
2633
2633
|
type: "file",
|
|
2634
2634
|
path: "/",
|
|
2635
|
-
mimeType:
|
|
2636
|
-
size:
|
|
2635
|
+
mimeType: I.type || "application/octet-stream",
|
|
2636
|
+
size: I.size,
|
|
2637
2637
|
mountId: "local",
|
|
2638
|
-
providerKey:
|
|
2638
|
+
providerKey: I.name,
|
|
2639
2639
|
ownerId: "me"
|
|
2640
2640
|
};
|
|
2641
|
-
|
|
2641
|
+
G(de), r(de, le), g(!1);
|
|
2642
2642
|
} catch (Q) {
|
|
2643
2643
|
console.error("Local file selection failed", Q);
|
|
2644
2644
|
} finally {
|
|
2645
|
-
|
|
2645
|
+
A(!1);
|
|
2646
2646
|
}
|
|
2647
2647
|
}
|
|
2648
|
-
},
|
|
2649
|
-
const
|
|
2650
|
-
if (!(!
|
|
2651
|
-
|
|
2648
|
+
}, se = async (_) => {
|
|
2649
|
+
const I = _.target.files?.[0];
|
|
2650
|
+
if (!(!I || !x)) {
|
|
2651
|
+
A(!0);
|
|
2652
2652
|
try {
|
|
2653
|
-
const Q = await
|
|
2653
|
+
const Q = await I.arrayBuffer(), le = await v?.({
|
|
2654
2654
|
file: new Uint8Array(Q),
|
|
2655
|
-
filename:
|
|
2656
|
-
mimeType:
|
|
2655
|
+
filename: I.name,
|
|
2656
|
+
mimeType: I.type || "application/octet-stream",
|
|
2657
2657
|
mountId: x.id,
|
|
2658
|
-
path:
|
|
2658
|
+
path: E
|
|
2659
2659
|
});
|
|
2660
2660
|
if (le?.data) {
|
|
2661
2661
|
const de = le.data;
|
|
2662
|
-
|
|
2662
|
+
G(de), r(de, new Uint8Array(Q)), g(!1);
|
|
2663
2663
|
}
|
|
2664
2664
|
} catch (Q) {
|
|
2665
2665
|
console.error("Upload failed", Q);
|
|
2666
2666
|
} finally {
|
|
2667
|
-
|
|
2667
|
+
A(!1);
|
|
2668
2668
|
}
|
|
2669
2669
|
}
|
|
2670
|
-
},
|
|
2670
|
+
}, re = async () => {
|
|
2671
2671
|
if (!(!f || !x)) {
|
|
2672
|
-
|
|
2672
|
+
A(!0);
|
|
2673
2673
|
try {
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2674
|
+
const _ = `${E}${f}/`;
|
|
2675
|
+
m && (await m({
|
|
2676
2676
|
name: f,
|
|
2677
2677
|
type: "folder",
|
|
2678
|
-
path:
|
|
2678
|
+
path: E,
|
|
2679
2679
|
mimeType: "application/x-directory",
|
|
2680
2680
|
size: 0,
|
|
2681
2681
|
mountId: x.id,
|
|
2682
|
-
providerKey:
|
|
2682
|
+
providerKey: _,
|
|
2683
2683
|
ownerId: "me"
|
|
2684
|
-
}), await N()), k(!1),
|
|
2685
|
-
} catch (
|
|
2686
|
-
console.error("Failed to create folder",
|
|
2684
|
+
}), await N()), k(!1), M("");
|
|
2685
|
+
} catch (_) {
|
|
2686
|
+
console.error("Failed to create folder", _);
|
|
2687
2687
|
} finally {
|
|
2688
|
-
|
|
2688
|
+
A(!1);
|
|
2689
2689
|
}
|
|
2690
2690
|
}
|
|
2691
|
-
}, X = async (
|
|
2692
|
-
|
|
2691
|
+
}, X = async (_) => {
|
|
2692
|
+
A(!0);
|
|
2693
2693
|
try {
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2696
|
-
} catch (
|
|
2697
|
-
console.error("Failed to download file",
|
|
2694
|
+
const I = await h?.(_.id);
|
|
2695
|
+
G(_), r(_, I), g(!1);
|
|
2696
|
+
} catch (I) {
|
|
2697
|
+
console.error("Failed to download file", I);
|
|
2698
2698
|
} finally {
|
|
2699
|
-
|
|
2699
|
+
A(!1);
|
|
2700
2700
|
}
|
|
2701
|
-
},
|
|
2702
|
-
|
|
2703
|
-
},
|
|
2704
|
-
const
|
|
2701
|
+
}, P = (_) => {
|
|
2702
|
+
_.stopPropagation(), G(null), r(null);
|
|
2703
|
+
}, H = ge(() => {
|
|
2704
|
+
const _ = /* @__PURE__ */ new Set(), I = [];
|
|
2705
2705
|
return D.forEach((Q) => {
|
|
2706
2706
|
if (Q.type === "folder") {
|
|
2707
|
-
Q.path ===
|
|
2707
|
+
Q.path === E && _.add(Q.name);
|
|
2708
2708
|
return;
|
|
2709
2709
|
}
|
|
2710
|
-
const le = Q.providerKey || Q.name,
|
|
2711
|
-
|
|
2710
|
+
const le = Q.providerKey || Q.name, pe = (E ? le.substring(E.length) : le).split("/").filter((he) => he !== "");
|
|
2711
|
+
pe.length > 1 ? _.add(pe[0]) : pe.length === 1 && I.push(Q);
|
|
2712
2712
|
}), {
|
|
2713
|
-
folders: Array.from(
|
|
2714
|
-
files:
|
|
2713
|
+
folders: Array.from(_).sort(),
|
|
2714
|
+
files: I.sort((Q, le) => Q.name.localeCompare(le.name))
|
|
2715
2715
|
};
|
|
2716
|
-
}, [D,
|
|
2717
|
-
|
|
2718
|
-
},
|
|
2719
|
-
const
|
|
2720
|
-
|
|
2721
|
-
},
|
|
2722
|
-
const
|
|
2723
|
-
id: `folder-${
|
|
2724
|
-
name:
|
|
2716
|
+
}, [D, E]), T = (_) => {
|
|
2717
|
+
j((I) => `${I}${_}/`);
|
|
2718
|
+
}, S = () => {
|
|
2719
|
+
const _ = E.split("/").filter((I) => I !== "");
|
|
2720
|
+
_.pop(), _.length === 0 ? j("/") : j(`${_.join("/")}/`);
|
|
2721
|
+
}, L = ge(() => {
|
|
2722
|
+
const _ = H.folders.map((I) => ({
|
|
2723
|
+
id: `folder-${I}`,
|
|
2724
|
+
name: I,
|
|
2725
2725
|
type: "folder"
|
|
2726
2726
|
}));
|
|
2727
|
-
return
|
|
2728
|
-
|
|
2729
|
-
...
|
|
2727
|
+
return H.files.forEach((I) => {
|
|
2728
|
+
_.push({
|
|
2729
|
+
...I,
|
|
2730
2730
|
type: "file"
|
|
2731
2731
|
});
|
|
2732
|
-
}),
|
|
2733
|
-
}, [
|
|
2732
|
+
}), _;
|
|
2733
|
+
}, [H]), O = [
|
|
2734
2734
|
{
|
|
2735
2735
|
id: "name",
|
|
2736
2736
|
header: "Name",
|
|
2737
2737
|
accessor: "name",
|
|
2738
|
-
cell: (
|
|
2738
|
+
cell: (_, I) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
2739
2739
|
/* @__PURE__ */ e(
|
|
2740
2740
|
Z,
|
|
2741
2741
|
{
|
|
2742
|
-
icon:
|
|
2742
|
+
icon: I.type === "folder" ? Ve : Pe,
|
|
2743
2743
|
size: "sm",
|
|
2744
|
-
color:
|
|
2744
|
+
color: I.type === "folder" ? "warning" : "secondary"
|
|
2745
2745
|
}
|
|
2746
2746
|
),
|
|
2747
|
-
/* @__PURE__ */ e("span", { className: i(
|
|
2747
|
+
/* @__PURE__ */ e("span", { className: i(I.type === "folder" && "font-medium"), children: _ })
|
|
2748
2748
|
] })
|
|
2749
2749
|
},
|
|
2750
2750
|
{
|
|
2751
2751
|
id: "type",
|
|
2752
2752
|
header: "Type",
|
|
2753
|
-
accessor: (
|
|
2753
|
+
accessor: (_) => _.type === "folder" ? "Folder" : _.mimeType
|
|
2754
2754
|
},
|
|
2755
2755
|
{
|
|
2756
2756
|
id: "size",
|
|
2757
2757
|
header: "Size",
|
|
2758
|
-
accessor: (
|
|
2758
|
+
accessor: (_) => _.type === "file" ? `${(_.size / 1024).toFixed(1)} KB` : "-"
|
|
2759
2759
|
},
|
|
2760
2760
|
{
|
|
2761
2761
|
id: "actions",
|
|
2762
2762
|
header: "",
|
|
2763
2763
|
accessor: "id",
|
|
2764
2764
|
align: "right",
|
|
2765
|
-
cell: (
|
|
2766
|
-
|
|
2765
|
+
cell: (_, I) => /* @__PURE__ */ e(
|
|
2766
|
+
ne,
|
|
2767
2767
|
{
|
|
2768
2768
|
variant: "outline",
|
|
2769
2769
|
onClick: (Q) => {
|
|
2770
|
-
Q.stopPropagation(),
|
|
2770
|
+
Q.stopPropagation(), I.type === "folder" ? T(I.name) : X(I);
|
|
2771
2771
|
},
|
|
2772
|
-
loading:
|
|
2773
|
-
children:
|
|
2772
|
+
loading: q && I.type === "file" && K?.id === I.id,
|
|
2773
|
+
children: I.type === "folder" ? "Open" : "Select"
|
|
2774
2774
|
}
|
|
2775
2775
|
)
|
|
2776
2776
|
}
|
|
2777
|
-
],
|
|
2777
|
+
], V = [
|
|
2778
2778
|
{
|
|
2779
2779
|
id: "name",
|
|
2780
2780
|
header: "Mount Name",
|
|
2781
2781
|
accessor: "name",
|
|
2782
|
-
cell: (
|
|
2782
|
+
cell: (_) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2783
2783
|
/* @__PURE__ */ e(Z, { icon: qe, size: "sm", color: "primary" }),
|
|
2784
|
-
/* @__PURE__ */ e("span", { children:
|
|
2784
|
+
/* @__PURE__ */ e("span", { children: _ })
|
|
2785
2785
|
] })
|
|
2786
2786
|
},
|
|
2787
2787
|
{
|
|
@@ -2789,7 +2789,7 @@ const jr = ({
|
|
|
2789
2789
|
header: "",
|
|
2790
2790
|
accessor: "id",
|
|
2791
2791
|
align: "right",
|
|
2792
|
-
cell: (
|
|
2792
|
+
cell: (_, I) => /* @__PURE__ */ e(ne, { variant: "outline", onClick: () => C(I), children: "Open" })
|
|
2793
2793
|
}
|
|
2794
2794
|
];
|
|
2795
2795
|
return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
@@ -2805,14 +2805,14 @@ const jr = ({
|
|
|
2805
2805
|
l && "opacity-50 cursor-not-allowed bg-surface-sunk"
|
|
2806
2806
|
),
|
|
2807
2807
|
children: [
|
|
2808
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(Z, { icon:
|
|
2809
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2810
|
-
|
|
2808
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(Z, { icon: K ? Pe : qe, color: K ? "primary" : "secondary" }) }),
|
|
2809
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: K ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: K.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
2810
|
+
K && !l && /* @__PURE__ */ e(
|
|
2811
2811
|
"button",
|
|
2812
2812
|
{
|
|
2813
|
-
onClick:
|
|
2813
|
+
onClick: P,
|
|
2814
2814
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
2815
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
2815
|
+
children: /* @__PURE__ */ e(Z, { icon: ke, size: "xs" })
|
|
2816
2816
|
}
|
|
2817
2817
|
)
|
|
2818
2818
|
]
|
|
@@ -2824,7 +2824,7 @@ const jr = ({
|
|
|
2824
2824
|
{
|
|
2825
2825
|
open: b,
|
|
2826
2826
|
onClose: () => {
|
|
2827
|
-
g(!1),
|
|
2827
|
+
g(!1), C(null), j("/"), k(!1);
|
|
2828
2828
|
},
|
|
2829
2829
|
title: x ? `Explorer: ${x.name}` : "Select Storage Mount",
|
|
2830
2830
|
size: "lg",
|
|
@@ -2836,33 +2836,33 @@ const jr = ({
|
|
|
2836
2836
|
{
|
|
2837
2837
|
id: "remote",
|
|
2838
2838
|
label: "Platform Storage",
|
|
2839
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: x ? /* @__PURE__ */ c(
|
|
2839
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: x ? /* @__PURE__ */ c(Ce, { children: [
|
|
2840
2840
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2841
2841
|
/* @__PURE__ */ e(
|
|
2842
|
-
|
|
2842
|
+
ne,
|
|
2843
2843
|
{
|
|
2844
2844
|
variant: "ghost",
|
|
2845
2845
|
onClick: () => {
|
|
2846
|
-
|
|
2846
|
+
E && E !== "/" ? S() : C(null);
|
|
2847
2847
|
},
|
|
2848
2848
|
leftIcon: /* @__PURE__ */ e(Z, { icon: zt, size: "xs" }),
|
|
2849
|
-
children:
|
|
2849
|
+
children: E ? "Back" : "Back to Mounts"
|
|
2850
2850
|
}
|
|
2851
2851
|
),
|
|
2852
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2852
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: E }) }),
|
|
2853
2853
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2854
|
-
|
|
2854
|
+
we,
|
|
2855
2855
|
{
|
|
2856
2856
|
placeholder: "Search...",
|
|
2857
|
-
value:
|
|
2858
|
-
onChange: (
|
|
2857
|
+
value: R,
|
|
2858
|
+
onChange: (_) => ee(_.target.value),
|
|
2859
2859
|
startIcon: /* @__PURE__ */ e(Ae, { size: 14 }),
|
|
2860
2860
|
fullWidth: !0
|
|
2861
2861
|
}
|
|
2862
2862
|
) }),
|
|
2863
2863
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
2864
2864
|
/* @__PURE__ */ e(
|
|
2865
|
-
|
|
2865
|
+
ne,
|
|
2866
2866
|
{
|
|
2867
2867
|
variant: "outline",
|
|
2868
2868
|
onClick: () => k(!0),
|
|
@@ -2871,12 +2871,12 @@ const jr = ({
|
|
|
2871
2871
|
}
|
|
2872
2872
|
),
|
|
2873
2873
|
/* @__PURE__ */ e(
|
|
2874
|
-
|
|
2874
|
+
ne,
|
|
2875
2875
|
{
|
|
2876
2876
|
variant: "primary",
|
|
2877
2877
|
onClick: () => y.current?.click(),
|
|
2878
2878
|
leftIcon: /* @__PURE__ */ e(Z, { icon: Tt, size: "xs" }),
|
|
2879
|
-
loading:
|
|
2879
|
+
loading: q,
|
|
2880
2880
|
children: "Upload"
|
|
2881
2881
|
}
|
|
2882
2882
|
),
|
|
@@ -2886,7 +2886,7 @@ const jr = ({
|
|
|
2886
2886
|
type: "file",
|
|
2887
2887
|
className: "hidden",
|
|
2888
2888
|
ref: y,
|
|
2889
|
-
onChange:
|
|
2889
|
+
onChange: se,
|
|
2890
2890
|
accept: o
|
|
2891
2891
|
}
|
|
2892
2892
|
)
|
|
@@ -2895,35 +2895,35 @@ const jr = ({
|
|
|
2895
2895
|
ie && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
2896
2896
|
/* @__PURE__ */ e(Z, { icon: Ve, size: "sm", color: "warning" }),
|
|
2897
2897
|
/* @__PURE__ */ e(
|
|
2898
|
-
|
|
2898
|
+
we,
|
|
2899
2899
|
{
|
|
2900
2900
|
placeholder: "Folder name",
|
|
2901
2901
|
value: f,
|
|
2902
|
-
onChange: (
|
|
2902
|
+
onChange: (_) => M(_.target.value),
|
|
2903
2903
|
autoFocus: !0
|
|
2904
2904
|
}
|
|
2905
2905
|
),
|
|
2906
|
-
/* @__PURE__ */ e(
|
|
2907
|
-
/* @__PURE__ */ e(
|
|
2906
|
+
/* @__PURE__ */ e(ne, { onClick: re, loading: q, children: "Create" }),
|
|
2907
|
+
/* @__PURE__ */ e(ne, { variant: "ghost", onClick: () => k(!1), children: "Cancel" })
|
|
2908
2908
|
] }),
|
|
2909
2909
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2910
2910
|
Ke,
|
|
2911
2911
|
{
|
|
2912
|
-
data:
|
|
2912
|
+
data: L,
|
|
2913
2913
|
columns: O,
|
|
2914
|
-
loading:
|
|
2914
|
+
loading: q,
|
|
2915
2915
|
emptyContent: "This folder is empty",
|
|
2916
|
-
onRowClick: (
|
|
2916
|
+
onRowClick: (_) => _.type === "folder" ? T(_.name) : X(_)
|
|
2917
2917
|
}
|
|
2918
2918
|
) })
|
|
2919
2919
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2920
2920
|
Ke,
|
|
2921
2921
|
{
|
|
2922
2922
|
data: w,
|
|
2923
|
-
columns:
|
|
2924
|
-
loading:
|
|
2923
|
+
columns: V,
|
|
2924
|
+
loading: q,
|
|
2925
2925
|
emptyContent: "No storage mounts configured",
|
|
2926
|
-
onRowClick: (
|
|
2926
|
+
onRowClick: (_) => C(_)
|
|
2927
2927
|
}
|
|
2928
2928
|
) }) })
|
|
2929
2929
|
},
|
|
@@ -2939,15 +2939,15 @@ const jr = ({
|
|
|
2939
2939
|
" be uploaded to platform storage."
|
|
2940
2940
|
] }),
|
|
2941
2941
|
/* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
|
|
2942
|
-
/* @__PURE__ */ e(
|
|
2942
|
+
/* @__PURE__ */ e(ne, { variant: "primary", size: "lg", loading: q, className: "pointer-events-none", children: "Browse Local File" }),
|
|
2943
2943
|
/* @__PURE__ */ e(
|
|
2944
2944
|
"input",
|
|
2945
2945
|
{
|
|
2946
2946
|
type: "file",
|
|
2947
2947
|
className: "hidden",
|
|
2948
|
-
onChange:
|
|
2948
|
+
onChange: J,
|
|
2949
2949
|
accept: o,
|
|
2950
|
-
disabled:
|
|
2950
|
+
disabled: q
|
|
2951
2951
|
}
|
|
2952
2952
|
)
|
|
2953
2953
|
] })
|
|
@@ -2973,11 +2973,11 @@ const jr = ({
|
|
|
2973
2973
|
fullWidth: a = !1,
|
|
2974
2974
|
loading: l = !1,
|
|
2975
2975
|
containerClassName: o,
|
|
2976
|
-
labelClassName:
|
|
2976
|
+
labelClassName: u,
|
|
2977
2977
|
className: d,
|
|
2978
2978
|
id: v,
|
|
2979
2979
|
rows: h = 4,
|
|
2980
|
-
...
|
|
2980
|
+
...m
|
|
2981
2981
|
}, b) => {
|
|
2982
2982
|
const g = ce.useId(), w = v || `textarea-${g}`, p = !!n, x = n || r ? `${w}-description` : void 0;
|
|
2983
2983
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col", a && "w-full", o), children: [
|
|
@@ -2988,7 +2988,7 @@ const jr = ({
|
|
|
2988
2988
|
className: i(
|
|
2989
2989
|
rt,
|
|
2990
2990
|
p ? "text-danger-fg" : "text-text-muted",
|
|
2991
|
-
|
|
2991
|
+
u
|
|
2992
2992
|
),
|
|
2993
2993
|
children: t
|
|
2994
2994
|
}
|
|
@@ -3009,7 +3009,7 @@ const jr = ({
|
|
|
3009
3009
|
st(p),
|
|
3010
3010
|
d
|
|
3011
3011
|
),
|
|
3012
|
-
...
|
|
3012
|
+
...m
|
|
3013
3013
|
}
|
|
3014
3014
|
),
|
|
3015
3015
|
l && /* @__PURE__ */ e(
|
|
@@ -3089,8 +3089,8 @@ function Rr(t, r, n) {
|
|
|
3089
3089
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
3090
3090
|
let l = a;
|
|
3091
3091
|
for (let o = 0; o < s.length - 1; o++) {
|
|
3092
|
-
const
|
|
3093
|
-
l[
|
|
3092
|
+
const u = s[o], d = l[u];
|
|
3093
|
+
l[u] = d && typeof d == "object" ? Array.isArray(d) ? [...d] : { ...d } : {}, l = l[u];
|
|
3094
3094
|
}
|
|
3095
3095
|
return l[s[s.length - 1]] = n, a;
|
|
3096
3096
|
}
|
|
@@ -3110,7 +3110,7 @@ function qr({
|
|
|
3110
3110
|
className: n,
|
|
3111
3111
|
children: s
|
|
3112
3112
|
}) {
|
|
3113
|
-
return /* @__PURE__ */ c("div", { className: i("flex flex-col gap-4 py-6 sm:flex-row sm:gap-8", n), children: [
|
|
3113
|
+
return !t && !r ? /* @__PURE__ */ e("div", { children: s }) : /* @__PURE__ */ c("div", { className: i("flex flex-col gap-4 py-6 sm:flex-row sm:gap-8", n), children: [
|
|
3114
3114
|
/* @__PURE__ */ c("div", { className: "w-full shrink-0 sm:w-form-label", children: [
|
|
3115
3115
|
t && /* @__PURE__ */ e("span", { className: "text-base font-semibold text-text", children: t }),
|
|
3116
3116
|
r && /* @__PURE__ */ e("p", { className: "mt-1 text-sm leading-relaxed text-pretty text-text-subtle", children: r })
|
|
@@ -3126,22 +3126,22 @@ const as = ({
|
|
|
3126
3126
|
onChange: a,
|
|
3127
3127
|
transform: l,
|
|
3128
3128
|
validate: o,
|
|
3129
|
-
submitButton:
|
|
3129
|
+
submitButton: u = { label: "Submit", variant: "primary" },
|
|
3130
3130
|
cancelButton: d = { label: "Cancel", variant: "outline" },
|
|
3131
3131
|
showButtons: v = !0,
|
|
3132
3132
|
layout: h = "vertical",
|
|
3133
|
-
size:
|
|
3133
|
+
size: m = "md",
|
|
3134
3134
|
loading: b = !1,
|
|
3135
3135
|
className: g,
|
|
3136
3136
|
ref: w,
|
|
3137
3137
|
sdk: p
|
|
3138
3138
|
}) => {
|
|
3139
|
-
const [x,
|
|
3140
|
-
|
|
3141
|
-
r &&
|
|
3139
|
+
const [x, C] = F(r || {}), [E, j] = F({}), [D, U] = F({});
|
|
3140
|
+
Y(() => {
|
|
3141
|
+
r && C({ ...r });
|
|
3142
3142
|
}, [r]);
|
|
3143
|
-
const
|
|
3144
|
-
(k, f,
|
|
3143
|
+
const q = xe(
|
|
3144
|
+
(k, f, M) => {
|
|
3145
3145
|
const y = t.flatMap(($) => $.items).find(($) => $.name === k);
|
|
3146
3146
|
if (!y) return null;
|
|
3147
3147
|
if (y.required && (f == null || f === ""))
|
|
@@ -3154,48 +3154,48 @@ const as = ({
|
|
|
3154
3154
|
if (Array.isArray(f) && y.arrayFields) {
|
|
3155
3155
|
const $ = [];
|
|
3156
3156
|
let N = !1;
|
|
3157
|
-
if (f.forEach((
|
|
3158
|
-
const
|
|
3157
|
+
if (f.forEach((J, se) => {
|
|
3158
|
+
const re = {};
|
|
3159
3159
|
for (const X of y.arrayFields) {
|
|
3160
|
-
const
|
|
3161
|
-
if (X.required && (
|
|
3162
|
-
|
|
3160
|
+
const P = J?.[X.name];
|
|
3161
|
+
if (X.required && (P == null || P === ""))
|
|
3162
|
+
re[X.name] = `${X.label} is required`, N = !0;
|
|
3163
3163
|
else if (X.validator) {
|
|
3164
|
-
const
|
|
3165
|
-
|
|
3164
|
+
const H = X.validator(P, J);
|
|
3165
|
+
H && (re[X.name] = H, N = !0);
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
3168
|
-
$[
|
|
3168
|
+
$[se] = re;
|
|
3169
3169
|
}), N)
|
|
3170
3170
|
return JSON.stringify($);
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
3173
|
-
return y.validator ? y.validator(f,
|
|
3173
|
+
return y.validator ? y.validator(f, M) : null;
|
|
3174
3174
|
},
|
|
3175
3175
|
[t]
|
|
3176
|
-
),
|
|
3176
|
+
), A = xe(
|
|
3177
3177
|
(k, f) => {
|
|
3178
|
-
let
|
|
3178
|
+
let M = Rr(
|
|
3179
3179
|
x,
|
|
3180
3180
|
k,
|
|
3181
3181
|
f
|
|
3182
3182
|
);
|
|
3183
|
-
t.flatMap((N) => N.items).find((N) => N.name === k)?.removeIfEmpty && (f == null || f === "") && (
|
|
3184
|
-
const $ =
|
|
3185
|
-
|
|
3183
|
+
t.flatMap((N) => N.items).find((N) => N.name === k)?.removeIfEmpty && (f == null || f === "") && (M = Hr(M, k)), C(M), U((N) => ({ ...N, [k]: !0 }));
|
|
3184
|
+
const $ = q(k, f, M);
|
|
3185
|
+
j((N) => ({
|
|
3186
3186
|
...N,
|
|
3187
3187
|
[k]: $ || ""
|
|
3188
|
-
})), a?.(
|
|
3188
|
+
})), a?.(M, k);
|
|
3189
3189
|
},
|
|
3190
|
-
[x, t,
|
|
3191
|
-
),
|
|
3190
|
+
[x, t, q, a]
|
|
3191
|
+
), R = xe(
|
|
3192
3192
|
async (k) => {
|
|
3193
3193
|
if (k.preventDefault(), b) return;
|
|
3194
|
-
const f = {},
|
|
3195
|
-
for (const $ of
|
|
3194
|
+
const f = {}, M = t.flatMap(($) => $.items);
|
|
3195
|
+
for (const $ of M) {
|
|
3196
3196
|
if ($.hidden || $.conditional && !$.conditional(x))
|
|
3197
3197
|
continue;
|
|
3198
|
-
const N =
|
|
3198
|
+
const N = q(
|
|
3199
3199
|
$.name,
|
|
3200
3200
|
Je(x, $.name),
|
|
3201
3201
|
x
|
|
@@ -3206,15 +3206,15 @@ const as = ({
|
|
|
3206
3206
|
const $ = o(x);
|
|
3207
3207
|
$ && Object.assign(f, $);
|
|
3208
3208
|
}
|
|
3209
|
-
if (
|
|
3209
|
+
if (j(f), Object.keys(f).some(($) => f[$]))
|
|
3210
3210
|
return;
|
|
3211
3211
|
const y = l ? l(x) : x;
|
|
3212
3212
|
await n?.(x, y);
|
|
3213
3213
|
},
|
|
3214
|
-
[x, t,
|
|
3215
|
-
),
|
|
3214
|
+
[x, t, q, o, l, n, b]
|
|
3215
|
+
), ee = xe(
|
|
3216
3216
|
(k) => {
|
|
3217
|
-
const f = Je(x, k.name),
|
|
3217
|
+
const f = Je(x, k.name), M = D[k.name] ? E[k.name] : void 0, y = k.disabled || b, $ = {
|
|
3218
3218
|
value: f || "",
|
|
3219
3219
|
disabled: y,
|
|
3220
3220
|
required: k.required,
|
|
@@ -3230,14 +3230,14 @@ const as = ({
|
|
|
3230
3230
|
case "url":
|
|
3231
3231
|
case "color":
|
|
3232
3232
|
return /* @__PURE__ */ e(
|
|
3233
|
-
|
|
3233
|
+
we,
|
|
3234
3234
|
{
|
|
3235
3235
|
...$,
|
|
3236
|
-
onChange: (N) =>
|
|
3236
|
+
onChange: (N) => A(k.name, N.target.value),
|
|
3237
3237
|
type: k.textType || k.type,
|
|
3238
3238
|
...Ge(k.autocomplete),
|
|
3239
|
-
error:
|
|
3240
|
-
size:
|
|
3239
|
+
error: M,
|
|
3240
|
+
size: m
|
|
3241
3241
|
}
|
|
3242
3242
|
);
|
|
3243
3243
|
case "textarea":
|
|
@@ -3245,18 +3245,18 @@ const as = ({
|
|
|
3245
3245
|
Be,
|
|
3246
3246
|
{
|
|
3247
3247
|
...$,
|
|
3248
|
-
onChange: (N) =>
|
|
3248
|
+
onChange: (N) => A(k.name, N.target.value),
|
|
3249
3249
|
rows: k.rows ?? 4,
|
|
3250
|
-
error:
|
|
3251
|
-
size:
|
|
3250
|
+
error: M,
|
|
3251
|
+
size: m
|
|
3252
3252
|
}
|
|
3253
3253
|
);
|
|
3254
3254
|
case "select":
|
|
3255
3255
|
return /* @__PURE__ */ e(
|
|
3256
|
-
|
|
3256
|
+
_e,
|
|
3257
3257
|
{
|
|
3258
3258
|
...$,
|
|
3259
|
-
onChange: (N) =>
|
|
3259
|
+
onChange: (N) => A(k.name, N),
|
|
3260
3260
|
options: (k.options || []).map((N) => ({
|
|
3261
3261
|
...N,
|
|
3262
3262
|
value: String(N.value)
|
|
@@ -3264,8 +3264,8 @@ const as = ({
|
|
|
3264
3264
|
searchable: k.searchable,
|
|
3265
3265
|
multiple: k.multiple,
|
|
3266
3266
|
allowCreate: k.allowCreate,
|
|
3267
|
-
error:
|
|
3268
|
-
size:
|
|
3267
|
+
error: M,
|
|
3268
|
+
size: m
|
|
3269
3269
|
}
|
|
3270
3270
|
);
|
|
3271
3271
|
// A short, fixed set of mutually exclusive values — priority, a scope,
|
|
@@ -3277,12 +3277,12 @@ const as = ({
|
|
|
3277
3277
|
{
|
|
3278
3278
|
"aria-label": k.label,
|
|
3279
3279
|
value: f == null ? "" : String(f),
|
|
3280
|
-
onChange: (N) =>
|
|
3280
|
+
onChange: (N) => A(k.name, N),
|
|
3281
3281
|
options: (k.options || []).map((N) => ({
|
|
3282
3282
|
value: String(N.value),
|
|
3283
3283
|
label: N.label
|
|
3284
3284
|
})),
|
|
3285
|
-
size:
|
|
3285
|
+
size: m === "sm" ? "sm" : "md",
|
|
3286
3286
|
className: k.disabled ? "pointer-events-none opacity-50" : void 0
|
|
3287
3287
|
}
|
|
3288
3288
|
);
|
|
@@ -3293,8 +3293,8 @@ const as = ({
|
|
|
3293
3293
|
...$,
|
|
3294
3294
|
label: k.label,
|
|
3295
3295
|
checked: !!f,
|
|
3296
|
-
onChange: (N) =>
|
|
3297
|
-
size:
|
|
3296
|
+
onChange: (N) => A(k.name, N.target.checked),
|
|
3297
|
+
size: m
|
|
3298
3298
|
}
|
|
3299
3299
|
);
|
|
3300
3300
|
case "radio":
|
|
@@ -3310,7 +3310,7 @@ const as = ({
|
|
|
3310
3310
|
name: k.name,
|
|
3311
3311
|
value: N.value,
|
|
3312
3312
|
checked: f === N.value,
|
|
3313
|
-
onChange: () =>
|
|
3313
|
+
onChange: () => A(k.name, N.value),
|
|
3314
3314
|
disabled: y || N.disabled,
|
|
3315
3315
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3316
3316
|
}
|
|
@@ -3326,8 +3326,8 @@ const as = ({
|
|
|
3326
3326
|
{
|
|
3327
3327
|
...$,
|
|
3328
3328
|
value: f ? new Date(f) : null,
|
|
3329
|
-
onChange: (N) =>
|
|
3330
|
-
size:
|
|
3329
|
+
onChange: (N) => A(k.name, N),
|
|
3330
|
+
size: m
|
|
3331
3331
|
}
|
|
3332
3332
|
);
|
|
3333
3333
|
case "file":
|
|
@@ -3336,8 +3336,8 @@ const as = ({
|
|
|
3336
3336
|
{
|
|
3337
3337
|
...$,
|
|
3338
3338
|
value: f,
|
|
3339
|
-
onChange: (N) =>
|
|
3340
|
-
error:
|
|
3339
|
+
onChange: (N) => A(k.name, N),
|
|
3340
|
+
error: M,
|
|
3341
3341
|
onListFiles: (N) => p?.http.invoke({
|
|
3342
3342
|
method: "POST",
|
|
3343
3343
|
action: "storage.file.list",
|
|
@@ -3368,67 +3368,67 @@ const as = ({
|
|
|
3368
3368
|
wr,
|
|
3369
3369
|
{
|
|
3370
3370
|
value: f || {},
|
|
3371
|
-
onChange: (N) =>
|
|
3371
|
+
onChange: (N) => A(k.name, N),
|
|
3372
3372
|
onListFolders: () => p?.http.invoke({
|
|
3373
3373
|
method: "GET",
|
|
3374
3374
|
action: "storage.mount"
|
|
3375
3375
|
}),
|
|
3376
3376
|
disabled: y,
|
|
3377
|
-
size:
|
|
3377
|
+
size: m,
|
|
3378
3378
|
placeholder: k.placeholder
|
|
3379
3379
|
}
|
|
3380
3380
|
);
|
|
3381
3381
|
case "custom":
|
|
3382
3382
|
return k.customComponent?.({
|
|
3383
3383
|
value: f,
|
|
3384
|
-
onChange: (N) =>
|
|
3385
|
-
error:
|
|
3384
|
+
onChange: (N) => A(k.name, N),
|
|
3385
|
+
error: M,
|
|
3386
3386
|
disabled: y
|
|
3387
3387
|
});
|
|
3388
3388
|
case "array": {
|
|
3389
3389
|
const N = f || [];
|
|
3390
|
-
let
|
|
3391
|
-
if (typeof
|
|
3390
|
+
let J = [];
|
|
3391
|
+
if (typeof M == "string" && M.startsWith("["))
|
|
3392
3392
|
try {
|
|
3393
|
-
|
|
3393
|
+
J = JSON.parse(M);
|
|
3394
3394
|
} catch {
|
|
3395
3395
|
}
|
|
3396
|
-
const
|
|
3397
|
-
|
|
3398
|
-
},
|
|
3399
|
-
|
|
3396
|
+
const se = () => {
|
|
3397
|
+
A(k.name, [...N, {}]);
|
|
3398
|
+
}, re = (P) => {
|
|
3399
|
+
A(
|
|
3400
3400
|
k.name,
|
|
3401
|
-
N.filter((
|
|
3401
|
+
N.filter((H, T) => T !== P)
|
|
3402
3402
|
);
|
|
3403
|
-
}, X = (
|
|
3404
|
-
const
|
|
3405
|
-
|
|
3406
|
-
...
|
|
3407
|
-
[
|
|
3408
|
-
},
|
|
3403
|
+
}, X = (P, H, T) => {
|
|
3404
|
+
const S = [...N];
|
|
3405
|
+
S[P] = {
|
|
3406
|
+
...S[P],
|
|
3407
|
+
[H]: T
|
|
3408
|
+
}, A(k.name, S);
|
|
3409
3409
|
};
|
|
3410
3410
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
3411
|
-
N.map((
|
|
3412
|
-
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: k.arrayFields?.map((
|
|
3413
|
-
const
|
|
3411
|
+
N.map((P, H) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
3412
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: k.arrayFields?.map((T) => {
|
|
3413
|
+
const S = J?.[H]?.[T.name];
|
|
3414
3414
|
return /* @__PURE__ */ c(
|
|
3415
3415
|
"div",
|
|
3416
3416
|
{
|
|
3417
3417
|
className: "flex flex-col gap-1",
|
|
3418
3418
|
children: [
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3419
|
+
H === 0 && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3420
|
+
T.label,
|
|
3421
|
+
T.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3422
3422
|
] }),
|
|
3423
3423
|
(() => {
|
|
3424
|
-
const
|
|
3425
|
-
value:
|
|
3424
|
+
const L = {
|
|
3425
|
+
value: P?.[T.name] || "",
|
|
3426
3426
|
disabled: y,
|
|
3427
|
-
required:
|
|
3428
|
-
placeholder:
|
|
3429
|
-
...
|
|
3427
|
+
required: T.required,
|
|
3428
|
+
placeholder: T.placeholder,
|
|
3429
|
+
...T.fieldProps
|
|
3430
3430
|
};
|
|
3431
|
-
switch (
|
|
3431
|
+
switch (T.type) {
|
|
3432
3432
|
case "text":
|
|
3433
3433
|
case "email":
|
|
3434
3434
|
case "password":
|
|
@@ -3436,74 +3436,74 @@ const as = ({
|
|
|
3436
3436
|
case "tel":
|
|
3437
3437
|
case "url":
|
|
3438
3438
|
return /* @__PURE__ */ e(
|
|
3439
|
-
|
|
3439
|
+
we,
|
|
3440
3440
|
{
|
|
3441
|
-
...
|
|
3441
|
+
...L,
|
|
3442
3442
|
onChange: (O) => X(
|
|
3443
|
-
|
|
3444
|
-
|
|
3443
|
+
H,
|
|
3444
|
+
T.name,
|
|
3445
3445
|
O.target.value
|
|
3446
3446
|
),
|
|
3447
|
-
type:
|
|
3448
|
-
...Ge(
|
|
3449
|
-
error:
|
|
3450
|
-
size:
|
|
3447
|
+
type: T.textType || T.type,
|
|
3448
|
+
...Ge(T.autocomplete),
|
|
3449
|
+
error: S,
|
|
3450
|
+
size: m
|
|
3451
3451
|
}
|
|
3452
3452
|
);
|
|
3453
3453
|
case "textarea":
|
|
3454
3454
|
return /* @__PURE__ */ e(
|
|
3455
3455
|
Be,
|
|
3456
3456
|
{
|
|
3457
|
-
...
|
|
3457
|
+
...L,
|
|
3458
3458
|
onChange: (O) => X(
|
|
3459
|
-
|
|
3460
|
-
|
|
3459
|
+
H,
|
|
3460
|
+
T.name,
|
|
3461
3461
|
O.target.value
|
|
3462
3462
|
),
|
|
3463
|
-
rows:
|
|
3464
|
-
error:
|
|
3465
|
-
size:
|
|
3463
|
+
rows: T.rows ?? 4,
|
|
3464
|
+
error: S,
|
|
3465
|
+
size: m
|
|
3466
3466
|
}
|
|
3467
3467
|
);
|
|
3468
3468
|
case "select":
|
|
3469
3469
|
return /* @__PURE__ */ e(
|
|
3470
|
-
|
|
3470
|
+
_e,
|
|
3471
3471
|
{
|
|
3472
|
-
...
|
|
3472
|
+
...L,
|
|
3473
3473
|
onChange: (O) => X(
|
|
3474
|
-
|
|
3475
|
-
|
|
3474
|
+
H,
|
|
3475
|
+
T.name,
|
|
3476
3476
|
O
|
|
3477
3477
|
),
|
|
3478
|
-
options: (
|
|
3478
|
+
options: (T.options || []).map(
|
|
3479
3479
|
(O) => ({
|
|
3480
3480
|
...O,
|
|
3481
3481
|
value: String(O.value)
|
|
3482
3482
|
})
|
|
3483
3483
|
),
|
|
3484
|
-
searchable:
|
|
3485
|
-
multiple:
|
|
3486
|
-
allowCreate:
|
|
3487
|
-
error:
|
|
3488
|
-
size:
|
|
3484
|
+
searchable: T.searchable,
|
|
3485
|
+
multiple: T.multiple,
|
|
3486
|
+
allowCreate: T.allowCreate,
|
|
3487
|
+
error: S,
|
|
3488
|
+
size: m
|
|
3489
3489
|
}
|
|
3490
3490
|
);
|
|
3491
3491
|
case "checkbox":
|
|
3492
3492
|
return /* @__PURE__ */ e(
|
|
3493
3493
|
ye,
|
|
3494
3494
|
{
|
|
3495
|
-
...
|
|
3496
|
-
checked: !!
|
|
3495
|
+
...L,
|
|
3496
|
+
checked: !!P?.[T.name],
|
|
3497
3497
|
onChange: (O) => X(
|
|
3498
|
-
|
|
3499
|
-
|
|
3498
|
+
H,
|
|
3499
|
+
T.name,
|
|
3500
3500
|
O.target.checked
|
|
3501
3501
|
),
|
|
3502
|
-
size:
|
|
3502
|
+
size: m
|
|
3503
3503
|
}
|
|
3504
3504
|
);
|
|
3505
3505
|
case "radio":
|
|
3506
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
3506
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: T.options?.map((O) => /* @__PURE__ */ c(
|
|
3507
3507
|
"label",
|
|
3508
3508
|
{
|
|
3509
3509
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3512,12 +3512,12 @@ const as = ({
|
|
|
3512
3512
|
"input",
|
|
3513
3513
|
{
|
|
3514
3514
|
type: "radio",
|
|
3515
|
-
name: `${k.name}.${
|
|
3515
|
+
name: `${k.name}.${H}.${T.name}`,
|
|
3516
3516
|
value: O.value,
|
|
3517
|
-
checked:
|
|
3517
|
+
checked: P?.[T.name] === O.value,
|
|
3518
3518
|
onChange: () => X(
|
|
3519
|
-
|
|
3520
|
-
|
|
3519
|
+
H,
|
|
3520
|
+
T.name,
|
|
3521
3521
|
O.value
|
|
3522
3522
|
),
|
|
3523
3523
|
disabled: y || O.disabled,
|
|
@@ -3530,30 +3530,30 @@ const as = ({
|
|
|
3530
3530
|
O.value
|
|
3531
3531
|
)) });
|
|
3532
3532
|
case "date": {
|
|
3533
|
-
const O =
|
|
3533
|
+
const O = P?.[T.name];
|
|
3534
3534
|
return /* @__PURE__ */ e(
|
|
3535
3535
|
Fe,
|
|
3536
3536
|
{
|
|
3537
|
-
...
|
|
3537
|
+
...L,
|
|
3538
3538
|
value: O ? new Date(O) : null,
|
|
3539
|
-
onChange: (
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3539
|
+
onChange: (V) => X(
|
|
3540
|
+
H,
|
|
3541
|
+
T.name,
|
|
3542
|
+
V
|
|
3543
3543
|
),
|
|
3544
|
-
size:
|
|
3544
|
+
size: m
|
|
3545
3545
|
}
|
|
3546
3546
|
);
|
|
3547
3547
|
}
|
|
3548
3548
|
case "custom":
|
|
3549
|
-
return
|
|
3550
|
-
value:
|
|
3549
|
+
return T.customComponent?.({
|
|
3550
|
+
value: P?.[T.name],
|
|
3551
3551
|
onChange: (O) => X(
|
|
3552
|
-
|
|
3553
|
-
|
|
3552
|
+
H,
|
|
3553
|
+
T.name,
|
|
3554
3554
|
O
|
|
3555
3555
|
),
|
|
3556
|
-
error:
|
|
3556
|
+
error: S,
|
|
3557
3557
|
disabled: y
|
|
3558
3558
|
});
|
|
3559
3559
|
// Add other field types here as needed
|
|
@@ -3561,38 +3561,38 @@ const as = ({
|
|
|
3561
3561
|
return /* @__PURE__ */ c("p", { children: [
|
|
3562
3562
|
"Unsupported field type in array:",
|
|
3563
3563
|
" ",
|
|
3564
|
-
|
|
3564
|
+
T.type
|
|
3565
3565
|
] });
|
|
3566
3566
|
}
|
|
3567
3567
|
})(),
|
|
3568
|
-
|
|
3568
|
+
S && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: S })
|
|
3569
3569
|
]
|
|
3570
3570
|
},
|
|
3571
|
-
|
|
3571
|
+
T.name
|
|
3572
3572
|
);
|
|
3573
3573
|
}) }),
|
|
3574
3574
|
/* @__PURE__ */ e(
|
|
3575
|
-
|
|
3575
|
+
ne,
|
|
3576
3576
|
{
|
|
3577
3577
|
type: "button",
|
|
3578
3578
|
iconOnly: !0,
|
|
3579
3579
|
variant: "ghost",
|
|
3580
3580
|
size: "md",
|
|
3581
3581
|
"aria-label": `${k.label} verwijderen`,
|
|
3582
|
-
onClick: () =>
|
|
3582
|
+
onClick: () => re(H),
|
|
3583
3583
|
disabled: y,
|
|
3584
|
-
className: i("shrink-0",
|
|
3584
|
+
className: i("shrink-0", H === 0 && "mt-5"),
|
|
3585
3585
|
children: /* @__PURE__ */ e(_t, { className: "size-icon-md" })
|
|
3586
3586
|
}
|
|
3587
3587
|
)
|
|
3588
|
-
] },
|
|
3588
|
+
] }, H)),
|
|
3589
3589
|
/* @__PURE__ */ c(
|
|
3590
|
-
|
|
3590
|
+
ne,
|
|
3591
3591
|
{
|
|
3592
3592
|
type: "button",
|
|
3593
3593
|
variant: "secondary",
|
|
3594
3594
|
leftIcon: /* @__PURE__ */ e($t, { className: "size-icon-sm" }),
|
|
3595
|
-
onClick:
|
|
3595
|
+
onClick: se,
|
|
3596
3596
|
disabled: y,
|
|
3597
3597
|
children: [
|
|
3598
3598
|
k.label,
|
|
@@ -3606,14 +3606,14 @@ const as = ({
|
|
|
3606
3606
|
return null;
|
|
3607
3607
|
}
|
|
3608
3608
|
},
|
|
3609
|
-
[x, D,
|
|
3610
|
-
),
|
|
3609
|
+
[x, D, E, b, m, A]
|
|
3610
|
+
), K = xe(
|
|
3611
3611
|
(k) => {
|
|
3612
3612
|
if (k.conditional && !k.conditional(x))
|
|
3613
3613
|
return null;
|
|
3614
3614
|
const f = k.items.filter((y) => !(y.hidden || y.conditional && !y.conditional(x)));
|
|
3615
3615
|
if (f.length === 0) return null;
|
|
3616
|
-
const
|
|
3616
|
+
const M = i(
|
|
3617
3617
|
k.layout === "flex" ? "flex flex-wrap gap-3.5" : "grid gap-3.5",
|
|
3618
3618
|
k.layout !== "flex" && {
|
|
3619
3619
|
"grid-cols-1": !k.columns || k.columns === 1,
|
|
@@ -3633,8 +3633,8 @@ const as = ({
|
|
|
3633
3633
|
title: k.title,
|
|
3634
3634
|
description: k.description,
|
|
3635
3635
|
className: "not-last:border-b not-last:border-border-subtle",
|
|
3636
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className:
|
|
3637
|
-
const $ = D[y.name] ?
|
|
3636
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: M, children: f.map((y) => {
|
|
3637
|
+
const $ = D[y.name] ? E[y.name] : void 0;
|
|
3638
3638
|
return /* @__PURE__ */ c(
|
|
3639
3639
|
"div",
|
|
3640
3640
|
{
|
|
@@ -3651,7 +3651,7 @@ const as = ({
|
|
|
3651
3651
|
y.label,
|
|
3652
3652
|
y.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3653
3653
|
] }),
|
|
3654
|
-
|
|
3654
|
+
ee(y),
|
|
3655
3655
|
y.help && !$ && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: y.help })
|
|
3656
3656
|
]
|
|
3657
3657
|
},
|
|
@@ -3663,23 +3663,23 @@ const as = ({
|
|
|
3663
3663
|
)
|
|
3664
3664
|
);
|
|
3665
3665
|
},
|
|
3666
|
-
[x, D,
|
|
3667
|
-
),
|
|
3666
|
+
[x, D, E, ee]
|
|
3667
|
+
), G = i(
|
|
3668
3668
|
{
|
|
3669
|
-
"max-w-settings":
|
|
3670
|
-
"max-w-form":
|
|
3671
|
-
"max-w-6xl":
|
|
3672
|
-
"max-w-full":
|
|
3669
|
+
"max-w-settings": m === "sm",
|
|
3670
|
+
"max-w-form": m === "md",
|
|
3671
|
+
"max-w-6xl": m === "lg",
|
|
3672
|
+
"max-w-full": m === "full"
|
|
3673
3673
|
},
|
|
3674
3674
|
g
|
|
3675
|
-
), ie =
|
|
3676
|
-
return /* @__PURE__ */ c("form", { ref: w, onSubmit:
|
|
3675
|
+
), ie = m === "full" ? "md" : m;
|
|
3676
|
+
return /* @__PURE__ */ c("form", { ref: w, onSubmit: R, className: G, children: [
|
|
3677
3677
|
!v && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3678
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(
|
|
3679
|
-
v && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle py-4", children: /* @__PURE__ */ c(
|
|
3678
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(K) }),
|
|
3679
|
+
v && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle py-4", children: /* @__PURE__ */ c(Ce, { children: [
|
|
3680
3680
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
3681
3681
|
s && /* @__PURE__ */ e(
|
|
3682
|
-
|
|
3682
|
+
ne,
|
|
3683
3683
|
{
|
|
3684
3684
|
type: "button",
|
|
3685
3685
|
variant: d.variant ?? "ghost",
|
|
@@ -3691,15 +3691,15 @@ const as = ({
|
|
|
3691
3691
|
}
|
|
3692
3692
|
),
|
|
3693
3693
|
/* @__PURE__ */ e(
|
|
3694
|
-
|
|
3694
|
+
ne,
|
|
3695
3695
|
{
|
|
3696
3696
|
type: "submit",
|
|
3697
|
-
variant:
|
|
3698
|
-
size:
|
|
3699
|
-
disabled:
|
|
3697
|
+
variant: u.variant,
|
|
3698
|
+
size: u.size || ie,
|
|
3699
|
+
disabled: u.disabled || b,
|
|
3700
3700
|
loading: b,
|
|
3701
|
-
className:
|
|
3702
|
-
children:
|
|
3701
|
+
className: u.className,
|
|
3702
|
+
children: u.label
|
|
3703
3703
|
}
|
|
3704
3704
|
)
|
|
3705
3705
|
] }) })
|
|
@@ -3713,7 +3713,7 @@ function ls({
|
|
|
3713
3713
|
cancelLabel: a = "Annuleren",
|
|
3714
3714
|
tone: l = "default",
|
|
3715
3715
|
loading: o = !1,
|
|
3716
|
-
onConfirm:
|
|
3716
|
+
onConfirm: u,
|
|
3717
3717
|
onCancel: d
|
|
3718
3718
|
}) {
|
|
3719
3719
|
return /* @__PURE__ */ e(
|
|
@@ -3724,12 +3724,12 @@ function ls({
|
|
|
3724
3724
|
title: r,
|
|
3725
3725
|
size: "sm",
|
|
3726
3726
|
footer: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3727
|
-
/* @__PURE__ */ e(
|
|
3727
|
+
/* @__PURE__ */ e(ne, { variant: "ghost", onClick: d, disabled: o, children: a }),
|
|
3728
3728
|
/* @__PURE__ */ e(
|
|
3729
|
-
|
|
3729
|
+
ne,
|
|
3730
3730
|
{
|
|
3731
3731
|
variant: l === "danger" ? "destructive" : "primary",
|
|
3732
|
-
onClick:
|
|
3732
|
+
onClick: u,
|
|
3733
3733
|
loading: o,
|
|
3734
3734
|
children: s
|
|
3735
3735
|
}
|
|
@@ -3771,7 +3771,7 @@ function Kr({
|
|
|
3771
3771
|
dismissible: a = !1,
|
|
3772
3772
|
onDismiss: l,
|
|
3773
3773
|
className: o,
|
|
3774
|
-
children:
|
|
3774
|
+
children: u,
|
|
3775
3775
|
...d
|
|
3776
3776
|
}) {
|
|
3777
3777
|
return /* @__PURE__ */ c(
|
|
@@ -3797,15 +3797,15 @@ function Kr({
|
|
|
3797
3797
|
)
|
|
3798
3798
|
}
|
|
3799
3799
|
),
|
|
3800
|
-
s && /* @__PURE__ */ e("span", { className: i("flex-shrink-0",
|
|
3801
|
-
|
|
3800
|
+
s && /* @__PURE__ */ e("span", { className: i("flex-shrink-0", u && "mr-1"), children: s }),
|
|
3801
|
+
u,
|
|
3802
3802
|
a && l && /* @__PURE__ */ e(
|
|
3803
3803
|
"button",
|
|
3804
3804
|
{
|
|
3805
3805
|
onClick: l,
|
|
3806
3806
|
className: "ml-1.5 flex-shrink-0 hover:opacity-70 transition-opacity",
|
|
3807
3807
|
"aria-label": "Remove badge",
|
|
3808
|
-
children: /* @__PURE__ */ e(Z, { icon:
|
|
3808
|
+
children: /* @__PURE__ */ e(Z, { icon: ke, size: "xs", color: "current" })
|
|
3809
3809
|
}
|
|
3810
3810
|
)
|
|
3811
3811
|
]
|
|
@@ -3893,10 +3893,10 @@ function Re({
|
|
|
3893
3893
|
children: a,
|
|
3894
3894
|
className: l,
|
|
3895
3895
|
showTableSkeleton: o = !1,
|
|
3896
|
-
tableColumns:
|
|
3896
|
+
tableColumns: u,
|
|
3897
3897
|
tableRows: d
|
|
3898
3898
|
}) {
|
|
3899
|
-
const v = r ?? (o ? "table" : "text"), h = n ?? d ?? Jr[v],
|
|
3899
|
+
const v = r ?? (o ? "table" : "text"), h = n ?? d ?? Jr[v], m = s ?? u ?? (v === "cards" ? 3 : 6), b = /* @__PURE__ */ e("div", { className: i("w-full animate-pulse", l), "aria-hidden": !0, children: a ?? /* @__PURE__ */ e(Gr, { shape: v, rows: h, columns: m }) });
|
|
3900
3900
|
return t === "inline" ? b : /* @__PURE__ */ e("main", { className: "flex-1 bg-surface p-6", children: b });
|
|
3901
3901
|
}
|
|
3902
3902
|
const Yr = {
|
|
@@ -3911,7 +3911,7 @@ function os({
|
|
|
3911
3911
|
actions: a,
|
|
3912
3912
|
card: l = !1,
|
|
3913
3913
|
className: o,
|
|
3914
|
-
...
|
|
3914
|
+
...u
|
|
3915
3915
|
}) {
|
|
3916
3916
|
return /* @__PURE__ */ c(
|
|
3917
3917
|
"div",
|
|
@@ -3921,7 +3921,7 @@ function os({
|
|
|
3921
3921
|
l && "rounded-lg border border-border bg-surface px-11 py-9 shadow-overlay",
|
|
3922
3922
|
o
|
|
3923
3923
|
),
|
|
3924
|
-
...
|
|
3924
|
+
...u,
|
|
3925
3925
|
children: [
|
|
3926
3926
|
t != null && /* @__PURE__ */ e("span", { className: i("flex size-disc items-center justify-center rounded-full text-2xl", Yr[r]), children: t }),
|
|
3927
3927
|
/* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
|
|
@@ -4103,7 +4103,7 @@ function ms({
|
|
|
4103
4103
|
className: a
|
|
4104
4104
|
}) {
|
|
4105
4105
|
const l = t.indexOf(r), o = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
4106
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...o, className: i("flex items-center gap-1.5", a), children: t.map((
|
|
4106
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...o, className: i("flex items-center gap-1.5", a), children: t.map((u, d) => /* @__PURE__ */ e(
|
|
4107
4107
|
"span",
|
|
4108
4108
|
{
|
|
4109
4109
|
className: i(
|
|
@@ -4113,8 +4113,8 @@ function ms({
|
|
|
4113
4113
|
d > l && "bg-border"
|
|
4114
4114
|
)
|
|
4115
4115
|
},
|
|
4116
|
-
|
|
4117
|
-
)) }) : /* @__PURE__ */ e("div", { ...o, className: i("flex items-center gap-2", a), children: t.map((
|
|
4116
|
+
u
|
|
4117
|
+
)) }) : /* @__PURE__ */ e("div", { ...o, className: i("flex items-center gap-2", a), children: t.map((u, d) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
4118
4118
|
/* @__PURE__ */ e(
|
|
4119
4119
|
"span",
|
|
4120
4120
|
{
|
|
@@ -4129,7 +4129,7 @@ function ms({
|
|
|
4129
4129
|
}
|
|
4130
4130
|
),
|
|
4131
4131
|
d < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
4132
|
-
] },
|
|
4132
|
+
] }, u)) });
|
|
4133
4133
|
}
|
|
4134
4134
|
const nn = /<[a-z][\s\S]*>/i, sn = [
|
|
4135
4135
|
"[&_p]:my-1.5 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_p]:leading-relaxed",
|
|
@@ -4169,7 +4169,7 @@ const nn = /<[a-z][\s\S]*>/i, sn = [
|
|
|
4169
4169
|
th: (t) => /* @__PURE__ */ e("th", { className: "border border-border px-2 py-1 text-left font-semibold", ...t }),
|
|
4170
4170
|
td: (t) => /* @__PURE__ */ e("td", { className: "border border-border px-2 py-1", ...t })
|
|
4171
4171
|
};
|
|
4172
|
-
function
|
|
4172
|
+
function ze({ text: t, className: r, as: n }) {
|
|
4173
4173
|
const s = t ?? "";
|
|
4174
4174
|
return (n ? n === "html" : nn.test(s)) ? /* @__PURE__ */ e(
|
|
4175
4175
|
"div",
|
|
@@ -4200,9 +4200,9 @@ function dn({ block: t }) {
|
|
|
4200
4200
|
case "heading":
|
|
4201
4201
|
return t.level === 1 ? /* @__PURE__ */ e("h1", { className: "text-2xl font-semibold tracking-tight text-text", children: t.text }) : t.level === 2 ? /* @__PURE__ */ e("h2", { className: "pt-2 text-base font-semibold tracking-tight text-text", children: t.text }) : /* @__PURE__ */ e("h3", { className: "pt-1 text-sm font-semibold text-text", children: t.text });
|
|
4202
4202
|
case "paragraph":
|
|
4203
|
-
return /* @__PURE__ */ e(
|
|
4203
|
+
return /* @__PURE__ */ e(ze, { as: "markdown", text: t.text, className: "text-sm text-text" });
|
|
4204
4204
|
case "quote":
|
|
4205
|
-
return /* @__PURE__ */ e("blockquote", { className: "border-l-2 border-border pl-3.5", children: /* @__PURE__ */ e(
|
|
4205
|
+
return /* @__PURE__ */ e("blockquote", { className: "border-l-2 border-border pl-3.5", children: /* @__PURE__ */ e(ze, { as: "markdown", text: t.text, className: "text-sm text-text-muted" }) });
|
|
4206
4206
|
case "code":
|
|
4207
4207
|
return /* @__PURE__ */ e("pre", { className: "overflow-x-auto rounded-lg bg-surface-sunk p-3 text-xs", children: /* @__PURE__ */ e("code", { className: "font-mono", children: t.text }) });
|
|
4208
4208
|
case "divider":
|
|
@@ -4221,7 +4221,7 @@ function dn({ block: t }) {
|
|
|
4221
4221
|
n.lead,
|
|
4222
4222
|
" "
|
|
4223
4223
|
] }),
|
|
4224
|
-
/* @__PURE__ */ e(
|
|
4224
|
+
/* @__PURE__ */ e(ze, { as: "markdown", text: n.text, className: "inline" })
|
|
4225
4225
|
] }, s))
|
|
4226
4226
|
}
|
|
4227
4227
|
);
|
|
@@ -4271,7 +4271,7 @@ function dn({ block: t }) {
|
|
|
4271
4271
|
case "callout":
|
|
4272
4272
|
return /* @__PURE__ */ c("div", { className: i("rounded-lg border px-4 py-3", on[t.tone]), children: [
|
|
4273
4273
|
t.title && /* @__PURE__ */ e("div", { className: "pb-0.5 text-sm font-semibold text-text", children: t.title }),
|
|
4274
|
-
/* @__PURE__ */ e(
|
|
4274
|
+
/* @__PURE__ */ e(ze, { as: "markdown", text: t.text, className: "text-sm text-text" })
|
|
4275
4275
|
] });
|
|
4276
4276
|
default:
|
|
4277
4277
|
return null;
|
|
@@ -4325,7 +4325,7 @@ function fn(t) {
|
|
|
4325
4325
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
4326
4326
|
}
|
|
4327
4327
|
const hn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a, title: l }) => {
|
|
4328
|
-
const [o,
|
|
4328
|
+
const [o, u] = ce.useState(!1), d = i(
|
|
4329
4329
|
// Its own token and not `surface-hover`: at 0.972 the plate was within a few
|
|
4330
4330
|
// percent of every surface it sits on, so the monogram floated instead of
|
|
4331
4331
|
// sitting in a disc.
|
|
@@ -4343,14 +4343,14 @@ const hn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4343
4343
|
alt: t ?? "",
|
|
4344
4344
|
title: l ?? t,
|
|
4345
4345
|
className: i(d, "object-cover"),
|
|
4346
|
-
onError: () =>
|
|
4346
|
+
onError: () => u(!0)
|
|
4347
4347
|
}
|
|
4348
4348
|
) : /* @__PURE__ */ e("span", { className: d, title: l ?? t, "aria-label": t, children: fn(t) });
|
|
4349
4349
|
}, Ye = "ring-surface", xn = "ring-surface-accent", xs = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
|
|
4350
4350
|
if (t.length === 0) return null;
|
|
4351
4351
|
const a = t.slice(0, r), l = t.length - a.length;
|
|
4352
4352
|
return /* @__PURE__ */ c("span", { className: i("inline-flex items-center", s), children: [
|
|
4353
|
-
a.map((o,
|
|
4353
|
+
a.map((o, u) => /* @__PURE__ */ e(
|
|
4354
4354
|
hn,
|
|
4355
4355
|
{
|
|
4356
4356
|
name: o.name,
|
|
@@ -4358,12 +4358,12 @@ const hn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4358
4358
|
size: n,
|
|
4359
4359
|
title: o.name ? o.seen === !1 ? `${o.name} — nog niet gelezen` : o.name : void 0,
|
|
4360
4360
|
className: i(
|
|
4361
|
-
|
|
4361
|
+
u > 0 && "-ml-2",
|
|
4362
4362
|
o.owner ? xn : Ye,
|
|
4363
4363
|
o.seen === !1 && "opacity-40"
|
|
4364
4364
|
)
|
|
4365
4365
|
},
|
|
4366
|
-
o.id ?? `${o.name}-${
|
|
4366
|
+
o.id ?? `${o.name}-${u}`
|
|
4367
4367
|
)),
|
|
4368
4368
|
l > 0 && /* @__PURE__ */ c(
|
|
4369
4369
|
"span",
|
|
@@ -4382,7 +4382,7 @@ const hn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4382
4382
|
}
|
|
4383
4383
|
)
|
|
4384
4384
|
] });
|
|
4385
|
-
},
|
|
4385
|
+
}, Me = {
|
|
4386
4386
|
mail: { fg: "text-channel-mail-fg", bg: "bg-channel-mail-soft" },
|
|
4387
4387
|
wa: { fg: "text-channel-whatsapp-fg", bg: "bg-channel-whatsapp-soft" },
|
|
4388
4388
|
chat: { fg: "text-channel-chat-fg", bg: "bg-channel-chat-soft" },
|
|
@@ -4394,7 +4394,7 @@ const hn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4394
4394
|
lg: "size-avatar-lg rounded-md text-base"
|
|
4395
4395
|
};
|
|
4396
4396
|
function bs({ channel: t, children: r, size: n = "md", className: s, title: a }) {
|
|
4397
|
-
const l = t in
|
|
4397
|
+
const l = t in Me ? Me[t] : void 0;
|
|
4398
4398
|
return /* @__PURE__ */ e(
|
|
4399
4399
|
"span",
|
|
4400
4400
|
{
|
|
@@ -4405,7 +4405,7 @@ function bs({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
4405
4405
|
// An undeclared channel used to collapse onto the neutral "note" tone,
|
|
4406
4406
|
// which is also what a real internal note looks like. Deriving from the
|
|
4407
4407
|
// key keeps it distinguishable and keeps `note` meaning `note`.
|
|
4408
|
-
l ? i(l.fg, l.bg) : t ? Qe(t) : i(
|
|
4408
|
+
l ? i(l.fg, l.bg) : t ? Qe(t) : i(Me.note.fg, Me.note.bg),
|
|
4409
4409
|
s
|
|
4410
4410
|
),
|
|
4411
4411
|
children: r
|
|
@@ -4420,23 +4420,23 @@ const gs = ({
|
|
|
4420
4420
|
radius: a = "md",
|
|
4421
4421
|
showLoading: l = !0,
|
|
4422
4422
|
showError: o = !0,
|
|
4423
|
-
fallback:
|
|
4423
|
+
fallback: u,
|
|
4424
4424
|
loadingContent: d,
|
|
4425
4425
|
errorContent: v,
|
|
4426
4426
|
className: h,
|
|
4427
|
-
onLoad:
|
|
4427
|
+
onLoad: m,
|
|
4428
4428
|
onError: b,
|
|
4429
4429
|
...g
|
|
4430
4430
|
}) => {
|
|
4431
|
-
const [w, p] =
|
|
4432
|
-
p(!1),
|
|
4433
|
-
},
|
|
4434
|
-
if (p(!1),
|
|
4435
|
-
|
|
4431
|
+
const [w, p] = F(!0), [x, C] = F(!1), [E, j] = F(t), D = (G) => {
|
|
4432
|
+
p(!1), C(!1), m?.(G);
|
|
4433
|
+
}, U = (G) => {
|
|
4434
|
+
if (p(!1), C(!0), u && E !== u) {
|
|
4435
|
+
j(u), C(!1), p(!0);
|
|
4436
4436
|
return;
|
|
4437
4437
|
}
|
|
4438
|
-
b?.(
|
|
4439
|
-
},
|
|
4438
|
+
b?.(G);
|
|
4439
|
+
}, q = i(
|
|
4440
4440
|
"relative overflow-hidden bg-surface-hover",
|
|
4441
4441
|
// Size variants
|
|
4442
4442
|
{
|
|
@@ -4464,33 +4464,33 @@ const gs = ({
|
|
|
4464
4464
|
"rounded-full": a === "full"
|
|
4465
4465
|
},
|
|
4466
4466
|
h
|
|
4467
|
-
),
|
|
4467
|
+
), A = i(
|
|
4468
4468
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
4469
4469
|
{
|
|
4470
4470
|
"opacity-0": w || x,
|
|
4471
4471
|
"opacity-100": !w && !x
|
|
4472
4472
|
}
|
|
4473
|
-
),
|
|
4473
|
+
), R = i(
|
|
4474
4474
|
"absolute inset-0 flex items-center justify-center",
|
|
4475
4475
|
"text-text-muted"
|
|
4476
|
-
),
|
|
4476
|
+
), ee = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), K = /* @__PURE__ */ c("div", { className: "text-center", children: [
|
|
4477
4477
|
/* @__PURE__ */ e(Z, { icon: At, size: "lg", className: "mx-auto mb-1" }),
|
|
4478
4478
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
4479
4479
|
] });
|
|
4480
|
-
return /* @__PURE__ */ c("div", { className:
|
|
4480
|
+
return /* @__PURE__ */ c("div", { className: q, children: [
|
|
4481
4481
|
/* @__PURE__ */ e(
|
|
4482
4482
|
"img",
|
|
4483
4483
|
{
|
|
4484
4484
|
...g,
|
|
4485
|
-
src:
|
|
4485
|
+
src: E,
|
|
4486
4486
|
alt: r,
|
|
4487
|
-
className:
|
|
4487
|
+
className: A,
|
|
4488
4488
|
onLoad: D,
|
|
4489
|
-
onError:
|
|
4489
|
+
onError: U
|
|
4490
4490
|
}
|
|
4491
4491
|
),
|
|
4492
|
-
w && l && /* @__PURE__ */ e("div", { className:
|
|
4493
|
-
x && o && /* @__PURE__ */ e("div", { className:
|
|
4492
|
+
w && l && /* @__PURE__ */ e("div", { className: R, children: d || ee }),
|
|
4493
|
+
x && o && /* @__PURE__ */ e("div", { className: R, children: v || K })
|
|
4494
4494
|
] });
|
|
4495
4495
|
};
|
|
4496
4496
|
function ps({
|
|
@@ -4524,47 +4524,47 @@ function vs({
|
|
|
4524
4524
|
renderItem: a,
|
|
4525
4525
|
trailing: l,
|
|
4526
4526
|
onSelect: o,
|
|
4527
|
-
onActiveIndexChange:
|
|
4527
|
+
onActiveIndexChange: u,
|
|
4528
4528
|
isActive: d,
|
|
4529
4529
|
unread: v,
|
|
4530
4530
|
dimmed: h,
|
|
4531
|
-
groupBy:
|
|
4531
|
+
groupBy: m,
|
|
4532
4532
|
groups: b,
|
|
4533
4533
|
renderGroupHeader: g,
|
|
4534
4534
|
stickyGroupHeaders: w = !1,
|
|
4535
4535
|
collapsibleGroups: p = !1,
|
|
4536
4536
|
hideGroupCount: x = !1,
|
|
4537
|
-
selectable:
|
|
4538
|
-
selectedItems:
|
|
4539
|
-
onSelectionChange:
|
|
4537
|
+
selectable: C = !1,
|
|
4538
|
+
selectedItems: E = [],
|
|
4539
|
+
onSelectionChange: j,
|
|
4540
4540
|
bulkActions: D,
|
|
4541
|
-
header:
|
|
4542
|
-
stickyHeader:
|
|
4543
|
-
bordered:
|
|
4544
|
-
emptyContent:
|
|
4545
|
-
loading:
|
|
4546
|
-
loadingRows:
|
|
4547
|
-
className:
|
|
4541
|
+
header: U,
|
|
4542
|
+
stickyHeader: q = !1,
|
|
4543
|
+
bordered: A = !1,
|
|
4544
|
+
emptyContent: R,
|
|
4545
|
+
loading: ee = !1,
|
|
4546
|
+
loadingRows: K = 4,
|
|
4547
|
+
className: G,
|
|
4548
4548
|
"aria-label": ie
|
|
4549
4549
|
}) {
|
|
4550
4550
|
const [k, f] = ce.useState(
|
|
4551
4551
|
() => Object.fromEntries(
|
|
4552
|
-
(b ?? []).filter((
|
|
4552
|
+
(b ?? []).filter((S) => S.defaultCollapsed).map((S) => [S.id, !0])
|
|
4553
4553
|
)
|
|
4554
|
-
),
|
|
4555
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
4554
|
+
), M = ce.useRef(null), y = (S) => {
|
|
4555
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(S.key)) return;
|
|
4556
4556
|
const O = Array.from(
|
|
4557
|
-
|
|
4557
|
+
M.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
4558
4558
|
);
|
|
4559
4559
|
if (O.length === 0) return;
|
|
4560
|
-
|
|
4561
|
-
const
|
|
4562
|
-
O[
|
|
4563
|
-
}, $ = (
|
|
4564
|
-
|
|
4565
|
-
|
|
4560
|
+
S.preventDefault();
|
|
4561
|
+
const V = O.indexOf(document.activeElement), _ = S.key === "Home" ? 0 : S.key === "End" ? O.length - 1 : S.key === "ArrowDown" ? (V + 1) % O.length : (V - 1 + O.length) % O.length;
|
|
4562
|
+
O[_]?.focus();
|
|
4563
|
+
}, $ = (S, L) => r ? r(S, L) : L, N = (S) => E.includes(S), J = (S, L) => {
|
|
4564
|
+
j && j(
|
|
4565
|
+
L ? [...E, S] : E.filter((O) => O !== S)
|
|
4566
4566
|
);
|
|
4567
|
-
},
|
|
4567
|
+
}, se = (S) => j?.(S ? [...t] : []), re = i(
|
|
4568
4568
|
"flex flex-col",
|
|
4569
4569
|
// With a selection open the list has a dock at its foot. Sticky can only
|
|
4570
4570
|
// park at the bottom of its own box, so on a list shorter than the window
|
|
@@ -4572,17 +4572,17 @@ function vs({
|
|
|
4572
4572
|
// screen. Growing the box to the height of its parent puts it where it
|
|
4573
4573
|
// belongs — and only while a selection exists, so an ordinary short list
|
|
4574
4574
|
// keeps its natural height.
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4575
|
+
C && E.length > 0 && "min-h-full",
|
|
4576
|
+
A && "overflow-hidden rounded-lg border border-border-subtle",
|
|
4577
|
+
G
|
|
4578
4578
|
);
|
|
4579
|
-
if (
|
|
4580
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4579
|
+
if (ee)
|
|
4580
|
+
return /* @__PURE__ */ e("div", { className: re, children: Array.from({ length: K }).map((S, L) => /* @__PURE__ */ c(
|
|
4581
4581
|
"div",
|
|
4582
4582
|
{
|
|
4583
4583
|
className: i(
|
|
4584
4584
|
"flex animate-pulse items-center gap-3 px-4 py-2",
|
|
4585
|
-
n === "divided" &&
|
|
4585
|
+
n === "divided" && L > 0 && "border-t border-border-subtle"
|
|
4586
4586
|
),
|
|
4587
4587
|
children: [
|
|
4588
4588
|
/* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
|
|
@@ -4591,12 +4591,12 @@ function vs({
|
|
|
4591
4591
|
/* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
|
|
4592
4592
|
]
|
|
4593
4593
|
},
|
|
4594
|
-
`skeleton-${
|
|
4594
|
+
`skeleton-${L}`
|
|
4595
4595
|
)) });
|
|
4596
|
-
if (t.length === 0 &&
|
|
4597
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4598
|
-
const X = t.length > 0 &&
|
|
4599
|
-
const
|
|
4596
|
+
if (t.length === 0 && R)
|
|
4597
|
+
return /* @__PURE__ */ e("div", { className: re, children: R });
|
|
4598
|
+
const X = t.length > 0 && E.length === t.length, P = E.length > 0 && !X, H = (S, L, O) => {
|
|
4599
|
+
const V = d?.(S, L) ?? !1, _ = v?.(S, L) ?? !1, I = h?.(S, L) ?? !1, Q = C && N(S);
|
|
4600
4600
|
return /* @__PURE__ */ c(
|
|
4601
4601
|
"li",
|
|
4602
4602
|
{
|
|
@@ -4604,11 +4604,11 @@ function vs({
|
|
|
4604
4604
|
role: "button",
|
|
4605
4605
|
tabIndex: 0,
|
|
4606
4606
|
"data-list-row": "",
|
|
4607
|
-
"aria-current":
|
|
4608
|
-
onClick: () => o(
|
|
4609
|
-
onFocus: () =>
|
|
4607
|
+
"aria-current": V || void 0,
|
|
4608
|
+
onClick: () => o(S, L),
|
|
4609
|
+
onFocus: () => u?.(L),
|
|
4610
4610
|
onKeyDown: (le) => {
|
|
4611
|
-
le.key !== "Enter" && le.key !== " " || (le.preventDefault(), o(
|
|
4611
|
+
le.key !== "Enter" && le.key !== " " || (le.preventDefault(), o(S, L));
|
|
4612
4612
|
}
|
|
4613
4613
|
} : {},
|
|
4614
4614
|
className: i(
|
|
@@ -4620,18 +4620,18 @@ function vs({
|
|
|
4620
4620
|
// An unread row is tinted, not bolded: at five columns a bold row
|
|
4621
4621
|
// shouts across all of them, while the tint marks the row and leaves
|
|
4622
4622
|
// the consumer free to weight only the sender and the subject.
|
|
4623
|
-
|
|
4623
|
+
V || Q ? "bg-accent-soft text-text" : _ ? i("bg-surface-unread", o && "hover:bg-surface-unread-hover") : o && "hover:bg-surface-hover",
|
|
4624
4624
|
// Read rows stay at full opacity — fading them also fades the avatars
|
|
4625
4625
|
// and team dots, which is exactly the identity you scan by. They read
|
|
4626
4626
|
// as secondary through weight and text colour instead.
|
|
4627
|
-
|
|
4627
|
+
I && "text-text-muted"
|
|
4628
4628
|
),
|
|
4629
4629
|
children: [
|
|
4630
|
-
|
|
4630
|
+
C && /* @__PURE__ */ e("span", { onClick: (le) => le.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4631
4631
|
ye,
|
|
4632
4632
|
{
|
|
4633
|
-
checked: N(
|
|
4634
|
-
onChange: (le) =>
|
|
4633
|
+
checked: N(S),
|
|
4634
|
+
onChange: (le) => J(S, le.target.checked),
|
|
4635
4635
|
"aria-label": "Rij selecteren"
|
|
4636
4636
|
}
|
|
4637
4637
|
) }),
|
|
@@ -4642,43 +4642,43 @@ function vs({
|
|
|
4642
4642
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
4643
4643
|
}
|
|
4644
4644
|
),
|
|
4645
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(
|
|
4646
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(
|
|
4647
|
-
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(
|
|
4645
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(S, L) }),
|
|
4646
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(S, L) : String(S) }),
|
|
4647
|
+
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(S, L) })
|
|
4648
4648
|
]
|
|
4649
4649
|
},
|
|
4650
|
-
$(
|
|
4650
|
+
$(S, L)
|
|
4651
4651
|
);
|
|
4652
|
-
},
|
|
4653
|
-
if (!
|
|
4654
|
-
return t.map((
|
|
4655
|
-
const
|
|
4656
|
-
t.forEach((
|
|
4657
|
-
const
|
|
4658
|
-
|
|
4652
|
+
}, T = (() => {
|
|
4653
|
+
if (!m)
|
|
4654
|
+
return t.map((V, _) => H(V, _, _ === 0));
|
|
4655
|
+
const S = /* @__PURE__ */ new Map();
|
|
4656
|
+
t.forEach((V, _) => {
|
|
4657
|
+
const I = m(V, _);
|
|
4658
|
+
S.has(I) || S.set(I, []), S.get(I).push({ item: V, index: _ });
|
|
4659
4659
|
});
|
|
4660
|
-
const
|
|
4660
|
+
const L = b ?? [];
|
|
4661
4661
|
return [
|
|
4662
|
-
...
|
|
4663
|
-
...[...
|
|
4664
|
-
].flatMap((
|
|
4665
|
-
const
|
|
4662
|
+
...L.filter((V) => S.has(V.id)),
|
|
4663
|
+
...[...S.keys()].filter((V) => !L.some((_) => _.id === V)).map((V) => ({ id: V }))
|
|
4664
|
+
].flatMap((V, _) => {
|
|
4665
|
+
const I = S.get(V.id) ?? [], Q = p && k[V.id], le = V.title ?? V.id, de = V.count ?? I.length, pe = /* @__PURE__ */ e(
|
|
4666
4666
|
"li",
|
|
4667
4667
|
{
|
|
4668
|
-
onClick: p ? () => f((he) => ({ ...he, [
|
|
4668
|
+
onClick: p ? () => f((he) => ({ ...he, [V.id]: !he[V.id] })) : void 0,
|
|
4669
4669
|
className: i(
|
|
4670
4670
|
// A caption over its rows, not a band across the table: same
|
|
4671
4671
|
// surface as the rows, no rules, and the count as a quiet pill.
|
|
4672
4672
|
// The old grey uppercase strip read as a second column header.
|
|
4673
4673
|
"flex items-center gap-2.5 bg-surface px-5 pb-1.5 text-base font-semibold",
|
|
4674
|
-
|
|
4675
|
-
|
|
4674
|
+
_ > 0 ? "pt-5" : "pt-3",
|
|
4675
|
+
V.tone === "danger" ? "text-danger-fg" : V.tone === "muted" ? "text-text-subtle" : "text-text",
|
|
4676
4676
|
w && "sticky z-10",
|
|
4677
4677
|
p && "cursor-pointer select-none"
|
|
4678
4678
|
),
|
|
4679
4679
|
"aria-expanded": p ? !Q : void 0,
|
|
4680
|
-
style: w ? { top:
|
|
4681
|
-
children: g ? g(
|
|
4680
|
+
style: w ? { top: q ? 28 : 0 } : void 0,
|
|
4681
|
+
children: g ? g(V, I.map((he) => he.item)) : /* @__PURE__ */ c(Ce, { children: [
|
|
4682
4682
|
p && /* @__PURE__ */ e(
|
|
4683
4683
|
De,
|
|
4684
4684
|
{
|
|
@@ -4695,25 +4695,25 @@ function vs({
|
|
|
4695
4695
|
{
|
|
4696
4696
|
className: i(
|
|
4697
4697
|
"rounded-full px-2 text-xs font-normal tabular-nums",
|
|
4698
|
-
|
|
4698
|
+
V.tone === "danger" ? "bg-danger-soft text-danger-fg" : "bg-surface-sunk text-text-subtle"
|
|
4699
4699
|
),
|
|
4700
4700
|
children: de
|
|
4701
4701
|
}
|
|
4702
4702
|
)
|
|
4703
4703
|
] })
|
|
4704
4704
|
},
|
|
4705
|
-
`group-${
|
|
4705
|
+
`group-${V.id}`
|
|
4706
4706
|
);
|
|
4707
|
-
return Q ? [
|
|
4708
|
-
|
|
4709
|
-
...
|
|
4710
|
-
({ item: he, index: Ie },
|
|
4707
|
+
return Q ? [pe] : [
|
|
4708
|
+
pe,
|
|
4709
|
+
...I.map(
|
|
4710
|
+
({ item: he, index: Ie }, z) => H(he, Ie, z === 0)
|
|
4711
4711
|
)
|
|
4712
4712
|
];
|
|
4713
4713
|
});
|
|
4714
4714
|
})();
|
|
4715
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
4716
|
-
|
|
4715
|
+
return /* @__PURE__ */ c("div", { ref: M, className: re, onKeyDown: o ? y : void 0, children: [
|
|
4716
|
+
U && /* @__PURE__ */ c(
|
|
4717
4717
|
"div",
|
|
4718
4718
|
{
|
|
4719
4719
|
className: i(
|
|
@@ -4721,26 +4721,26 @@ function vs({
|
|
|
4721
4721
|
// sticky group headers park against.
|
|
4722
4722
|
"flex h-row-sm items-end gap-3 border-b border-border bg-surface px-5 pb-2",
|
|
4723
4723
|
"text-xs font-semibold uppercase tracking-wider text-text-disabled",
|
|
4724
|
-
|
|
4724
|
+
q && "sticky top-0 z-20"
|
|
4725
4725
|
),
|
|
4726
4726
|
children: [
|
|
4727
|
-
|
|
4727
|
+
C && /* @__PURE__ */ e("span", { className: "flex items-center", children: /* @__PURE__ */ e(
|
|
4728
4728
|
ye,
|
|
4729
4729
|
{
|
|
4730
4730
|
checked: X,
|
|
4731
|
-
indeterminate:
|
|
4732
|
-
onChange: (
|
|
4731
|
+
indeterminate: P,
|
|
4732
|
+
onChange: (S) => se(S.target.checked),
|
|
4733
4733
|
"aria-label": "Alles selecteren"
|
|
4734
4734
|
}
|
|
4735
4735
|
) }),
|
|
4736
|
-
|
|
4736
|
+
U
|
|
4737
4737
|
]
|
|
4738
4738
|
}
|
|
4739
4739
|
),
|
|
4740
|
-
/* @__PURE__ */ e("ul", { "aria-label": ie, className: "flex flex-col", children:
|
|
4741
|
-
|
|
4740
|
+
/* @__PURE__ */ e("ul", { "aria-label": ie, className: "flex flex-col", children: T }),
|
|
4741
|
+
C && E.length > 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none sticky bottom-0 z-10 flex justify-center px-5 pb-4", children: /* @__PURE__ */ c("div", { className: "pointer-events-auto flex items-center gap-1.5 rounded-lg bg-accent py-1.5 pl-3.5 pr-1.5 text-accent-fg shadow-overlay", children: [
|
|
4742
4742
|
/* @__PURE__ */ c("span", { className: "text-sm font-medium", children: [
|
|
4743
|
-
|
|
4743
|
+
E.length,
|
|
4744
4744
|
" geselecteerd"
|
|
4745
4745
|
] }),
|
|
4746
4746
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "mx-1.5 h-4 w-px bg-current opacity-25" }),
|
|
@@ -4750,10 +4750,10 @@ function vs({
|
|
|
4750
4750
|
"button",
|
|
4751
4751
|
{
|
|
4752
4752
|
type: "button",
|
|
4753
|
-
onClick: () =>
|
|
4753
|
+
onClick: () => j?.([]),
|
|
4754
4754
|
"aria-label": "Selectie wissen",
|
|
4755
4755
|
className: "grid size-tile-md shrink-0 cursor-pointer place-items-center rounded-md transition-colors duration-fast ease-out hover:bg-white/15 focus-visible:outline-none focus-visible:focus-ring",
|
|
4756
|
-
children: /* @__PURE__ */ e(
|
|
4756
|
+
children: /* @__PURE__ */ e(ke, { className: "size-icon-lg" })
|
|
4757
4757
|
}
|
|
4758
4758
|
)
|
|
4759
4759
|
] }) })
|
|
@@ -4815,23 +4815,23 @@ const pn = ({
|
|
|
4815
4815
|
actions: a = [],
|
|
4816
4816
|
children: l,
|
|
4817
4817
|
className: o,
|
|
4818
|
-
backLabel:
|
|
4818
|
+
backLabel: u = "Back",
|
|
4819
4819
|
backClassName: d,
|
|
4820
4820
|
onBack: v,
|
|
4821
4821
|
editable: h = !1,
|
|
4822
|
-
onTitleChange:
|
|
4822
|
+
onTitleChange: m
|
|
4823
4823
|
}) => {
|
|
4824
|
-
const [b, g] =
|
|
4825
|
-
|
|
4824
|
+
const [b, g] = F(!1), [w, p] = F(r), x = te(null);
|
|
4825
|
+
Y(() => {
|
|
4826
4826
|
p(r);
|
|
4827
|
-
}, [r]),
|
|
4827
|
+
}, [r]), Y(() => {
|
|
4828
4828
|
b && x.current && (x.current.focus(), x.current.select());
|
|
4829
4829
|
}, [b]);
|
|
4830
|
-
const
|
|
4830
|
+
const C = () => {
|
|
4831
4831
|
h && g(!0);
|
|
4832
|
-
},
|
|
4833
|
-
g(!1), w.trim() !== "" && w !== r &&
|
|
4834
|
-
},
|
|
4832
|
+
}, E = () => {
|
|
4833
|
+
g(!1), w.trim() !== "" && w !== r && m ? m(w.trim()) : p(r);
|
|
4834
|
+
}, j = (D) => {
|
|
4835
4835
|
D.key === "Enter" ? x.current?.blur() : D.key === "Escape" && (p(r), g(!1));
|
|
4836
4836
|
};
|
|
4837
4837
|
return /* @__PURE__ */ c(
|
|
@@ -4851,7 +4851,7 @@ const pn = ({
|
|
|
4851
4851
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
4852
4852
|
v && // Ghost: a framed box around a back chevron makes the way out of a
|
|
4853
4853
|
// page look like the page's primary control.
|
|
4854
|
-
/* @__PURE__ */ e(
|
|
4854
|
+
/* @__PURE__ */ e(ne, { variant: "ghost", onClick: v, leftIcon: /* @__PURE__ */ e(Z, { icon: Se, size: "md" }), iconOnly: !0 }),
|
|
4855
4855
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
4856
4856
|
b ? /* @__PURE__ */ e(
|
|
4857
4857
|
"input",
|
|
@@ -4860,15 +4860,15 @@ const pn = ({
|
|
|
4860
4860
|
type: "text",
|
|
4861
4861
|
value: w,
|
|
4862
4862
|
onChange: (D) => p(D.target.value),
|
|
4863
|
-
onBlur:
|
|
4864
|
-
onKeyDown:
|
|
4863
|
+
onBlur: E,
|
|
4864
|
+
onKeyDown: j,
|
|
4865
4865
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
|
|
4866
4866
|
}
|
|
4867
4867
|
) : /* @__PURE__ */ c("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
4868
4868
|
/* @__PURE__ */ e(
|
|
4869
4869
|
"h2",
|
|
4870
4870
|
{
|
|
4871
|
-
onClick:
|
|
4871
|
+
onClick: C,
|
|
4872
4872
|
className: i(
|
|
4873
4873
|
"text-lg font-semibold tracking-title truncate",
|
|
4874
4874
|
h && "cursor-pointer"
|
|
@@ -4882,7 +4882,7 @@ const pn = ({
|
|
|
4882
4882
|
Lt,
|
|
4883
4883
|
{
|
|
4884
4884
|
size: 15,
|
|
4885
|
-
onClick:
|
|
4885
|
+
onClick: C,
|
|
4886
4886
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4887
4887
|
}
|
|
4888
4888
|
)
|
|
@@ -4916,11 +4916,11 @@ const pn = ({
|
|
|
4916
4916
|
},
|
|
4917
4917
|
D.id
|
|
4918
4918
|
) : /* @__PURE__ */ e(
|
|
4919
|
-
|
|
4919
|
+
ne,
|
|
4920
4920
|
{
|
|
4921
4921
|
variant: D.variant ?? "secondary",
|
|
4922
|
-
onClick: (
|
|
4923
|
-
|
|
4922
|
+
onClick: (U) => {
|
|
4923
|
+
U.stopPropagation(), U.target.blur(), D.onClick();
|
|
4924
4924
|
},
|
|
4925
4925
|
disabled: D.disabled,
|
|
4926
4926
|
leftIcon: D.icon,
|
|
@@ -4946,18 +4946,18 @@ const pn = ({
|
|
|
4946
4946
|
onBack: a,
|
|
4947
4947
|
editable: l,
|
|
4948
4948
|
onTitleChange: o,
|
|
4949
|
-
surface:
|
|
4949
|
+
surface: u = !1,
|
|
4950
4950
|
headerContent: d,
|
|
4951
4951
|
loading: v = !1,
|
|
4952
4952
|
loadingShape: h = "table",
|
|
4953
|
-
empty:
|
|
4953
|
+
empty: m,
|
|
4954
4954
|
padding: b = "md",
|
|
4955
4955
|
scroll: g = !0,
|
|
4956
4956
|
className: w,
|
|
4957
4957
|
contentClassName: p,
|
|
4958
4958
|
children: x
|
|
4959
4959
|
}) => {
|
|
4960
|
-
const
|
|
4960
|
+
const C = v ? /* @__PURE__ */ e(Re, { variant: "inline", shape: h }) : m ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12", children: m }) : x;
|
|
4961
4961
|
return /* @__PURE__ */ c(
|
|
4962
4962
|
"div",
|
|
4963
4963
|
{
|
|
@@ -4973,7 +4973,7 @@ const pn = ({
|
|
|
4973
4973
|
/* @__PURE__ */ e(
|
|
4974
4974
|
pn,
|
|
4975
4975
|
{
|
|
4976
|
-
surface:
|
|
4976
|
+
surface: u,
|
|
4977
4977
|
title: t,
|
|
4978
4978
|
subtitle: r,
|
|
4979
4979
|
meta: n,
|
|
@@ -4993,7 +4993,7 @@ const pn = ({
|
|
|
4993
4993
|
vn[b],
|
|
4994
4994
|
p
|
|
4995
4995
|
),
|
|
4996
|
-
children:
|
|
4996
|
+
children: C
|
|
4997
4997
|
}
|
|
4998
4998
|
)
|
|
4999
4999
|
]
|
|
@@ -5018,7 +5018,7 @@ function yn() {
|
|
|
5018
5018
|
return ht(ot);
|
|
5019
5019
|
}
|
|
5020
5020
|
function Es() {
|
|
5021
|
-
const [t, r] =
|
|
5021
|
+
const [t, r] = F(null), n = ge(
|
|
5022
5022
|
() => ({
|
|
5023
5023
|
setTrail: (s, a) => r((l) => a ? { ownerId: s, entry: a } : l && l.ownerId !== s ? l : null)
|
|
5024
5024
|
}),
|
|
@@ -5036,26 +5036,47 @@ const Nn = {
|
|
|
5036
5036
|
children: t,
|
|
5037
5037
|
actions: r = [],
|
|
5038
5038
|
secondaryActions: n = [],
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5039
|
+
actionsPlacement: s = "header",
|
|
5040
|
+
onBack: a,
|
|
5041
|
+
backLabel: l = "Back",
|
|
5042
|
+
title: o,
|
|
5043
|
+
loading: u = !1,
|
|
5044
|
+
loadingShape: d = "form",
|
|
5045
|
+
padding: v = "md",
|
|
5046
|
+
className: h,
|
|
5047
|
+
contentClassName: m
|
|
5047
5048
|
}) => {
|
|
5048
|
-
const
|
|
5049
|
-
|
|
5050
|
-
const
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5049
|
+
const b = yn(), g = ft(), w = te(a);
|
|
5050
|
+
w.current = a;
|
|
5051
|
+
const p = !!a, x = te(r);
|
|
5052
|
+
x.current = r;
|
|
5053
|
+
const C = te(n);
|
|
5054
|
+
C.current = n;
|
|
5055
|
+
const E = s === "header", j = E && (r.length > 0 || n.length > 0), D = j ? JSON.stringify(
|
|
5056
|
+
[...n, ...r].map((A) => [A.id, A.label, A.variant, A.disabled])
|
|
5057
|
+
) : "", U = ge(() => {
|
|
5058
|
+
if (!j) return;
|
|
5059
|
+
const A = (R) => (ee, K) => ({
|
|
5060
|
+
...ee,
|
|
5061
|
+
onClick: () => {
|
|
5062
|
+
(R === "primary" ? x.current : C.current)[K]?.onClick();
|
|
5063
|
+
}
|
|
5064
|
+
});
|
|
5065
|
+
return {
|
|
5066
|
+
actions: x.current.map(A("primary")),
|
|
5067
|
+
secondaryActions: C.current.map(A("secondary"))
|
|
5068
|
+
};
|
|
5069
|
+
}, [j, D]);
|
|
5070
|
+
Y(() => {
|
|
5071
|
+
if (b && !(!p && !o && !U))
|
|
5072
|
+
return b.setTrail(g, {
|
|
5073
|
+
title: o,
|
|
5074
|
+
onBack: p ? () => w.current?.() : void 0,
|
|
5075
|
+
actions: U?.actions,
|
|
5076
|
+
secondaryActions: U?.secondaryActions
|
|
5077
|
+
}), () => b.setTrail(g, null);
|
|
5078
|
+
}, [b, g, o, p, U]);
|
|
5079
|
+
const q = !E && (r.length > 0 || n.length > 0);
|
|
5059
5080
|
return (
|
|
5060
5081
|
/**
|
|
5061
5082
|
* `min-h-full` + a sticky footer, rather than a nested scroll container.
|
|
@@ -5063,24 +5084,28 @@ const Nn = {
|
|
|
5063
5084
|
* panel that has not been migrated yet. This way a short page still drops
|
|
5064
5085
|
* its footer to the bottom, and a long one keeps it pinned while scrolling.
|
|
5065
5086
|
*/
|
|
5066
|
-
/* @__PURE__ */ c("div", { className: i("flex min-h-full flex-col",
|
|
5067
|
-
!
|
|
5068
|
-
|
|
5069
|
-
|
|
5087
|
+
/* @__PURE__ */ c("div", { className: i("flex min-h-full flex-col", h), children: [
|
|
5088
|
+
!b && (p || o || j) && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-2 px-5 pt-4", children: [
|
|
5089
|
+
p && /* @__PURE__ */ e(
|
|
5090
|
+
ne,
|
|
5070
5091
|
{
|
|
5071
5092
|
variant: "ghost",
|
|
5072
|
-
onClick: () =>
|
|
5073
|
-
"aria-label":
|
|
5074
|
-
leftIcon: /* @__PURE__ */ e(Z, { icon:
|
|
5093
|
+
onClick: () => w.current?.(),
|
|
5094
|
+
"aria-label": l,
|
|
5095
|
+
leftIcon: /* @__PURE__ */ e(Z, { icon: Se, size: "sm" }),
|
|
5075
5096
|
iconOnly: !0
|
|
5076
5097
|
}
|
|
5077
5098
|
),
|
|
5078
|
-
|
|
5099
|
+
o && /* @__PURE__ */ e("h2", { className: "min-w-0 truncate text-md font-semibold tracking-title text-text", children: o }),
|
|
5100
|
+
E && /* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
5101
|
+
n.length > 0 && /* @__PURE__ */ e(Ne, { actions: n, defaultVariant: "ghost" }),
|
|
5102
|
+
r.length > 0 && /* @__PURE__ */ e(Ne, { actions: r })
|
|
5103
|
+
] })
|
|
5079
5104
|
] }),
|
|
5080
|
-
/* @__PURE__ */ e("div", { className: i("flex-1", Nn[
|
|
5081
|
-
|
|
5082
|
-
n.length > 0 && /* @__PURE__ */ e(
|
|
5083
|
-
r.length > 0 && /* @__PURE__ */ e(
|
|
5105
|
+
/* @__PURE__ */ e("div", { className: i("flex-1", Nn[v], m), children: u ? /* @__PURE__ */ e(Re, { variant: "inline", shape: d }) : t }),
|
|
5106
|
+
q && /* @__PURE__ */ c("div", { className: "sticky bottom-0 z-10 flex shrink-0 items-center gap-2 border-t border-border bg-surface px-5 py-3", children: [
|
|
5107
|
+
n.length > 0 && /* @__PURE__ */ e(Ne, { actions: n, defaultVariant: "ghost" }),
|
|
5108
|
+
r.length > 0 && /* @__PURE__ */ e(Ne, { actions: r, className: "ml-auto" })
|
|
5084
5109
|
] })
|
|
5085
5110
|
] })
|
|
5086
5111
|
);
|
|
@@ -5151,16 +5176,16 @@ function _s({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
5151
5176
|
);
|
|
5152
5177
|
}
|
|
5153
5178
|
function wn(t) {
|
|
5154
|
-
const { id: r, header: n, accessor: s, label: a, tone: l, visible: o, width:
|
|
5179
|
+
const { id: r, header: n, accessor: s, label: a, tone: l, visible: o, width: u, sortable: d, align: v } = t;
|
|
5155
5180
|
return {
|
|
5156
5181
|
id: r,
|
|
5157
5182
|
header: n,
|
|
5158
5183
|
accessor: (h) => a(s(h), h),
|
|
5159
|
-
cell: (h,
|
|
5160
|
-
const b = s(
|
|
5161
|
-
return o && !o(b,
|
|
5184
|
+
cell: (h, m) => {
|
|
5185
|
+
const b = s(m);
|
|
5186
|
+
return o && !o(b, m) ? null : /* @__PURE__ */ e(Kr, { variant: l ? l(b, m) : "default", size: "sm", children: a(b, m) });
|
|
5162
5187
|
},
|
|
5163
|
-
width:
|
|
5188
|
+
width: u,
|
|
5164
5189
|
sortable: d,
|
|
5165
5190
|
align: v
|
|
5166
5191
|
};
|
|
@@ -5173,7 +5198,7 @@ function $s(t) {
|
|
|
5173
5198
|
onLabel: a,
|
|
5174
5199
|
offLabel: l,
|
|
5175
5200
|
onTone: o = "success",
|
|
5176
|
-
offTone:
|
|
5201
|
+
offTone: u = "secondary",
|
|
5177
5202
|
width: d,
|
|
5178
5203
|
sortable: v
|
|
5179
5204
|
} = t;
|
|
@@ -5182,7 +5207,7 @@ function $s(t) {
|
|
|
5182
5207
|
header: n,
|
|
5183
5208
|
accessor: (h) => !!s(h),
|
|
5184
5209
|
label: (h) => h ? a : l,
|
|
5185
|
-
tone: (h) => h ? o :
|
|
5210
|
+
tone: (h) => h ? o : u,
|
|
5186
5211
|
width: d,
|
|
5187
5212
|
sortable: v
|
|
5188
5213
|
});
|
|
@@ -5195,7 +5220,7 @@ function Ds(t) {
|
|
|
5195
5220
|
label: a,
|
|
5196
5221
|
empty: l = "—",
|
|
5197
5222
|
separator: o = ", ",
|
|
5198
|
-
width:
|
|
5223
|
+
width: u,
|
|
5199
5224
|
searchable: d,
|
|
5200
5225
|
sortable: v
|
|
5201
5226
|
} = t;
|
|
@@ -5203,10 +5228,10 @@ function Ds(t) {
|
|
|
5203
5228
|
id: r,
|
|
5204
5229
|
header: n,
|
|
5205
5230
|
accessor: (h) => {
|
|
5206
|
-
const
|
|
5231
|
+
const m = s(h), g = (m == null ? [] : Array.isArray(m) ? m : [m]).filter(Boolean).map((w) => a(w) ?? w);
|
|
5207
5232
|
return g.length ? g.join(o) : l;
|
|
5208
5233
|
},
|
|
5209
|
-
width:
|
|
5234
|
+
width: u,
|
|
5210
5235
|
searchable: d,
|
|
5211
5236
|
sortable: v
|
|
5212
5237
|
};
|
|
@@ -5234,15 +5259,15 @@ const As = ({
|
|
|
5234
5259
|
} catch {
|
|
5235
5260
|
return String(h);
|
|
5236
5261
|
}
|
|
5237
|
-
}, l = (h) => h ? "Ja" : "Nee", o = (h,
|
|
5238
|
-
if (!
|
|
5239
|
-
const b =
|
|
5262
|
+
}, l = (h) => h ? "Ja" : "Nee", o = (h, m) => {
|
|
5263
|
+
if (!m) return String(h || "-");
|
|
5264
|
+
const b = m.find((g) => g.value === h);
|
|
5240
5265
|
return b ? b.label : String(h || "-");
|
|
5241
|
-
},
|
|
5266
|
+
}, u = xe(
|
|
5242
5267
|
(h) => {
|
|
5243
|
-
const
|
|
5268
|
+
const m = kn(r, h.name);
|
|
5244
5269
|
if (h.type === "array") {
|
|
5245
|
-
const g =
|
|
5270
|
+
const g = m;
|
|
5246
5271
|
return !g || g.length === 0 ? /* @__PURE__ */ e(
|
|
5247
5272
|
me,
|
|
5248
5273
|
{
|
|
@@ -5271,8 +5296,8 @@ const As = ({
|
|
|
5271
5296
|
}
|
|
5272
5297
|
) }),
|
|
5273
5298
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((x) => {
|
|
5274
|
-
const
|
|
5275
|
-
let
|
|
5299
|
+
const C = w?.[x.name];
|
|
5300
|
+
let E = "-";
|
|
5276
5301
|
switch (x.type) {
|
|
5277
5302
|
case "text":
|
|
5278
5303
|
case "email":
|
|
@@ -5280,30 +5305,30 @@ const As = ({
|
|
|
5280
5305
|
case "tel":
|
|
5281
5306
|
case "url":
|
|
5282
5307
|
case "textarea":
|
|
5283
|
-
|
|
5308
|
+
E = C || "-";
|
|
5284
5309
|
break;
|
|
5285
5310
|
case "select":
|
|
5286
5311
|
case "radio":
|
|
5287
|
-
|
|
5288
|
-
|
|
5312
|
+
E = o(
|
|
5313
|
+
C,
|
|
5289
5314
|
x.options
|
|
5290
5315
|
);
|
|
5291
5316
|
break;
|
|
5292
5317
|
case "checkbox":
|
|
5293
|
-
|
|
5318
|
+
E = l(C);
|
|
5294
5319
|
break;
|
|
5295
5320
|
case "date":
|
|
5296
|
-
|
|
5321
|
+
E = a(C);
|
|
5297
5322
|
break;
|
|
5298
5323
|
case "custom":
|
|
5299
|
-
|
|
5300
|
-
value:
|
|
5324
|
+
E = x.customComponent?.({
|
|
5325
|
+
value: C
|
|
5301
5326
|
});
|
|
5302
5327
|
break;
|
|
5303
5328
|
default:
|
|
5304
|
-
|
|
5329
|
+
E = String(C || "-");
|
|
5305
5330
|
}
|
|
5306
|
-
return x.format && (
|
|
5331
|
+
return x.format && (E = x.format(C, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
5307
5332
|
/* @__PURE__ */ e(
|
|
5308
5333
|
me,
|
|
5309
5334
|
{
|
|
@@ -5319,7 +5344,7 @@ const As = ({
|
|
|
5319
5344
|
variant: "body",
|
|
5320
5345
|
size: "sm",
|
|
5321
5346
|
className: "text-text",
|
|
5322
|
-
children:
|
|
5347
|
+
children: E
|
|
5323
5348
|
}
|
|
5324
5349
|
)
|
|
5325
5350
|
] }, x.name);
|
|
@@ -5330,9 +5355,9 @@ const As = ({
|
|
|
5330
5355
|
)) });
|
|
5331
5356
|
}
|
|
5332
5357
|
if (h.type === "custom" && h.customComponent)
|
|
5333
|
-
return h.customComponent({ value:
|
|
5358
|
+
return h.customComponent({ value: m });
|
|
5334
5359
|
if (h.format) {
|
|
5335
|
-
const g = h.format(
|
|
5360
|
+
const g = h.format(m, r);
|
|
5336
5361
|
return /* @__PURE__ */ e(
|
|
5337
5362
|
me,
|
|
5338
5363
|
{
|
|
@@ -5351,23 +5376,23 @@ const As = ({
|
|
|
5351
5376
|
case "number":
|
|
5352
5377
|
case "tel":
|
|
5353
5378
|
case "url":
|
|
5354
|
-
b =
|
|
5379
|
+
b = m ? String(m) : "-";
|
|
5355
5380
|
break;
|
|
5356
5381
|
case "textarea":
|
|
5357
|
-
b =
|
|
5382
|
+
b = m ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(m || "-") }) : "-";
|
|
5358
5383
|
break;
|
|
5359
5384
|
case "select":
|
|
5360
5385
|
case "radio":
|
|
5361
|
-
b = o(
|
|
5386
|
+
b = o(m, h.options);
|
|
5362
5387
|
break;
|
|
5363
5388
|
case "checkbox":
|
|
5364
|
-
b = l(
|
|
5389
|
+
b = l(m);
|
|
5365
5390
|
break;
|
|
5366
5391
|
case "date":
|
|
5367
|
-
b = a(
|
|
5392
|
+
b = a(m);
|
|
5368
5393
|
break;
|
|
5369
5394
|
default:
|
|
5370
|
-
b =
|
|
5395
|
+
b = m ? String(m) : "-";
|
|
5371
5396
|
}
|
|
5372
5397
|
return /* @__PURE__ */ e(
|
|
5373
5398
|
me,
|
|
@@ -5384,8 +5409,8 @@ const As = ({
|
|
|
5384
5409
|
(h) => {
|
|
5385
5410
|
if (h.conditional && !h.conditional(r))
|
|
5386
5411
|
return null;
|
|
5387
|
-
const
|
|
5388
|
-
if (
|
|
5412
|
+
const m = h.items.filter((g) => !(g.hidden || g.conditional && !g.conditional(r)));
|
|
5413
|
+
if (m.length === 0) return null;
|
|
5389
5414
|
const b = i(
|
|
5390
5415
|
"space-y-4",
|
|
5391
5416
|
{
|
|
@@ -5426,7 +5451,7 @@ const As = ({
|
|
|
5426
5451
|
}
|
|
5427
5452
|
)
|
|
5428
5453
|
] }),
|
|
5429
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: b, children:
|
|
5454
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: b, children: m.map((g) => /* @__PURE__ */ c(
|
|
5430
5455
|
"div",
|
|
5431
5456
|
{
|
|
5432
5457
|
className: "space-y-1",
|
|
@@ -5444,7 +5469,7 @@ const As = ({
|
|
|
5444
5469
|
children: g.label
|
|
5445
5470
|
}
|
|
5446
5471
|
),
|
|
5447
|
-
|
|
5472
|
+
u(g)
|
|
5448
5473
|
]
|
|
5449
5474
|
},
|
|
5450
5475
|
g.name
|
|
@@ -5454,7 +5479,7 @@ const As = ({
|
|
|
5454
5479
|
h.id
|
|
5455
5480
|
);
|
|
5456
5481
|
},
|
|
5457
|
-
[r,
|
|
5482
|
+
[r, u]
|
|
5458
5483
|
), v = i(
|
|
5459
5484
|
"space-y-6",
|
|
5460
5485
|
{
|
|
@@ -5493,7 +5518,7 @@ const As = ({
|
|
|
5493
5518
|
v
|
|
5494
5519
|
)) })
|
|
5495
5520
|
] });
|
|
5496
|
-
const o = t.action,
|
|
5521
|
+
const o = t.action, u = o?.visibility !== "always";
|
|
5497
5522
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
5498
5523
|
"div",
|
|
5499
5524
|
{
|
|
@@ -5530,7 +5555,7 @@ const As = ({
|
|
|
5530
5555
|
className: i(
|
|
5531
5556
|
"shrink-0 text-xs tabular-nums",
|
|
5532
5557
|
l ? "rounded-full bg-accent px-1.5 font-semibold text-accent-fg" : "text-text-subtle",
|
|
5533
|
-
o &&
|
|
5558
|
+
o && u && "group-hover/item:hidden group-focus-within/item:hidden"
|
|
5534
5559
|
),
|
|
5535
5560
|
children: t.count
|
|
5536
5561
|
}
|
|
@@ -5550,7 +5575,7 @@ const As = ({
|
|
|
5550
5575
|
"text-text-subtle transition-colors duration-fast ease-out",
|
|
5551
5576
|
"hover:bg-page-hover hover:text-text",
|
|
5552
5577
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
5553
|
-
|
|
5578
|
+
u && "opacity-0 group-hover/item:opacity-100 focus-visible:opacity-100"
|
|
5554
5579
|
),
|
|
5555
5580
|
children: o.icon
|
|
5556
5581
|
}
|
|
@@ -5617,7 +5642,7 @@ const As = ({
|
|
|
5617
5642
|
align: a = "left",
|
|
5618
5643
|
truncate: l = !1,
|
|
5619
5644
|
className: o,
|
|
5620
|
-
children:
|
|
5645
|
+
children: u,
|
|
5621
5646
|
...d
|
|
5622
5647
|
}) => {
|
|
5623
5648
|
const v = `h${t}`, h = i(
|
|
@@ -5629,7 +5654,7 @@ const As = ({
|
|
|
5629
5654
|
l && "truncate",
|
|
5630
5655
|
o
|
|
5631
5656
|
);
|
|
5632
|
-
return /* @__PURE__ */ e(v, { className: h, ...d, children:
|
|
5657
|
+
return /* @__PURE__ */ e(v, { className: h, ...d, children: u });
|
|
5633
5658
|
};
|
|
5634
5659
|
function Tn(t) {
|
|
5635
5660
|
return {
|
|
@@ -5649,37 +5674,37 @@ const Ps = ({
|
|
|
5649
5674
|
initialCommandPath: a,
|
|
5650
5675
|
initialActiveIndex: l
|
|
5651
5676
|
}) => {
|
|
5652
|
-
const [o,
|
|
5677
|
+
const [o, u] = F(""), [d, v] = F(a || []), [h, m] = F(l || 0), b = te(null), g = te(null), p = (d.length ? t.find((x) => x.id === d[0])?.subCommands || [] : t).filter(
|
|
5653
5678
|
(x) => x.label.toLowerCase().includes(o.toLowerCase())
|
|
5654
5679
|
);
|
|
5655
|
-
return
|
|
5656
|
-
r || (
|
|
5657
|
-
}, [r]),
|
|
5658
|
-
const x = (
|
|
5680
|
+
return Y(() => {
|
|
5681
|
+
r || (u(""), v(a || []), m(l || 0));
|
|
5682
|
+
}, [r]), Y(() => {
|
|
5683
|
+
const x = (C) => {
|
|
5659
5684
|
if (r) {
|
|
5660
|
-
if (
|
|
5685
|
+
if (C.key === "Escape")
|
|
5661
5686
|
n();
|
|
5662
|
-
else if (
|
|
5663
|
-
|
|
5664
|
-
(
|
|
5687
|
+
else if (C.key === "ArrowUp")
|
|
5688
|
+
m(
|
|
5689
|
+
(E) => E > 0 ? E - 1 : p.length - 1
|
|
5665
5690
|
);
|
|
5666
|
-
else if (
|
|
5667
|
-
|
|
5668
|
-
(
|
|
5691
|
+
else if (C.key === "ArrowDown")
|
|
5692
|
+
m(
|
|
5693
|
+
(E) => E < p.length - 1 ? E + 1 : 0
|
|
5669
5694
|
);
|
|
5670
|
-
else if (
|
|
5671
|
-
const
|
|
5672
|
-
|
|
5695
|
+
else if (C.key === "Enter") {
|
|
5696
|
+
const E = p[h];
|
|
5697
|
+
E && (E.subCommands ? (v([...d, E.id]), m(0)) : E.action && (E.action(), n()));
|
|
5673
5698
|
}
|
|
5674
5699
|
}
|
|
5675
5700
|
};
|
|
5676
5701
|
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
5677
|
-
}, [r, n, p, h, d]),
|
|
5678
|
-
const x = (
|
|
5679
|
-
b.current && !b.current.contains(
|
|
5702
|
+
}, [r, n, p, h, d]), Y(() => {
|
|
5703
|
+
const x = (C) => {
|
|
5704
|
+
b.current && !b.current.contains(C.target) && n();
|
|
5680
5705
|
};
|
|
5681
5706
|
return r && document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
5682
|
-
}, [r, n]),
|
|
5707
|
+
}, [r, n]), Y(() => {
|
|
5683
5708
|
if (!r) return;
|
|
5684
5709
|
g.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
|
|
5685
5710
|
}, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
|
|
@@ -5697,7 +5722,7 @@ const Ps = ({
|
|
|
5697
5722
|
autoFocus: !0,
|
|
5698
5723
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
5699
5724
|
value: o,
|
|
5700
|
-
onChange: (x) =>
|
|
5725
|
+
onChange: (x) => u(x.target.value),
|
|
5701
5726
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
5702
5727
|
}
|
|
5703
5728
|
)
|
|
@@ -5709,15 +5734,15 @@ const Ps = ({
|
|
|
5709
5734
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
5710
5735
|
children: [
|
|
5711
5736
|
p.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
5712
|
-
p.map((x,
|
|
5737
|
+
p.map((x, C) => /* @__PURE__ */ c(
|
|
5713
5738
|
"div",
|
|
5714
5739
|
{
|
|
5715
|
-
"data-index":
|
|
5716
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
5740
|
+
"data-index": C,
|
|
5741
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${C === h ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
5717
5742
|
onClick: () => {
|
|
5718
|
-
x.subCommands ? (v([...d, x.id]),
|
|
5743
|
+
x.subCommands ? (v([...d, x.id]), m(0)) : x.action && (x.action(), n());
|
|
5719
5744
|
},
|
|
5720
|
-
onMouseEnter: () =>
|
|
5745
|
+
onMouseEnter: () => m(C),
|
|
5721
5746
|
children: [
|
|
5722
5747
|
x.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: x.icon }),
|
|
5723
5748
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: x.label }),
|
|
@@ -5816,7 +5841,7 @@ const Ps = ({
|
|
|
5816
5841
|
shadow: a,
|
|
5817
5842
|
border: l,
|
|
5818
5843
|
borderColor: o,
|
|
5819
|
-
className:
|
|
5844
|
+
className: u,
|
|
5820
5845
|
children: d,
|
|
5821
5846
|
...v
|
|
5822
5847
|
}, h) => /* @__PURE__ */ e(
|
|
@@ -5831,7 +5856,7 @@ const Ps = ({
|
|
|
5831
5856
|
a && Ln[a],
|
|
5832
5857
|
l && In[l],
|
|
5833
5858
|
o && Pn[o],
|
|
5834
|
-
|
|
5859
|
+
u
|
|
5835
5860
|
),
|
|
5836
5861
|
...v,
|
|
5837
5862
|
children: d
|
|
@@ -5863,41 +5888,41 @@ function js({
|
|
|
5863
5888
|
componentProps: l,
|
|
5864
5889
|
className: o
|
|
5865
5890
|
}) {
|
|
5866
|
-
const
|
|
5867
|
-
b.current = r,
|
|
5891
|
+
const u = te(null), [d, v] = F(null), [, h] = F(0), m = te(null), b = te(r);
|
|
5892
|
+
b.current = r, Y(() => {
|
|
5868
5893
|
if (je.has(t)) return;
|
|
5869
|
-
let
|
|
5894
|
+
let C = !0;
|
|
5870
5895
|
return (async () => {
|
|
5871
5896
|
try {
|
|
5872
|
-
const
|
|
5873
|
-
if (!
|
|
5874
|
-
je.set(t,
|
|
5875
|
-
} catch (
|
|
5876
|
-
console.error(`[FederatedResource] Load failed: ${t}`,
|
|
5897
|
+
const j = await b.current();
|
|
5898
|
+
if (!C) return;
|
|
5899
|
+
je.set(t, j), h((D) => D + 1);
|
|
5900
|
+
} catch (j) {
|
|
5901
|
+
console.error(`[FederatedResource] Load failed: ${t}`, j), C && v(t);
|
|
5877
5902
|
}
|
|
5878
5903
|
})(), () => {
|
|
5879
|
-
|
|
5904
|
+
C = !1;
|
|
5880
5905
|
};
|
|
5881
5906
|
}, [t]);
|
|
5882
5907
|
const g = je.get(t) ?? null, w = !g && d === t, p = !g && !w, x = g ? n === "react" && (g.component || g.default) || g : null;
|
|
5883
|
-
return
|
|
5908
|
+
return Y(() => {
|
|
5884
5909
|
if (!x || n === "react") return;
|
|
5885
|
-
const
|
|
5886
|
-
if (
|
|
5910
|
+
const C = u.current;
|
|
5911
|
+
if (C) {
|
|
5887
5912
|
if (n === "svelte") {
|
|
5888
|
-
const
|
|
5889
|
-
return
|
|
5913
|
+
const E = x.default || x, j = new E({ target: C, props: l || {} });
|
|
5914
|
+
return m.current = j, () => j.$destroy();
|
|
5890
5915
|
}
|
|
5891
5916
|
if (x.mount) {
|
|
5892
|
-
const
|
|
5917
|
+
const E = x.mount({ container: C, props: l || {} });
|
|
5893
5918
|
return () => {
|
|
5894
|
-
typeof
|
|
5919
|
+
typeof E == "function" ? E() : x.unmount?.(C);
|
|
5895
5920
|
};
|
|
5896
5921
|
}
|
|
5897
5922
|
}
|
|
5898
|
-
}, [x, n]),
|
|
5899
|
-
n === "svelte" &&
|
|
5900
|
-
}, [l, n]), /* @__PURE__ */ c("div", { ref:
|
|
5923
|
+
}, [x, n]), Y(() => {
|
|
5924
|
+
n === "svelte" && m.current && m.current.$set?.(l);
|
|
5925
|
+
}, [l, n]), /* @__PURE__ */ c("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
5901
5926
|
p && s,
|
|
5902
5927
|
w && a,
|
|
5903
5928
|
n === "react" && x && /* @__PURE__ */ e(x, { ...l })
|
|
@@ -5938,7 +5963,7 @@ export {
|
|
|
5938
5963
|
xs as AvatarStack,
|
|
5939
5964
|
Kr as Badge,
|
|
5940
5965
|
it as Box,
|
|
5941
|
-
|
|
5966
|
+
ne as Button,
|
|
5942
5967
|
Xn as ButtonGroup,
|
|
5943
5968
|
Os as Card,
|
|
5944
5969
|
bs as ChannelBadge,
|
|
@@ -5971,17 +5996,17 @@ export {
|
|
|
5971
5996
|
ws as Page,
|
|
5972
5997
|
pn as PageHeader,
|
|
5973
5998
|
ts as PageToolbar,
|
|
5974
|
-
|
|
5999
|
+
Ne as PageToolbarActions,
|
|
5975
6000
|
Jn as ParticipantTile,
|
|
5976
6001
|
et as Popover,
|
|
5977
6002
|
is as ProgressBar,
|
|
5978
|
-
|
|
6003
|
+
ze as RichText,
|
|
5979
6004
|
at as SearchField,
|
|
5980
6005
|
Er as SearchableTextField,
|
|
5981
6006
|
ks as SectionCaption,
|
|
5982
6007
|
Cs as SectionDivider,
|
|
5983
6008
|
nr as SegmentedToggle,
|
|
5984
|
-
|
|
6009
|
+
_e as Select,
|
|
5985
6010
|
Ss as SettingsFrameProvider,
|
|
5986
6011
|
zs as SettingsPage,
|
|
5987
6012
|
Ms as SettingsRow,
|
|
@@ -5999,7 +6024,7 @@ export {
|
|
|
5999
6024
|
Pr as Tabs,
|
|
6000
6025
|
me as Text,
|
|
6001
6026
|
Be as TextArea,
|
|
6002
|
-
|
|
6027
|
+
we as TextField,
|
|
6003
6028
|
Yn as VideoSurface,
|
|
6004
6029
|
As as View,
|
|
6005
6030
|
Ge as autofillProps,
|
|
@@ -6017,7 +6042,7 @@ export {
|
|
|
6017
6042
|
qt as normalizeText,
|
|
6018
6043
|
Zn as resolveLucideIcon,
|
|
6019
6044
|
ns as selectFilterHandler,
|
|
6020
|
-
|
|
6045
|
+
Te as text,
|
|
6021
6046
|
Le as useAnchoredPosition,
|
|
6022
6047
|
yn as useSettingsFrame,
|
|
6023
6048
|
Es as useSettingsFrameHost
|