@opencxh/ui-kit 3.177.0 → 3.178.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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1131 -1124
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/utils/useAnchoredPosition.d.ts +8 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
-
import le, { forwardRef as be, useState as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import le, { forwardRef as be, useState as B, useLayoutEffect as yt, useRef as se, useEffect as Z, createContext as tt, useId as Nt, useMemo as ge, useContext as wt, useCallback as de, Component as kt } from "react";
|
|
3
3
|
import { clsx as Ct } from "clsx";
|
|
4
4
|
import * as St from "lucide-react";
|
|
5
|
-
import { X as Se, ChevronDown as
|
|
5
|
+
import { X as Se, ChevronDown as Le, ExternalLink as Et, Search as Ie, ChevronRight as Oe, Sparkles as Tt, ArrowUpRight as rt, ImageOff as zt, ChevronLeft as Ee, Pencil as Mt, Calendar as At, Check as Ke, ChevronUp as Dt, Ellipsis as _t, ChevronDownIcon as $t, FileText as je, HardDrive as We, ArrowLeft as Lt, FolderPlus as It, Upload as Ot, Folder as Ge, Trash2 as Pt, Plus as jt, Loader2 as Rt, VideoOff as Ft, User as Bt, MicOff as Ht, Mic as qt } from "lucide-react";
|
|
6
6
|
import qe from "dompurify";
|
|
7
7
|
import Ut from "react-markdown";
|
|
8
8
|
import Vt from "remark-gfm";
|
|
@@ -55,11 +55,11 @@ const Kt = {
|
|
|
55
55
|
iconOnly: o = !1,
|
|
56
56
|
shape: u = "default",
|
|
57
57
|
className: i,
|
|
58
|
-
children:
|
|
58
|
+
children: p,
|
|
59
59
|
disabled: m,
|
|
60
60
|
...f
|
|
61
61
|
}, g) => {
|
|
62
|
-
const
|
|
62
|
+
const b = m || s;
|
|
63
63
|
return /* @__PURE__ */ c(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
@@ -81,7 +81,7 @@ const Kt = {
|
|
|
81
81
|
s && "cursor-wait",
|
|
82
82
|
i
|
|
83
83
|
),
|
|
84
|
-
disabled:
|
|
84
|
+
disabled: b,
|
|
85
85
|
"aria-busy": s || void 0,
|
|
86
86
|
...f,
|
|
87
87
|
children: [
|
|
@@ -93,9 +93,9 @@ const Kt = {
|
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
95
|
!s && a && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: a }),
|
|
96
|
-
!o &&
|
|
96
|
+
!o && p,
|
|
97
97
|
!s && l && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: l }),
|
|
98
|
-
o && !s && !a && !l &&
|
|
98
|
+
o && !s && !a && !l && p
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
101
|
);
|
|
@@ -148,7 +148,7 @@ const Yt = {
|
|
|
148
148
|
info: "text-info-fg",
|
|
149
149
|
neutral: "text-text-subtle",
|
|
150
150
|
current: "text-current"
|
|
151
|
-
},
|
|
151
|
+
}, Q = ({
|
|
152
152
|
icon: t,
|
|
153
153
|
size: r = "md",
|
|
154
154
|
color: n = "current",
|
|
@@ -158,7 +158,7 @@ const Yt = {
|
|
|
158
158
|
"aria-label": o,
|
|
159
159
|
...u
|
|
160
160
|
}) => {
|
|
161
|
-
const i = typeof r == "number" ? r : Xt(r),
|
|
161
|
+
const i = typeof r == "number" ? r : Xt(r), p = d(
|
|
162
162
|
"inline-block shrink-0",
|
|
163
163
|
Yt[n],
|
|
164
164
|
s && [
|
|
@@ -169,7 +169,7 @@ const Yt = {
|
|
|
169
169
|
), m = {
|
|
170
170
|
size: i,
|
|
171
171
|
strokeWidth: 2,
|
|
172
|
-
className:
|
|
172
|
+
className: p,
|
|
173
173
|
onClick: s ? a : void 0,
|
|
174
174
|
"aria-label": o,
|
|
175
175
|
"aria-hidden": o ? void 0 : !0,
|
|
@@ -191,15 +191,15 @@ function Xt(t) {
|
|
|
191
191
|
xl: 24
|
|
192
192
|
}[t];
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const [l, o] =
|
|
194
|
+
function Te(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
195
|
+
const [l, o] = B({});
|
|
196
196
|
return yt(() => {
|
|
197
197
|
if (!t) return;
|
|
198
198
|
const u = () => {
|
|
199
199
|
const i = r.current;
|
|
200
200
|
if (!i) return;
|
|
201
|
-
const
|
|
202
|
-
w ? (
|
|
201
|
+
const p = i.getBoundingClientRect(), m = window.innerHeight - p.bottom, f = p.top, g = a.startsWith("top"), b = g ? f < 200 && m > f : m < 200 && f > m, w = g !== b, v = { position: "fixed" };
|
|
202
|
+
w ? (v.bottom = window.innerHeight - p.top + n, v.maxHeight = Math.max(120, f - n * 2)) : (v.top = p.bottom + n, v.maxHeight = Math.max(120, m - n * 2)), a.endsWith("end") ? (v.right = window.innerWidth - p.right, v.maxWidth = Math.max(160, p.right - n)) : (v.left = p.left, v.maxWidth = Math.max(160, window.innerWidth - p.left - n)), s && (v.width = p.width), o(v);
|
|
203
203
|
};
|
|
204
204
|
return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
205
205
|
window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
@@ -216,28 +216,28 @@ const nt = ({
|
|
|
216
216
|
disabled: o = !1,
|
|
217
217
|
triggerLabel: u
|
|
218
218
|
}) => {
|
|
219
|
-
const [i,
|
|
220
|
-
|
|
219
|
+
const [i, p] = B(!1), m = se(null), f = se(null), g = Te(i, f, { placement: n });
|
|
220
|
+
Z(() => {
|
|
221
221
|
if (!i) return;
|
|
222
|
-
const
|
|
223
|
-
m.current && !m.current.contains(
|
|
224
|
-
}, h = (
|
|
225
|
-
|
|
222
|
+
const v = (C) => {
|
|
223
|
+
m.current && !m.current.contains(C.target) && p(!1);
|
|
224
|
+
}, h = (C) => {
|
|
225
|
+
C.key === "Escape" && p(!1);
|
|
226
226
|
};
|
|
227
|
-
return document.addEventListener("mousedown",
|
|
228
|
-
document.removeEventListener("mousedown",
|
|
227
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", h), () => {
|
|
228
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", h);
|
|
229
229
|
};
|
|
230
230
|
}, [i]);
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
}, w = () =>
|
|
231
|
+
const b = (v) => {
|
|
232
|
+
v.stopPropagation(), !o && p((h) => !h);
|
|
233
|
+
}, w = () => p(!1);
|
|
234
234
|
return /* @__PURE__ */ c("div", { ref: m, className: d("relative inline-flex", a), children: [
|
|
235
235
|
/* @__PURE__ */ e(
|
|
236
236
|
"button",
|
|
237
237
|
{
|
|
238
238
|
ref: f,
|
|
239
239
|
type: "button",
|
|
240
|
-
onClick:
|
|
240
|
+
onClick: b,
|
|
241
241
|
disabled: o,
|
|
242
242
|
"aria-label": u,
|
|
243
243
|
"aria-expanded": i,
|
|
@@ -295,45 +295,45 @@ function tr({
|
|
|
295
295
|
caret: o = !1,
|
|
296
296
|
menu: u,
|
|
297
297
|
menuClassName: i,
|
|
298
|
-
onClear:
|
|
298
|
+
onClear: p,
|
|
299
299
|
clearLabel: m = "Filter wissen",
|
|
300
300
|
onClick: f,
|
|
301
301
|
title: g,
|
|
302
|
-
className:
|
|
302
|
+
className: b
|
|
303
303
|
}) {
|
|
304
|
-
const w = l && !!
|
|
304
|
+
const w = l && !!p, v = s === "pill" ? "rounded-full" : "rounded-md", h = Zt({ active: l, tone: n, shape: s, size: a, className: b }), C = /* @__PURE__ */ c($e, { children: [
|
|
305
305
|
r,
|
|
306
306
|
t,
|
|
307
|
-
o && /* @__PURE__ */ e(
|
|
308
|
-
] }),
|
|
307
|
+
o && /* @__PURE__ */ e(Q, { icon: Le, size: "xs" })
|
|
308
|
+
] }), k = er({ shape: s, withClear: w }), P = w && /* @__PURE__ */ e(
|
|
309
309
|
"button",
|
|
310
310
|
{
|
|
311
311
|
type: "button",
|
|
312
312
|
"aria-label": m,
|
|
313
|
-
onClick:
|
|
313
|
+
onClick: p,
|
|
314
314
|
className: d(
|
|
315
315
|
"inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring",
|
|
316
|
-
|
|
316
|
+
v
|
|
317
317
|
),
|
|
318
|
-
children: /* @__PURE__ */ e(
|
|
318
|
+
children: /* @__PURE__ */ e(Q, { icon: Se, size: "xs" })
|
|
319
319
|
}
|
|
320
320
|
);
|
|
321
321
|
return u ? /* @__PURE__ */ c("span", { className: h, title: g, children: [
|
|
322
322
|
/* @__PURE__ */ e(
|
|
323
323
|
nt,
|
|
324
324
|
{
|
|
325
|
-
trigger:
|
|
325
|
+
trigger: C,
|
|
326
326
|
rootClassName: "h-full",
|
|
327
|
-
triggerClassName: d(
|
|
327
|
+
triggerClassName: d(k, "h-full"),
|
|
328
328
|
className: d("min-w-menu p-1.5", i),
|
|
329
329
|
children: u
|
|
330
330
|
}
|
|
331
331
|
),
|
|
332
|
-
|
|
332
|
+
P
|
|
333
333
|
] }) : w ? /* @__PURE__ */ c("span", { className: h, title: g, children: [
|
|
334
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: f, className:
|
|
335
|
-
|
|
336
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title: g, onClick: f, className: d(h,
|
|
334
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: f, className: k, children: C }),
|
|
335
|
+
P
|
|
336
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: g, onClick: f, className: d(h, k), children: C });
|
|
337
337
|
}
|
|
338
338
|
const rr = {
|
|
339
339
|
xs: "text-xs",
|
|
@@ -369,7 +369,7 @@ const rr = {
|
|
|
369
369
|
children: o,
|
|
370
370
|
href: u,
|
|
371
371
|
target: i,
|
|
372
|
-
rel:
|
|
372
|
+
rel: p,
|
|
373
373
|
...m
|
|
374
374
|
}) => {
|
|
375
375
|
const f = a || u && (u.startsWith("http") || u.startsWith("mailto:")), g = d(
|
|
@@ -386,14 +386,14 @@ const rr = {
|
|
|
386
386
|
],
|
|
387
387
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
388
388
|
l
|
|
389
|
-
),
|
|
389
|
+
), b = {
|
|
390
390
|
...m,
|
|
391
391
|
href: s ? void 0 : u,
|
|
392
392
|
target: f ? "_blank" : i,
|
|
393
|
-
rel: f ? "noopener noreferrer" :
|
|
393
|
+
rel: f ? "noopener noreferrer" : p,
|
|
394
394
|
"aria-disabled": s || void 0
|
|
395
395
|
};
|
|
396
|
-
return /* @__PURE__ */ c("a", { className: g, ...
|
|
396
|
+
return /* @__PURE__ */ c("a", { className: g, ...b, children: [
|
|
397
397
|
o,
|
|
398
398
|
f && /* @__PURE__ */ e(Et, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
399
399
|
] });
|
|
@@ -423,12 +423,12 @@ function lr({
|
|
|
423
423
|
o
|
|
424
424
|
),
|
|
425
425
|
children: t.map((i) => {
|
|
426
|
-
const
|
|
426
|
+
const p = i.value === r;
|
|
427
427
|
return /* @__PURE__ */ e(
|
|
428
428
|
"button",
|
|
429
429
|
{
|
|
430
430
|
role: "tab",
|
|
431
|
-
"aria-selected":
|
|
431
|
+
"aria-selected": p,
|
|
432
432
|
"aria-label": i.title,
|
|
433
433
|
title: i.title,
|
|
434
434
|
type: "button",
|
|
@@ -439,7 +439,7 @@ function lr({
|
|
|
439
439
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
440
440
|
l && "min-w-0 flex-1",
|
|
441
441
|
ar[s],
|
|
442
|
-
|
|
442
|
+
p ? "bg-surface text-text font-medium shadow-sm" : "text-text-muted hover:text-text"
|
|
443
443
|
),
|
|
444
444
|
children: i.label
|
|
445
445
|
},
|
|
@@ -467,7 +467,7 @@ function st({
|
|
|
467
467
|
disabled: o = !1,
|
|
468
468
|
loading: u = !1,
|
|
469
469
|
menuPlacement: i = "bottom-end",
|
|
470
|
-
menuLabel:
|
|
470
|
+
menuLabel: p = "More options"
|
|
471
471
|
}) {
|
|
472
472
|
const m = o || u, f = l.length > 0;
|
|
473
473
|
return (
|
|
@@ -493,7 +493,7 @@ function st({
|
|
|
493
493
|
{
|
|
494
494
|
placement: i,
|
|
495
495
|
disabled: m,
|
|
496
|
-
triggerLabel:
|
|
496
|
+
triggerLabel: p,
|
|
497
497
|
className: "min-w-menu py-1",
|
|
498
498
|
trigger: /* @__PURE__ */ e(
|
|
499
499
|
"span",
|
|
@@ -506,28 +506,28 @@ function st({
|
|
|
506
506
|
cr[s],
|
|
507
507
|
m && "cursor-not-allowed opacity-50"
|
|
508
508
|
),
|
|
509
|
-
children: /* @__PURE__ */ e(
|
|
509
|
+
children: /* @__PURE__ */ e(Le, { className: "size-icon-md" })
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
|
-
children: (g) => /* @__PURE__ */ e(
|
|
512
|
+
children: (g) => /* @__PURE__ */ e($e, { children: l.map((b) => /* @__PURE__ */ c(
|
|
513
513
|
"button",
|
|
514
514
|
{
|
|
515
515
|
type: "button",
|
|
516
516
|
onClick: () => {
|
|
517
|
-
|
|
517
|
+
b.onClick(), g();
|
|
518
518
|
},
|
|
519
519
|
className: d(
|
|
520
520
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
521
521
|
"transition-colors duration-fast ease-out",
|
|
522
522
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
523
|
-
|
|
523
|
+
b.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
|
|
524
524
|
),
|
|
525
525
|
children: [
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
b.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: b.icon }),
|
|
527
|
+
b.label
|
|
528
528
|
]
|
|
529
529
|
},
|
|
530
|
-
|
|
530
|
+
b.id
|
|
531
531
|
)) })
|
|
532
532
|
}
|
|
533
533
|
)
|
|
@@ -542,39 +542,39 @@ const us = ({
|
|
|
542
542
|
initialCommandPath: a,
|
|
543
543
|
initialActiveIndex: l
|
|
544
544
|
}) => {
|
|
545
|
-
const [o, u] =
|
|
545
|
+
const [o, u] = B(""), [i, p] = B(a || []), [m, f] = B(l || 0), g = se(null), b = se(null), v = (i.length ? t.find((h) => h.id === i[0])?.subCommands || [] : t).filter(
|
|
546
546
|
(h) => h.label.toLowerCase().includes(o.toLowerCase())
|
|
547
547
|
);
|
|
548
|
-
return
|
|
549
|
-
r || (u(""),
|
|
550
|
-
}, [r, a, l]),
|
|
551
|
-
const h = (
|
|
548
|
+
return Z(() => {
|
|
549
|
+
r || (u(""), p(a || []), f(l || 0));
|
|
550
|
+
}, [r, a, l]), Z(() => {
|
|
551
|
+
const h = (C) => {
|
|
552
552
|
if (r) {
|
|
553
|
-
if (
|
|
553
|
+
if (C.key === "Escape")
|
|
554
554
|
n();
|
|
555
|
-
else if (
|
|
555
|
+
else if (C.key === "ArrowUp")
|
|
556
556
|
f(
|
|
557
|
-
(
|
|
557
|
+
(k) => k > 0 ? k - 1 : v.length - 1
|
|
558
558
|
);
|
|
559
|
-
else if (
|
|
559
|
+
else if (C.key === "ArrowDown")
|
|
560
560
|
f(
|
|
561
|
-
(
|
|
561
|
+
(k) => k < v.length - 1 ? k + 1 : 0
|
|
562
562
|
);
|
|
563
|
-
else if (
|
|
564
|
-
const
|
|
565
|
-
|
|
563
|
+
else if (C.key === "Enter") {
|
|
564
|
+
const k = v[m];
|
|
565
|
+
k && (k.subCommands ? (p([...i, k.id]), f(0)) : k.action && (k.action(), n()));
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
};
|
|
569
569
|
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
570
|
-
}, [r, n,
|
|
571
|
-
const h = (
|
|
572
|
-
g.current && !g.current.contains(
|
|
570
|
+
}, [r, n, v, m, i]), Z(() => {
|
|
571
|
+
const h = (C) => {
|
|
572
|
+
g.current && !g.current.contains(C.target) && n();
|
|
573
573
|
};
|
|
574
574
|
return r && document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
575
|
-
}, [r, n]),
|
|
575
|
+
}, [r, n]), Z(() => {
|
|
576
576
|
if (!r) return;
|
|
577
|
-
|
|
577
|
+
b.current?.querySelector(`[data-index="${m}"]`)?.scrollIntoView({ block: "nearest" });
|
|
578
578
|
}, [m, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
|
|
579
579
|
"div",
|
|
580
580
|
{
|
|
@@ -582,7 +582,7 @@ const us = ({
|
|
|
582
582
|
ref: g,
|
|
583
583
|
children: [
|
|
584
584
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
585
|
-
/* @__PURE__ */ e(
|
|
585
|
+
/* @__PURE__ */ e(Ie, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
586
586
|
/* @__PURE__ */ e(
|
|
587
587
|
"input",
|
|
588
588
|
{
|
|
@@ -597,23 +597,23 @@ const us = ({
|
|
|
597
597
|
/* @__PURE__ */ c(
|
|
598
598
|
"div",
|
|
599
599
|
{
|
|
600
|
-
ref:
|
|
600
|
+
ref: b,
|
|
601
601
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
602
602
|
children: [
|
|
603
|
-
|
|
604
|
-
|
|
603
|
+
v.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
604
|
+
v.map((h, C) => /* @__PURE__ */ c(
|
|
605
605
|
"div",
|
|
606
606
|
{
|
|
607
|
-
"data-index":
|
|
608
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
607
|
+
"data-index": C,
|
|
608
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${C === m ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
609
609
|
onClick: () => {
|
|
610
|
-
h.subCommands ? (
|
|
610
|
+
h.subCommands ? (p([...i, h.id]), f(0)) : h.action && (h.action(), n());
|
|
611
611
|
},
|
|
612
|
-
onMouseEnter: () => f(
|
|
612
|
+
onMouseEnter: () => f(C),
|
|
613
613
|
children: [
|
|
614
614
|
h.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: h.icon }),
|
|
615
615
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: h.label }),
|
|
616
|
-
h.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(
|
|
616
|
+
h.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(Oe, { className: "w-4 h-4" }) })
|
|
617
617
|
]
|
|
618
618
|
},
|
|
619
619
|
h.id
|
|
@@ -684,7 +684,7 @@ const us = ({
|
|
|
684
684
|
th: (t) => /* @__PURE__ */ e("th", { className: "border border-border px-2 py-1 text-left font-semibold", ...t }),
|
|
685
685
|
td: (t) => /* @__PURE__ */ e("td", { className: "border border-border px-2 py-1", ...t })
|
|
686
686
|
};
|
|
687
|
-
function
|
|
687
|
+
function ze({ text: t, className: r, as: n }) {
|
|
688
688
|
const s = t ?? "";
|
|
689
689
|
return (n ? n === "html" : ir.test(s)) ? /* @__PURE__ */ e(
|
|
690
690
|
"div",
|
|
@@ -717,9 +717,9 @@ function xr({ block: t }) {
|
|
|
717
717
|
case "heading":
|
|
718
718
|
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 });
|
|
719
719
|
case "paragraph":
|
|
720
|
-
return /* @__PURE__ */ e(
|
|
720
|
+
return /* @__PURE__ */ e(ze, { as: "markdown", text: t.text, className: "text-sm text-text" });
|
|
721
721
|
case "quote":
|
|
722
|
-
return /* @__PURE__ */ e("blockquote", { className: "border-l-2 border-border pl-3.5", children: /* @__PURE__ */ e(
|
|
722
|
+
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" }) });
|
|
723
723
|
case "code":
|
|
724
724
|
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 }) });
|
|
725
725
|
case "divider":
|
|
@@ -738,7 +738,7 @@ function xr({ block: t }) {
|
|
|
738
738
|
n.lead,
|
|
739
739
|
" "
|
|
740
740
|
] }),
|
|
741
|
-
/* @__PURE__ */ e(
|
|
741
|
+
/* @__PURE__ */ e(ze, { as: "markdown", text: n.text, className: "inline" })
|
|
742
742
|
] }, s))
|
|
743
743
|
}
|
|
744
744
|
);
|
|
@@ -788,7 +788,7 @@ function xr({ block: t }) {
|
|
|
788
788
|
case "callout":
|
|
789
789
|
return /* @__PURE__ */ c("div", { className: d("rounded-lg border px-4 py-3", fr[t.tone]), children: [
|
|
790
790
|
t.title && /* @__PURE__ */ e("div", { className: "pb-0.5 text-sm font-semibold text-text", children: t.title }),
|
|
791
|
-
/* @__PURE__ */ e(
|
|
791
|
+
/* @__PURE__ */ e(ze, { as: "markdown", text: t.text, className: "text-sm text-text" })
|
|
792
792
|
] });
|
|
793
793
|
default:
|
|
794
794
|
return null;
|
|
@@ -1035,7 +1035,7 @@ function vs({
|
|
|
1035
1035
|
"grid size-avatar-md shrink-0 place-items-center rounded-full",
|
|
1036
1036
|
r === "assistant" ? "bg-assistant-soft text-assistant" : "bg-surface-track text-text-muted"
|
|
1037
1037
|
),
|
|
1038
|
-
children: /* @__PURE__ */ e(
|
|
1038
|
+
children: /* @__PURE__ */ e(Q, { icon: t, size: "sm", color: "current" })
|
|
1039
1039
|
}
|
|
1040
1040
|
);
|
|
1041
1041
|
}
|
|
@@ -1045,7 +1045,7 @@ function ys({ children: t, className: r }) {
|
|
|
1045
1045
|
function Ns({ icon: t, text: r, time: n, joinUrl: s, joinLabel: a }) {
|
|
1046
1046
|
const l = Jt(t);
|
|
1047
1047
|
return /* @__PURE__ */ c("div", { className: "flex items-center gap-2 py-1.5 pl-10.5 text-xs text-text-subtle", children: [
|
|
1048
|
-
l && /* @__PURE__ */ e(
|
|
1048
|
+
l && /* @__PURE__ */ e(Q, { icon: l, size: "sm", color: "current" }),
|
|
1049
1049
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: r }),
|
|
1050
1050
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "shrink-0 text-text-disabled", children: "·" }),
|
|
1051
1051
|
/* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums", children: n }),
|
|
@@ -1059,13 +1059,13 @@ function Ns({ icon: t, text: r, time: n, joinUrl: s, joinLabel: a }) {
|
|
|
1059
1059
|
children: [
|
|
1060
1060
|
a ?? "Join",
|
|
1061
1061
|
" ",
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1062
|
+
/* @__PURE__ */ e(Q, { icon: rt, size: "xs" })
|
|
1063
1063
|
]
|
|
1064
1064
|
}
|
|
1065
1065
|
)
|
|
1066
1066
|
] });
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const Me = {
|
|
1069
1069
|
mail: { fg: "text-channel-mail-fg", bg: "bg-channel-mail-soft" },
|
|
1070
1070
|
wa: { fg: "text-channel-whatsapp-fg", bg: "bg-channel-whatsapp-soft" },
|
|
1071
1071
|
chat: { fg: "text-channel-chat-fg", bg: "bg-channel-chat-soft" },
|
|
@@ -1083,7 +1083,7 @@ function ws({
|
|
|
1083
1083
|
className: s,
|
|
1084
1084
|
title: a
|
|
1085
1085
|
}) {
|
|
1086
|
-
const l = t in
|
|
1086
|
+
const l = t in Me ? Me[t] : void 0;
|
|
1087
1087
|
return /* @__PURE__ */ e(
|
|
1088
1088
|
"span",
|
|
1089
1089
|
{
|
|
@@ -1094,7 +1094,7 @@ function ws({
|
|
|
1094
1094
|
// An undeclared channel used to collapse onto the neutral "note" tone,
|
|
1095
1095
|
// which is also what a real internal note looks like. Deriving from the
|
|
1096
1096
|
// key keeps it distinguishable and keeps `note` meaning `note`.
|
|
1097
|
-
l ? d(l.fg, l.bg) : t ? lt(t) : d(
|
|
1097
|
+
l ? d(l.fg, l.bg) : t ? lt(t) : d(Me.note.fg, Me.note.bg),
|
|
1098
1098
|
s
|
|
1099
1099
|
),
|
|
1100
1100
|
children: r
|
|
@@ -1111,21 +1111,21 @@ const ks = ({
|
|
|
1111
1111
|
showError: o = !0,
|
|
1112
1112
|
fallback: u,
|
|
1113
1113
|
loadingContent: i,
|
|
1114
|
-
errorContent:
|
|
1114
|
+
errorContent: p,
|
|
1115
1115
|
className: m,
|
|
1116
1116
|
onLoad: f,
|
|
1117
1117
|
onError: g,
|
|
1118
|
-
...
|
|
1118
|
+
...b
|
|
1119
1119
|
}) => {
|
|
1120
|
-
const [w,
|
|
1121
|
-
|
|
1122
|
-
},
|
|
1123
|
-
if (
|
|
1124
|
-
|
|
1120
|
+
const [w, v] = B(!0), [h, C] = B(!1), [k, P] = B(t), D = (U) => {
|
|
1121
|
+
v(!1), C(!1), f?.(U);
|
|
1122
|
+
}, Y = (U) => {
|
|
1123
|
+
if (v(!1), C(!0), u && k !== u) {
|
|
1124
|
+
P(u), C(!1), v(!0);
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
|
-
g?.(
|
|
1128
|
-
},
|
|
1127
|
+
g?.(U);
|
|
1128
|
+
}, F = d(
|
|
1129
1129
|
"relative overflow-hidden bg-surface-hover",
|
|
1130
1130
|
// Size variants
|
|
1131
1131
|
{
|
|
@@ -1153,30 +1153,30 @@ const ks = ({
|
|
|
1153
1153
|
"rounded-full": a === "full"
|
|
1154
1154
|
},
|
|
1155
1155
|
m
|
|
1156
|
-
),
|
|
1156
|
+
), _ = d("w-full h-full object-cover transition-opacity duration-fast", {
|
|
1157
1157
|
"opacity-0": w || h,
|
|
1158
1158
|
"opacity-100": !w && !h
|
|
1159
|
-
}),
|
|
1159
|
+
}), I = d(
|
|
1160
1160
|
"absolute inset-0 flex items-center justify-center",
|
|
1161
1161
|
"text-text-muted"
|
|
1162
|
-
),
|
|
1163
|
-
/* @__PURE__ */ e(
|
|
1162
|
+
), O = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), H = /* @__PURE__ */ c("div", { className: "text-center", children: [
|
|
1163
|
+
/* @__PURE__ */ e(Q, { icon: zt, size: "lg", className: "mx-auto mb-1" }),
|
|
1164
1164
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
1165
1165
|
] });
|
|
1166
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1166
|
+
return /* @__PURE__ */ c("div", { className: F, children: [
|
|
1167
1167
|
/* @__PURE__ */ e(
|
|
1168
1168
|
"img",
|
|
1169
1169
|
{
|
|
1170
|
-
...
|
|
1171
|
-
src:
|
|
1170
|
+
...b,
|
|
1171
|
+
src: k,
|
|
1172
1172
|
alt: r,
|
|
1173
|
-
className:
|
|
1173
|
+
className: _,
|
|
1174
1174
|
onLoad: D,
|
|
1175
|
-
onError:
|
|
1175
|
+
onError: Y
|
|
1176
1176
|
}
|
|
1177
1177
|
),
|
|
1178
|
-
w && l && /* @__PURE__ */ e("div", { className:
|
|
1179
|
-
h && o && /* @__PURE__ */ e("div", { className:
|
|
1178
|
+
w && l && /* @__PURE__ */ e("div", { className: I, children: i || O }),
|
|
1179
|
+
h && o && /* @__PURE__ */ e("div", { className: I, children: p || H })
|
|
1180
1180
|
] });
|
|
1181
1181
|
}, Tr = {
|
|
1182
1182
|
default: "text-text",
|
|
@@ -1215,9 +1215,9 @@ const zr = {
|
|
|
1215
1215
|
labelClassName: o,
|
|
1216
1216
|
className: u,
|
|
1217
1217
|
id: i,
|
|
1218
|
-
...
|
|
1218
|
+
...p
|
|
1219
1219
|
}, m) => {
|
|
1220
|
-
const f = le.useId(), g = i || `checkbox-${f}`,
|
|
1220
|
+
const f = le.useId(), g = i || `checkbox-${f}`, b = !!n, w = le.useRef(null), v = le.useCallback(
|
|
1221
1221
|
(h) => {
|
|
1222
1222
|
w.current = h, typeof m == "function" ? m(h) : m && typeof m == "object" && (m.current = h);
|
|
1223
1223
|
},
|
|
@@ -1230,10 +1230,10 @@ const zr = {
|
|
|
1230
1230
|
/* @__PURE__ */ e(
|
|
1231
1231
|
"input",
|
|
1232
1232
|
{
|
|
1233
|
-
ref:
|
|
1233
|
+
ref: v,
|
|
1234
1234
|
id: g,
|
|
1235
1235
|
type: "checkbox",
|
|
1236
|
-
"aria-invalid":
|
|
1236
|
+
"aria-invalid": b || void 0,
|
|
1237
1237
|
className: d(
|
|
1238
1238
|
// radius-xs (5px): its own step on the scale. At 16px the 9px
|
|
1239
1239
|
// button radius reads as a circle and the 7px chip radius still
|
|
@@ -1244,10 +1244,10 @@ const zr = {
|
|
|
1244
1244
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
1245
1245
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
1246
1246
|
zr[s],
|
|
1247
|
-
|
|
1247
|
+
b ? "border-danger-border" : "border-border-strong",
|
|
1248
1248
|
u
|
|
1249
1249
|
),
|
|
1250
|
-
...
|
|
1250
|
+
...p
|
|
1251
1251
|
}
|
|
1252
1252
|
),
|
|
1253
1253
|
t && /* @__PURE__ */ c("div", { className: "flex-1", children: [
|
|
@@ -1257,7 +1257,7 @@ const zr = {
|
|
|
1257
1257
|
htmlFor: g,
|
|
1258
1258
|
className: d(
|
|
1259
1259
|
"cursor-pointer",
|
|
1260
|
-
|
|
1260
|
+
b ? "text-danger-fg" : "text-text",
|
|
1261
1261
|
Ar[s],
|
|
1262
1262
|
o
|
|
1263
1263
|
),
|
|
@@ -1305,41 +1305,41 @@ function Es({
|
|
|
1305
1305
|
onSelect: o,
|
|
1306
1306
|
onActiveIndexChange: u,
|
|
1307
1307
|
isActive: i,
|
|
1308
|
-
unread:
|
|
1308
|
+
unread: p,
|
|
1309
1309
|
dimmed: m,
|
|
1310
1310
|
groupBy: f,
|
|
1311
1311
|
groups: g,
|
|
1312
|
-
renderGroupHeader:
|
|
1312
|
+
renderGroupHeader: b,
|
|
1313
1313
|
stickyGroupHeaders: w = !1,
|
|
1314
|
-
collapsibleGroups:
|
|
1314
|
+
collapsibleGroups: v = !1,
|
|
1315
1315
|
hideGroupCount: h = !1,
|
|
1316
|
-
selectable:
|
|
1317
|
-
selectedItems:
|
|
1318
|
-
onSelectionChange:
|
|
1316
|
+
selectable: C = !1,
|
|
1317
|
+
selectedItems: k = [],
|
|
1318
|
+
onSelectionChange: P,
|
|
1319
1319
|
bulkActions: D,
|
|
1320
|
-
header:
|
|
1321
|
-
stickyHeader:
|
|
1322
|
-
bordered:
|
|
1323
|
-
emptyContent:
|
|
1324
|
-
loading:
|
|
1325
|
-
loadingRows:
|
|
1326
|
-
className:
|
|
1327
|
-
"aria-label":
|
|
1320
|
+
header: Y,
|
|
1321
|
+
stickyHeader: F = !1,
|
|
1322
|
+
bordered: _ = !1,
|
|
1323
|
+
emptyContent: I,
|
|
1324
|
+
loading: O = !1,
|
|
1325
|
+
loadingRows: H = 4,
|
|
1326
|
+
className: U,
|
|
1327
|
+
"aria-label": te
|
|
1328
1328
|
}) {
|
|
1329
|
-
const [
|
|
1330
|
-
() => Object.fromEntries((g ?? []).filter((
|
|
1331
|
-
), x = le.useRef(null),
|
|
1332
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
1333
|
-
const
|
|
1329
|
+
const [W, y] = le.useState(
|
|
1330
|
+
() => Object.fromEntries((g ?? []).filter((S) => S.defaultCollapsed).map((S) => [S.id, !0]))
|
|
1331
|
+
), x = le.useRef(null), E = (S) => {
|
|
1332
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(S.key)) return;
|
|
1333
|
+
const X = Array.from(
|
|
1334
1334
|
x.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
1335
1335
|
);
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1338
|
-
const q =
|
|
1339
|
-
|
|
1340
|
-
},
|
|
1341
|
-
|
|
1342
|
-
}, M = (
|
|
1336
|
+
if (X.length === 0) return;
|
|
1337
|
+
S.preventDefault();
|
|
1338
|
+
const q = X.indexOf(document.activeElement), N = S.key === "Home" ? 0 : S.key === "End" ? X.length - 1 : S.key === "ArrowDown" ? (q + 1) % X.length : (q - 1 + X.length) % X.length;
|
|
1339
|
+
X[N]?.focus();
|
|
1340
|
+
}, $ = (S, z) => r ? r(S, z) : z, T = (S) => k.includes(S), L = (S, z) => {
|
|
1341
|
+
P && P(z ? [...k, S] : k.filter((X) => X !== S));
|
|
1342
|
+
}, M = (S) => P?.(S ? [...t] : []), ce = d(
|
|
1343
1343
|
"flex flex-col",
|
|
1344
1344
|
// With a selection open the list has a dock at its foot. Sticky can only
|
|
1345
1345
|
// park at the bottom of its own box, so on a list shorter than the window
|
|
@@ -1347,12 +1347,12 @@ function Es({
|
|
|
1347
1347
|
// screen. Growing the box to the height of its parent puts it where it
|
|
1348
1348
|
// belongs — and only while a selection exists, so an ordinary short list
|
|
1349
1349
|
// keeps its natural height.
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1350
|
+
C && k.length > 0 && "min-h-full",
|
|
1351
|
+
_ && "overflow-hidden rounded-lg border border-border-subtle",
|
|
1352
|
+
U
|
|
1353
1353
|
);
|
|
1354
|
-
if (
|
|
1355
|
-
return /* @__PURE__ */ e("div", { className: ce, children: Array.from({ length:
|
|
1354
|
+
if (O)
|
|
1355
|
+
return /* @__PURE__ */ e("div", { className: ce, children: Array.from({ length: H }).map((S, z) => /* @__PURE__ */ c(
|
|
1356
1356
|
"div",
|
|
1357
1357
|
{
|
|
1358
1358
|
className: d(
|
|
@@ -1368,10 +1368,10 @@ function Es({
|
|
|
1368
1368
|
},
|
|
1369
1369
|
`skeleton-${z}`
|
|
1370
1370
|
)) });
|
|
1371
|
-
if (t.length === 0 &&
|
|
1372
|
-
return /* @__PURE__ */ e("div", { className: ce, children:
|
|
1373
|
-
const ie = t.length > 0 &&
|
|
1374
|
-
const q = i?.(
|
|
1371
|
+
if (t.length === 0 && I)
|
|
1372
|
+
return /* @__PURE__ */ e("div", { className: ce, children: I });
|
|
1373
|
+
const ie = t.length > 0 && k.length === t.length, G = k.length > 0 && !ie, K = (S, z, X) => {
|
|
1374
|
+
const q = i?.(S, z) ?? !1, N = p?.(S, z) ?? !1, R = m?.(S, z) ?? !1, re = C && T(S);
|
|
1375
1375
|
return /* @__PURE__ */ c(
|
|
1376
1376
|
"li",
|
|
1377
1377
|
{
|
|
@@ -1380,33 +1380,33 @@ function Es({
|
|
|
1380
1380
|
tabIndex: 0,
|
|
1381
1381
|
"data-list-row": "",
|
|
1382
1382
|
"aria-current": q || void 0,
|
|
1383
|
-
onClick: () => o(
|
|
1383
|
+
onClick: () => o(S, z),
|
|
1384
1384
|
onFocus: () => u?.(z),
|
|
1385
1385
|
onKeyDown: (oe) => {
|
|
1386
|
-
oe.key !== "Enter" && oe.key !== " " || (oe.preventDefault(), o(
|
|
1386
|
+
oe.key !== "Enter" && oe.key !== " " || (oe.preventDefault(), o(S, z));
|
|
1387
1387
|
}
|
|
1388
1388
|
} : {},
|
|
1389
1389
|
className: d(
|
|
1390
1390
|
"flex items-center gap-3 text-base",
|
|
1391
1391
|
"transition-colors duration-fast ease-out",
|
|
1392
1392
|
n === "inset" ? "mx-2 rounded-lg px-3 py-2.5" : "px-5 py-2.5",
|
|
1393
|
-
n === "divided" && !
|
|
1393
|
+
n === "divided" && !X && "border-t border-border-subtle",
|
|
1394
1394
|
o && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
1395
1395
|
// An unread row is tinted, not bolded: at five columns a bold row
|
|
1396
1396
|
// shouts across all of them, while the tint marks the row and leaves
|
|
1397
1397
|
// the consumer free to weight only the sender and the subject.
|
|
1398
|
-
q ||
|
|
1398
|
+
q || re ? "bg-accent-soft text-text" : N ? d("bg-surface-unread", o && "hover:bg-surface-unread-hover") : o && "hover:bg-surface-hover",
|
|
1399
1399
|
// Read rows stay at full opacity — fading them also fades the avatars
|
|
1400
1400
|
// and team dots, which is exactly the identity you scan by. They read
|
|
1401
1401
|
// as secondary through weight and text colour instead.
|
|
1402
|
-
|
|
1402
|
+
R && "text-text-muted"
|
|
1403
1403
|
),
|
|
1404
1404
|
children: [
|
|
1405
|
-
|
|
1405
|
+
C && /* @__PURE__ */ e("span", { onClick: (oe) => oe.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1406
1406
|
we,
|
|
1407
1407
|
{
|
|
1408
|
-
checked:
|
|
1409
|
-
onChange: (oe) =>
|
|
1408
|
+
checked: T(S),
|
|
1409
|
+
onChange: (oe) => L(S, oe.target.checked),
|
|
1410
1410
|
"aria-label": "Rij selecteren"
|
|
1411
1411
|
}
|
|
1412
1412
|
) }),
|
|
@@ -1417,30 +1417,30 @@ function Es({
|
|
|
1417
1417
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
1418
1418
|
}
|
|
1419
1419
|
),
|
|
1420
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(
|
|
1421
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(
|
|
1422
|
-
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(
|
|
1420
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(S, z) }),
|
|
1421
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(S, z) : String(S) }),
|
|
1422
|
+
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(S, z) })
|
|
1423
1423
|
]
|
|
1424
1424
|
},
|
|
1425
|
-
|
|
1425
|
+
$(S, z)
|
|
1426
1426
|
);
|
|
1427
|
-
},
|
|
1427
|
+
}, j = (() => {
|
|
1428
1428
|
if (!f)
|
|
1429
|
-
return t.map((q, N) =>
|
|
1430
|
-
const
|
|
1429
|
+
return t.map((q, N) => K(q, N, N === 0));
|
|
1430
|
+
const S = /* @__PURE__ */ new Map();
|
|
1431
1431
|
t.forEach((q, N) => {
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1432
|
+
const R = f(q, N);
|
|
1433
|
+
S.has(R) || S.set(R, []), S.get(R)?.push({ item: q, index: N });
|
|
1434
1434
|
});
|
|
1435
1435
|
const z = g ?? [];
|
|
1436
1436
|
return [
|
|
1437
|
-
...z.filter((q) =>
|
|
1438
|
-
...[...
|
|
1437
|
+
...z.filter((q) => S.has(q.id)),
|
|
1438
|
+
...[...S.keys()].filter((q) => !z.some((N) => N.id === q)).map((q) => ({ id: q }))
|
|
1439
1439
|
].flatMap((q, N) => {
|
|
1440
|
-
const
|
|
1440
|
+
const R = S.get(q.id) ?? [], re = v && W[q.id], oe = q.title ?? q.id, pe = q.count ?? R.length, ye = /* @__PURE__ */ e(
|
|
1441
1441
|
"li",
|
|
1442
1442
|
{
|
|
1443
|
-
onClick:
|
|
1443
|
+
onClick: v ? () => y((he) => ({ ...he, [q.id]: !he[q.id] })) : void 0,
|
|
1444
1444
|
className: d(
|
|
1445
1445
|
// A caption over its rows, not a band across the table: same
|
|
1446
1446
|
// surface as the rows, no rules, and the count as a quiet pill.
|
|
@@ -1449,21 +1449,21 @@ function Es({
|
|
|
1449
1449
|
N > 0 ? "pt-5" : "pt-3",
|
|
1450
1450
|
q.tone === "danger" ? "text-danger-fg" : q.tone === "muted" ? "text-text-subtle" : "text-text",
|
|
1451
1451
|
w && "sticky z-10",
|
|
1452
|
-
|
|
1452
|
+
v && "cursor-pointer select-none"
|
|
1453
1453
|
),
|
|
1454
|
-
"aria-expanded":
|
|
1455
|
-
style: w ? { top:
|
|
1456
|
-
children:
|
|
1454
|
+
"aria-expanded": v ? !re : void 0,
|
|
1455
|
+
style: w ? { top: F ? 28 : 0 } : void 0,
|
|
1456
|
+
children: b ? b(
|
|
1457
1457
|
q,
|
|
1458
|
-
|
|
1459
|
-
) : /* @__PURE__ */ c(
|
|
1460
|
-
|
|
1461
|
-
|
|
1458
|
+
R.map((he) => he.item)
|
|
1459
|
+
) : /* @__PURE__ */ c($e, { children: [
|
|
1460
|
+
v && /* @__PURE__ */ e(
|
|
1461
|
+
Oe,
|
|
1462
1462
|
{
|
|
1463
1463
|
"aria-hidden": !0,
|
|
1464
1464
|
className: d(
|
|
1465
1465
|
"size-icon-md shrink-0 text-text-subtle transition-transform duration-fast ease-out",
|
|
1466
|
-
!
|
|
1466
|
+
!re && "rotate-90"
|
|
1467
1467
|
)
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
@@ -1482,14 +1482,14 @@ function Es({
|
|
|
1482
1482
|
},
|
|
1483
1483
|
`group-${q.id}`
|
|
1484
1484
|
);
|
|
1485
|
-
return
|
|
1485
|
+
return re ? [ye] : [
|
|
1486
1486
|
ye,
|
|
1487
|
-
...
|
|
1487
|
+
...R.map(({ item: he, index: xe }, Pe) => K(he, xe, Pe === 0))
|
|
1488
1488
|
];
|
|
1489
1489
|
});
|
|
1490
1490
|
})();
|
|
1491
|
-
return /* @__PURE__ */ c("div", { ref: x, className: ce, onKeyDown: o ?
|
|
1492
|
-
|
|
1491
|
+
return /* @__PURE__ */ c("div", { ref: x, className: ce, onKeyDown: o ? E : void 0, children: [
|
|
1492
|
+
Y && /* @__PURE__ */ c(
|
|
1493
1493
|
"div",
|
|
1494
1494
|
{
|
|
1495
1495
|
className: d(
|
|
@@ -1497,26 +1497,26 @@ function Es({
|
|
|
1497
1497
|
// sticky group headers park against.
|
|
1498
1498
|
"flex h-row-sm items-end gap-3 border-b border-border bg-surface px-5 pb-2",
|
|
1499
1499
|
"text-xs font-semibold uppercase tracking-wider text-text-disabled",
|
|
1500
|
-
|
|
1500
|
+
F && "sticky top-0 z-20"
|
|
1501
1501
|
),
|
|
1502
1502
|
children: [
|
|
1503
|
-
|
|
1503
|
+
C && /* @__PURE__ */ e("span", { className: "flex items-center", children: /* @__PURE__ */ e(
|
|
1504
1504
|
we,
|
|
1505
1505
|
{
|
|
1506
1506
|
checked: ie,
|
|
1507
1507
|
indeterminate: G,
|
|
1508
|
-
onChange: (
|
|
1508
|
+
onChange: (S) => M(S.target.checked),
|
|
1509
1509
|
"aria-label": "Alles selecteren"
|
|
1510
1510
|
}
|
|
1511
1511
|
) }),
|
|
1512
|
-
|
|
1512
|
+
Y
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
1516
|
-
/* @__PURE__ */ e("ul", { "aria-label":
|
|
1517
|
-
|
|
1516
|
+
/* @__PURE__ */ e("ul", { "aria-label": te, className: "flex flex-col", children: j }),
|
|
1517
|
+
C && k.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: [
|
|
1518
1518
|
/* @__PURE__ */ c("span", { className: "text-sm font-medium", children: [
|
|
1519
|
-
|
|
1519
|
+
k.length,
|
|
1520
1520
|
" geselecteerd"
|
|
1521
1521
|
] }),
|
|
1522
1522
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "mx-1.5 h-4 w-px bg-current opacity-25" }),
|
|
@@ -1526,7 +1526,7 @@ function Es({
|
|
|
1526
1526
|
"button",
|
|
1527
1527
|
{
|
|
1528
1528
|
type: "button",
|
|
1529
|
-
onClick: () =>
|
|
1529
|
+
onClick: () => P?.([]),
|
|
1530
1530
|
"aria-label": "Selectie wissen",
|
|
1531
1531
|
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",
|
|
1532
1532
|
children: /* @__PURE__ */ e(Se, { className: "size-icon-lg" })
|
|
@@ -1674,7 +1674,7 @@ function Ue({
|
|
|
1674
1674
|
tableColumns: u,
|
|
1675
1675
|
tableRows: i
|
|
1676
1676
|
}) {
|
|
1677
|
-
const
|
|
1677
|
+
const p = r ?? (o ? "table" : "text"), m = n ?? i ?? _r[p], f = s ?? u ?? (p === "cards" ? 3 : 6), g = /* @__PURE__ */ e("div", { className: d("w-full animate-pulse", l), "aria-hidden": !0, children: a ?? /* @__PURE__ */ e(Dr, { shape: p, rows: m, columns: f }) });
|
|
1678
1678
|
return t === "inline" ? g : /* @__PURE__ */ e("main", { className: "flex-1 bg-surface p-6", children: g });
|
|
1679
1679
|
}
|
|
1680
1680
|
const $r = ({
|
|
@@ -1687,22 +1687,22 @@ const $r = ({
|
|
|
1687
1687
|
className: o,
|
|
1688
1688
|
backLabel: u = "Back",
|
|
1689
1689
|
backClassName: i,
|
|
1690
|
-
onBack:
|
|
1690
|
+
onBack: p,
|
|
1691
1691
|
editable: m = !1,
|
|
1692
1692
|
onTitleChange: f
|
|
1693
1693
|
}) => {
|
|
1694
|
-
const [g,
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}, [r]),
|
|
1694
|
+
const [g, b] = B(!1), [w, v] = B(r), h = se(null);
|
|
1695
|
+
Z(() => {
|
|
1696
|
+
v(r);
|
|
1697
|
+
}, [r]), Z(() => {
|
|
1698
1698
|
g && h.current && (h.current.focus(), h.current.select());
|
|
1699
1699
|
}, [g]);
|
|
1700
|
-
const
|
|
1701
|
-
m &&
|
|
1702
|
-
},
|
|
1703
|
-
|
|
1704
|
-
},
|
|
1705
|
-
D.key === "Enter" ? h.current?.blur() : D.key === "Escape" && (
|
|
1700
|
+
const C = () => {
|
|
1701
|
+
m && b(!0);
|
|
1702
|
+
}, k = () => {
|
|
1703
|
+
b(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : v(r);
|
|
1704
|
+
}, P = (D) => {
|
|
1705
|
+
D.key === "Enter" ? h.current?.blur() : D.key === "Escape" && (v(r), b(!1));
|
|
1706
1706
|
};
|
|
1707
1707
|
return /* @__PURE__ */ c(
|
|
1708
1708
|
"div",
|
|
@@ -1719,14 +1719,14 @@ const $r = ({
|
|
|
1719
1719
|
children: [
|
|
1720
1720
|
/* @__PURE__ */ c("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
1721
1721
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
1722
|
-
|
|
1722
|
+
p && // Ghost: a framed box around a back chevron makes the way out of a
|
|
1723
1723
|
// page look like the page's primary control.
|
|
1724
1724
|
/* @__PURE__ */ e(
|
|
1725
1725
|
ae,
|
|
1726
1726
|
{
|
|
1727
1727
|
variant: "ghost",
|
|
1728
|
-
onClick:
|
|
1729
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1728
|
+
onClick: p,
|
|
1729
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: Ee, size: "md" }),
|
|
1730
1730
|
iconOnly: !0
|
|
1731
1731
|
}
|
|
1732
1732
|
),
|
|
@@ -1737,16 +1737,16 @@ const $r = ({
|
|
|
1737
1737
|
ref: h,
|
|
1738
1738
|
type: "text",
|
|
1739
1739
|
value: w,
|
|
1740
|
-
onChange: (D) =>
|
|
1741
|
-
onBlur:
|
|
1742
|
-
onKeyDown:
|
|
1740
|
+
onChange: (D) => v(D.target.value),
|
|
1741
|
+
onBlur: k,
|
|
1742
|
+
onKeyDown: P,
|
|
1743
1743
|
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"
|
|
1744
1744
|
}
|
|
1745
1745
|
) : /* @__PURE__ */ c("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
1746
1746
|
/* @__PURE__ */ e(
|
|
1747
1747
|
"h2",
|
|
1748
1748
|
{
|
|
1749
|
-
onClick:
|
|
1749
|
+
onClick: C,
|
|
1750
1750
|
className: d(
|
|
1751
1751
|
"text-lg font-semibold tracking-title truncate",
|
|
1752
1752
|
m && "cursor-pointer"
|
|
@@ -1760,7 +1760,7 @@ const $r = ({
|
|
|
1760
1760
|
Mt,
|
|
1761
1761
|
{
|
|
1762
1762
|
size: 15,
|
|
1763
|
-
onClick:
|
|
1763
|
+
onClick: C,
|
|
1764
1764
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
1765
1765
|
}
|
|
1766
1766
|
)
|
|
@@ -1797,8 +1797,8 @@ const $r = ({
|
|
|
1797
1797
|
ae,
|
|
1798
1798
|
{
|
|
1799
1799
|
variant: D.variant ?? "secondary",
|
|
1800
|
-
onClick: (
|
|
1801
|
-
|
|
1800
|
+
onClick: (Y) => {
|
|
1801
|
+
Y.stopPropagation(), Y.target.blur(), D.onClick();
|
|
1802
1802
|
},
|
|
1803
1803
|
disabled: D.disabled,
|
|
1804
1804
|
leftIcon: D.icon,
|
|
@@ -1826,16 +1826,16 @@ const $r = ({
|
|
|
1826
1826
|
onTitleChange: o,
|
|
1827
1827
|
surface: u = !1,
|
|
1828
1828
|
headerContent: i,
|
|
1829
|
-
loading:
|
|
1829
|
+
loading: p = !1,
|
|
1830
1830
|
loadingShape: m = "table",
|
|
1831
1831
|
empty: f,
|
|
1832
1832
|
padding: g = "md",
|
|
1833
|
-
scroll:
|
|
1833
|
+
scroll: b = !0,
|
|
1834
1834
|
className: w,
|
|
1835
|
-
contentClassName:
|
|
1835
|
+
contentClassName: v,
|
|
1836
1836
|
children: h
|
|
1837
1837
|
}) => {
|
|
1838
|
-
const
|
|
1838
|
+
const C = p ? /* @__PURE__ */ e(Ue, { variant: "inline", shape: m }) : f ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12", children: f }) : h;
|
|
1839
1839
|
return /* @__PURE__ */ c(
|
|
1840
1840
|
"div",
|
|
1841
1841
|
{
|
|
@@ -1844,7 +1844,7 @@ const $r = ({
|
|
|
1844
1844
|
// element that scrolls today. Taking the scroll over here is what pins
|
|
1845
1845
|
// the header; without `min-h-0` the body would grow past the card
|
|
1846
1846
|
// instead of scrolling inside it.
|
|
1847
|
-
|
|
1847
|
+
b ? "flex h-full min-h-0 flex-col" : "flex flex-col",
|
|
1848
1848
|
w
|
|
1849
1849
|
),
|
|
1850
1850
|
children: [
|
|
@@ -1859,7 +1859,7 @@ const $r = ({
|
|
|
1859
1859
|
onBack: a,
|
|
1860
1860
|
editable: l,
|
|
1861
1861
|
onTitleChange: o,
|
|
1862
|
-
className:
|
|
1862
|
+
className: b ? "shrink-0" : void 0,
|
|
1863
1863
|
children: i
|
|
1864
1864
|
}
|
|
1865
1865
|
),
|
|
@@ -1867,11 +1867,11 @@ const $r = ({
|
|
|
1867
1867
|
"div",
|
|
1868
1868
|
{
|
|
1869
1869
|
className: d(
|
|
1870
|
-
|
|
1870
|
+
b && "min-h-0 flex-1 overflow-y-auto",
|
|
1871
1871
|
Lr[g],
|
|
1872
|
-
|
|
1872
|
+
v
|
|
1873
1873
|
),
|
|
1874
|
-
children:
|
|
1874
|
+
children: C
|
|
1875
1875
|
}
|
|
1876
1876
|
)
|
|
1877
1877
|
]
|
|
@@ -1925,7 +1925,7 @@ const $r = ({
|
|
|
1925
1925
|
variant: "secondary",
|
|
1926
1926
|
onClick: r,
|
|
1927
1927
|
"aria-label": n,
|
|
1928
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1928
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: Ee, size: "sm" }),
|
|
1929
1929
|
iconOnly: !0
|
|
1930
1930
|
}
|
|
1931
1931
|
),
|
|
@@ -1960,7 +1960,7 @@ function Or() {
|
|
|
1960
1960
|
return wt(ct);
|
|
1961
1961
|
}
|
|
1962
1962
|
function Is() {
|
|
1963
|
-
const [t, r] =
|
|
1963
|
+
const [t, r] = B(null), n = ge(
|
|
1964
1964
|
() => ({
|
|
1965
1965
|
setTrail: (s, a) => r((l) => a ? { ownerId: s, entry: a } : l && l.ownerId !== s ? l : null)
|
|
1966
1966
|
}),
|
|
@@ -1984,43 +1984,43 @@ const Pr = {
|
|
|
1984
1984
|
title: o,
|
|
1985
1985
|
loading: u = !1,
|
|
1986
1986
|
loadingShape: i = "form",
|
|
1987
|
-
padding:
|
|
1987
|
+
padding: p = "md",
|
|
1988
1988
|
className: m,
|
|
1989
1989
|
contentClassName: f
|
|
1990
1990
|
}) => {
|
|
1991
|
-
const g = Or(),
|
|
1991
|
+
const g = Or(), b = Nt(), w = se(a);
|
|
1992
1992
|
w.current = a;
|
|
1993
|
-
const
|
|
1993
|
+
const v = !!a, h = se(r);
|
|
1994
1994
|
h.current = r;
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1999
|
-
[...n, ...r].map((
|
|
1995
|
+
const C = se(n);
|
|
1996
|
+
C.current = n;
|
|
1997
|
+
const k = s === "header", P = k && (r.length > 0 || n.length > 0);
|
|
1998
|
+
P && JSON.stringify(
|
|
1999
|
+
[...n, ...r].map((F) => [F.id, F.label, F.variant, F.disabled])
|
|
2000
2000
|
);
|
|
2001
2001
|
const D = ge(() => {
|
|
2002
|
-
if (!
|
|
2003
|
-
const
|
|
2004
|
-
...
|
|
2002
|
+
if (!P) return;
|
|
2003
|
+
const F = (_) => (I, O) => ({
|
|
2004
|
+
...I,
|
|
2005
2005
|
onClick: () => {
|
|
2006
|
-
(
|
|
2006
|
+
(_ === "primary" ? h.current : C.current)[O]?.onClick();
|
|
2007
2007
|
}
|
|
2008
2008
|
});
|
|
2009
2009
|
return {
|
|
2010
|
-
actions: h.current.map(
|
|
2011
|
-
secondaryActions:
|
|
2010
|
+
actions: h.current.map(F("primary")),
|
|
2011
|
+
secondaryActions: C.current.map(F("secondary"))
|
|
2012
2012
|
};
|
|
2013
|
-
}, [
|
|
2014
|
-
|
|
2015
|
-
if (g && !(!
|
|
2016
|
-
return g.setTrail(
|
|
2013
|
+
}, [P]);
|
|
2014
|
+
Z(() => {
|
|
2015
|
+
if (g && !(!v && !o && !D))
|
|
2016
|
+
return g.setTrail(b, {
|
|
2017
2017
|
title: o,
|
|
2018
|
-
onBack:
|
|
2018
|
+
onBack: v ? () => w.current?.() : void 0,
|
|
2019
2019
|
actions: D?.actions,
|
|
2020
2020
|
secondaryActions: D?.secondaryActions
|
|
2021
|
-
}), () => g.setTrail(
|
|
2022
|
-
}, [g,
|
|
2023
|
-
const
|
|
2021
|
+
}), () => g.setTrail(b, null);
|
|
2022
|
+
}, [g, b, o, v, D]);
|
|
2023
|
+
const Y = !k && (r.length > 0 || n.length > 0);
|
|
2024
2024
|
return (
|
|
2025
2025
|
/**
|
|
2026
2026
|
* `min-h-full` + a sticky footer, rather than a nested scroll container.
|
|
@@ -2029,25 +2029,25 @@ const Pr = {
|
|
|
2029
2029
|
* its footer to the bottom, and a long one keeps it pinned while scrolling.
|
|
2030
2030
|
*/
|
|
2031
2031
|
/* @__PURE__ */ c("div", { className: d("flex min-h-full flex-col", m), children: [
|
|
2032
|
-
!g && (
|
|
2033
|
-
|
|
2032
|
+
!g && (v || o || P) && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-2 px-5 pt-4", children: [
|
|
2033
|
+
v && /* @__PURE__ */ e(
|
|
2034
2034
|
ae,
|
|
2035
2035
|
{
|
|
2036
2036
|
variant: "ghost",
|
|
2037
2037
|
onClick: () => w.current?.(),
|
|
2038
2038
|
"aria-label": l,
|
|
2039
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2039
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: Ee, size: "sm" }),
|
|
2040
2040
|
iconOnly: !0
|
|
2041
2041
|
}
|
|
2042
2042
|
),
|
|
2043
2043
|
o && /* @__PURE__ */ e("h2", { className: "min-w-0 truncate text-md font-semibold tracking-title text-text", children: o }),
|
|
2044
|
-
|
|
2044
|
+
k && /* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
2045
2045
|
n.length > 0 && /* @__PURE__ */ e(ke, { actions: n, defaultVariant: "ghost" }),
|
|
2046
2046
|
r.length > 0 && /* @__PURE__ */ e(ke, { actions: r })
|
|
2047
2047
|
] })
|
|
2048
2048
|
] }),
|
|
2049
|
-
/* @__PURE__ */ e("div", { className: d("flex-1", Pr[
|
|
2050
|
-
|
|
2049
|
+
/* @__PURE__ */ e("div", { className: d("flex-1", Pr[p], f), children: u ? /* @__PURE__ */ e(Ue, { variant: "inline", shape: i }) : t }),
|
|
2050
|
+
Y && /* @__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: [
|
|
2051
2051
|
n.length > 0 && /* @__PURE__ */ e(ke, { actions: n, defaultVariant: "ghost" }),
|
|
2052
2052
|
r.length > 0 && /* @__PURE__ */ e(ke, { actions: r, className: "ml-auto" })
|
|
2053
2053
|
] })
|
|
@@ -2091,7 +2091,7 @@ function js({
|
|
|
2091
2091
|
}) {
|
|
2092
2092
|
return /* @__PURE__ */ c("section", { className: d("flex flex-col gap-2", l), children: [
|
|
2093
2093
|
/* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
2094
|
-
t && /* @__PURE__ */ e(
|
|
2094
|
+
t && /* @__PURE__ */ e(Q, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
|
|
2095
2095
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
2096
2096
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-text", children: r }),
|
|
2097
2097
|
n && /* @__PURE__ */ e("p", { className: "text-xs text-text-muted", children: n })
|
|
@@ -2121,12 +2121,12 @@ function Rs({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
),
|
|
2123
2123
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: t }),
|
|
2124
|
-
/* @__PURE__ */ e(
|
|
2124
|
+
/* @__PURE__ */ e(Q, { icon: rt, size: "xs", className: "opacity-70" })
|
|
2125
2125
|
]
|
|
2126
2126
|
}
|
|
2127
2127
|
);
|
|
2128
2128
|
}
|
|
2129
|
-
const jr = () => /* @__PURE__ */ e(
|
|
2129
|
+
const jr = () => /* @__PURE__ */ e(Q, { icon: At, size: "md", color: "current" }), Rr = () => /* @__PURE__ */ e(Q, { icon: Ee, size: "md", color: "current" }), Fr = () => /* @__PURE__ */ e(Q, { icon: Oe, size: "md", color: "current" }), Be = be(
|
|
2130
2130
|
({
|
|
2131
2131
|
value: t,
|
|
2132
2132
|
onChange: r,
|
|
@@ -2137,50 +2137,50 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2137
2137
|
className: o,
|
|
2138
2138
|
minDate: u,
|
|
2139
2139
|
maxDate: i,
|
|
2140
|
-
format:
|
|
2140
|
+
format: p = "MM/dd/yyyy",
|
|
2141
2141
|
withTime: m = !1
|
|
2142
2142
|
}, f) => {
|
|
2143
|
-
const [g,
|
|
2144
|
-
|
|
2143
|
+
const [g, b] = B(!1), [w, v] = B(() => t || /* @__PURE__ */ new Date()), h = se(null), C = se(null), k = Te(g, C);
|
|
2144
|
+
Z(() => {
|
|
2145
2145
|
const y = (x) => {
|
|
2146
|
-
h.current && !h.current.contains(x.target) &&
|
|
2146
|
+
h.current && !h.current.contains(x.target) && b(!1);
|
|
2147
2147
|
};
|
|
2148
2148
|
return g && document.addEventListener("mousedown", y), () => {
|
|
2149
2149
|
document.removeEventListener("mousedown", y);
|
|
2150
2150
|
};
|
|
2151
2151
|
}, [g]);
|
|
2152
|
-
const
|
|
2152
|
+
const P = (y) => {
|
|
2153
2153
|
if (!y) return "";
|
|
2154
|
-
const x = y.getDate().toString().padStart(2, "0"),
|
|
2155
|
-
return m ? `${
|
|
2156
|
-
}, D = (y) => `${y.getHours().toString().padStart(2, "0")}:${y.getMinutes().toString().padStart(2, "0")}`,
|
|
2157
|
-
const [x,
|
|
2158
|
-
if (Number.isNaN(x) || Number.isNaN(
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
},
|
|
2162
|
-
const y = w.getFullYear(), x = w.getMonth(),
|
|
2163
|
-
|
|
2164
|
-
const
|
|
2154
|
+
const x = y.getDate().toString().padStart(2, "0"), E = (y.getMonth() + 1).toString().padStart(2, "0"), $ = y.getFullYear(), T = p === "dd/MM/yyyy" ? `${x}/${E}/${$}` : p === "yyyy-MM-dd" ? `${$}-${E}-${x}` : `${E}/${x}/${$}`;
|
|
2155
|
+
return m ? `${T} ${D(y)}` : T;
|
|
2156
|
+
}, D = (y) => `${y.getHours().toString().padStart(2, "0")}:${y.getMinutes().toString().padStart(2, "0")}`, Y = (y) => {
|
|
2157
|
+
const [x, E] = y.split(":").map(Number);
|
|
2158
|
+
if (Number.isNaN(x) || Number.isNaN(E)) return;
|
|
2159
|
+
const $ = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
2160
|
+
$.setHours(x, E, 0, 0), r?.($);
|
|
2161
|
+
}, F = () => {
|
|
2162
|
+
const y = w.getFullYear(), x = w.getMonth(), E = new Date(y, x, 1), $ = new Date(E);
|
|
2163
|
+
$.setDate($.getDate() - E.getDay());
|
|
2164
|
+
const T = [], L = new Date($);
|
|
2165
2165
|
for (let M = 0; M < 42; M++)
|
|
2166
|
-
|
|
2167
|
-
return
|
|
2168
|
-
},
|
|
2166
|
+
T.push(new Date(L)), L.setDate(L.getDate() + 1);
|
|
2167
|
+
return T;
|
|
2168
|
+
}, _ = (y) => {
|
|
2169
2169
|
if (y.getMonth() === w.getMonth() && !(u && y < u) && !(i && y > i)) {
|
|
2170
2170
|
if (m) {
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2171
|
+
const E = new Date(y);
|
|
2172
|
+
E.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(E);
|
|
2173
2173
|
return;
|
|
2174
2174
|
}
|
|
2175
|
-
r?.(y),
|
|
2175
|
+
r?.(y), b(!1);
|
|
2176
2176
|
}
|
|
2177
|
-
},
|
|
2178
|
-
|
|
2179
|
-
},
|
|
2180
|
-
|
|
2181
|
-
},
|
|
2182
|
-
r?.(null),
|
|
2183
|
-
},
|
|
2177
|
+
}, I = () => {
|
|
2178
|
+
v(new Date(w.getFullYear(), w.getMonth() - 1, 1));
|
|
2179
|
+
}, O = () => {
|
|
2180
|
+
v(new Date(w.getFullYear(), w.getMonth() + 1, 1));
|
|
2181
|
+
}, H = () => {
|
|
2182
|
+
r?.(null), b(!1);
|
|
2183
|
+
}, U = d(
|
|
2184
2184
|
"w-full border border-border-strong rounded-tile transition-colors duration-fast",
|
|
2185
2185
|
"bg-surface text-text",
|
|
2186
2186
|
"placeholder:text-text-muted",
|
|
@@ -2193,7 +2193,7 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2193
2193
|
"h-control-md w-full px-3 text-base": l === "full"
|
|
2194
2194
|
},
|
|
2195
2195
|
o
|
|
2196
|
-
),
|
|
2196
|
+
), te = F(), W = [
|
|
2197
2197
|
"January",
|
|
2198
2198
|
"February",
|
|
2199
2199
|
"March",
|
|
@@ -2208,26 +2208,26 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2208
2208
|
"December"
|
|
2209
2209
|
];
|
|
2210
2210
|
return /* @__PURE__ */ c("div", { ref: h, className: "relative", children: [
|
|
2211
|
-
/* @__PURE__ */ c("div", { ref:
|
|
2211
|
+
/* @__PURE__ */ c("div", { ref: C, className: "relative", children: [
|
|
2212
2212
|
/* @__PURE__ */ e(
|
|
2213
2213
|
"input",
|
|
2214
2214
|
{
|
|
2215
2215
|
ref: f,
|
|
2216
2216
|
type: "text",
|
|
2217
|
-
value:
|
|
2217
|
+
value: P(t ?? null),
|
|
2218
2218
|
placeholder: n,
|
|
2219
2219
|
disabled: s,
|
|
2220
2220
|
required: a,
|
|
2221
2221
|
readOnly: !0,
|
|
2222
|
-
onClick: () => !s &&
|
|
2223
|
-
className: d(
|
|
2222
|
+
onClick: () => !s && b(!g),
|
|
2223
|
+
className: d(U, "pr-10 cursor-pointer")
|
|
2224
2224
|
}
|
|
2225
2225
|
),
|
|
2226
2226
|
/* @__PURE__ */ e(
|
|
2227
2227
|
"button",
|
|
2228
2228
|
{
|
|
2229
2229
|
type: "button",
|
|
2230
|
-
onClick: () => !s &&
|
|
2230
|
+
onClick: () => !s && b(!g),
|
|
2231
2231
|
disabled: s,
|
|
2232
2232
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
2233
2233
|
children: /* @__PURE__ */ e(jr, {})
|
|
@@ -2237,31 +2237,31 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2237
2237
|
g && /* @__PURE__ */ c(
|
|
2238
2238
|
"div",
|
|
2239
2239
|
{
|
|
2240
|
-
style:
|
|
2240
|
+
style: k,
|
|
2241
2241
|
className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel",
|
|
2242
2242
|
children: [
|
|
2243
2243
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2244
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
2244
|
+
/* @__PURE__ */ e("button", { onClick: I, className: "p-1 hover:bg-surface-hover rounded", children: /* @__PURE__ */ e(Rr, {}) }),
|
|
2245
2245
|
/* @__PURE__ */ c("h3", { className: "text-sm font-medium text-text", children: [
|
|
2246
|
-
|
|
2246
|
+
W[w.getMonth()],
|
|
2247
2247
|
" ",
|
|
2248
2248
|
w.getFullYear()
|
|
2249
2249
|
] }),
|
|
2250
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
2250
|
+
/* @__PURE__ */ e("button", { onClick: O, className: "p-1 hover:bg-surface-hover rounded", children: /* @__PURE__ */ e(Fr, {}) })
|
|
2251
2251
|
] }),
|
|
2252
2252
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((y) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: y }, y)) }),
|
|
2253
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children:
|
|
2254
|
-
const
|
|
2253
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: te.map((y, x) => {
|
|
2254
|
+
const E = y.getMonth() === w.getMonth(), $ = t && y.toDateString() === t.toDateString(), T = y.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !E || u && y < u || i && y > i;
|
|
2255
2255
|
return /* @__PURE__ */ e(
|
|
2256
2256
|
"button",
|
|
2257
2257
|
{
|
|
2258
|
-
onClick: () => !
|
|
2259
|
-
disabled:
|
|
2258
|
+
onClick: () => !L && _(y),
|
|
2259
|
+
disabled: L,
|
|
2260
2260
|
className: d("w-8 h-8 text-sm rounded transition-colors duration-fast", {
|
|
2261
|
-
"text-text hover:bg-surface-hover":
|
|
2262
|
-
"bg-accent text-accent-fg":
|
|
2263
|
-
"bg-surface-hover text-text":
|
|
2264
|
-
"text-text-muted cursor-not-allowed":
|
|
2261
|
+
"text-text hover:bg-surface-hover": E && !$ && !L,
|
|
2262
|
+
"bg-accent text-accent-fg": $,
|
|
2263
|
+
"bg-surface-hover text-text": T && !$,
|
|
2264
|
+
"text-text-muted cursor-not-allowed": L
|
|
2265
2265
|
}),
|
|
2266
2266
|
children: y.getDate()
|
|
2267
2267
|
},
|
|
@@ -2276,17 +2276,17 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2276
2276
|
id: "datepicker-time",
|
|
2277
2277
|
type: "time",
|
|
2278
2278
|
value: t ? D(t) : "",
|
|
2279
|
-
onChange: (y) =>
|
|
2279
|
+
onChange: (y) => Y(y.target.value),
|
|
2280
2280
|
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"
|
|
2281
2281
|
}
|
|
2282
2282
|
)
|
|
2283
2283
|
] }),
|
|
2284
2284
|
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-border", children: [
|
|
2285
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
2285
|
+
/* @__PURE__ */ e("button", { onClick: H, className: "text-sm text-text-muted hover:text-text", children: "Clear" }),
|
|
2286
2286
|
/* @__PURE__ */ e(
|
|
2287
2287
|
"button",
|
|
2288
2288
|
{
|
|
2289
|
-
onClick: () =>
|
|
2289
|
+
onClick: () => b(!1),
|
|
2290
2290
|
className: "text-sm text-info-fg hover:underline",
|
|
2291
2291
|
children: "Close"
|
|
2292
2292
|
}
|
|
@@ -2308,7 +2308,7 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2308
2308
|
className: o,
|
|
2309
2309
|
disabled: u,
|
|
2310
2310
|
...i
|
|
2311
|
-
},
|
|
2311
|
+
}, p) => /* @__PURE__ */ c(
|
|
2312
2312
|
"div",
|
|
2313
2313
|
{
|
|
2314
2314
|
className: d(
|
|
@@ -2322,11 +2322,11 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2322
2322
|
l
|
|
2323
2323
|
),
|
|
2324
2324
|
children: [
|
|
2325
|
-
/* @__PURE__ */ e(
|
|
2325
|
+
/* @__PURE__ */ e(Q, { icon: Ie, size: "md", color: "current", className: "shrink-0" }),
|
|
2326
2326
|
/* @__PURE__ */ e(
|
|
2327
2327
|
"input",
|
|
2328
2328
|
{
|
|
2329
|
-
ref:
|
|
2329
|
+
ref: p,
|
|
2330
2330
|
type: "search",
|
|
2331
2331
|
value: t,
|
|
2332
2332
|
disabled: u,
|
|
@@ -2354,7 +2354,7 @@ const jr = () => /* @__PURE__ */ e(X, { icon: At, size: "md", color: "current" }
|
|
|
2354
2354
|
"aria-label": a,
|
|
2355
2355
|
onClick: () => r(""),
|
|
2356
2356
|
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",
|
|
2357
|
-
children: /* @__PURE__ */ e(
|
|
2357
|
+
children: /* @__PURE__ */ e(Q, { icon: Se, size: "sm", color: "current" })
|
|
2358
2358
|
}
|
|
2359
2359
|
) : n && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: n })
|
|
2360
2360
|
]
|
|
@@ -2373,39 +2373,39 @@ const Br = ({
|
|
|
2373
2373
|
showCheck: u = !0,
|
|
2374
2374
|
header: i
|
|
2375
2375
|
}) => {
|
|
2376
|
-
const [
|
|
2377
|
-
|
|
2376
|
+
const [p, m] = B(!1), [f, g] = B(null), [b, w] = B({ top: 0, left: 0 }), v = se(null), h = se(null), C = se(null), k = se(null), P = Te(p, h, { placement: a }), D = se(null), Y = () => Array.from(
|
|
2377
|
+
k.current?.querySelectorAll(
|
|
2378
2378
|
"button[data-option-value]:not(:disabled)"
|
|
2379
2379
|
) ?? []
|
|
2380
2380
|
);
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
}, [
|
|
2384
|
-
const
|
|
2381
|
+
Z(() => {
|
|
2382
|
+
p && Y()[0]?.focus();
|
|
2383
|
+
}, [p, Y]);
|
|
2384
|
+
const F = (y) => {
|
|
2385
2385
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(y.key)) return;
|
|
2386
|
-
const
|
|
2387
|
-
if (
|
|
2386
|
+
const E = Y();
|
|
2387
|
+
if (E.length === 0) return;
|
|
2388
2388
|
y.preventDefault();
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2389
|
+
const $ = E.indexOf(document.activeElement), T = y.key === "Home" ? 0 : y.key === "End" ? E.length - 1 : y.key === "ArrowDown" ? ($ + 1) % E.length : ($ - 1 + E.length) % E.length;
|
|
2390
|
+
E[T]?.focus();
|
|
2391
2391
|
};
|
|
2392
|
-
|
|
2392
|
+
Z(() => {
|
|
2393
2393
|
const y = (x) => {
|
|
2394
|
-
|
|
2394
|
+
v.current && (!v.current.contains(x.target) || C.current && !C.current.contains(x.target)) && (m(!1), g(null), D.current && (clearTimeout(D.current), D.current = null));
|
|
2395
2395
|
};
|
|
2396
|
-
return
|
|
2396
|
+
return p && document.addEventListener("mousedown", y), () => {
|
|
2397
2397
|
document.removeEventListener("mousedown", y);
|
|
2398
2398
|
};
|
|
2399
|
-
}, [
|
|
2399
|
+
}, [p]), Z(() => {
|
|
2400
2400
|
const y = (x) => {
|
|
2401
2401
|
x.key === "Escape" && (m(!1), g(null), h.current?.focus(), D.current && (clearTimeout(D.current), D.current = null));
|
|
2402
2402
|
};
|
|
2403
|
-
return
|
|
2403
|
+
return p && document.addEventListener("keydown", y), () => {
|
|
2404
2404
|
document.removeEventListener("keydown", y);
|
|
2405
2405
|
};
|
|
2406
|
-
}, [
|
|
2407
|
-
if (f &&
|
|
2408
|
-
const y =
|
|
2406
|
+
}, [p]), Z(() => {
|
|
2407
|
+
if (f && v.current) {
|
|
2408
|
+
const y = v.current.querySelector(
|
|
2409
2409
|
`[data-option-value="${f}"]`
|
|
2410
2410
|
);
|
|
2411
2411
|
if (y) {
|
|
@@ -2416,32 +2416,32 @@ const Br = ({
|
|
|
2416
2416
|
});
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
|
-
}, [f]),
|
|
2419
|
+
}, [f]), Z(() => () => {
|
|
2420
2420
|
D.current && clearTimeout(D.current);
|
|
2421
2421
|
}, []);
|
|
2422
|
-
const
|
|
2423
|
-
y.stopPropagation(), !l && (m(!
|
|
2424
|
-
},
|
|
2425
|
-
y.stopPropagation(), !x.disabled && !x.divider && (!x.children || x.children.length === 0) && (s?.(x.value,
|
|
2426
|
-
},
|
|
2422
|
+
const _ = (y) => {
|
|
2423
|
+
y.stopPropagation(), !l && (m(!p), g(null), D.current && (clearTimeout(D.current), D.current = null));
|
|
2424
|
+
}, I = (y, x, E) => {
|
|
2425
|
+
y.stopPropagation(), !x.disabled && !x.divider && (!x.children || x.children.length === 0) && (s?.(x.value, E), m(!1), g(null));
|
|
2426
|
+
}, O = (y) => {
|
|
2427
2427
|
D.current && (clearTimeout(D.current), D.current = null), y.children && y.children.length > 0 ? g(y.value) : g(null);
|
|
2428
|
-
},
|
|
2428
|
+
}, H = (y) => {
|
|
2429
2429
|
y.children && y.children.length > 0 ? D.current = setTimeout(() => {
|
|
2430
2430
|
g(null);
|
|
2431
2431
|
}, 150) : g(null);
|
|
2432
|
-
},
|
|
2433
|
-
y.stopPropagation(), !x.disabled && !x.divider && (s?.(x.value,
|
|
2434
|
-
},
|
|
2432
|
+
}, U = (y, x, E) => {
|
|
2433
|
+
y.stopPropagation(), !x.disabled && !x.divider && (s?.(x.value, E), m(!1), g(null));
|
|
2434
|
+
}, te = d(
|
|
2435
2435
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
2436
2436
|
"max-h-60 overflow-auto"
|
|
2437
|
-
),
|
|
2437
|
+
), W = d(
|
|
2438
2438
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
2439
2439
|
"max-h-60 overflow-auto"
|
|
2440
2440
|
);
|
|
2441
2441
|
return /* @__PURE__ */ c(
|
|
2442
2442
|
"div",
|
|
2443
2443
|
{
|
|
2444
|
-
ref:
|
|
2444
|
+
ref: v,
|
|
2445
2445
|
className: d(
|
|
2446
2446
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
2447
2447
|
o
|
|
@@ -2451,45 +2451,45 @@ const Br = ({
|
|
|
2451
2451
|
"button",
|
|
2452
2452
|
{
|
|
2453
2453
|
ref: h,
|
|
2454
|
-
onClick:
|
|
2454
|
+
onClick: _,
|
|
2455
2455
|
disabled: l,
|
|
2456
2456
|
"aria-haspopup": "menu",
|
|
2457
|
-
"aria-expanded":
|
|
2457
|
+
"aria-expanded": p,
|
|
2458
2458
|
className: d("inline-flex items-center justify-center", {
|
|
2459
2459
|
"opacity-50 cursor-not-allowed": l
|
|
2460
2460
|
}),
|
|
2461
2461
|
children: t
|
|
2462
2462
|
}
|
|
2463
2463
|
),
|
|
2464
|
-
|
|
2464
|
+
p && /* @__PURE__ */ e(
|
|
2465
2465
|
"div",
|
|
2466
2466
|
{
|
|
2467
|
-
ref:
|
|
2468
|
-
className:
|
|
2469
|
-
style:
|
|
2470
|
-
onKeyDown:
|
|
2467
|
+
ref: k,
|
|
2468
|
+
className: te,
|
|
2469
|
+
style: P,
|
|
2470
|
+
onKeyDown: F,
|
|
2471
2471
|
children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
2472
2472
|
i && (typeof i == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: i }) : i),
|
|
2473
2473
|
r.map((y, x) => {
|
|
2474
2474
|
if (y.divider)
|
|
2475
2475
|
return /* @__PURE__ */ e("div", { className: "border-t border-border my-2" }, `divider-${x}`);
|
|
2476
|
-
const
|
|
2476
|
+
const E = y.children && y.children.length > 0, $ = f === y.value;
|
|
2477
2477
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
2478
2478
|
/* @__PURE__ */ c(
|
|
2479
2479
|
"button",
|
|
2480
2480
|
{
|
|
2481
2481
|
"data-option-value": y.value,
|
|
2482
2482
|
role: "menuitem",
|
|
2483
|
-
"aria-haspopup":
|
|
2484
|
-
onClick: (
|
|
2485
|
-
onMouseEnter: () =>
|
|
2486
|
-
onMouseLeave: () =>
|
|
2483
|
+
"aria-haspopup": E ? "menu" : void 0,
|
|
2484
|
+
onClick: (T) => I(T, y),
|
|
2485
|
+
onMouseEnter: () => O(y),
|
|
2486
|
+
onMouseLeave: () => H(y),
|
|
2487
2487
|
disabled: y.disabled,
|
|
2488
2488
|
className: d(
|
|
2489
2489
|
"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",
|
|
2490
2490
|
{
|
|
2491
2491
|
"opacity-50 cursor-not-allowed": y.disabled,
|
|
2492
|
-
"bg-surface-hover":
|
|
2492
|
+
"bg-surface-hover": $ && E
|
|
2493
2493
|
}
|
|
2494
2494
|
),
|
|
2495
2495
|
children: [
|
|
@@ -2502,19 +2502,19 @@ const Br = ({
|
|
|
2502
2502
|
] }),
|
|
2503
2503
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
2504
2504
|
u && n === y.value && /* @__PURE__ */ e(Ke, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
2505
|
-
|
|
2505
|
+
E && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
2506
2506
|
] })
|
|
2507
2507
|
]
|
|
2508
2508
|
}
|
|
2509
2509
|
),
|
|
2510
|
-
|
|
2510
|
+
E && $ && /* @__PURE__ */ e(
|
|
2511
2511
|
"div",
|
|
2512
2512
|
{
|
|
2513
|
-
ref:
|
|
2514
|
-
className:
|
|
2513
|
+
ref: C,
|
|
2514
|
+
className: W,
|
|
2515
2515
|
style: {
|
|
2516
|
-
top: `${
|
|
2517
|
-
left: `${
|
|
2516
|
+
top: `${b.top}px`,
|
|
2517
|
+
left: `${b.left}px`
|
|
2518
2518
|
},
|
|
2519
2519
|
onMouseEnter: () => {
|
|
2520
2520
|
D.current && (clearTimeout(D.current), D.current = null), g(y.value);
|
|
@@ -2524,33 +2524,33 @@ const Br = ({
|
|
|
2524
2524
|
g(null);
|
|
2525
2525
|
}, 150);
|
|
2526
2526
|
},
|
|
2527
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children: y.children?.map((
|
|
2528
|
-
if (
|
|
2527
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: y.children?.map((T, L) => {
|
|
2528
|
+
if (T.divider)
|
|
2529
2529
|
return /* @__PURE__ */ e(
|
|
2530
2530
|
"div",
|
|
2531
2531
|
{
|
|
2532
2532
|
className: "border-t border-border my-2"
|
|
2533
2533
|
},
|
|
2534
|
-
`divider-${
|
|
2534
|
+
`divider-${L}`
|
|
2535
2535
|
);
|
|
2536
|
-
const M = typeof n == "object" && n[y.value] && n[y.value].includes(
|
|
2536
|
+
const M = typeof n == "object" && n[y.value] && n[y.value].includes(T.value) || n === T.value;
|
|
2537
2537
|
return /* @__PURE__ */ c(
|
|
2538
2538
|
"button",
|
|
2539
2539
|
{
|
|
2540
|
-
onClick: (ce) =>
|
|
2541
|
-
disabled:
|
|
2540
|
+
onClick: (ce) => U(ce, T, y.value),
|
|
2541
|
+
disabled: T.disabled,
|
|
2542
2542
|
className: d(
|
|
2543
2543
|
"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",
|
|
2544
2544
|
{
|
|
2545
|
-
"opacity-50 cursor-not-allowed":
|
|
2545
|
+
"opacity-50 cursor-not-allowed": T.disabled
|
|
2546
2546
|
}
|
|
2547
2547
|
),
|
|
2548
2548
|
children: [
|
|
2549
2549
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
2550
|
-
|
|
2550
|
+
T.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: T.icon }),
|
|
2551
2551
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
2552
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
2553
|
-
|
|
2552
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: T.label }),
|
|
2553
|
+
T.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: T.description })
|
|
2554
2554
|
] })
|
|
2555
2555
|
] }),
|
|
2556
2556
|
u && M && /* @__PURE__ */ e(
|
|
@@ -2562,7 +2562,7 @@ const Br = ({
|
|
|
2562
2562
|
)
|
|
2563
2563
|
]
|
|
2564
2564
|
},
|
|
2565
|
-
|
|
2565
|
+
T.value
|
|
2566
2566
|
);
|
|
2567
2567
|
}) })
|
|
2568
2568
|
}
|
|
@@ -2570,10 +2570,10 @@ const Br = ({
|
|
|
2570
2570
|
] }, y.value);
|
|
2571
2571
|
}),
|
|
2572
2572
|
(() => {
|
|
2573
|
-
const y = r.reduce((x,
|
|
2574
|
-
if (
|
|
2575
|
-
const
|
|
2576
|
-
return x + 1 +
|
|
2573
|
+
const y = r.reduce((x, E) => {
|
|
2574
|
+
if (E.divider) return x;
|
|
2575
|
+
const $ = E.children ? E.children.filter((T) => !T.divider).length : 0;
|
|
2576
|
+
return x + 1 + $;
|
|
2577
2577
|
}, 0);
|
|
2578
2578
|
return y > 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: [
|
|
2579
2579
|
y,
|
|
@@ -2665,112 +2665,112 @@ const Kr = (t) => {
|
|
|
2665
2665
|
onSearchChange: o,
|
|
2666
2666
|
filters: u = [],
|
|
2667
2667
|
toolbarActions: i = [],
|
|
2668
|
-
toolbarContent:
|
|
2668
|
+
toolbarContent: p,
|
|
2669
2669
|
groupBy: m,
|
|
2670
2670
|
groups: f,
|
|
2671
2671
|
paginated: g = !1,
|
|
2672
|
-
defaultPageSize:
|
|
2672
|
+
defaultPageSize: b = 10,
|
|
2673
2673
|
actions: w = [],
|
|
2674
|
-
onRowClick:
|
|
2674
|
+
onRowClick: v,
|
|
2675
2675
|
selectable: h = !1,
|
|
2676
|
-
selectedRows:
|
|
2677
|
-
onSelectionChange:
|
|
2678
|
-
getRowKey:
|
|
2676
|
+
selectedRows: C = [],
|
|
2677
|
+
onSelectionChange: k,
|
|
2678
|
+
getRowKey: P = (te, W) => W,
|
|
2679
2679
|
emptyContent: D,
|
|
2680
|
-
footerSummary:
|
|
2681
|
-
size:
|
|
2682
|
-
hoverable:
|
|
2683
|
-
padding:
|
|
2684
|
-
className:
|
|
2685
|
-
rowClassName:
|
|
2686
|
-
headerBackground:
|
|
2680
|
+
footerSummary: Y,
|
|
2681
|
+
size: F = "md",
|
|
2682
|
+
hoverable: _ = !0,
|
|
2683
|
+
padding: I = "md",
|
|
2684
|
+
className: O,
|
|
2685
|
+
rowClassName: H,
|
|
2686
|
+
headerBackground: U = !0
|
|
2687
2687
|
}) => {
|
|
2688
|
-
const [
|
|
2688
|
+
const [te, W] = B(""), y = l !== void 0, x = y ? l : te, E = o ?? W, [$, T] = B({
|
|
2689
2689
|
column: null,
|
|
2690
2690
|
direction: null
|
|
2691
|
-
}), [
|
|
2691
|
+
}), [L, M] = B({
|
|
2692
2692
|
page: 0,
|
|
2693
|
-
pageSize:
|
|
2694
|
-
}), ce =
|
|
2693
|
+
pageSize: b
|
|
2694
|
+
}), ce = se(null), ie = ge(() => {
|
|
2695
2695
|
let A = t;
|
|
2696
2696
|
if (s && !y && x.trim()) {
|
|
2697
|
-
const J = r.filter((ue) => ue.searchable !== !1),
|
|
2697
|
+
const J = r.filter((ue) => ue.searchable !== !1), ne = x.toLowerCase();
|
|
2698
2698
|
A = A.filter((ue) => J.some((ee) => {
|
|
2699
|
-
const
|
|
2700
|
-
return String(
|
|
2699
|
+
const V = typeof ee.accessor == "function" ? ee.accessor(ue) : ue[ee.accessor];
|
|
2700
|
+
return String(V || "").toLowerCase().includes(ne);
|
|
2701
2701
|
}));
|
|
2702
2702
|
}
|
|
2703
2703
|
return A;
|
|
2704
2704
|
}, [t, x, y, r, s]), G = ge(() => {
|
|
2705
|
-
if (
|
|
2706
|
-
const A = r.find((J) => J.id ===
|
|
2707
|
-
return A ? [...ie].sort((J,
|
|
2708
|
-
const ue = typeof A.accessor == "function" ? A.accessor(J) : J[A.accessor], ee = typeof A.accessor == "function" ? A.accessor(
|
|
2709
|
-
let
|
|
2710
|
-
return ue < ee ?
|
|
2705
|
+
if (!$.column || !$.direction) return ie;
|
|
2706
|
+
const A = r.find((J) => J.id === $.column);
|
|
2707
|
+
return A ? [...ie].sort((J, ne) => {
|
|
2708
|
+
const ue = typeof A.accessor == "function" ? A.accessor(J) : J[A.accessor], ee = typeof A.accessor == "function" ? A.accessor(ne) : ne[A.accessor];
|
|
2709
|
+
let V = 0;
|
|
2710
|
+
return ue < ee ? V = -1 : ue > ee && (V = 1), $.direction === "desc" ? -V : V;
|
|
2711
2711
|
}) : ie;
|
|
2712
|
-
}, [ie,
|
|
2712
|
+
}, [ie, $, r]), K = ge(() => {
|
|
2713
2713
|
if (!g || m) return G;
|
|
2714
|
-
const A =
|
|
2714
|
+
const A = L.page * L.pageSize, J = A + L.pageSize;
|
|
2715
2715
|
return G.slice(A, J);
|
|
2716
|
-
}, [G,
|
|
2716
|
+
}, [G, L, g, m]), j = de(
|
|
2717
2717
|
(A) => {
|
|
2718
|
-
r.find((
|
|
2718
|
+
r.find((ne) => ne.id === A)?.sortable && T((ne) => ne.column !== A ? { column: A, direction: "asc" } : ne.direction === "asc" ? { column: A, direction: "desc" } : { column: null, direction: null });
|
|
2719
2719
|
},
|
|
2720
2720
|
[r]
|
|
2721
|
-
),
|
|
2721
|
+
), S = de((A) => {
|
|
2722
2722
|
M((J) => ({ ...J, page: A }));
|
|
2723
2723
|
}, []), z = de(
|
|
2724
2724
|
(A, J) => {
|
|
2725
|
-
if (!
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2725
|
+
if (!k) return;
|
|
2726
|
+
const ne = P(A, 0);
|
|
2727
|
+
k(J ? [...C, A] : C.filter((ue, ee) => P(C[ee], ee) !== ne));
|
|
2728
2728
|
},
|
|
2729
|
-
[
|
|
2730
|
-
),
|
|
2729
|
+
[C, k, P]
|
|
2730
|
+
), X = de(
|
|
2731
2731
|
(A) => {
|
|
2732
|
-
|
|
2732
|
+
k && k(A ? [...K] : []);
|
|
2733
2733
|
},
|
|
2734
|
-
[
|
|
2734
|
+
[K, k]
|
|
2735
2735
|
);
|
|
2736
|
-
|
|
2736
|
+
Z(() => {
|
|
2737
2737
|
M((A) => ({ ...A, page: 0 }));
|
|
2738
|
-
}, []),
|
|
2738
|
+
}, []), Z(() => {
|
|
2739
2739
|
M((A) => ({ ...A, page: 0 }));
|
|
2740
2740
|
}, []);
|
|
2741
|
-
const q = G.length, N = Math.ceil(q /
|
|
2742
|
-
const J =
|
|
2743
|
-
return
|
|
2744
|
-
}), pe =
|
|
2745
|
-
const J =
|
|
2746
|
-
return
|
|
2747
|
-
}), ye = Hr[
|
|
2748
|
-
const A =
|
|
2741
|
+
const q = G.length, N = Math.ceil(q / L.pageSize), R = L.page * L.pageSize + 1, re = Math.min(R + L.pageSize - 1, q), oe = K.length > 0 && K.every((A) => {
|
|
2742
|
+
const J = P(A, 0);
|
|
2743
|
+
return C.some((ne, ue) => P(ne, ue) === J);
|
|
2744
|
+
}), pe = K.some((A) => {
|
|
2745
|
+
const J = P(A, 0);
|
|
2746
|
+
return C.some((ne, ue) => P(ne, ue) === J);
|
|
2747
|
+
}), ye = Hr[I], he = U ? "bg-surface-sunk" : "bg-surface", xe = d("text-text", ye), Pe = s || u.length > 0 || i.length > 0 || !!p, gt = ge(() => {
|
|
2748
|
+
const A = K.map((ee, V) => ({ row: ee, index: V }));
|
|
2749
2749
|
if (!m) return [{ group: null, rows: A }];
|
|
2750
2750
|
const J = /* @__PURE__ */ new Map();
|
|
2751
2751
|
for (const ee of A) {
|
|
2752
|
-
const
|
|
2753
|
-
ve ? ve.push(ee) : J.set(
|
|
2752
|
+
const V = m(ee.row, ee.index), ve = J.get(V);
|
|
2753
|
+
ve ? ve.push(ee) : J.set(V, [ee]);
|
|
2754
2754
|
}
|
|
2755
|
-
const
|
|
2755
|
+
const ne = f ?? [];
|
|
2756
2756
|
return [
|
|
2757
|
-
...
|
|
2758
|
-
...[...J.keys()].filter((ee) => !
|
|
2757
|
+
...ne.filter((ee) => J.has(ee.id)),
|
|
2758
|
+
...[...J.keys()].filter((ee) => !ne.some((V) => V.id === ee)).map((ee) => ({ id: ee }))
|
|
2759
2759
|
].map((ee) => ({ group: ee, rows: J.get(ee.id) ?? [] }));
|
|
2760
|
-
}, [
|
|
2761
|
-
return /* @__PURE__ */ c("div", { className: d("flex min-w-0 flex-col",
|
|
2760
|
+
}, [K, m, f]), bt = r.length + (h ? 1 : 0) + (w.length > 0 ? 1 : 0), Ve = g && q > 0, pt = Ve || Y !== void 0;
|
|
2761
|
+
return /* @__PURE__ */ c("div", { className: d("flex min-w-0 flex-col", O), children: [
|
|
2762
2762
|
Pe && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2 pb-3", children: [
|
|
2763
2763
|
s && /* @__PURE__ */ e(
|
|
2764
2764
|
it,
|
|
2765
2765
|
{
|
|
2766
2766
|
value: x,
|
|
2767
|
-
onValueChange:
|
|
2767
|
+
onValueChange: E,
|
|
2768
2768
|
placeholder: a,
|
|
2769
2769
|
containerClassName: "w-full sm:w-66"
|
|
2770
2770
|
}
|
|
2771
2771
|
),
|
|
2772
2772
|
u.map((A) => /* @__PURE__ */ e(Kr, { ...A }, A.id)),
|
|
2773
|
-
|
|
2773
|
+
p,
|
|
2774
2774
|
i.length > 0 && /* @__PURE__ */ e(ke, { actions: i, className: "ml-auto" })
|
|
2775
2775
|
] }),
|
|
2776
2776
|
/* @__PURE__ */ e("div", { className: "relative w-full overflow-x-auto rounded-lg ring-1 ring-border", children: /* @__PURE__ */ c("table", { ref: ce, className: "min-w-full border-collapse text-base text-text", children: [
|
|
@@ -2781,7 +2781,7 @@ const Kr = (t) => {
|
|
|
2781
2781
|
size: "sm",
|
|
2782
2782
|
checked: oe,
|
|
2783
2783
|
indeterminate: pe && !oe,
|
|
2784
|
-
onChange: (A) =>
|
|
2784
|
+
onChange: (A) => X(A.target.checked),
|
|
2785
2785
|
"aria-label": "Select all rows"
|
|
2786
2786
|
}
|
|
2787
2787
|
) }),
|
|
@@ -2802,17 +2802,17 @@ const Kr = (t) => {
|
|
|
2802
2802
|
}
|
|
2803
2803
|
),
|
|
2804
2804
|
style: { width: A.width },
|
|
2805
|
-
onClick: () => A.sortable &&
|
|
2805
|
+
onClick: () => A.sortable && j(A.id),
|
|
2806
2806
|
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
2807
2807
|
A.headerCell ? A.headerCell() : A.header,
|
|
2808
2808
|
A.sortable && /* @__PURE__ */ e(
|
|
2809
|
-
|
|
2809
|
+
Q,
|
|
2810
2810
|
{
|
|
2811
|
-
icon:
|
|
2811
|
+
icon: $.column === A.id && $.direction === "desc" ? Le : Dt,
|
|
2812
2812
|
size: "xs",
|
|
2813
2813
|
className: d(
|
|
2814
2814
|
"transition-opacity duration-fast ease-out",
|
|
2815
|
-
|
|
2815
|
+
$.column === A.id ? "text-text opacity-100" : "text-text-subtle opacity-0 group-hover:opacity-100"
|
|
2816
2816
|
)
|
|
2817
2817
|
}
|
|
2818
2818
|
)
|
|
@@ -2829,11 +2829,11 @@ const Kr = (t) => {
|
|
|
2829
2829
|
"aria-hidden": !0,
|
|
2830
2830
|
children: [
|
|
2831
2831
|
h && /* @__PURE__ */ e("td", { className: d(xe, "h-row-lg"), children: /* @__PURE__ */ e("span", { className: "block size-4 rounded-xs bg-surface-hover" }) }),
|
|
2832
|
-
r.map((
|
|
2832
|
+
r.map((ne, ue) => /* @__PURE__ */ e(
|
|
2833
2833
|
"td",
|
|
2834
2834
|
{
|
|
2835
2835
|
className: d(xe, "h-row-lg"),
|
|
2836
|
-
style: { width:
|
|
2836
|
+
style: { width: ne.width },
|
|
2837
2837
|
children: /* @__PURE__ */ e(
|
|
2838
2838
|
"span",
|
|
2839
2839
|
{
|
|
@@ -2844,13 +2844,13 @@ const Kr = (t) => {
|
|
|
2844
2844
|
}
|
|
2845
2845
|
)
|
|
2846
2846
|
},
|
|
2847
|
-
|
|
2847
|
+
ne.id
|
|
2848
2848
|
)),
|
|
2849
2849
|
w.length > 0 && /* @__PURE__ */ e("td", { className: d(xe, "h-row-lg") })
|
|
2850
2850
|
]
|
|
2851
2851
|
},
|
|
2852
2852
|
`skeleton-${J}`
|
|
2853
|
-
)) :
|
|
2853
|
+
)) : K.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
2854
2854
|
"td",
|
|
2855
2855
|
{
|
|
2856
2856
|
colSpan: r.length + (h ? 1 : 0) + (w.length > 0 ? 1 : 0),
|
|
@@ -2879,25 +2879,25 @@ const Kr = (t) => {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
) }, `group-${A.group.id}`)
|
|
2881
2881
|
] : [],
|
|
2882
|
-
...A.rows.map(({ row: J, index:
|
|
2883
|
-
const ue =
|
|
2884
|
-
(
|
|
2882
|
+
...A.rows.map(({ row: J, index: ne }) => {
|
|
2883
|
+
const ue = P(J, ne), ee = C.some(
|
|
2884
|
+
(V, ve) => P(V, ve) === ue
|
|
2885
2885
|
);
|
|
2886
2886
|
return /* @__PURE__ */ c(
|
|
2887
2887
|
"tr",
|
|
2888
2888
|
{
|
|
2889
2889
|
className: d(
|
|
2890
|
-
qr[
|
|
2890
|
+
qr[F],
|
|
2891
2891
|
// Hairline above every row, including the first: it is
|
|
2892
2892
|
// what separates the body from the column strip.
|
|
2893
2893
|
"border-t border-border-subtle",
|
|
2894
|
-
|
|
2895
|
-
|
|
2894
|
+
_ && "transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
2895
|
+
v && "cursor-pointer",
|
|
2896
2896
|
ee && "bg-accent-soft",
|
|
2897
|
-
|
|
2897
|
+
H?.(J, ne)
|
|
2898
2898
|
),
|
|
2899
|
-
onClick: (
|
|
2900
|
-
|
|
2899
|
+
onClick: (V) => {
|
|
2900
|
+
V.stopPropagation(), v?.(J, ne);
|
|
2901
2901
|
},
|
|
2902
2902
|
children: [
|
|
2903
2903
|
h && /* @__PURE__ */ e("td", { className: xe, children: /* @__PURE__ */ e(
|
|
@@ -2905,44 +2905,44 @@ const Kr = (t) => {
|
|
|
2905
2905
|
{
|
|
2906
2906
|
size: "sm",
|
|
2907
2907
|
checked: ee,
|
|
2908
|
-
onClick: (
|
|
2909
|
-
onChange: (
|
|
2910
|
-
|
|
2908
|
+
onClick: (V) => V.stopPropagation(),
|
|
2909
|
+
onChange: (V) => {
|
|
2910
|
+
V.stopPropagation(), z(J, V.target.checked);
|
|
2911
2911
|
},
|
|
2912
2912
|
"aria-label": "Select row"
|
|
2913
2913
|
}
|
|
2914
2914
|
) }),
|
|
2915
|
-
r.map((
|
|
2916
|
-
const ve = typeof
|
|
2915
|
+
r.map((V) => {
|
|
2916
|
+
const ve = typeof V.accessor == "function" ? V.accessor(J) : J[V.accessor];
|
|
2917
2917
|
return /* @__PURE__ */ e(
|
|
2918
2918
|
"td",
|
|
2919
2919
|
{
|
|
2920
2920
|
className: d(xe, {
|
|
2921
|
-
"text-left":
|
|
2922
|
-
"text-center":
|
|
2923
|
-
"text-right":
|
|
2924
|
-
"sticky left-0 bg-surface":
|
|
2925
|
-
"sticky right-0 bg-surface":
|
|
2921
|
+
"text-left": V.align === "left" || !V.align,
|
|
2922
|
+
"text-center": V.align === "center",
|
|
2923
|
+
"text-right": V.align === "right",
|
|
2924
|
+
"sticky left-0 bg-surface": V.sticky === "left",
|
|
2925
|
+
"sticky right-0 bg-surface": V.sticky === "right"
|
|
2926
2926
|
}),
|
|
2927
|
-
children:
|
|
2927
|
+
children: V.cell ? V.cell(ve, J, ne) : String(ve || "")
|
|
2928
2928
|
},
|
|
2929
|
-
|
|
2929
|
+
V.id
|
|
2930
2930
|
);
|
|
2931
2931
|
}),
|
|
2932
2932
|
w.length > 0 && /* @__PURE__ */ e("td", { className: xe, children: /* @__PURE__ */ e(
|
|
2933
2933
|
Br,
|
|
2934
2934
|
{
|
|
2935
2935
|
className: "rounded-md",
|
|
2936
|
-
trigger: /* @__PURE__ */ e("span", { className: "grid size-7 place-items-center text-text-subtle", children: /* @__PURE__ */ e(
|
|
2937
|
-
options: w.map((
|
|
2938
|
-
value:
|
|
2939
|
-
label:
|
|
2940
|
-
icon:
|
|
2941
|
-
disabled:
|
|
2936
|
+
trigger: /* @__PURE__ */ e("span", { className: "grid size-7 place-items-center text-text-subtle", children: /* @__PURE__ */ e(Q, { icon: _t, size: "md", color: "current" }) }),
|
|
2937
|
+
options: w.map((V) => ({
|
|
2938
|
+
value: V.id,
|
|
2939
|
+
label: V.label,
|
|
2940
|
+
icon: V.icon,
|
|
2941
|
+
disabled: V.disabled?.(J)
|
|
2942
2942
|
})),
|
|
2943
|
-
onSelect: (
|
|
2944
|
-
const ve = w.find((vt) => vt.id ===
|
|
2945
|
-
ve && ve.onClick(J,
|
|
2943
|
+
onSelect: (V) => {
|
|
2944
|
+
const ve = w.find((vt) => vt.id === V);
|
|
2945
|
+
ve && ve.onClick(J, ne);
|
|
2946
2946
|
},
|
|
2947
2947
|
placement: "bottom-end"
|
|
2948
2948
|
}
|
|
@@ -2955,7 +2955,7 @@ const Kr = (t) => {
|
|
|
2955
2955
|
]) })
|
|
2956
2956
|
] }) }),
|
|
2957
2957
|
pt && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-3 px-1 pt-3 text-xs text-text-muted", children: [
|
|
2958
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children:
|
|
2958
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: Y ?? `Showing ${R}–${re} of ${q}` }),
|
|
2959
2959
|
Ve && /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5", children: [
|
|
2960
2960
|
/* @__PURE__ */ e(
|
|
2961
2961
|
ae,
|
|
@@ -2964,23 +2964,23 @@ const Kr = (t) => {
|
|
|
2964
2964
|
variant: "ghost",
|
|
2965
2965
|
iconOnly: !0,
|
|
2966
2966
|
"aria-label": "Previous page",
|
|
2967
|
-
onClick: () =>
|
|
2968
|
-
disabled:
|
|
2969
|
-
children: /* @__PURE__ */ e(
|
|
2967
|
+
onClick: () => S(L.page - 1),
|
|
2968
|
+
disabled: L.page === 0,
|
|
2969
|
+
children: /* @__PURE__ */ e(Q, { icon: Ee, size: "md", color: "current" })
|
|
2970
2970
|
}
|
|
2971
2971
|
),
|
|
2972
|
-
Vr(
|
|
2972
|
+
Vr(L.page, N).map(
|
|
2973
2973
|
(A, J) => A === "gap" ? /* @__PURE__ */ e("span", { className: "px-1 text-text-subtle", children: "…" }, `gap-${J}`) : /* @__PURE__ */ e(
|
|
2974
2974
|
"button",
|
|
2975
2975
|
{
|
|
2976
2976
|
type: "button",
|
|
2977
|
-
"aria-current": A ===
|
|
2978
|
-
onClick: () =>
|
|
2977
|
+
"aria-current": A === L.page ? "page" : void 0,
|
|
2978
|
+
onClick: () => S(A),
|
|
2979
2979
|
className: d(
|
|
2980
2980
|
"h-control-xs min-w-6 cursor-pointer rounded-sm px-1.5 tabular-nums",
|
|
2981
2981
|
"transition-colors duration-fast ease-out",
|
|
2982
2982
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2983
|
-
A ===
|
|
2983
|
+
A === L.page ? "bg-surface-sunk font-semibold text-text" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
2984
2984
|
),
|
|
2985
2985
|
children: A + 1
|
|
2986
2986
|
},
|
|
@@ -2994,9 +2994,9 @@ const Kr = (t) => {
|
|
|
2994
2994
|
variant: "ghost",
|
|
2995
2995
|
iconOnly: !0,
|
|
2996
2996
|
"aria-label": "Next page",
|
|
2997
|
-
onClick: () =>
|
|
2998
|
-
disabled:
|
|
2999
|
-
children: /* @__PURE__ */ e(
|
|
2997
|
+
onClick: () => S(L.page + 1),
|
|
2998
|
+
disabled: L.page >= N - 1,
|
|
2999
|
+
children: /* @__PURE__ */ e(Q, { icon: Oe, size: "md", color: "current" })
|
|
3000
3000
|
}
|
|
3001
3001
|
)
|
|
3002
3002
|
] })
|
|
@@ -3057,7 +3057,7 @@ function Yr({
|
|
|
3057
3057
|
onClick: l,
|
|
3058
3058
|
className: "ml-1.5 flex-shrink-0 hover:opacity-70 transition-opacity",
|
|
3059
3059
|
"aria-label": "Remove badge",
|
|
3060
|
-
children: /* @__PURE__ */ e(
|
|
3060
|
+
children: /* @__PURE__ */ e(Q, { icon: Se, size: "xs", color: "current" })
|
|
3061
3061
|
}
|
|
3062
3062
|
)
|
|
3063
3063
|
]
|
|
@@ -3065,7 +3065,7 @@ function Yr({
|
|
|
3065
3065
|
);
|
|
3066
3066
|
}
|
|
3067
3067
|
function Xr(t) {
|
|
3068
|
-
const { id: r, header: n, accessor: s, label: a, tone: l, visible: o, width: u, sortable: i, align:
|
|
3068
|
+
const { id: r, header: n, accessor: s, label: a, tone: l, visible: o, width: u, sortable: i, align: p } = t;
|
|
3069
3069
|
return {
|
|
3070
3070
|
id: r,
|
|
3071
3071
|
header: n,
|
|
@@ -3076,7 +3076,7 @@ function Xr(t) {
|
|
|
3076
3076
|
},
|
|
3077
3077
|
width: u,
|
|
3078
3078
|
sortable: i,
|
|
3079
|
-
align:
|
|
3079
|
+
align: p
|
|
3080
3080
|
};
|
|
3081
3081
|
}
|
|
3082
3082
|
function qs(t) {
|
|
@@ -3089,7 +3089,7 @@ function qs(t) {
|
|
|
3089
3089
|
onTone: o = "success",
|
|
3090
3090
|
offTone: u = "secondary",
|
|
3091
3091
|
width: i,
|
|
3092
|
-
sortable:
|
|
3092
|
+
sortable: p
|
|
3093
3093
|
} = t;
|
|
3094
3094
|
return Xr({
|
|
3095
3095
|
id: r,
|
|
@@ -3098,7 +3098,7 @@ function qs(t) {
|
|
|
3098
3098
|
label: (m) => m ? a : l,
|
|
3099
3099
|
tone: (m) => m ? o : u,
|
|
3100
3100
|
width: i,
|
|
3101
|
-
sortable:
|
|
3101
|
+
sortable: p
|
|
3102
3102
|
});
|
|
3103
3103
|
}
|
|
3104
3104
|
function Us(t) {
|
|
@@ -3111,18 +3111,18 @@ function Us(t) {
|
|
|
3111
3111
|
separator: o = ", ",
|
|
3112
3112
|
width: u,
|
|
3113
3113
|
searchable: i,
|
|
3114
|
-
sortable:
|
|
3114
|
+
sortable: p
|
|
3115
3115
|
} = t;
|
|
3116
3116
|
return {
|
|
3117
3117
|
id: r,
|
|
3118
3118
|
header: n,
|
|
3119
3119
|
accessor: (m) => {
|
|
3120
|
-
const f = s(m),
|
|
3121
|
-
return
|
|
3120
|
+
const f = s(m), b = (f == null ? [] : Array.isArray(f) ? f : [f]).filter(Boolean).map((w) => a(w) ?? w);
|
|
3121
|
+
return b.length ? b.join(o) : l;
|
|
3122
3122
|
},
|
|
3123
3123
|
width: u,
|
|
3124
3124
|
searchable: i,
|
|
3125
|
-
sortable:
|
|
3125
|
+
sortable: p
|
|
3126
3126
|
};
|
|
3127
3127
|
}
|
|
3128
3128
|
const Qr = {
|
|
@@ -3167,21 +3167,21 @@ const Qr = {
|
|
|
3167
3167
|
italic: o = !1,
|
|
3168
3168
|
underline: u = !1,
|
|
3169
3169
|
lineHeight: i = "normal",
|
|
3170
|
-
as:
|
|
3170
|
+
as: p,
|
|
3171
3171
|
className: m,
|
|
3172
3172
|
children: f,
|
|
3173
3173
|
...g
|
|
3174
3174
|
}) => {
|
|
3175
|
-
const
|
|
3175
|
+
const b = p || nn(t), w = t === "caption", v = t === "label", h = t === "code", C = d(
|
|
3176
3176
|
"font-sans",
|
|
3177
3177
|
// Variant — caption and label pin their own size/weight
|
|
3178
3178
|
w && "text-xs text-text-subtle",
|
|
3179
|
-
|
|
3179
|
+
v && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
3180
3180
|
h && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
3181
3181
|
// Size — only where the variant does not pin it
|
|
3182
|
-
!w && !
|
|
3182
|
+
!w && !v && !h && Qr[r],
|
|
3183
3183
|
// Weight — label owns its weight
|
|
3184
|
-
!
|
|
3184
|
+
!v && Zr[n],
|
|
3185
3185
|
en[s],
|
|
3186
3186
|
tn[a],
|
|
3187
3187
|
// Line height only overrides the body variant
|
|
@@ -3191,7 +3191,7 @@ const Qr = {
|
|
|
3191
3191
|
l && "truncate",
|
|
3192
3192
|
m
|
|
3193
3193
|
);
|
|
3194
|
-
return /* @__PURE__ */ e(
|
|
3194
|
+
return /* @__PURE__ */ e(b, { className: C, ...g, children: f });
|
|
3195
3195
|
};
|
|
3196
3196
|
function nn(t) {
|
|
3197
3197
|
return {
|
|
@@ -3226,22 +3226,22 @@ const Vs = ({
|
|
|
3226
3226
|
}
|
|
3227
3227
|
}, l = (m) => m ? "Ja" : "Nee", o = (m, f) => {
|
|
3228
3228
|
if (!f) return String(m || "-");
|
|
3229
|
-
const g = f.find((
|
|
3229
|
+
const g = f.find((b) => b.value === m);
|
|
3230
3230
|
return g ? g.label : String(m || "-");
|
|
3231
3231
|
}, u = de(
|
|
3232
3232
|
(m) => {
|
|
3233
3233
|
const f = sn(r, m.name);
|
|
3234
3234
|
if (m.type === "array") {
|
|
3235
|
-
const
|
|
3236
|
-
return !
|
|
3235
|
+
const b = f;
|
|
3236
|
+
return !b || b.length === 0 ? /* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text-muted", children: "Geen items" }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map((w, v) => /* @__PURE__ */ c("div", { className: "p-4 border border-border rounded-xl space-y-3", children: [
|
|
3237
3237
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ c(me, { variant: "label", size: "sm", weight: "medium", className: "text-text-muted", children: [
|
|
3238
3238
|
m.label,
|
|
3239
3239
|
" ",
|
|
3240
|
-
|
|
3240
|
+
v + 1
|
|
3241
3241
|
] }) }),
|
|
3242
3242
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: m.arrayFields?.map((h) => {
|
|
3243
|
-
const
|
|
3244
|
-
let
|
|
3243
|
+
const C = w?.[h.name];
|
|
3244
|
+
let k = "-";
|
|
3245
3245
|
switch (h.type) {
|
|
3246
3246
|
case "text":
|
|
3247
3247
|
case "email":
|
|
@@ -3249,38 +3249,38 @@ const Vs = ({
|
|
|
3249
3249
|
case "tel":
|
|
3250
3250
|
case "url":
|
|
3251
3251
|
case "textarea":
|
|
3252
|
-
|
|
3252
|
+
k = C || "-";
|
|
3253
3253
|
break;
|
|
3254
3254
|
case "select":
|
|
3255
3255
|
case "radio":
|
|
3256
|
-
|
|
3256
|
+
k = o(C, h.options);
|
|
3257
3257
|
break;
|
|
3258
3258
|
case "checkbox":
|
|
3259
|
-
|
|
3259
|
+
k = l(C);
|
|
3260
3260
|
break;
|
|
3261
3261
|
case "date":
|
|
3262
|
-
|
|
3262
|
+
k = a(C);
|
|
3263
3263
|
break;
|
|
3264
3264
|
case "custom":
|
|
3265
|
-
|
|
3266
|
-
value:
|
|
3265
|
+
k = h.customComponent?.({
|
|
3266
|
+
value: C
|
|
3267
3267
|
});
|
|
3268
3268
|
break;
|
|
3269
3269
|
default:
|
|
3270
|
-
|
|
3270
|
+
k = String(C || "-");
|
|
3271
3271
|
}
|
|
3272
|
-
return h.format && (
|
|
3272
|
+
return h.format && (k = h.format(C, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
3273
3273
|
/* @__PURE__ */ e(me, { variant: "label", size: "xs", className: "text-text-muted", children: h.label }),
|
|
3274
|
-
/* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text", children:
|
|
3274
|
+
/* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text", children: k })
|
|
3275
3275
|
] }, h.name);
|
|
3276
3276
|
}) })
|
|
3277
|
-
] },
|
|
3277
|
+
] }, v)) });
|
|
3278
3278
|
}
|
|
3279
3279
|
if (m.type === "custom" && m.customComponent)
|
|
3280
3280
|
return m.customComponent({ value: f });
|
|
3281
3281
|
if (m.format) {
|
|
3282
|
-
const
|
|
3283
|
-
return /* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text", children:
|
|
3282
|
+
const b = m.format(f, r);
|
|
3283
|
+
return /* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text", children: b });
|
|
3284
3284
|
}
|
|
3285
3285
|
let g = "-";
|
|
3286
3286
|
switch (m.type) {
|
|
@@ -3315,7 +3315,7 @@ const Vs = ({
|
|
|
3315
3315
|
(m) => {
|
|
3316
3316
|
if (m.conditional && !m.conditional(r))
|
|
3317
3317
|
return null;
|
|
3318
|
-
const f = m.items.filter((
|
|
3318
|
+
const f = m.items.filter((b) => !(b.hidden || b.conditional && !b.conditional(r)));
|
|
3319
3319
|
if (f.length === 0) return null;
|
|
3320
3320
|
const g = d(
|
|
3321
3321
|
"space-y-4",
|
|
@@ -3340,20 +3340,20 @@ const Vs = ({
|
|
|
3340
3340
|
/* @__PURE__ */ e(me, { variant: "label", size: "lg", weight: "semibold", className: "text-text", children: m.title }),
|
|
3341
3341
|
m.description && /* @__PURE__ */ e(me, { variant: "body", size: "sm", className: "text-text-muted mt-1", children: m.description })
|
|
3342
3342
|
] }),
|
|
3343
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: g, children: f.map((
|
|
3343
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: g, children: f.map((b) => /* @__PURE__ */ c(
|
|
3344
3344
|
"div",
|
|
3345
3345
|
{
|
|
3346
3346
|
className: "space-y-1",
|
|
3347
3347
|
style: {
|
|
3348
|
-
width: typeof
|
|
3349
|
-
gridColumn: typeof
|
|
3348
|
+
width: typeof b.width == "string" ? b.width : void 0,
|
|
3349
|
+
gridColumn: typeof b.width == "number" ? `span ${b.width} / span ${b.width}` : void 0
|
|
3350
3350
|
},
|
|
3351
3351
|
children: [
|
|
3352
|
-
|
|
3353
|
-
u(
|
|
3352
|
+
b.type !== "custom" && /* @__PURE__ */ e(me, { variant: "label", size: "sm", className: "font-medium text-text-muted", children: b.label }),
|
|
3353
|
+
u(b)
|
|
3354
3354
|
]
|
|
3355
3355
|
},
|
|
3356
|
-
|
|
3356
|
+
b.name
|
|
3357
3357
|
)) }) })
|
|
3358
3358
|
]
|
|
3359
3359
|
},
|
|
@@ -3361,7 +3361,7 @@ const Vs = ({
|
|
|
3361
3361
|
);
|
|
3362
3362
|
},
|
|
3363
3363
|
[r, u]
|
|
3364
|
-
),
|
|
3364
|
+
), p = d(
|
|
3365
3365
|
"space-y-6",
|
|
3366
3366
|
{
|
|
3367
3367
|
"max-w-md": n === "sm",
|
|
@@ -3371,7 +3371,7 @@ const Vs = ({
|
|
|
3371
3371
|
},
|
|
3372
3372
|
s
|
|
3373
3373
|
);
|
|
3374
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3374
|
+
return /* @__PURE__ */ e("div", { className: p, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(i) }) });
|
|
3375
3375
|
};
|
|
3376
3376
|
class Ks extends kt {
|
|
3377
3377
|
constructor() {
|
|
@@ -3411,42 +3411,42 @@ function Ws({
|
|
|
3411
3411
|
componentProps: l,
|
|
3412
3412
|
className: o
|
|
3413
3413
|
}) {
|
|
3414
|
-
const u =
|
|
3415
|
-
g.current = r,
|
|
3414
|
+
const u = se(null), [i, p] = B(null), [, m] = B(0), f = se(null), g = se(r);
|
|
3415
|
+
g.current = r, Z(() => {
|
|
3416
3416
|
if (Re.has(t)) return;
|
|
3417
|
-
let
|
|
3417
|
+
let C = !0;
|
|
3418
3418
|
return (async () => {
|
|
3419
3419
|
try {
|
|
3420
|
-
const
|
|
3421
|
-
if (!
|
|
3422
|
-
Re.set(t,
|
|
3423
|
-
} catch (
|
|
3424
|
-
console.error(`[FederatedResource] Load failed: ${t}`,
|
|
3420
|
+
const P = await g.current();
|
|
3421
|
+
if (!C) return;
|
|
3422
|
+
Re.set(t, P), m((D) => D + 1);
|
|
3423
|
+
} catch (P) {
|
|
3424
|
+
console.error(`[FederatedResource] Load failed: ${t}`, P), C && p(t);
|
|
3425
3425
|
}
|
|
3426
3426
|
})(), () => {
|
|
3427
|
-
|
|
3427
|
+
C = !1;
|
|
3428
3428
|
};
|
|
3429
3429
|
}, [t]);
|
|
3430
|
-
const
|
|
3431
|
-
return
|
|
3430
|
+
const b = Re.get(t) ?? null, w = !b && i === t, v = !b && !w, h = b ? n === "react" && (b.component || b.default) || b : null;
|
|
3431
|
+
return Z(() => {
|
|
3432
3432
|
if (!h || n === "react") return;
|
|
3433
|
-
const
|
|
3434
|
-
if (
|
|
3433
|
+
const C = u.current;
|
|
3434
|
+
if (C) {
|
|
3435
3435
|
if (n === "svelte") {
|
|
3436
|
-
const
|
|
3437
|
-
return f.current =
|
|
3436
|
+
const k = h.default || h, P = new k({ target: C, props: l || {} });
|
|
3437
|
+
return f.current = P, () => P.$destroy();
|
|
3438
3438
|
}
|
|
3439
3439
|
if (h.mount) {
|
|
3440
|
-
const
|
|
3440
|
+
const k = h.mount({ container: C, props: l || {} });
|
|
3441
3441
|
return () => {
|
|
3442
|
-
typeof
|
|
3442
|
+
typeof k == "function" ? k() : h.unmount?.(C);
|
|
3443
3443
|
};
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
|
-
}, [h, n, l]),
|
|
3446
|
+
}, [h, n, l]), Z(() => {
|
|
3447
3447
|
n === "svelte" && f.current && f.current.$set?.(l);
|
|
3448
3448
|
}, [l, n]), /* @__PURE__ */ c("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
3449
|
-
|
|
3449
|
+
v && s,
|
|
3450
3450
|
w && a,
|
|
3451
3451
|
n === "react" && h && /* @__PURE__ */ e(h, { ...l })
|
|
3452
3452
|
] });
|
|
@@ -3739,12 +3739,12 @@ function Qe(t) {
|
|
|
3739
3739
|
"data-form-type": "other"
|
|
3740
3740
|
};
|
|
3741
3741
|
}
|
|
3742
|
-
const
|
|
3742
|
+
const De = (t) => t == null ? "" : String(t), hn = (t) => De(t).trim().toLowerCase(), xn = {
|
|
3743
3743
|
sm: "h-control-sm px-3 text-sm",
|
|
3744
3744
|
md: "h-control-md px-3 text-sm",
|
|
3745
3745
|
lg: "h-control-lg px-3 text-base",
|
|
3746
3746
|
full: "h-control-md w-full px-3 text-sm"
|
|
3747
|
-
},
|
|
3747
|
+
}, Ae = hn, _e = be(
|
|
3748
3748
|
({
|
|
3749
3749
|
label: t,
|
|
3750
3750
|
helperText: r,
|
|
@@ -3755,85 +3755,85 @@ const Ae = (t) => t == null ? "" : String(t), hn = (t) => Ae(t).trim().toLowerCa
|
|
|
3755
3755
|
options: o,
|
|
3756
3756
|
placeholder: u,
|
|
3757
3757
|
containerClassName: i,
|
|
3758
|
-
labelClassName:
|
|
3758
|
+
labelClassName: p,
|
|
3759
3759
|
className: m,
|
|
3760
3760
|
id: f,
|
|
3761
3761
|
searchable: g,
|
|
3762
|
-
multiple:
|
|
3762
|
+
multiple: b,
|
|
3763
3763
|
value: w,
|
|
3764
|
-
onChange:
|
|
3764
|
+
onChange: v,
|
|
3765
3765
|
allowCreate: h,
|
|
3766
|
-
onCreateOption:
|
|
3767
|
-
...
|
|
3768
|
-
},
|
|
3769
|
-
const D = f || `select-${Math.random().toString(36).substr(2, 9)}`,
|
|
3770
|
-
le.useImperativeHandle(
|
|
3771
|
-
const
|
|
3772
|
-
|
|
3766
|
+
onCreateOption: C,
|
|
3767
|
+
...k
|
|
3768
|
+
}, P) => {
|
|
3769
|
+
const D = f || `select-${Math.random().toString(36).substr(2, 9)}`, Y = !!n, [F, _] = le.useState(!1), [I, O] = le.useState(""), H = le.useRef(null), U = le.useRef(null), te = Te(F, U, { matchWidth: !0 }), [W, y] = le.useState(o);
|
|
3770
|
+
le.useImperativeHandle(P, () => H.current), le.useEffect(() => {
|
|
3771
|
+
const j = (S) => {
|
|
3772
|
+
H.current && !H.current.contains(S.target) && _(!1);
|
|
3773
3773
|
};
|
|
3774
|
-
return document.addEventListener("mousedown",
|
|
3774
|
+
return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
|
|
3775
3775
|
}, []);
|
|
3776
3776
|
const x = le.useCallback(
|
|
3777
|
-
(
|
|
3777
|
+
(j, S) => j.some((z) => Ae(z.value) === Ae(S) || Ae(z.label) === Ae(S)),
|
|
3778
3778
|
[]
|
|
3779
|
-
),
|
|
3780
|
-
(
|
|
3781
|
-
const z = [...
|
|
3782
|
-
const N =
|
|
3779
|
+
), E = le.useCallback(
|
|
3780
|
+
(j, S) => {
|
|
3781
|
+
const z = [...j], X = (q) => {
|
|
3782
|
+
const N = De(q).trim();
|
|
3783
3783
|
N && (x(z, N) || z.push({ value: N, label: N }));
|
|
3784
3784
|
};
|
|
3785
|
-
return Array.isArray(
|
|
3785
|
+
return Array.isArray(S) ? S.forEach(X) : X(S), z;
|
|
3786
3786
|
},
|
|
3787
3787
|
[x]
|
|
3788
3788
|
);
|
|
3789
3789
|
le.useEffect(() => {
|
|
3790
|
-
y((
|
|
3791
|
-
const
|
|
3792
|
-
return
|
|
3793
|
-
!x(
|
|
3794
|
-
}), S
|
|
3790
|
+
y((j) => {
|
|
3791
|
+
const S = [...o];
|
|
3792
|
+
return j.forEach((z) => {
|
|
3793
|
+
!x(S, z.value) && !x(S, z.label) && S.push(z);
|
|
3794
|
+
}), E(S, w);
|
|
3795
3795
|
});
|
|
3796
|
-
}, [o, w,
|
|
3797
|
-
const
|
|
3798
|
-
() => Array.isArray(w) ? w.map(
|
|
3796
|
+
}, [o, w, E, x]);
|
|
3797
|
+
const $ = le.useMemo(
|
|
3798
|
+
() => Array.isArray(w) ? w.map(De) : w == null ? void 0 : De(w),
|
|
3799
3799
|
[w]
|
|
3800
|
-
),
|
|
3801
|
-
if (
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3800
|
+
), T = (j) => {
|
|
3801
|
+
if (b) {
|
|
3802
|
+
const S = Array.isArray($) ? $ : [], z = S.includes(j) ? S.filter((X) => X !== j) : [...S, j];
|
|
3803
|
+
v?.(z);
|
|
3804
3804
|
} else
|
|
3805
|
-
|
|
3806
|
-
},
|
|
3807
|
-
(
|
|
3808
|
-
) :
|
|
3809
|
-
const
|
|
3810
|
-
if (!
|
|
3811
|
-
const z =
|
|
3812
|
-
value:
|
|
3813
|
-
label:
|
|
3805
|
+
v?.(j), _(!1), O("");
|
|
3806
|
+
}, L = b ? null : W.find((j) => j.value === $), M = b ? W.filter((j) => Array.isArray($) && $.includes(j.value)) : [], ce = g && I ? W.filter(
|
|
3807
|
+
(j) => j.label.toLowerCase().includes(I.toLowerCase())
|
|
3808
|
+
) : W, ie = !!h && !!g && !!I.trim() && !x(W, I), G = (j) => {
|
|
3809
|
+
const S = j.trim();
|
|
3810
|
+
if (!S) return;
|
|
3811
|
+
const z = C?.(S) ?? {
|
|
3812
|
+
value: S,
|
|
3813
|
+
label: S
|
|
3814
3814
|
};
|
|
3815
|
-
if (x(
|
|
3816
|
-
|
|
3815
|
+
if (x(W, z.value) || x(W, z.label)) {
|
|
3816
|
+
T(z.value), O(""), b || _(!1);
|
|
3817
3817
|
return;
|
|
3818
3818
|
}
|
|
3819
|
-
y((
|
|
3820
|
-
},
|
|
3819
|
+
y((X) => [...X, z]), T(z.value), O(""), b || _(!1);
|
|
3820
|
+
}, K = () => b ? M.length > 0 ? M.map((j) => j.label).join(", ") : u || "Select options" : L?.label || u || "Select an option";
|
|
3821
3821
|
return /* @__PURE__ */ c(
|
|
3822
3822
|
"div",
|
|
3823
3823
|
{
|
|
3824
|
-
ref:
|
|
3824
|
+
ref: H,
|
|
3825
3825
|
className: d("relative flex flex-col", a && "w-full", i),
|
|
3826
|
-
...
|
|
3826
|
+
...k,
|
|
3827
3827
|
children: [
|
|
3828
3828
|
t && /* @__PURE__ */ e(
|
|
3829
3829
|
"label",
|
|
3830
3830
|
{
|
|
3831
3831
|
htmlFor: D,
|
|
3832
|
-
onClick: () =>
|
|
3832
|
+
onClick: () => _(!F),
|
|
3833
3833
|
className: d(
|
|
3834
3834
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
3835
|
-
|
|
3836
|
-
|
|
3835
|
+
Y ? "text-danger-fg" : "text-text-muted",
|
|
3836
|
+
p
|
|
3837
3837
|
),
|
|
3838
3838
|
children: t
|
|
3839
3839
|
}
|
|
@@ -3842,39 +3842,39 @@ const Ae = (t) => t == null ? "" : String(t), hn = (t) => Ae(t).trim().toLowerCa
|
|
|
3842
3842
|
/* @__PURE__ */ c(
|
|
3843
3843
|
"button",
|
|
3844
3844
|
{
|
|
3845
|
-
ref:
|
|
3845
|
+
ref: U,
|
|
3846
3846
|
type: "button",
|
|
3847
3847
|
id: D,
|
|
3848
3848
|
disabled: l,
|
|
3849
|
-
onClick: () =>
|
|
3849
|
+
onClick: () => _(!F),
|
|
3850
3850
|
className: d(
|
|
3851
3851
|
"flex w-full items-center justify-between gap-2 rounded-tile border transition-colors duration-fast text-left",
|
|
3852
3852
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
3853
3853
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
3854
3854
|
"bg-surface",
|
|
3855
3855
|
xn[s],
|
|
3856
|
-
|
|
3856
|
+
Y ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
3857
3857
|
m
|
|
3858
3858
|
),
|
|
3859
3859
|
children: [
|
|
3860
|
-
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children:
|
|
3860
|
+
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: K() }),
|
|
3861
3861
|
/* @__PURE__ */ e(
|
|
3862
3862
|
$t,
|
|
3863
3863
|
{
|
|
3864
3864
|
size: 16,
|
|
3865
3865
|
className: d(
|
|
3866
3866
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
3867
|
-
|
|
3867
|
+
F && "rotate-180"
|
|
3868
3868
|
)
|
|
3869
3869
|
}
|
|
3870
3870
|
)
|
|
3871
3871
|
]
|
|
3872
3872
|
}
|
|
3873
3873
|
),
|
|
3874
|
-
|
|
3874
|
+
F && /* @__PURE__ */ c(
|
|
3875
3875
|
"div",
|
|
3876
3876
|
{
|
|
3877
|
-
style:
|
|
3877
|
+
style: te,
|
|
3878
3878
|
className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay",
|
|
3879
3879
|
children: [
|
|
3880
3880
|
g && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
@@ -3882,10 +3882,10 @@ const Ae = (t) => t == null ? "" : String(t), hn = (t) => Ae(t).trim().toLowerCa
|
|
|
3882
3882
|
{
|
|
3883
3883
|
type: "text",
|
|
3884
3884
|
placeholder: "Search...",
|
|
3885
|
-
value:
|
|
3886
|
-
onChange: (
|
|
3887
|
-
onKeyDown: (
|
|
3888
|
-
|
|
3885
|
+
value: I,
|
|
3886
|
+
onChange: (j) => O(j.target.value),
|
|
3887
|
+
onKeyDown: (j) => {
|
|
3888
|
+
j.key === "Enter" && ie && (j.preventDefault(), G(I));
|
|
3889
3889
|
},
|
|
3890
3890
|
className: d(
|
|
3891
3891
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -3900,51 +3900,51 @@ const Ae = (t) => t == null ? "" : String(t), hn = (t) => Ae(t).trim().toLowerCa
|
|
|
3900
3900
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
3901
3901
|
"text-info-fg hover:bg-surface-hover"
|
|
3902
3902
|
),
|
|
3903
|
-
onClick: () => G(
|
|
3903
|
+
onClick: () => G(I),
|
|
3904
3904
|
children: [
|
|
3905
3905
|
"+: “",
|
|
3906
|
-
|
|
3906
|
+
I.trim(),
|
|
3907
3907
|
"”"
|
|
3908
3908
|
]
|
|
3909
3909
|
}
|
|
3910
3910
|
),
|
|
3911
3911
|
/* @__PURE__ */ c("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
3912
|
-
u && !
|
|
3912
|
+
u && !b && /* @__PURE__ */ e(
|
|
3913
3913
|
"li",
|
|
3914
3914
|
{
|
|
3915
3915
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
3916
3916
|
onClick: () => {
|
|
3917
|
-
|
|
3917
|
+
v?.(""), _(!1);
|
|
3918
3918
|
},
|
|
3919
3919
|
children: u
|
|
3920
3920
|
}
|
|
3921
3921
|
),
|
|
3922
|
-
ce.map((
|
|
3923
|
-
const
|
|
3922
|
+
ce.map((j) => {
|
|
3923
|
+
const S = b ? Array.isArray($) && $.includes(j.value) : $ === j.value;
|
|
3924
3924
|
return /* @__PURE__ */ e(
|
|
3925
3925
|
"li",
|
|
3926
3926
|
{
|
|
3927
|
-
onClick: () => !
|
|
3927
|
+
onClick: () => !j.disabled && T(j.value),
|
|
3928
3928
|
className: d(
|
|
3929
3929
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
3930
3930
|
"text-text",
|
|
3931
|
-
|
|
3932
|
-
|
|
3931
|
+
j.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
3932
|
+
S && "bg-accent-soft text-accent font-semibold"
|
|
3933
3933
|
),
|
|
3934
3934
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
3935
|
-
|
|
3935
|
+
b && /* @__PURE__ */ e(
|
|
3936
3936
|
"input",
|
|
3937
3937
|
{
|
|
3938
3938
|
type: "checkbox",
|
|
3939
|
-
checked:
|
|
3939
|
+
checked: S,
|
|
3940
3940
|
readOnly: !0,
|
|
3941
3941
|
className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
|
|
3942
3942
|
}
|
|
3943
3943
|
),
|
|
3944
|
-
/* @__PURE__ */ e("span", { children:
|
|
3944
|
+
/* @__PURE__ */ e("span", { children: j.label })
|
|
3945
3945
|
] })
|
|
3946
3946
|
},
|
|
3947
|
-
|
|
3947
|
+
j.value
|
|
3948
3948
|
);
|
|
3949
3949
|
})
|
|
3950
3950
|
] })
|
|
@@ -3952,13 +3952,13 @@ const Ae = (t) => t == null ? "" : String(t), hn = (t) => Ae(t).trim().toLowerCa
|
|
|
3952
3952
|
}
|
|
3953
3953
|
)
|
|
3954
3954
|
] }),
|
|
3955
|
-
(n || r) && /* @__PURE__ */ e("p", { className: d("mt-1 text-xs",
|
|
3955
|
+
(n || r) && /* @__PURE__ */ e("p", { className: d("mt-1 text-xs", Y ? "text-danger-fg" : "text-text-muted"), children: n || r })
|
|
3956
3956
|
]
|
|
3957
3957
|
}
|
|
3958
3958
|
);
|
|
3959
3959
|
}
|
|
3960
3960
|
);
|
|
3961
|
-
|
|
3961
|
+
_e.displayName = "Select";
|
|
3962
3962
|
const gn = {
|
|
3963
3963
|
sm: "h-control-sm px-3 text-sm",
|
|
3964
3964
|
md: "h-control-md px-3 text-base",
|
|
@@ -3975,21 +3975,21 @@ const gn = {
|
|
|
3975
3975
|
endIcon: o,
|
|
3976
3976
|
loading: u = !1,
|
|
3977
3977
|
containerClassName: i,
|
|
3978
|
-
labelClassName:
|
|
3978
|
+
labelClassName: p,
|
|
3979
3979
|
className: m,
|
|
3980
3980
|
id: f,
|
|
3981
3981
|
...g
|
|
3982
|
-
},
|
|
3983
|
-
const w = le.useId(),
|
|
3982
|
+
}, b) => {
|
|
3983
|
+
const w = le.useId(), v = f || `textfield-${w}`, h = !!n, C = n || r ? `${v}-description` : void 0;
|
|
3984
3984
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", i), children: [
|
|
3985
3985
|
t && /* @__PURE__ */ e(
|
|
3986
3986
|
"label",
|
|
3987
3987
|
{
|
|
3988
|
-
htmlFor:
|
|
3988
|
+
htmlFor: v,
|
|
3989
3989
|
className: d(
|
|
3990
3990
|
dt,
|
|
3991
3991
|
h ? "text-danger-fg" : "text-text-muted",
|
|
3992
|
-
|
|
3992
|
+
p
|
|
3993
3993
|
),
|
|
3994
3994
|
children: t
|
|
3995
3995
|
}
|
|
@@ -3999,10 +3999,10 @@ const gn = {
|
|
|
3999
3999
|
/* @__PURE__ */ e(
|
|
4000
4000
|
"input",
|
|
4001
4001
|
{
|
|
4002
|
-
ref:
|
|
4003
|
-
id:
|
|
4002
|
+
ref: b,
|
|
4003
|
+
id: v,
|
|
4004
4004
|
"aria-invalid": h || void 0,
|
|
4005
|
-
"aria-describedby":
|
|
4005
|
+
"aria-describedby": C,
|
|
4006
4006
|
className: d(
|
|
4007
4007
|
ut,
|
|
4008
4008
|
gn[s],
|
|
@@ -4025,7 +4025,7 @@ const gn = {
|
|
|
4025
4025
|
(n || r) && /* @__PURE__ */ e(
|
|
4026
4026
|
"p",
|
|
4027
4027
|
{
|
|
4028
|
-
id:
|
|
4028
|
+
id: C,
|
|
4029
4029
|
className: d("mt-1 text-xs", h ? "text-danger-fg" : "text-text-subtle"),
|
|
4030
4030
|
children: n || r
|
|
4031
4031
|
}
|
|
@@ -4044,11 +4044,11 @@ function bn({
|
|
|
4044
4044
|
templatePlaceholder: o,
|
|
4045
4045
|
showTemplate: u = !0
|
|
4046
4046
|
}) {
|
|
4047
|
-
const [i,
|
|
4048
|
-
|
|
4047
|
+
const [i, p] = B([]);
|
|
4048
|
+
Z(() => {
|
|
4049
4049
|
let f = !0;
|
|
4050
4050
|
return Promise.resolve(n?.()).then((g) => {
|
|
4051
|
-
f && g &&
|
|
4051
|
+
f && g && p(g.data ?? []);
|
|
4052
4052
|
}).catch(() => {
|
|
4053
4053
|
}), () => {
|
|
4054
4054
|
f = !1;
|
|
@@ -4057,7 +4057,7 @@ function bn({
|
|
|
4057
4057
|
const m = t ?? {};
|
|
4058
4058
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
4059
4059
|
/* @__PURE__ */ e(
|
|
4060
|
-
|
|
4060
|
+
_e,
|
|
4061
4061
|
{
|
|
4062
4062
|
size: a,
|
|
4063
4063
|
fullWidth: !0,
|
|
@@ -4080,7 +4080,7 @@ function bn({
|
|
|
4080
4080
|
] });
|
|
4081
4081
|
}
|
|
4082
4082
|
const pn = tt(null), ea = ({ items: t, activeTab: r, onTabChange: n, className: s }) => {
|
|
4083
|
-
const [a, l] =
|
|
4083
|
+
const [a, l] = B(t[0]?.id || ""), o = r || a, u = (i) => {
|
|
4084
4084
|
n ? n(i) : l(i);
|
|
4085
4085
|
};
|
|
4086
4086
|
return /* @__PURE__ */ e("div", { className: d("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((i) => /* @__PURE__ */ e(
|
|
@@ -4121,14 +4121,14 @@ const pn = tt(null), ea = ({ items: t, activeTab: r, onTabChange: n, className:
|
|
|
4121
4121
|
size: l = "md",
|
|
4122
4122
|
className: o
|
|
4123
4123
|
}) => {
|
|
4124
|
-
const [u, i] =
|
|
4124
|
+
const [u, i] = B(
|
|
4125
4125
|
r || n || t[0]?.id || ""
|
|
4126
|
-
),
|
|
4127
|
-
s ? s(
|
|
4126
|
+
), p = n || u, m = (v) => {
|
|
4127
|
+
s ? s(v) : i(v);
|
|
4128
4128
|
}, f = {
|
|
4129
|
-
activeTab:
|
|
4129
|
+
activeTab: p,
|
|
4130
4130
|
setActiveTab: m
|
|
4131
|
-
}, g = t.find((
|
|
4131
|
+
}, g = t.find((v) => v.id === p), b = d(
|
|
4132
4132
|
"flex",
|
|
4133
4133
|
{
|
|
4134
4134
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -4137,12 +4137,12 @@ const pn = tt(null), ea = ({ items: t, activeTab: r, onTabChange: n, className:
|
|
|
4137
4137
|
"space-x-8": a === "default" || a === "underline"
|
|
4138
4138
|
},
|
|
4139
4139
|
o
|
|
4140
|
-
), w = (
|
|
4141
|
-
const
|
|
4140
|
+
), w = (v, h) => {
|
|
4141
|
+
const C = "transition-colors duration-fast font-medium", k = {
|
|
4142
4142
|
"text-xs px-2 py-1": l === "sm",
|
|
4143
4143
|
"text-sm px-3 py-2": l === "md",
|
|
4144
4144
|
"text-base px-4 py-3": l === "lg"
|
|
4145
|
-
},
|
|
4145
|
+
}, P = {
|
|
4146
4146
|
// Default variant
|
|
4147
4147
|
"border-b-2 -mb-px": a === "default",
|
|
4148
4148
|
// Pills variant
|
|
@@ -4150,49 +4150,49 @@ const pn = tt(null), ea = ({ items: t, activeTab: r, onTabChange: n, className:
|
|
|
4150
4150
|
// Underline variant
|
|
4151
4151
|
"border-b-2 pb-2": a === "underline"
|
|
4152
4152
|
}, D = {
|
|
4153
|
-
"opacity-50 cursor-not-allowed":
|
|
4154
|
-
"cursor-pointer": !
|
|
4155
|
-
},
|
|
4153
|
+
"opacity-50 cursor-not-allowed": v.disabled,
|
|
4154
|
+
"cursor-pointer": !v.disabled
|
|
4155
|
+
}, Y = h ? {
|
|
4156
4156
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
4157
4157
|
"bg-surface text-text shadow-none": a === "pills"
|
|
4158
|
-
} : {},
|
|
4158
|
+
} : {}, F = !h && !v.disabled ? {
|
|
4159
4159
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
4160
4160
|
"text-text-muted hover:text-text": a === "pills",
|
|
4161
4161
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
4162
4162
|
} : {};
|
|
4163
4163
|
return d(
|
|
4164
|
+
C,
|
|
4164
4165
|
k,
|
|
4165
|
-
|
|
4166
|
-
j,
|
|
4166
|
+
P,
|
|
4167
4167
|
D,
|
|
4168
|
-
|
|
4169
|
-
|
|
4168
|
+
Y,
|
|
4169
|
+
F
|
|
4170
4170
|
);
|
|
4171
4171
|
};
|
|
4172
4172
|
return /* @__PURE__ */ e(pn.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
|
|
4173
|
-
/* @__PURE__ */ e("div", { className:
|
|
4173
|
+
/* @__PURE__ */ e("div", { className: b, role: "tablist", children: t.map((v) => /* @__PURE__ */ e(
|
|
4174
4174
|
"button",
|
|
4175
4175
|
{
|
|
4176
4176
|
type: "button",
|
|
4177
4177
|
role: "tab",
|
|
4178
|
-
"aria-selected":
|
|
4179
|
-
"aria-controls": `tabpanel-${
|
|
4180
|
-
disabled:
|
|
4181
|
-
onClick: () => !
|
|
4182
|
-
className: w(
|
|
4178
|
+
"aria-selected": p === v.id,
|
|
4179
|
+
"aria-controls": `tabpanel-${v.id}`,
|
|
4180
|
+
disabled: v.disabled,
|
|
4181
|
+
onClick: () => !v.disabled && m(v.id),
|
|
4182
|
+
className: w(v, p === v.id),
|
|
4183
4183
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
4184
|
-
|
|
4185
|
-
|
|
4184
|
+
v.label,
|
|
4185
|
+
v.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-surface-hover text-text-muted", children: v.badge })
|
|
4186
4186
|
] })
|
|
4187
4187
|
},
|
|
4188
|
-
|
|
4188
|
+
v.id
|
|
4189
4189
|
)) }),
|
|
4190
4190
|
g?.content && /* @__PURE__ */ e(
|
|
4191
4191
|
"div",
|
|
4192
4192
|
{
|
|
4193
4193
|
role: "tabpanel",
|
|
4194
|
-
id: `tabpanel-${
|
|
4195
|
-
"aria-labelledby": `tab-${
|
|
4194
|
+
id: `tabpanel-${p}`,
|
|
4195
|
+
"aria-labelledby": `tab-${p}`,
|
|
4196
4196
|
className: "mt-4",
|
|
4197
4197
|
children: g.content
|
|
4198
4198
|
}
|
|
@@ -4215,20 +4215,20 @@ function ft({
|
|
|
4215
4215
|
className: o,
|
|
4216
4216
|
backdropClassName: u,
|
|
4217
4217
|
children: i,
|
|
4218
|
-
footer:
|
|
4218
|
+
footer: p,
|
|
4219
4219
|
showCloseButton: m = !0
|
|
4220
4220
|
}) {
|
|
4221
|
-
const f =
|
|
4222
|
-
|
|
4221
|
+
const f = se(null), g = se(null);
|
|
4222
|
+
Z(() => {
|
|
4223
4223
|
if (!t || !l) return;
|
|
4224
|
-
const w = (
|
|
4225
|
-
|
|
4224
|
+
const w = (v) => {
|
|
4225
|
+
v.key === "Escape" && r();
|
|
4226
4226
|
};
|
|
4227
4227
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
4228
|
-
}, [t, l, r]),
|
|
4228
|
+
}, [t, l, r]), Z(() => (t ? (g.current = document.activeElement, f.current && f.current.focus(), document.body.style.overflow = "hidden") : (g.current && g.current.focus(), document.body.style.overflow = ""), () => {
|
|
4229
4229
|
document.body.style.overflow = "";
|
|
4230
4230
|
}), [t]);
|
|
4231
|
-
const
|
|
4231
|
+
const b = (w) => {
|
|
4232
4232
|
a && w.target === w.currentTarget && r();
|
|
4233
4233
|
};
|
|
4234
4234
|
return t ? /* @__PURE__ */ e(
|
|
@@ -4239,7 +4239,7 @@ function ft({
|
|
|
4239
4239
|
"bg-scrim",
|
|
4240
4240
|
u
|
|
4241
4241
|
),
|
|
4242
|
-
onClick:
|
|
4242
|
+
onClick: b,
|
|
4243
4243
|
children: /* @__PURE__ */ c(
|
|
4244
4244
|
"div",
|
|
4245
4245
|
{
|
|
@@ -4263,12 +4263,12 @@ function ft({
|
|
|
4263
4263
|
onClick: r,
|
|
4264
4264
|
className: "p-1 text-text-muted hover:text-text transition-colors",
|
|
4265
4265
|
"aria-label": "Close modal",
|
|
4266
|
-
children: /* @__PURE__ */ e(
|
|
4266
|
+
children: /* @__PURE__ */ e(Q, { icon: Se, size: "lg", color: "current" })
|
|
4267
4267
|
}
|
|
4268
4268
|
)
|
|
4269
4269
|
] }),
|
|
4270
4270
|
/* @__PURE__ */ e("div", { className: "p-6", children: i }),
|
|
4271
|
-
|
|
4271
|
+
p && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: p })
|
|
4272
4272
|
]
|
|
4273
4273
|
}
|
|
4274
4274
|
)
|
|
@@ -4285,167 +4285,167 @@ const Nn = ({
|
|
|
4285
4285
|
accept: o,
|
|
4286
4286
|
onListFiles: u,
|
|
4287
4287
|
onListMounts: i,
|
|
4288
|
-
onUploadFile:
|
|
4288
|
+
onUploadFile: p,
|
|
4289
4289
|
onDownloadFile: m,
|
|
4290
4290
|
onRegisterFile: f
|
|
4291
4291
|
}) => {
|
|
4292
|
-
const [g,
|
|
4292
|
+
const [g, b] = B(!1), [w, v] = B([]), [h, C] = B(null), [k, P] = B("/"), [D, Y] = B([]), [F, _] = B(!1), [I, O] = B(""), [H, U] = B(
|
|
4293
4293
|
typeof t == "object" ? t : null
|
|
4294
|
-
), [
|
|
4295
|
-
|
|
4294
|
+
), [te, W] = B(!1), [y, x] = B(""), E = se(null), $ = de(async () => {
|
|
4295
|
+
_(!0);
|
|
4296
4296
|
try {
|
|
4297
4297
|
const N = await i?.();
|
|
4298
|
-
N?.data &&
|
|
4298
|
+
N?.data && v(N.data);
|
|
4299
4299
|
} catch (N) {
|
|
4300
4300
|
console.error("Failed to load mounts", N);
|
|
4301
4301
|
} finally {
|
|
4302
|
-
|
|
4302
|
+
_(!1);
|
|
4303
4303
|
}
|
|
4304
|
-
}, [i]),
|
|
4304
|
+
}, [i]), T = de(async () => {
|
|
4305
4305
|
if (h) {
|
|
4306
|
-
|
|
4306
|
+
_(!0);
|
|
4307
4307
|
try {
|
|
4308
4308
|
const N = await u?.({
|
|
4309
4309
|
mountId: h.id,
|
|
4310
|
-
name:
|
|
4311
|
-
path:
|
|
4310
|
+
name: I,
|
|
4311
|
+
path: k
|
|
4312
4312
|
});
|
|
4313
|
-
N?.data &&
|
|
4313
|
+
N?.data && Y(N.data);
|
|
4314
4314
|
} catch (N) {
|
|
4315
4315
|
console.error("Failed to load files", N);
|
|
4316
4316
|
} finally {
|
|
4317
|
-
|
|
4317
|
+
_(!1);
|
|
4318
4318
|
}
|
|
4319
4319
|
}
|
|
4320
|
-
}, [
|
|
4321
|
-
|
|
4322
|
-
g &&
|
|
4323
|
-
}, [g,
|
|
4324
|
-
g && h &&
|
|
4325
|
-
}, [g, h,
|
|
4326
|
-
const
|
|
4327
|
-
const
|
|
4328
|
-
if (
|
|
4329
|
-
|
|
4320
|
+
}, [k, u, I, h]);
|
|
4321
|
+
Z(() => {
|
|
4322
|
+
g && $();
|
|
4323
|
+
}, [g, $]), Z(() => {
|
|
4324
|
+
g && h && T();
|
|
4325
|
+
}, [g, h, T]);
|
|
4326
|
+
const L = async (N) => {
|
|
4327
|
+
const R = N.target.files?.[0];
|
|
4328
|
+
if (R) {
|
|
4329
|
+
_(!0);
|
|
4330
4330
|
try {
|
|
4331
|
-
const
|
|
4331
|
+
const re = await R.arrayBuffer(), oe = new Uint8Array(re), pe = {
|
|
4332
4332
|
id: `local-${Date.now()}`,
|
|
4333
|
-
name:
|
|
4333
|
+
name: R.name,
|
|
4334
4334
|
type: "file",
|
|
4335
4335
|
path: "/",
|
|
4336
|
-
mimeType:
|
|
4337
|
-
size:
|
|
4336
|
+
mimeType: R.type || "application/octet-stream",
|
|
4337
|
+
size: R.size,
|
|
4338
4338
|
mountId: "local",
|
|
4339
|
-
providerKey:
|
|
4339
|
+
providerKey: R.name,
|
|
4340
4340
|
ownerId: "me"
|
|
4341
4341
|
};
|
|
4342
|
-
|
|
4343
|
-
} catch (
|
|
4344
|
-
console.error("Local file selection failed",
|
|
4342
|
+
U(pe), r(pe, oe), b(!1);
|
|
4343
|
+
} catch (re) {
|
|
4344
|
+
console.error("Local file selection failed", re);
|
|
4345
4345
|
} finally {
|
|
4346
|
-
|
|
4346
|
+
_(!1);
|
|
4347
4347
|
}
|
|
4348
4348
|
}
|
|
4349
4349
|
}, M = async (N) => {
|
|
4350
|
-
const
|
|
4351
|
-
if (!(!
|
|
4352
|
-
|
|
4350
|
+
const R = N.target.files?.[0];
|
|
4351
|
+
if (!(!R || !h)) {
|
|
4352
|
+
_(!0);
|
|
4353
4353
|
try {
|
|
4354
|
-
const
|
|
4355
|
-
file: new Uint8Array(
|
|
4356
|
-
filename:
|
|
4357
|
-
mimeType:
|
|
4354
|
+
const re = await R.arrayBuffer(), oe = await p?.({
|
|
4355
|
+
file: new Uint8Array(re),
|
|
4356
|
+
filename: R.name,
|
|
4357
|
+
mimeType: R.type || "application/octet-stream",
|
|
4358
4358
|
mountId: h.id,
|
|
4359
|
-
path:
|
|
4359
|
+
path: k
|
|
4360
4360
|
});
|
|
4361
4361
|
if (oe?.data) {
|
|
4362
4362
|
const pe = oe.data;
|
|
4363
|
-
|
|
4363
|
+
U(pe), r(pe, new Uint8Array(re)), b(!1);
|
|
4364
4364
|
}
|
|
4365
|
-
} catch (
|
|
4366
|
-
console.error("Upload failed",
|
|
4365
|
+
} catch (re) {
|
|
4366
|
+
console.error("Upload failed", re);
|
|
4367
4367
|
} finally {
|
|
4368
|
-
|
|
4368
|
+
_(!1);
|
|
4369
4369
|
}
|
|
4370
4370
|
}
|
|
4371
4371
|
}, ce = async () => {
|
|
4372
4372
|
if (!(!y || !h)) {
|
|
4373
|
-
|
|
4373
|
+
_(!0);
|
|
4374
4374
|
try {
|
|
4375
|
-
const N = `${
|
|
4375
|
+
const N = `${k}${y}/`;
|
|
4376
4376
|
f && (await f({
|
|
4377
4377
|
name: y,
|
|
4378
4378
|
type: "folder",
|
|
4379
|
-
path:
|
|
4379
|
+
path: k,
|
|
4380
4380
|
mimeType: "application/x-directory",
|
|
4381
4381
|
size: 0,
|
|
4382
4382
|
mountId: h.id,
|
|
4383
4383
|
providerKey: N,
|
|
4384
4384
|
ownerId: "me"
|
|
4385
|
-
}), await
|
|
4385
|
+
}), await T()), W(!1), x("");
|
|
4386
4386
|
} catch (N) {
|
|
4387
4387
|
console.error("Failed to create folder", N);
|
|
4388
4388
|
} finally {
|
|
4389
|
-
|
|
4389
|
+
_(!1);
|
|
4390
4390
|
}
|
|
4391
4391
|
}
|
|
4392
4392
|
}, ie = async (N) => {
|
|
4393
|
-
|
|
4393
|
+
_(!0);
|
|
4394
4394
|
try {
|
|
4395
|
-
const
|
|
4396
|
-
|
|
4397
|
-
} catch (
|
|
4398
|
-
console.error("Failed to download file",
|
|
4395
|
+
const R = await m?.(N.id);
|
|
4396
|
+
U(N), r(N, R), b(!1);
|
|
4397
|
+
} catch (R) {
|
|
4398
|
+
console.error("Failed to download file", R);
|
|
4399
4399
|
} finally {
|
|
4400
|
-
|
|
4400
|
+
_(!1);
|
|
4401
4401
|
}
|
|
4402
4402
|
}, G = (N) => {
|
|
4403
|
-
N.stopPropagation(),
|
|
4404
|
-
},
|
|
4405
|
-
const N = /* @__PURE__ */ new Set(),
|
|
4406
|
-
return D.forEach((
|
|
4407
|
-
if (
|
|
4408
|
-
|
|
4403
|
+
N.stopPropagation(), U(null), r(null);
|
|
4404
|
+
}, K = ge(() => {
|
|
4405
|
+
const N = /* @__PURE__ */ new Set(), R = [];
|
|
4406
|
+
return D.forEach((re) => {
|
|
4407
|
+
if (re.type === "folder") {
|
|
4408
|
+
re.path === k && N.add(re.name);
|
|
4409
4409
|
return;
|
|
4410
4410
|
}
|
|
4411
|
-
const oe =
|
|
4412
|
-
ye.length > 1 ? N.add(ye[0]) : ye.length === 1 &&
|
|
4411
|
+
const oe = re.providerKey || re.name, ye = (k ? oe.substring(k.length) : oe).split("/").filter((he) => he !== "");
|
|
4412
|
+
ye.length > 1 ? N.add(ye[0]) : ye.length === 1 && R.push(re);
|
|
4413
4413
|
}), {
|
|
4414
4414
|
folders: Array.from(N).sort(),
|
|
4415
|
-
files:
|
|
4415
|
+
files: R.sort((re, oe) => re.name.localeCompare(oe.name))
|
|
4416
4416
|
};
|
|
4417
|
-
}, [D,
|
|
4418
|
-
|
|
4419
|
-
},
|
|
4420
|
-
const N =
|
|
4421
|
-
N.pop(), N.length === 0 ?
|
|
4417
|
+
}, [D, k]), j = (N) => {
|
|
4418
|
+
P((R) => `${R}${N}/`);
|
|
4419
|
+
}, S = () => {
|
|
4420
|
+
const N = k.split("/").filter((R) => R !== "");
|
|
4421
|
+
N.pop(), N.length === 0 ? P("/") : P(`${N.join("/")}/`);
|
|
4422
4422
|
}, z = ge(() => {
|
|
4423
|
-
const N =
|
|
4424
|
-
id: `folder-${
|
|
4425
|
-
name:
|
|
4423
|
+
const N = K.folders.map((R) => ({
|
|
4424
|
+
id: `folder-${R}`,
|
|
4425
|
+
name: R,
|
|
4426
4426
|
type: "folder"
|
|
4427
4427
|
}));
|
|
4428
|
-
return
|
|
4428
|
+
return K.files.forEach((R) => {
|
|
4429
4429
|
N.push({
|
|
4430
|
-
...
|
|
4430
|
+
...R,
|
|
4431
4431
|
type: "file"
|
|
4432
4432
|
});
|
|
4433
4433
|
}), N;
|
|
4434
|
-
}, [
|
|
4434
|
+
}, [K]), X = [
|
|
4435
4435
|
{
|
|
4436
4436
|
id: "name",
|
|
4437
4437
|
header: "Name",
|
|
4438
4438
|
accessor: "name",
|
|
4439
|
-
cell: (N,
|
|
4439
|
+
cell: (N, R) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
4440
4440
|
/* @__PURE__ */ e(
|
|
4441
|
-
|
|
4441
|
+
Q,
|
|
4442
4442
|
{
|
|
4443
|
-
icon:
|
|
4443
|
+
icon: R.type === "folder" ? Ge : je,
|
|
4444
4444
|
size: "sm",
|
|
4445
|
-
color:
|
|
4445
|
+
color: R.type === "folder" ? "warning" : "secondary"
|
|
4446
4446
|
}
|
|
4447
4447
|
),
|
|
4448
|
-
/* @__PURE__ */ e("span", { className: d(
|
|
4448
|
+
/* @__PURE__ */ e("span", { className: d(R.type === "folder" && "font-medium"), children: N })
|
|
4449
4449
|
] })
|
|
4450
4450
|
},
|
|
4451
4451
|
{
|
|
@@ -4463,15 +4463,15 @@ const Nn = ({
|
|
|
4463
4463
|
header: "",
|
|
4464
4464
|
accessor: "id",
|
|
4465
4465
|
align: "right",
|
|
4466
|
-
cell: (N,
|
|
4466
|
+
cell: (N, R) => /* @__PURE__ */ e(
|
|
4467
4467
|
ae,
|
|
4468
4468
|
{
|
|
4469
4469
|
variant: "outline",
|
|
4470
|
-
onClick: (
|
|
4471
|
-
|
|
4470
|
+
onClick: (re) => {
|
|
4471
|
+
re.stopPropagation(), R.type === "folder" ? j(R.name) : ie(R);
|
|
4472
4472
|
},
|
|
4473
|
-
loading:
|
|
4474
|
-
children:
|
|
4473
|
+
loading: F && R.type === "file" && H?.id === R.id,
|
|
4474
|
+
children: R.type === "folder" ? "Open" : "Select"
|
|
4475
4475
|
}
|
|
4476
4476
|
)
|
|
4477
4477
|
}
|
|
@@ -4481,7 +4481,7 @@ const Nn = ({
|
|
|
4481
4481
|
header: "Mount Name",
|
|
4482
4482
|
accessor: "name",
|
|
4483
4483
|
cell: (N) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
4484
|
-
/* @__PURE__ */ e(
|
|
4484
|
+
/* @__PURE__ */ e(Q, { icon: We, size: "sm", color: "primary" }),
|
|
4485
4485
|
/* @__PURE__ */ e("span", { children: N })
|
|
4486
4486
|
] })
|
|
4487
4487
|
},
|
|
@@ -4490,7 +4490,7 @@ const Nn = ({
|
|
|
4490
4490
|
header: "",
|
|
4491
4491
|
accessor: "id",
|
|
4492
4492
|
align: "right",
|
|
4493
|
-
cell: (N,
|
|
4493
|
+
cell: (N, R) => /* @__PURE__ */ e(ae, { variant: "outline", onClick: () => C(R), children: "Open" })
|
|
4494
4494
|
}
|
|
4495
4495
|
];
|
|
4496
4496
|
return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
@@ -4498,7 +4498,7 @@ const Nn = ({
|
|
|
4498
4498
|
/* @__PURE__ */ c(
|
|
4499
4499
|
"div",
|
|
4500
4500
|
{
|
|
4501
|
-
onClick: () => !l &&
|
|
4501
|
+
onClick: () => !l && b(!0),
|
|
4502
4502
|
className: d(
|
|
4503
4503
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
4504
4504
|
"hover:border-border-strong bg-surface",
|
|
@@ -4507,14 +4507,14 @@ const Nn = ({
|
|
|
4507
4507
|
),
|
|
4508
4508
|
children: [
|
|
4509
4509
|
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
4510
|
-
|
|
4510
|
+
Q,
|
|
4511
4511
|
{
|
|
4512
|
-
icon:
|
|
4513
|
-
color:
|
|
4512
|
+
icon: H ? je : We,
|
|
4513
|
+
color: H ? "primary" : "secondary"
|
|
4514
4514
|
}
|
|
4515
4515
|
) }),
|
|
4516
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
4517
|
-
|
|
4516
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: H ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: H.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
4517
|
+
H && !l && /* @__PURE__ */ e("button", { onClick: G, className: "p-1 hover:bg-surface-hover rounded", children: /* @__PURE__ */ e(Q, { icon: Se, size: "xs" }) })
|
|
4518
4518
|
]
|
|
4519
4519
|
}
|
|
4520
4520
|
),
|
|
@@ -4524,7 +4524,7 @@ const Nn = ({
|
|
|
4524
4524
|
{
|
|
4525
4525
|
open: g,
|
|
4526
4526
|
onClose: () => {
|
|
4527
|
-
|
|
4527
|
+
b(!1), C(null), P("/"), W(!1);
|
|
4528
4528
|
},
|
|
4529
4529
|
title: h ? `Explorer: ${h.name}` : "Select Storage Mount",
|
|
4530
4530
|
size: "lg",
|
|
@@ -4536,27 +4536,27 @@ const Nn = ({
|
|
|
4536
4536
|
{
|
|
4537
4537
|
id: "remote",
|
|
4538
4538
|
label: "Platform Storage",
|
|
4539
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: h ? /* @__PURE__ */ c(
|
|
4539
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: h ? /* @__PURE__ */ c($e, { children: [
|
|
4540
4540
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4541
4541
|
/* @__PURE__ */ e(
|
|
4542
4542
|
ae,
|
|
4543
4543
|
{
|
|
4544
4544
|
variant: "ghost",
|
|
4545
4545
|
onClick: () => {
|
|
4546
|
-
|
|
4546
|
+
k && k !== "/" ? S() : C(null);
|
|
4547
4547
|
},
|
|
4548
|
-
leftIcon: /* @__PURE__ */ e(
|
|
4549
|
-
children:
|
|
4548
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: Lt, size: "xs" }),
|
|
4549
|
+
children: k ? "Back" : "Back to Mounts"
|
|
4550
4550
|
}
|
|
4551
4551
|
),
|
|
4552
|
-
/* @__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:
|
|
4552
|
+
/* @__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: k }) }),
|
|
4553
4553
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
4554
4554
|
Ce,
|
|
4555
4555
|
{
|
|
4556
4556
|
placeholder: "Search...",
|
|
4557
|
-
value:
|
|
4558
|
-
onChange: (N) =>
|
|
4559
|
-
startIcon: /* @__PURE__ */ e(
|
|
4557
|
+
value: I,
|
|
4558
|
+
onChange: (N) => O(N.target.value),
|
|
4559
|
+
startIcon: /* @__PURE__ */ e(Ie, { size: 14 }),
|
|
4560
4560
|
fullWidth: !0
|
|
4561
4561
|
}
|
|
4562
4562
|
) }),
|
|
@@ -4565,8 +4565,8 @@ const Nn = ({
|
|
|
4565
4565
|
ae,
|
|
4566
4566
|
{
|
|
4567
4567
|
variant: "outline",
|
|
4568
|
-
onClick: () =>
|
|
4569
|
-
leftIcon: /* @__PURE__ */ e(
|
|
4568
|
+
onClick: () => W(!0),
|
|
4569
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: It, size: "xs" }),
|
|
4570
4570
|
children: "New Folder"
|
|
4571
4571
|
}
|
|
4572
4572
|
),
|
|
@@ -4574,9 +4574,9 @@ const Nn = ({
|
|
|
4574
4574
|
ae,
|
|
4575
4575
|
{
|
|
4576
4576
|
variant: "primary",
|
|
4577
|
-
onClick: () =>
|
|
4578
|
-
leftIcon: /* @__PURE__ */ e(
|
|
4579
|
-
loading:
|
|
4577
|
+
onClick: () => E.current?.click(),
|
|
4578
|
+
leftIcon: /* @__PURE__ */ e(Q, { icon: Ot, size: "xs" }),
|
|
4579
|
+
loading: F,
|
|
4580
4580
|
children: "Upload"
|
|
4581
4581
|
}
|
|
4582
4582
|
),
|
|
@@ -4585,15 +4585,15 @@ const Nn = ({
|
|
|
4585
4585
|
{
|
|
4586
4586
|
type: "file",
|
|
4587
4587
|
className: "hidden",
|
|
4588
|
-
ref:
|
|
4588
|
+
ref: E,
|
|
4589
4589
|
onChange: M,
|
|
4590
4590
|
accept: o
|
|
4591
4591
|
}
|
|
4592
4592
|
)
|
|
4593
4593
|
] })
|
|
4594
4594
|
] }),
|
|
4595
|
-
|
|
4596
|
-
/* @__PURE__ */ e(
|
|
4595
|
+
te && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
4596
|
+
/* @__PURE__ */ e(Q, { icon: Ge, size: "sm", color: "warning" }),
|
|
4597
4597
|
/* @__PURE__ */ e(
|
|
4598
4598
|
Ce,
|
|
4599
4599
|
{
|
|
@@ -4603,17 +4603,17 @@ const Nn = ({
|
|
|
4603
4603
|
autoFocus: !0
|
|
4604
4604
|
}
|
|
4605
4605
|
),
|
|
4606
|
-
/* @__PURE__ */ e(ae, { onClick: ce, loading:
|
|
4607
|
-
/* @__PURE__ */ e(ae, { variant: "ghost", onClick: () =>
|
|
4606
|
+
/* @__PURE__ */ e(ae, { onClick: ce, loading: F, children: "Create" }),
|
|
4607
|
+
/* @__PURE__ */ e(ae, { variant: "ghost", onClick: () => W(!1), children: "Cancel" })
|
|
4608
4608
|
] }),
|
|
4609
4609
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
4610
4610
|
Xe,
|
|
4611
4611
|
{
|
|
4612
4612
|
data: z,
|
|
4613
|
-
columns:
|
|
4614
|
-
loading:
|
|
4613
|
+
columns: X,
|
|
4614
|
+
loading: F,
|
|
4615
4615
|
emptyContent: "This folder is empty",
|
|
4616
|
-
onRowClick: (N) => N.type === "folder" ?
|
|
4616
|
+
onRowClick: (N) => N.type === "folder" ? j(N.name) : ie(N)
|
|
4617
4617
|
}
|
|
4618
4618
|
) })
|
|
4619
4619
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
@@ -4621,9 +4621,9 @@ const Nn = ({
|
|
|
4621
4621
|
{
|
|
4622
4622
|
data: w,
|
|
4623
4623
|
columns: q,
|
|
4624
|
-
loading:
|
|
4624
|
+
loading: F,
|
|
4625
4625
|
emptyContent: "No storage mounts configured",
|
|
4626
|
-
onRowClick: (N) =>
|
|
4626
|
+
onRowClick: (N) => C(N)
|
|
4627
4627
|
}
|
|
4628
4628
|
) }) })
|
|
4629
4629
|
},
|
|
@@ -4631,7 +4631,7 @@ const Nn = ({
|
|
|
4631
4631
|
id: "local",
|
|
4632
4632
|
label: "Local File",
|
|
4633
4633
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-border rounded-xl bg-surface-sunk/50", children: [
|
|
4634
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
4634
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(Q, { icon: je, size: "xl", color: "primary" }) }),
|
|
4635
4635
|
/* @__PURE__ */ e(me, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
4636
4636
|
/* @__PURE__ */ c(
|
|
4637
4637
|
me,
|
|
@@ -4652,7 +4652,7 @@ const Nn = ({
|
|
|
4652
4652
|
{
|
|
4653
4653
|
variant: "primary",
|
|
4654
4654
|
size: "lg",
|
|
4655
|
-
loading:
|
|
4655
|
+
loading: F,
|
|
4656
4656
|
className: "pointer-events-none",
|
|
4657
4657
|
children: "Browse Local File"
|
|
4658
4658
|
}
|
|
@@ -4662,9 +4662,9 @@ const Nn = ({
|
|
|
4662
4662
|
{
|
|
4663
4663
|
type: "file",
|
|
4664
4664
|
className: "hidden",
|
|
4665
|
-
onChange:
|
|
4665
|
+
onChange: L,
|
|
4666
4666
|
accept: o,
|
|
4667
|
-
disabled:
|
|
4667
|
+
disabled: F
|
|
4668
4668
|
}
|
|
4669
4669
|
)
|
|
4670
4670
|
] })
|
|
@@ -4692,11 +4692,11 @@ const Nn = ({
|
|
|
4692
4692
|
containerClassName: o,
|
|
4693
4693
|
labelClassName: u,
|
|
4694
4694
|
className: i,
|
|
4695
|
-
id:
|
|
4695
|
+
id: p,
|
|
4696
4696
|
rows: m = 4,
|
|
4697
4697
|
...f
|
|
4698
4698
|
}, g) => {
|
|
4699
|
-
const
|
|
4699
|
+
const b = le.useId(), w = p || `textarea-${b}`, v = !!n, h = n || r ? `${w}-description` : void 0;
|
|
4700
4700
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", o), children: [
|
|
4701
4701
|
t && /* @__PURE__ */ e(
|
|
4702
4702
|
"label",
|
|
@@ -4704,7 +4704,7 @@ const Nn = ({
|
|
|
4704
4704
|
htmlFor: w,
|
|
4705
4705
|
className: d(
|
|
4706
4706
|
dt,
|
|
4707
|
-
|
|
4707
|
+
v ? "text-danger-fg" : "text-text-muted",
|
|
4708
4708
|
u
|
|
4709
4709
|
),
|
|
4710
4710
|
children: t
|
|
@@ -4717,13 +4717,13 @@ const Nn = ({
|
|
|
4717
4717
|
ref: g,
|
|
4718
4718
|
id: w,
|
|
4719
4719
|
rows: m,
|
|
4720
|
-
"aria-invalid":
|
|
4720
|
+
"aria-invalid": v || void 0,
|
|
4721
4721
|
"aria-describedby": h,
|
|
4722
4722
|
className: d(
|
|
4723
4723
|
ut,
|
|
4724
4724
|
"resize-y leading-relaxed",
|
|
4725
4725
|
wn[s],
|
|
4726
|
-
mt(
|
|
4726
|
+
mt(v),
|
|
4727
4727
|
i
|
|
4728
4728
|
),
|
|
4729
4729
|
...f
|
|
@@ -4741,7 +4741,7 @@ const Nn = ({
|
|
|
4741
4741
|
"p",
|
|
4742
4742
|
{
|
|
4743
4743
|
id: h,
|
|
4744
|
-
className: d("mt-1 text-xs",
|
|
4744
|
+
className: d("mt-1 text-xs", v ? "text-danger-fg" : "text-text-subtle"),
|
|
4745
4745
|
children: n || r
|
|
4746
4746
|
}
|
|
4747
4747
|
)
|
|
@@ -4798,98 +4798,98 @@ const ta = ({
|
|
|
4798
4798
|
validate: o,
|
|
4799
4799
|
submitButton: u = { label: "Submit", variant: "primary" },
|
|
4800
4800
|
cancelButton: i = { label: "Cancel", variant: "outline" },
|
|
4801
|
-
showButtons:
|
|
4801
|
+
showButtons: p = !0,
|
|
4802
4802
|
layout: m = "vertical",
|
|
4803
4803
|
size: f = "md",
|
|
4804
4804
|
loading: g = !1,
|
|
4805
|
-
className:
|
|
4805
|
+
className: b,
|
|
4806
4806
|
ref: w,
|
|
4807
|
-
sdk:
|
|
4807
|
+
sdk: v
|
|
4808
4808
|
}) => {
|
|
4809
|
-
const [h,
|
|
4810
|
-
(x) => `${
|
|
4811
|
-
[
|
|
4812
|
-
), [D,
|
|
4813
|
-
|
|
4814
|
-
r &&
|
|
4809
|
+
const [h, C] = B(r || {}), k = le.useId(), P = de(
|
|
4810
|
+
(x) => `${k}-${String(x).replace(/\./g, "-")}`,
|
|
4811
|
+
[k]
|
|
4812
|
+
), [D, Y] = B({}), [F, _] = B({});
|
|
4813
|
+
Z(() => {
|
|
4814
|
+
r && C({ ...r });
|
|
4815
4815
|
}, [r]);
|
|
4816
|
-
const
|
|
4817
|
-
(x,
|
|
4818
|
-
const
|
|
4819
|
-
if (!
|
|
4820
|
-
if (
|
|
4821
|
-
return `${
|
|
4822
|
-
if (
|
|
4823
|
-
if (
|
|
4824
|
-
return `${
|
|
4825
|
-
if (
|
|
4826
|
-
return `${
|
|
4827
|
-
if (Array.isArray(
|
|
4828
|
-
const
|
|
4816
|
+
const I = de(
|
|
4817
|
+
(x, E, $) => {
|
|
4818
|
+
const T = t.flatMap((L) => L.items).find((L) => L.name === x);
|
|
4819
|
+
if (!T) return null;
|
|
4820
|
+
if (T.required && (E == null || E === ""))
|
|
4821
|
+
return `${T.label} is required`;
|
|
4822
|
+
if (T.type === "array") {
|
|
4823
|
+
if (T.required && (!E || E.length === 0))
|
|
4824
|
+
return `${T.label} cannot be empty.`;
|
|
4825
|
+
if (E && !Array.isArray(E))
|
|
4826
|
+
return `${T.label} must be an array.`;
|
|
4827
|
+
if (Array.isArray(E) && T.arrayFields) {
|
|
4828
|
+
const L = [];
|
|
4829
4829
|
let M = !1;
|
|
4830
|
-
if (
|
|
4830
|
+
if (E.forEach((ce, ie) => {
|
|
4831
4831
|
const G = {};
|
|
4832
|
-
for (const
|
|
4833
|
-
const
|
|
4834
|
-
if (
|
|
4835
|
-
G[
|
|
4836
|
-
else if (
|
|
4837
|
-
const
|
|
4838
|
-
|
|
4832
|
+
for (const K of T.arrayFields) {
|
|
4833
|
+
const j = ce?.[K.name];
|
|
4834
|
+
if (K.required && (j == null || j === ""))
|
|
4835
|
+
G[K.name] = `${K.label} is required`, M = !0;
|
|
4836
|
+
else if (K.validator) {
|
|
4837
|
+
const S = K.validator(j, ce);
|
|
4838
|
+
S && (G[K.name] = S, M = !0);
|
|
4839
4839
|
}
|
|
4840
4840
|
}
|
|
4841
|
-
|
|
4841
|
+
L[ie] = G;
|
|
4842
4842
|
}), M)
|
|
4843
|
-
return JSON.stringify(
|
|
4843
|
+
return JSON.stringify(L);
|
|
4844
4844
|
}
|
|
4845
4845
|
}
|
|
4846
|
-
return
|
|
4846
|
+
return T.validator ? T.validator(E, $) : null;
|
|
4847
4847
|
},
|
|
4848
4848
|
[t]
|
|
4849
|
-
),
|
|
4850
|
-
(x,
|
|
4851
|
-
let
|
|
4852
|
-
t.flatMap((M) => M.items).find((M) => M.name === x)?.removeIfEmpty && (
|
|
4853
|
-
const
|
|
4854
|
-
|
|
4849
|
+
), O = de(
|
|
4850
|
+
(x, E) => {
|
|
4851
|
+
let $ = kn(h, x, E);
|
|
4852
|
+
t.flatMap((M) => M.items).find((M) => M.name === x)?.removeIfEmpty && (E == null || E === "") && ($ = Cn($, x)), C($), _((M) => ({ ...M, [x]: !0 }));
|
|
4853
|
+
const L = I(x, E, $);
|
|
4854
|
+
Y((M) => ({
|
|
4855
4855
|
...M,
|
|
4856
|
-
[x]:
|
|
4857
|
-
})), a?.(
|
|
4856
|
+
[x]: L || ""
|
|
4857
|
+
})), a?.($, x);
|
|
4858
4858
|
},
|
|
4859
|
-
[h, t,
|
|
4860
|
-
),
|
|
4859
|
+
[h, t, I, a]
|
|
4860
|
+
), H = de(
|
|
4861
4861
|
async (x) => {
|
|
4862
4862
|
if (x.preventDefault(), g) return;
|
|
4863
|
-
const
|
|
4864
|
-
for (const
|
|
4865
|
-
if (
|
|
4863
|
+
const E = {}, $ = t.flatMap((L) => L.items);
|
|
4864
|
+
for (const L of $) {
|
|
4865
|
+
if (L.hidden || L.conditional && !L.conditional(h))
|
|
4866
4866
|
continue;
|
|
4867
|
-
const M =
|
|
4868
|
-
|
|
4869
|
-
Ze(h,
|
|
4867
|
+
const M = I(
|
|
4868
|
+
L.name,
|
|
4869
|
+
Ze(h, L.name),
|
|
4870
4870
|
h
|
|
4871
4871
|
);
|
|
4872
|
-
M && (
|
|
4872
|
+
M && (E[L.name] = M);
|
|
4873
4873
|
}
|
|
4874
4874
|
if (o) {
|
|
4875
|
-
const
|
|
4876
|
-
|
|
4875
|
+
const L = o(h);
|
|
4876
|
+
L && Object.assign(E, L);
|
|
4877
4877
|
}
|
|
4878
|
-
if (
|
|
4878
|
+
if (Y(E), Object.keys(E).some((L) => E[L]))
|
|
4879
4879
|
return;
|
|
4880
|
-
const
|
|
4881
|
-
await n?.(h,
|
|
4880
|
+
const T = l ? l(h) : h;
|
|
4881
|
+
await n?.(h, T);
|
|
4882
4882
|
},
|
|
4883
|
-
[h, t,
|
|
4884
|
-
),
|
|
4883
|
+
[h, t, I, o, l, n, g]
|
|
4884
|
+
), U = de(
|
|
4885
4885
|
(x) => {
|
|
4886
|
-
const
|
|
4886
|
+
const E = Ze(h, x.name), $ = F[x.name] ? D[x.name] : void 0, T = x.disabled || g, L = {
|
|
4887
4887
|
// Ties the field to the `<label>` the group wrapper renders; without it
|
|
4888
4888
|
// labels are unassociated — screen readers announce nothing, clicking a
|
|
4889
4889
|
// label focuses nothing, and tests cannot find a field by its label.
|
|
4890
|
-
id:
|
|
4891
|
-
value:
|
|
4892
|
-
disabled:
|
|
4890
|
+
id: P(x.name),
|
|
4891
|
+
value: E || "",
|
|
4892
|
+
disabled: T,
|
|
4893
4893
|
required: x.required,
|
|
4894
4894
|
placeholder: x.placeholder,
|
|
4895
4895
|
...x.fieldProps
|
|
@@ -4905,11 +4905,11 @@ const ta = ({
|
|
|
4905
4905
|
return /* @__PURE__ */ e(
|
|
4906
4906
|
Ce,
|
|
4907
4907
|
{
|
|
4908
|
-
...
|
|
4909
|
-
onChange: (M) =>
|
|
4908
|
+
...L,
|
|
4909
|
+
onChange: (M) => O(x.name, M.target.value),
|
|
4910
4910
|
type: x.textType || x.type,
|
|
4911
4911
|
...Qe(x.autocomplete),
|
|
4912
|
-
error:
|
|
4912
|
+
error: $,
|
|
4913
4913
|
size: f
|
|
4914
4914
|
}
|
|
4915
4915
|
);
|
|
@@ -4917,19 +4917,19 @@ const ta = ({
|
|
|
4917
4917
|
return /* @__PURE__ */ e(
|
|
4918
4918
|
He,
|
|
4919
4919
|
{
|
|
4920
|
-
...
|
|
4921
|
-
onChange: (M) =>
|
|
4920
|
+
...L,
|
|
4921
|
+
onChange: (M) => O(x.name, M.target.value),
|
|
4922
4922
|
rows: x.rows ?? 4,
|
|
4923
|
-
error:
|
|
4923
|
+
error: $,
|
|
4924
4924
|
size: f
|
|
4925
4925
|
}
|
|
4926
4926
|
);
|
|
4927
4927
|
case "select":
|
|
4928
4928
|
return /* @__PURE__ */ e(
|
|
4929
|
-
|
|
4929
|
+
_e,
|
|
4930
4930
|
{
|
|
4931
|
-
...
|
|
4932
|
-
onChange: (M) =>
|
|
4931
|
+
...L,
|
|
4932
|
+
onChange: (M) => O(x.name, M),
|
|
4933
4933
|
options: (x.options || []).map((M) => ({
|
|
4934
4934
|
...M,
|
|
4935
4935
|
value: String(M.value)
|
|
@@ -4937,7 +4937,7 @@ const ta = ({
|
|
|
4937
4937
|
searchable: x.searchable,
|
|
4938
4938
|
multiple: x.multiple,
|
|
4939
4939
|
allowCreate: x.allowCreate,
|
|
4940
|
-
error:
|
|
4940
|
+
error: $,
|
|
4941
4941
|
size: f
|
|
4942
4942
|
}
|
|
4943
4943
|
);
|
|
@@ -4949,8 +4949,8 @@ const ta = ({
|
|
|
4949
4949
|
lr,
|
|
4950
4950
|
{
|
|
4951
4951
|
"aria-label": x.label,
|
|
4952
|
-
value:
|
|
4953
|
-
onChange: (M) =>
|
|
4952
|
+
value: E == null ? "" : String(E),
|
|
4953
|
+
onChange: (M) => O(x.name, M),
|
|
4954
4954
|
options: (x.options || []).map((M) => ({
|
|
4955
4955
|
value: String(M.value),
|
|
4956
4956
|
label: M.label
|
|
@@ -4963,10 +4963,10 @@ const ta = ({
|
|
|
4963
4963
|
return /* @__PURE__ */ e(
|
|
4964
4964
|
we,
|
|
4965
4965
|
{
|
|
4966
|
-
...
|
|
4966
|
+
...L,
|
|
4967
4967
|
label: x.label,
|
|
4968
|
-
checked: !!
|
|
4969
|
-
onChange: (M) =>
|
|
4968
|
+
checked: !!E,
|
|
4969
|
+
onChange: (M) => O(x.name, M.target.checked),
|
|
4970
4970
|
size: f
|
|
4971
4971
|
}
|
|
4972
4972
|
);
|
|
@@ -4982,9 +4982,9 @@ const ta = ({
|
|
|
4982
4982
|
type: "radio",
|
|
4983
4983
|
name: x.name,
|
|
4984
4984
|
value: M.value,
|
|
4985
|
-
checked:
|
|
4986
|
-
onChange: () =>
|
|
4987
|
-
disabled:
|
|
4985
|
+
checked: E === M.value,
|
|
4986
|
+
onChange: () => O(x.name, M.value),
|
|
4987
|
+
disabled: T || M.disabled,
|
|
4988
4988
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
4989
4989
|
}
|
|
4990
4990
|
),
|
|
@@ -4997,9 +4997,9 @@ const ta = ({
|
|
|
4997
4997
|
return /* @__PURE__ */ e(
|
|
4998
4998
|
Be,
|
|
4999
4999
|
{
|
|
5000
|
-
...
|
|
5001
|
-
value:
|
|
5002
|
-
onChange: (M) =>
|
|
5000
|
+
...L,
|
|
5001
|
+
value: E ? new Date(E) : null,
|
|
5002
|
+
onChange: (M) => O(x.name, M),
|
|
5003
5003
|
size: f
|
|
5004
5004
|
}
|
|
5005
5005
|
);
|
|
@@ -5007,29 +5007,29 @@ const ta = ({
|
|
|
5007
5007
|
return /* @__PURE__ */ e(
|
|
5008
5008
|
Nn,
|
|
5009
5009
|
{
|
|
5010
|
-
...
|
|
5011
|
-
value:
|
|
5012
|
-
onChange: (M) =>
|
|
5013
|
-
error:
|
|
5014
|
-
onListFiles: (M) =>
|
|
5010
|
+
...L,
|
|
5011
|
+
value: E,
|
|
5012
|
+
onChange: (M) => O(x.name, M),
|
|
5013
|
+
error: $,
|
|
5014
|
+
onListFiles: (M) => v?.http.invoke({
|
|
5015
5015
|
method: "POST",
|
|
5016
5016
|
action: "storage.file.list",
|
|
5017
5017
|
body: M
|
|
5018
5018
|
}),
|
|
5019
|
-
onListMounts: () =>
|
|
5019
|
+
onListMounts: () => v?.http.invoke({
|
|
5020
5020
|
method: "GET",
|
|
5021
5021
|
action: "storage.mount"
|
|
5022
5022
|
}),
|
|
5023
|
-
onUploadFile: (M) =>
|
|
5023
|
+
onUploadFile: (M) => v?.http.invoke({
|
|
5024
5024
|
method: "POST",
|
|
5025
5025
|
action: "storage.file.upload",
|
|
5026
5026
|
body: M
|
|
5027
5027
|
}),
|
|
5028
|
-
onDownloadFile: (M) =>
|
|
5028
|
+
onDownloadFile: (M) => v?.http.invoke({
|
|
5029
5029
|
method: "GET",
|
|
5030
5030
|
action: `storage.file.${M}.download`
|
|
5031
5031
|
}),
|
|
5032
|
-
onRegisterFile: (M) =>
|
|
5032
|
+
onRegisterFile: (M) => v?.http.invoke({
|
|
5033
5033
|
method: "POST",
|
|
5034
5034
|
action: "storage.file.folder",
|
|
5035
5035
|
body: M
|
|
@@ -5040,59 +5040,59 @@ const ta = ({
|
|
|
5040
5040
|
return /* @__PURE__ */ e(
|
|
5041
5041
|
bn,
|
|
5042
5042
|
{
|
|
5043
|
-
value:
|
|
5044
|
-
onChange: (M) =>
|
|
5045
|
-
onListFolders: () =>
|
|
5043
|
+
value: E || {},
|
|
5044
|
+
onChange: (M) => O(x.name, M),
|
|
5045
|
+
onListFolders: () => v?.http.invoke({
|
|
5046
5046
|
method: "GET",
|
|
5047
5047
|
action: "storage.mount"
|
|
5048
5048
|
}),
|
|
5049
|
-
disabled:
|
|
5049
|
+
disabled: T,
|
|
5050
5050
|
size: f,
|
|
5051
5051
|
placeholder: x.placeholder
|
|
5052
5052
|
}
|
|
5053
5053
|
);
|
|
5054
5054
|
case "custom":
|
|
5055
5055
|
return x.customComponent?.({
|
|
5056
|
-
value:
|
|
5057
|
-
onChange: (M) =>
|
|
5058
|
-
error:
|
|
5059
|
-
disabled:
|
|
5056
|
+
value: E,
|
|
5057
|
+
onChange: (M) => O(x.name, M),
|
|
5058
|
+
error: $,
|
|
5059
|
+
disabled: T
|
|
5060
5060
|
});
|
|
5061
5061
|
case "array": {
|
|
5062
|
-
const M =
|
|
5062
|
+
const M = E || [];
|
|
5063
5063
|
let ce = [];
|
|
5064
|
-
if (typeof
|
|
5064
|
+
if (typeof $ == "string" && $.startsWith("["))
|
|
5065
5065
|
try {
|
|
5066
|
-
ce = JSON.parse(
|
|
5066
|
+
ce = JSON.parse($);
|
|
5067
5067
|
} catch {
|
|
5068
5068
|
}
|
|
5069
5069
|
const ie = () => {
|
|
5070
|
-
|
|
5071
|
-
}, G = (
|
|
5072
|
-
|
|
5070
|
+
O(x.name, [...M, {}]);
|
|
5071
|
+
}, G = (j) => {
|
|
5072
|
+
O(
|
|
5073
5073
|
x.name,
|
|
5074
|
-
M.filter((
|
|
5074
|
+
M.filter((S, z) => z !== j)
|
|
5075
5075
|
);
|
|
5076
|
-
},
|
|
5077
|
-
const
|
|
5078
|
-
|
|
5079
|
-
...
|
|
5080
|
-
[
|
|
5081
|
-
},
|
|
5076
|
+
}, K = (j, S, z) => {
|
|
5077
|
+
const X = [...M];
|
|
5078
|
+
X[j] = {
|
|
5079
|
+
...X[j],
|
|
5080
|
+
[S]: z
|
|
5081
|
+
}, O(x.name, X);
|
|
5082
5082
|
};
|
|
5083
5083
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
5084
|
-
M.map((
|
|
5084
|
+
M.map((j, S) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
5085
5085
|
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: x.arrayFields?.map((z) => {
|
|
5086
|
-
const
|
|
5086
|
+
const X = ce?.[S]?.[z.name];
|
|
5087
5087
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-1", children: [
|
|
5088
|
-
|
|
5088
|
+
S === 0 && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
5089
5089
|
z.label,
|
|
5090
5090
|
z.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
5091
5091
|
] }),
|
|
5092
5092
|
(() => {
|
|
5093
5093
|
const q = {
|
|
5094
|
-
value:
|
|
5095
|
-
disabled:
|
|
5094
|
+
value: j?.[z.name] || "",
|
|
5095
|
+
disabled: T,
|
|
5096
5096
|
required: z.required,
|
|
5097
5097
|
placeholder: z.placeholder,
|
|
5098
5098
|
...z.fieldProps
|
|
@@ -5108,14 +5108,14 @@ const ta = ({
|
|
|
5108
5108
|
Ce,
|
|
5109
5109
|
{
|
|
5110
5110
|
...q,
|
|
5111
|
-
onChange: (N) =>
|
|
5112
|
-
|
|
5111
|
+
onChange: (N) => K(
|
|
5112
|
+
S,
|
|
5113
5113
|
z.name,
|
|
5114
5114
|
N.target.value
|
|
5115
5115
|
),
|
|
5116
5116
|
type: z.textType || z.type,
|
|
5117
5117
|
...Qe(z.autocomplete),
|
|
5118
|
-
error:
|
|
5118
|
+
error: X,
|
|
5119
5119
|
size: f
|
|
5120
5120
|
}
|
|
5121
5121
|
);
|
|
@@ -5124,22 +5124,22 @@ const ta = ({
|
|
|
5124
5124
|
He,
|
|
5125
5125
|
{
|
|
5126
5126
|
...q,
|
|
5127
|
-
onChange: (N) =>
|
|
5128
|
-
|
|
5127
|
+
onChange: (N) => K(
|
|
5128
|
+
S,
|
|
5129
5129
|
z.name,
|
|
5130
5130
|
N.target.value
|
|
5131
5131
|
),
|
|
5132
5132
|
rows: z.rows ?? 4,
|
|
5133
|
-
error:
|
|
5133
|
+
error: X,
|
|
5134
5134
|
size: f
|
|
5135
5135
|
}
|
|
5136
5136
|
);
|
|
5137
5137
|
case "select":
|
|
5138
5138
|
return /* @__PURE__ */ e(
|
|
5139
|
-
|
|
5139
|
+
_e,
|
|
5140
5140
|
{
|
|
5141
5141
|
...q,
|
|
5142
|
-
onChange: (N) =>
|
|
5142
|
+
onChange: (N) => K(S, z.name, N),
|
|
5143
5143
|
options: (z.options || []).map((N) => ({
|
|
5144
5144
|
...N,
|
|
5145
5145
|
value: String(N.value)
|
|
@@ -5147,7 +5147,7 @@ const ta = ({
|
|
|
5147
5147
|
searchable: z.searchable,
|
|
5148
5148
|
multiple: z.multiple,
|
|
5149
5149
|
allowCreate: z.allowCreate,
|
|
5150
|
-
error:
|
|
5150
|
+
error: X,
|
|
5151
5151
|
size: f
|
|
5152
5152
|
}
|
|
5153
5153
|
);
|
|
@@ -5156,9 +5156,9 @@ const ta = ({
|
|
|
5156
5156
|
we,
|
|
5157
5157
|
{
|
|
5158
5158
|
...q,
|
|
5159
|
-
checked: !!
|
|
5160
|
-
onChange: (N) =>
|
|
5161
|
-
|
|
5159
|
+
checked: !!j?.[z.name],
|
|
5160
|
+
onChange: (N) => K(
|
|
5161
|
+
S,
|
|
5162
5162
|
z.name,
|
|
5163
5163
|
N.target.checked
|
|
5164
5164
|
),
|
|
@@ -5175,15 +5175,15 @@ const ta = ({
|
|
|
5175
5175
|
"input",
|
|
5176
5176
|
{
|
|
5177
5177
|
type: "radio",
|
|
5178
|
-
name: `${x.name}.${
|
|
5178
|
+
name: `${x.name}.${S}.${z.name}`,
|
|
5179
5179
|
value: N.value,
|
|
5180
|
-
checked:
|
|
5181
|
-
onChange: () =>
|
|
5182
|
-
|
|
5180
|
+
checked: j?.[z.name] === N.value,
|
|
5181
|
+
onChange: () => K(
|
|
5182
|
+
S,
|
|
5183
5183
|
z.name,
|
|
5184
5184
|
N.value
|
|
5185
5185
|
),
|
|
5186
|
-
disabled:
|
|
5186
|
+
disabled: T || N.disabled,
|
|
5187
5187
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
5188
5188
|
}
|
|
5189
5189
|
),
|
|
@@ -5193,23 +5193,23 @@ const ta = ({
|
|
|
5193
5193
|
N.value
|
|
5194
5194
|
)) });
|
|
5195
5195
|
case "date": {
|
|
5196
|
-
const N =
|
|
5196
|
+
const N = j?.[z.name];
|
|
5197
5197
|
return /* @__PURE__ */ e(
|
|
5198
5198
|
Be,
|
|
5199
5199
|
{
|
|
5200
5200
|
...q,
|
|
5201
5201
|
value: N ? new Date(N) : null,
|
|
5202
|
-
onChange: (
|
|
5202
|
+
onChange: (R) => K(S, z.name, R),
|
|
5203
5203
|
size: f
|
|
5204
5204
|
}
|
|
5205
5205
|
);
|
|
5206
5206
|
}
|
|
5207
5207
|
case "custom":
|
|
5208
5208
|
return z.customComponent?.({
|
|
5209
|
-
value:
|
|
5210
|
-
onChange: (N) =>
|
|
5211
|
-
error:
|
|
5212
|
-
disabled:
|
|
5209
|
+
value: j?.[z.name],
|
|
5210
|
+
onChange: (N) => K(S, z.name, N),
|
|
5211
|
+
error: X,
|
|
5212
|
+
disabled: T
|
|
5213
5213
|
});
|
|
5214
5214
|
default:
|
|
5215
5215
|
return /* @__PURE__ */ c("p", { children: [
|
|
@@ -5218,7 +5218,7 @@ const ta = ({
|
|
|
5218
5218
|
] });
|
|
5219
5219
|
}
|
|
5220
5220
|
})(),
|
|
5221
|
-
|
|
5221
|
+
X && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: X })
|
|
5222
5222
|
] }, z.name);
|
|
5223
5223
|
}) }),
|
|
5224
5224
|
/* @__PURE__ */ e(
|
|
@@ -5229,13 +5229,13 @@ const ta = ({
|
|
|
5229
5229
|
variant: "ghost",
|
|
5230
5230
|
size: "md",
|
|
5231
5231
|
"aria-label": `${x.label} verwijderen`,
|
|
5232
|
-
onClick: () => G(
|
|
5233
|
-
disabled:
|
|
5234
|
-
className: d("shrink-0",
|
|
5232
|
+
onClick: () => G(S),
|
|
5233
|
+
disabled: T,
|
|
5234
|
+
className: d("shrink-0", S === 0 && "mt-5"),
|
|
5235
5235
|
children: /* @__PURE__ */ e(Pt, { className: "size-icon-md" })
|
|
5236
5236
|
}
|
|
5237
5237
|
)
|
|
5238
|
-
] },
|
|
5238
|
+
] }, S)),
|
|
5239
5239
|
/* @__PURE__ */ c(
|
|
5240
5240
|
ae,
|
|
5241
5241
|
{
|
|
@@ -5243,7 +5243,7 @@ const ta = ({
|
|
|
5243
5243
|
variant: "secondary",
|
|
5244
5244
|
leftIcon: /* @__PURE__ */ e(jt, { className: "size-icon-sm" }),
|
|
5245
5245
|
onClick: ie,
|
|
5246
|
-
disabled:
|
|
5246
|
+
disabled: T,
|
|
5247
5247
|
children: [
|
|
5248
5248
|
x.label,
|
|
5249
5249
|
" toevoegen"
|
|
@@ -5256,14 +5256,14 @@ const ta = ({
|
|
|
5256
5256
|
return null;
|
|
5257
5257
|
}
|
|
5258
5258
|
},
|
|
5259
|
-
[h,
|
|
5260
|
-
),
|
|
5259
|
+
[h, F, D, g, f, O, P, v?.http.invoke]
|
|
5260
|
+
), te = de(
|
|
5261
5261
|
(x) => {
|
|
5262
5262
|
if (x.conditional && !x.conditional(h))
|
|
5263
5263
|
return null;
|
|
5264
|
-
const
|
|
5265
|
-
if (
|
|
5266
|
-
const
|
|
5264
|
+
const E = x.items.filter((T) => !(T.hidden || T.conditional && !T.conditional(h)));
|
|
5265
|
+
if (E.length === 0) return null;
|
|
5266
|
+
const $ = d(
|
|
5267
5267
|
x.layout === "flex" ? "flex flex-wrap gap-3.5" : "grid gap-3.5",
|
|
5268
5268
|
x.layout !== "flex" && {
|
|
5269
5269
|
"grid-cols-1": !x.columns || x.columns === 1,
|
|
@@ -5283,36 +5283,36 @@ const ta = ({
|
|
|
5283
5283
|
title: x.title,
|
|
5284
5284
|
description: x.description,
|
|
5285
5285
|
className: "not-last:border-b not-last:border-border-subtle",
|
|
5286
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className:
|
|
5287
|
-
const
|
|
5286
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: $, children: E.map((T) => {
|
|
5287
|
+
const L = F[T.name] ? D[T.name] : void 0;
|
|
5288
5288
|
return /* @__PURE__ */ c(
|
|
5289
5289
|
"div",
|
|
5290
5290
|
{
|
|
5291
5291
|
className: d(
|
|
5292
5292
|
"flex min-w-0 flex-col gap-1.5",
|
|
5293
|
-
|
|
5293
|
+
T.type === "checkbox" && "justify-center"
|
|
5294
5294
|
),
|
|
5295
5295
|
style: {
|
|
5296
|
-
width: typeof
|
|
5297
|
-
gridColumn: typeof
|
|
5296
|
+
width: typeof T.width == "string" ? T.width : void 0,
|
|
5297
|
+
gridColumn: typeof T.width == "number" ? `span ${T.width} / span ${T.width}` : void 0
|
|
5298
5298
|
},
|
|
5299
5299
|
children: [
|
|
5300
|
-
|
|
5300
|
+
T.type !== "custom" && T.type !== "checkbox" && /* @__PURE__ */ c(
|
|
5301
5301
|
"label",
|
|
5302
5302
|
{
|
|
5303
|
-
htmlFor:
|
|
5303
|
+
htmlFor: P(T.name),
|
|
5304
5304
|
className: "block text-sm font-medium text-text-muted",
|
|
5305
5305
|
children: [
|
|
5306
|
-
|
|
5307
|
-
|
|
5306
|
+
T.label,
|
|
5307
|
+
T.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
5308
5308
|
]
|
|
5309
5309
|
}
|
|
5310
5310
|
),
|
|
5311
|
-
|
|
5312
|
-
|
|
5311
|
+
U(T),
|
|
5312
|
+
T.help && !L && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: T.help })
|
|
5313
5313
|
]
|
|
5314
5314
|
},
|
|
5315
|
-
|
|
5315
|
+
T.name
|
|
5316
5316
|
);
|
|
5317
5317
|
}) }) })
|
|
5318
5318
|
},
|
|
@@ -5320,20 +5320,20 @@ const ta = ({
|
|
|
5320
5320
|
)
|
|
5321
5321
|
);
|
|
5322
5322
|
},
|
|
5323
|
-
[h,
|
|
5324
|
-
),
|
|
5323
|
+
[h, F, D, U, P]
|
|
5324
|
+
), W = d(
|
|
5325
5325
|
{
|
|
5326
5326
|
"max-w-settings": f === "sm",
|
|
5327
5327
|
"max-w-form": f === "md",
|
|
5328
5328
|
"max-w-6xl": f === "lg",
|
|
5329
5329
|
"max-w-full": f === "full"
|
|
5330
5330
|
},
|
|
5331
|
-
|
|
5331
|
+
b
|
|
5332
5332
|
), y = f === "full" ? "md" : f;
|
|
5333
|
-
return /* @__PURE__ */ c("form", { ref: w, onSubmit:
|
|
5334
|
-
!
|
|
5335
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(
|
|
5336
|
-
|
|
5333
|
+
return /* @__PURE__ */ c("form", { ref: w, onSubmit: H, className: W, children: [
|
|
5334
|
+
!p && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
5335
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(te) }),
|
|
5336
|
+
p && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 border-t border-border-subtle py-4", children: [
|
|
5337
5337
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
5338
5338
|
s && /* @__PURE__ */ e(
|
|
5339
5339
|
ae,
|
|
@@ -5372,19 +5372,19 @@ function ra({
|
|
|
5372
5372
|
helperText: o,
|
|
5373
5373
|
disabled: u,
|
|
5374
5374
|
className: i,
|
|
5375
|
-
chooseLabel:
|
|
5375
|
+
chooseLabel: p = "Choose",
|
|
5376
5376
|
removeLabel: m = "Remove",
|
|
5377
5377
|
tooLargeLabel: f = "That image is too large."
|
|
5378
5378
|
}) {
|
|
5379
|
-
const g =
|
|
5379
|
+
const g = se(null), [b, w] = B(null), v = async (h) => {
|
|
5380
5380
|
if (!h) return;
|
|
5381
5381
|
w(null);
|
|
5382
|
-
const
|
|
5383
|
-
if (a && En(
|
|
5382
|
+
const C = await Tn(h, s);
|
|
5383
|
+
if (a && En(C) > a) {
|
|
5384
5384
|
w(f);
|
|
5385
5385
|
return;
|
|
5386
5386
|
}
|
|
5387
|
-
n(
|
|
5387
|
+
n(C);
|
|
5388
5388
|
};
|
|
5389
5389
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col gap-1.5", i), children: [
|
|
5390
5390
|
t && /* @__PURE__ */ e("span", { className: "text-sm font-medium text-text", children: t }),
|
|
@@ -5408,7 +5408,7 @@ function ra({
|
|
|
5408
5408
|
variant: "secondary",
|
|
5409
5409
|
disabled: u,
|
|
5410
5410
|
onClick: () => g.current?.click(),
|
|
5411
|
-
children:
|
|
5411
|
+
children: p
|
|
5412
5412
|
}
|
|
5413
5413
|
),
|
|
5414
5414
|
r && /* @__PURE__ */ e(
|
|
@@ -5424,7 +5424,7 @@ function ra({
|
|
|
5424
5424
|
}
|
|
5425
5425
|
)
|
|
5426
5426
|
] }),
|
|
5427
|
-
(
|
|
5427
|
+
(b || o) && /* @__PURE__ */ e(me, { variant: "caption", color: b ? "error" : "muted", children: b ?? o })
|
|
5428
5428
|
] })
|
|
5429
5429
|
] }),
|
|
5430
5430
|
/* @__PURE__ */ e(
|
|
@@ -5434,7 +5434,7 @@ function ra({
|
|
|
5434
5434
|
type: "file",
|
|
5435
5435
|
accept: "image/png,image/jpeg,image/webp",
|
|
5436
5436
|
className: "hidden",
|
|
5437
|
-
onChange: (h) => void
|
|
5437
|
+
onChange: (h) => void v(h.target.files?.[0])
|
|
5438
5438
|
}
|
|
5439
5439
|
)
|
|
5440
5440
|
] });
|
|
@@ -5449,14 +5449,14 @@ function Tn(t, r) {
|
|
|
5449
5449
|
a.onload = () => {
|
|
5450
5450
|
const l = new Image();
|
|
5451
5451
|
l.onload = () => {
|
|
5452
|
-
const o = Math.min(1, r / Math.max(l.width, l.height)), u = Math.round(l.width * o), i = Math.round(l.height * o),
|
|
5453
|
-
|
|
5454
|
-
const m =
|
|
5452
|
+
const o = Math.min(1, r / Math.max(l.width, l.height)), u = Math.round(l.width * o), i = Math.round(l.height * o), p = document.createElement("canvas");
|
|
5453
|
+
p.width = u, p.height = i;
|
|
5454
|
+
const m = p.getContext("2d");
|
|
5455
5455
|
if (!m) {
|
|
5456
5456
|
n(a.result);
|
|
5457
5457
|
return;
|
|
5458
5458
|
}
|
|
5459
|
-
m.drawImage(l, 0, 0, u, i), n(
|
|
5459
|
+
m.drawImage(l, 0, 0, u, i), n(p.toDataURL("image/png"));
|
|
5460
5460
|
}, l.onerror = s, l.src = a.result;
|
|
5461
5461
|
}, a.onerror = s, a.readAsDataURL(t);
|
|
5462
5462
|
});
|
|
@@ -5476,103 +5476,103 @@ function An(t) {
|
|
|
5476
5476
|
}
|
|
5477
5477
|
const Dn = be(
|
|
5478
5478
|
({ initialContent: t, onChange: r, people: n, placeholder: s, onSubmit: a, autoFocus: l, className: o }, u) => {
|
|
5479
|
-
const i =
|
|
5480
|
-
if (
|
|
5481
|
-
const
|
|
5482
|
-
return n.filter((
|
|
5483
|
-
}, [n,
|
|
5479
|
+
const i = se(null), [p, m] = B(null), [f, g] = B(null), [b, w] = B(0), v = ge(() => ({ current: f }), [f]), h = ge(() => {
|
|
5480
|
+
if (p === null) return [];
|
|
5481
|
+
const _ = p.toLowerCase();
|
|
5482
|
+
return n.filter((I) => I.name.toLowerCase().includes(_)).slice(0, 8);
|
|
5483
|
+
}, [n, p]), C = Te(h.length > 0, v, { gap: 4 }), k = de(() => {
|
|
5484
5484
|
if (!i.current) return;
|
|
5485
|
-
const { text:
|
|
5486
|
-
r(
|
|
5487
|
-
}, [r]),
|
|
5485
|
+
const { text: _, mentions: I } = zn(i.current);
|
|
5486
|
+
r(_, I);
|
|
5487
|
+
}, [r]), P = de(() => {
|
|
5488
5488
|
m(null), g(null), w(0);
|
|
5489
5489
|
}, []);
|
|
5490
5490
|
le.useImperativeHandle(u, () => ({
|
|
5491
|
-
insertText: (
|
|
5492
|
-
const
|
|
5493
|
-
if (!
|
|
5491
|
+
insertText: (_) => {
|
|
5492
|
+
const I = i.current;
|
|
5493
|
+
if (!I) return;
|
|
5494
5494
|
const O = window.getSelection();
|
|
5495
|
-
if (O && O.rangeCount > 0 &&
|
|
5496
|
-
const
|
|
5497
|
-
|
|
5498
|
-
const
|
|
5495
|
+
if (O && O.rangeCount > 0 && I.contains(O.anchorNode)) {
|
|
5496
|
+
const H = O.getRangeAt(0);
|
|
5497
|
+
H.deleteContents();
|
|
5498
|
+
const U = document.createDocumentFragment(), te = _.split(`
|
|
5499
5499
|
`);
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
}),
|
|
5500
|
+
te.forEach((W, y) => {
|
|
5501
|
+
U.appendChild(document.createTextNode(W)), y < te.length - 1 && U.appendChild(document.createElement("br"));
|
|
5502
|
+
}), H.insertNode(U), H.collapse(!1), O.removeAllRanges(), O.addRange(H);
|
|
5503
5503
|
} else
|
|
5504
|
-
|
|
5505
|
-
|
|
5504
|
+
I.innerHTML += Mn(_);
|
|
5505
|
+
k();
|
|
5506
5506
|
},
|
|
5507
5507
|
clear: () => {
|
|
5508
|
-
i.current && (i.current.innerHTML = "",
|
|
5508
|
+
i.current && (i.current.innerHTML = "", P(), k());
|
|
5509
5509
|
},
|
|
5510
5510
|
focus: () => i.current?.focus()
|
|
5511
|
-
})),
|
|
5512
|
-
!i.current || !t || (i.current.innerHTML = An(t),
|
|
5513
|
-
}, [t,
|
|
5511
|
+
})), Z(() => {
|
|
5512
|
+
!i.current || !t || (i.current.innerHTML = An(t), k());
|
|
5513
|
+
}, [t, k]), Z(() => {
|
|
5514
5514
|
l && (window.matchMedia?.("(max-width: 767px)").matches || i.current?.focus());
|
|
5515
5515
|
}, [l]);
|
|
5516
|
-
const
|
|
5517
|
-
if (["Escape", "Enter", "ArrowUp", "ArrowDown", "Tab"].includes(
|
|
5518
|
-
const
|
|
5519
|
-
if (!
|
|
5520
|
-
const O =
|
|
5516
|
+
const D = de((_) => {
|
|
5517
|
+
if (["Escape", "Enter", "ArrowUp", "ArrowDown", "Tab"].includes(_.key)) return;
|
|
5518
|
+
const I = window.getSelection();
|
|
5519
|
+
if (!I || I.rangeCount === 0) return;
|
|
5520
|
+
const O = I.getRangeAt(0);
|
|
5521
5521
|
if (!O.collapsed || O.startContainer.nodeType !== Node.TEXT_NODE) return;
|
|
5522
|
-
const
|
|
5523
|
-
if (
|
|
5522
|
+
const H = O.startContainer, U = (H.textContent ?? "").slice(0, O.startOffset), te = U.lastIndexOf("@");
|
|
5523
|
+
if (te === -1 || U.slice(te + 1).includes(" ")) {
|
|
5524
5524
|
m(null), g(null);
|
|
5525
5525
|
return;
|
|
5526
5526
|
}
|
|
5527
5527
|
const W = document.createRange();
|
|
5528
|
-
W.setStart(
|
|
5529
|
-
}, []),
|
|
5530
|
-
(
|
|
5528
|
+
W.setStart(H, te), W.setEnd(H, O.startOffset), m(U.slice(te + 1)), g(W), w(0);
|
|
5529
|
+
}, []), Y = de(
|
|
5530
|
+
(_) => {
|
|
5531
5531
|
if (!i.current || !f) return;
|
|
5532
|
-
const
|
|
5533
|
-
if (!
|
|
5532
|
+
const I = window.getSelection();
|
|
5533
|
+
if (!I) return;
|
|
5534
5534
|
f.deleteContents();
|
|
5535
5535
|
const O = document.createElement("span");
|
|
5536
|
-
O.textContent = `@${
|
|
5537
|
-
const
|
|
5538
|
-
f.insertNode(
|
|
5539
|
-
const
|
|
5540
|
-
|
|
5536
|
+
O.textContent = `@${_.name}`, O.setAttribute("data-mention-id", _.id), O.setAttribute("contenteditable", "false"), O.className = "bg-beta-container text-info-fg font-semibold px-1 rounded-md";
|
|
5537
|
+
const H = document.createTextNode(" ");
|
|
5538
|
+
f.insertNode(H), f.insertNode(O);
|
|
5539
|
+
const U = document.createRange();
|
|
5540
|
+
U.setStartAfter(H), U.collapse(!0), I.removeAllRanges(), I.addRange(U), P(), k();
|
|
5541
5541
|
},
|
|
5542
|
-
[f,
|
|
5543
|
-
),
|
|
5544
|
-
(
|
|
5542
|
+
[f, k, P]
|
|
5543
|
+
), F = de(
|
|
5544
|
+
(_) => {
|
|
5545
5545
|
if (!i.current) return;
|
|
5546
|
-
if (
|
|
5547
|
-
if (
|
|
5548
|
-
|
|
5546
|
+
if (h.length > 0) {
|
|
5547
|
+
if (_.key === "ArrowDown") {
|
|
5548
|
+
_.preventDefault(), w((y) => (y + 1) % h.length);
|
|
5549
5549
|
return;
|
|
5550
5550
|
}
|
|
5551
|
-
if (
|
|
5552
|
-
|
|
5551
|
+
if (_.key === "ArrowUp") {
|
|
5552
|
+
_.preventDefault(), w((y) => (y - 1 + h.length) % h.length);
|
|
5553
5553
|
return;
|
|
5554
5554
|
}
|
|
5555
|
-
if (
|
|
5556
|
-
|
|
5555
|
+
if (_.key === "Enter" || _.key === "Tab") {
|
|
5556
|
+
_.preventDefault(), Y(h[b]);
|
|
5557
5557
|
return;
|
|
5558
5558
|
}
|
|
5559
|
-
if (
|
|
5560
|
-
|
|
5559
|
+
if (_.key === "Escape") {
|
|
5560
|
+
_.preventDefault(), P();
|
|
5561
5561
|
return;
|
|
5562
5562
|
}
|
|
5563
5563
|
}
|
|
5564
|
-
if (a &&
|
|
5565
|
-
|
|
5564
|
+
if (a && _.key === "Enter" && (_.metaKey || _.ctrlKey)) {
|
|
5565
|
+
_.preventDefault(), a();
|
|
5566
5566
|
return;
|
|
5567
5567
|
}
|
|
5568
|
-
const
|
|
5569
|
-
if (!
|
|
5570
|
-
const O =
|
|
5568
|
+
const I = window.getSelection();
|
|
5569
|
+
if (!I || I.rangeCount === 0) return;
|
|
5570
|
+
const O = I.getRangeAt(0);
|
|
5571
5571
|
if (!O.collapsed) return;
|
|
5572
|
-
const
|
|
5573
|
-
W instanceof HTMLElement && W.hasAttribute("data-mention-id") && (
|
|
5572
|
+
const H = O.startContainer, U = O.startOffset, te = (y) => H.nodeType === Node.TEXT_NODE ? y === "prev" ? H.previousSibling : H.nextSibling : H.childNodes[y === "prev" ? U - 1 : U], W = _.key === "Backspace" ? te("prev") : _.key === "Delete" ? te("next") : null;
|
|
5573
|
+
W instanceof HTMLElement && W.hasAttribute("data-mention-id") && (_.preventDefault(), W.remove(), k());
|
|
5574
5574
|
},
|
|
5575
|
-
[b,
|
|
5575
|
+
[h, b, Y, P, k, a]
|
|
5576
5576
|
);
|
|
5577
5577
|
return /* @__PURE__ */ c("div", { className: "relative w-full", children: [
|
|
5578
5578
|
/* @__PURE__ */ e(
|
|
@@ -5591,32 +5591,39 @@ const Dn = be(
|
|
|
5591
5591
|
o
|
|
5592
5592
|
),
|
|
5593
5593
|
"data-placeholder": s,
|
|
5594
|
-
onInput:
|
|
5595
|
-
onKeyUp:
|
|
5596
|
-
onKeyDown:
|
|
5597
|
-
onBlur:
|
|
5594
|
+
onInput: k,
|
|
5595
|
+
onKeyUp: D,
|
|
5596
|
+
onKeyDown: F,
|
|
5597
|
+
onBlur: P
|
|
5598
5598
|
}
|
|
5599
5599
|
),
|
|
5600
|
-
|
|
5601
|
-
"
|
|
5600
|
+
h.length > 0 && /* @__PURE__ */ e(
|
|
5601
|
+
"ul",
|
|
5602
5602
|
{
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5603
|
+
style: C,
|
|
5604
|
+
className: "z-50 w-64 overflow-y-auto overscroll-contain rounded-md border border-border bg-surface text-text shadow-lg",
|
|
5605
|
+
children: h.map((_, I) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
5606
|
+
"button",
|
|
5607
|
+
{
|
|
5608
|
+
type: "button",
|
|
5609
|
+
onMouseDown: (O) => {
|
|
5610
|
+
O.preventDefault(), Y(_);
|
|
5611
|
+
},
|
|
5612
|
+
onMouseEnter: () => w(I),
|
|
5613
|
+
className: d(
|
|
5614
|
+
"block w-full px-4 py-2 text-left text-sm",
|
|
5615
|
+
I === b && "bg-beta-container"
|
|
5616
|
+
),
|
|
5617
|
+
children: _.name
|
|
5618
|
+
}
|
|
5619
|
+
) }, _.id))
|
|
5613
5620
|
}
|
|
5614
|
-
)
|
|
5621
|
+
)
|
|
5615
5622
|
] });
|
|
5616
5623
|
}
|
|
5617
5624
|
);
|
|
5618
5625
|
Dn.displayName = "MentionComposer";
|
|
5619
|
-
const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
5626
|
+
const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(Ie, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), $n = (t) => /* @__PURE__ */ e(Le, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ln = {
|
|
5620
5627
|
sm: "h-control-sm px-3 text-sm",
|
|
5621
5628
|
md: "h-control-md px-3 text-base",
|
|
5622
5629
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -5637,60 +5644,60 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5637
5644
|
loading: o = !1,
|
|
5638
5645
|
containerClassName: u,
|
|
5639
5646
|
labelClassName: i,
|
|
5640
|
-
className:
|
|
5647
|
+
className: p,
|
|
5641
5648
|
id: m,
|
|
5642
5649
|
options: f,
|
|
5643
5650
|
onRemoteSearch: g,
|
|
5644
|
-
onSelect:
|
|
5651
|
+
onSelect: b,
|
|
5645
5652
|
debounceTime: w = 500,
|
|
5646
|
-
showAllOnOpen:
|
|
5653
|
+
showAllOnOpen: v = !1,
|
|
5647
5654
|
value: h,
|
|
5648
|
-
onChange:
|
|
5649
|
-
...
|
|
5650
|
-
},
|
|
5651
|
-
const D = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`,
|
|
5652
|
-
|
|
5653
|
-
h !== void 0 &&
|
|
5655
|
+
onChange: C,
|
|
5656
|
+
...k
|
|
5657
|
+
}, P) => {
|
|
5658
|
+
const D = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, Y = !!n, F = se(null), _ = se(null), [I, O] = B(h || ""), [H, U] = B(!1), [te, W] = B(!1), [y, x] = B(!1);
|
|
5659
|
+
Z(() => {
|
|
5660
|
+
h !== void 0 && O(h);
|
|
5654
5661
|
}, [h]);
|
|
5655
|
-
const
|
|
5656
|
-
if (
|
|
5657
|
-
const G = String(
|
|
5662
|
+
const E = ge(() => {
|
|
5663
|
+
if (v && !y || !I) return f;
|
|
5664
|
+
const G = String(I).toLowerCase();
|
|
5658
5665
|
return f.filter(
|
|
5659
|
-
(
|
|
5666
|
+
(K) => String(K.label).toLowerCase().includes(G)
|
|
5660
5667
|
);
|
|
5661
|
-
}, [
|
|
5662
|
-
|
|
5663
|
-
if (!g || !
|
|
5664
|
-
|
|
5668
|
+
}, [I, f, v, y]);
|
|
5669
|
+
Z(() => {
|
|
5670
|
+
if (!g || !I) {
|
|
5671
|
+
W(!1);
|
|
5665
5672
|
return;
|
|
5666
5673
|
}
|
|
5667
5674
|
const G = setTimeout(async () => {
|
|
5668
|
-
|
|
5675
|
+
W(!0);
|
|
5669
5676
|
try {
|
|
5670
|
-
await g(String(
|
|
5671
|
-
} catch (
|
|
5672
|
-
console.error("Remote search failed:",
|
|
5677
|
+
await g(String(I));
|
|
5678
|
+
} catch (K) {
|
|
5679
|
+
console.error("Remote search failed:", K);
|
|
5673
5680
|
} finally {
|
|
5674
|
-
|
|
5681
|
+
W(!1);
|
|
5675
5682
|
}
|
|
5676
5683
|
}, w);
|
|
5677
5684
|
return () => {
|
|
5678
|
-
clearTimeout(G),
|
|
5685
|
+
clearTimeout(G), W(!1);
|
|
5679
5686
|
};
|
|
5680
|
-
}, [
|
|
5681
|
-
const G = (
|
|
5682
|
-
|
|
5687
|
+
}, [I, w, g]), Z(() => {
|
|
5688
|
+
const G = (K) => {
|
|
5689
|
+
F.current && !F.current.contains(K.target) && U(!1);
|
|
5683
5690
|
};
|
|
5684
5691
|
return document.addEventListener("mousedown", G), () => document.removeEventListener("mousedown", G);
|
|
5685
5692
|
}, []);
|
|
5686
|
-
const
|
|
5687
|
-
const
|
|
5688
|
-
|
|
5689
|
-
},
|
|
5690
|
-
|
|
5691
|
-
},
|
|
5692
|
-
(f.length > 0 || g) && (
|
|
5693
|
-
}, M = o ||
|
|
5693
|
+
const $ = (G) => {
|
|
5694
|
+
const K = G.target.value;
|
|
5695
|
+
O(K), U(!0), x(!0), C && C(G);
|
|
5696
|
+
}, T = (G) => {
|
|
5697
|
+
O(G.label), U(!1), x(!1), b && b(G.value);
|
|
5698
|
+
}, L = () => {
|
|
5699
|
+
(f.length > 0 || g) && (U(!0), x(!1));
|
|
5700
|
+
}, M = o || te, ce = H && (E.length > 0 || M), ie = ge(() => P || _, [P]);
|
|
5694
5701
|
return /* @__PURE__ */ c(
|
|
5695
5702
|
"div",
|
|
5696
5703
|
{
|
|
@@ -5700,7 +5707,7 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5700
5707
|
u || "",
|
|
5701
5708
|
"relative"
|
|
5702
5709
|
),
|
|
5703
|
-
ref:
|
|
5710
|
+
ref: F,
|
|
5704
5711
|
children: [
|
|
5705
5712
|
t && /* @__PURE__ */ e(
|
|
5706
5713
|
"label",
|
|
@@ -5708,7 +5715,7 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5708
5715
|
htmlFor: D,
|
|
5709
5716
|
className: Ne(
|
|
5710
5717
|
"block text-sm font-medium mb-1",
|
|
5711
|
-
|
|
5718
|
+
Y ? "text-danger-fg" : "text-text",
|
|
5712
5719
|
i || ""
|
|
5713
5720
|
),
|
|
5714
5721
|
children: t
|
|
@@ -5721,9 +5728,9 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5721
5728
|
{
|
|
5722
5729
|
ref: ie,
|
|
5723
5730
|
id: D,
|
|
5724
|
-
value:
|
|
5725
|
-
onChange:
|
|
5726
|
-
onFocus:
|
|
5731
|
+
value: I,
|
|
5732
|
+
onChange: $,
|
|
5733
|
+
onFocus: L,
|
|
5727
5734
|
className: Ne(
|
|
5728
5735
|
// Base styles
|
|
5729
5736
|
"block w-full rounded-tile border bg-surface-input transition-colors duration-fast ease-out",
|
|
@@ -5736,10 +5743,10 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5736
5743
|
"pr-10",
|
|
5737
5744
|
// room for the dropdown/loading icon
|
|
5738
5745
|
// State styles
|
|
5739
|
-
|
|
5740
|
-
|
|
5746
|
+
Y ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
5747
|
+
p || ""
|
|
5741
5748
|
),
|
|
5742
|
-
...
|
|
5749
|
+
...k
|
|
5743
5750
|
}
|
|
5744
5751
|
),
|
|
5745
5752
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || o ? (
|
|
@@ -5753,29 +5760,29 @@ const Ne = (...t) => t.filter(Boolean).join(" "), _n = (t) => /* @__PURE__ */ e(
|
|
|
5753
5760
|
className: Ne(
|
|
5754
5761
|
"text-text-muted cursor-pointer transition-transform",
|
|
5755
5762
|
Fe[s],
|
|
5756
|
-
|
|
5763
|
+
H ? "rotate-180" : "rotate-0"
|
|
5757
5764
|
),
|
|
5758
5765
|
onClick: () => {
|
|
5759
|
-
|
|
5766
|
+
U((G) => (G || x(!1), !G));
|
|
5760
5767
|
}
|
|
5761
5768
|
}
|
|
5762
5769
|
)
|
|
5763
5770
|
) })
|
|
5764
5771
|
] }),
|
|
5765
|
-
ce && /* @__PURE__ */ e("ul", { className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full", children:
|
|
5772
|
+
ce && /* @__PURE__ */ e("ul", { className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full", children: E.length > 0 ? E.map((G) => /* @__PURE__ */ e(
|
|
5766
5773
|
"li",
|
|
5767
5774
|
{
|
|
5768
5775
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
5769
|
-
onClick: () =>
|
|
5770
|
-
"aria-selected":
|
|
5776
|
+
onClick: () => T(G),
|
|
5777
|
+
"aria-selected": I === G.label,
|
|
5771
5778
|
children: G.label
|
|
5772
5779
|
},
|
|
5773
5780
|
G.value
|
|
5774
5781
|
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children: M || o ? "Zoeken op afstand..." : "Geen resultaten gevonden." }) }),
|
|
5775
|
-
(n || r) && /* @__PURE__ */ e("p", { className: Ne("mt-1 text-xs",
|
|
5782
|
+
(n || r) && /* @__PURE__ */ e("p", { className: Ne("mt-1 text-xs", Y ? "text-danger-fg" : "text-text-muted"), children: n || r }),
|
|
5776
5783
|
g && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
5777
5784
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
5778
|
-
String(
|
|
5785
|
+
String(I)
|
|
5779
5786
|
] })
|
|
5780
5787
|
]
|
|
5781
5788
|
}
|
|
@@ -5922,8 +5929,8 @@ function aa({
|
|
|
5922
5929
|
mirrored: n = !1,
|
|
5923
5930
|
className: s
|
|
5924
5931
|
}) {
|
|
5925
|
-
const a =
|
|
5926
|
-
return
|
|
5932
|
+
const a = se(null);
|
|
5933
|
+
return Z(() => {
|
|
5927
5934
|
if (!r || !a.current) return;
|
|
5928
5935
|
const l = t(a.current);
|
|
5929
5936
|
return () => {
|
|
@@ -5957,7 +5964,7 @@ const Bn = () => /* @__PURE__ */ e(Ue, { variant: "inline", shape: "menu" }), ht
|
|
|
5957
5964
|
]
|
|
5958
5965
|
}
|
|
5959
5966
|
),
|
|
5960
|
-
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-px", children: t.children?.map((i,
|
|
5967
|
+
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-px", children: t.children?.map((i, p) => /* @__PURE__ */ e(
|
|
5961
5968
|
ht,
|
|
5962
5969
|
{
|
|
5963
5970
|
item: i,
|
|
@@ -5965,7 +5972,7 @@ const Bn = () => /* @__PURE__ */ e(Ue, { variant: "inline", shape: "menu" }), ht
|
|
|
5965
5972
|
onClick: n,
|
|
5966
5973
|
depth: s + 1
|
|
5967
5974
|
},
|
|
5968
|
-
|
|
5975
|
+
p
|
|
5969
5976
|
)) })
|
|
5970
5977
|
] });
|
|
5971
5978
|
const o = t.action, u = o?.visibility !== "always";
|
|
@@ -6177,7 +6184,7 @@ const Hn = {
|
|
|
6177
6184
|
borderColor: o,
|
|
6178
6185
|
className: u,
|
|
6179
6186
|
children: i,
|
|
6180
|
-
...
|
|
6187
|
+
...p
|
|
6181
6188
|
}, m) => /* @__PURE__ */ e(
|
|
6182
6189
|
"div",
|
|
6183
6190
|
{
|
|
@@ -6192,7 +6199,7 @@ const Hn = {
|
|
|
6192
6199
|
o && Gn[o],
|
|
6193
6200
|
u
|
|
6194
6201
|
),
|
|
6195
|
-
...
|
|
6202
|
+
...p,
|
|
6196
6203
|
children: i
|
|
6197
6204
|
}
|
|
6198
6205
|
)
|
|
@@ -6241,7 +6248,7 @@ const ca = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(xt, { backgrou
|
|
|
6241
6248
|
children: u,
|
|
6242
6249
|
...i
|
|
6243
6250
|
}) => {
|
|
6244
|
-
const
|
|
6251
|
+
const p = `h${t}`, m = d(
|
|
6245
6252
|
"font-sans text-pretty",
|
|
6246
6253
|
Jn[r || Zn(t)],
|
|
6247
6254
|
Yn[n],
|
|
@@ -6250,7 +6257,7 @@ const ca = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(xt, { backgrou
|
|
|
6250
6257
|
l && "truncate",
|
|
6251
6258
|
o
|
|
6252
6259
|
);
|
|
6253
|
-
return /* @__PURE__ */ e(
|
|
6260
|
+
return /* @__PURE__ */ e(p, { className: m, ...i, children: u });
|
|
6254
6261
|
};
|
|
6255
6262
|
function Zn(t) {
|
|
6256
6263
|
return {
|
|
@@ -6297,7 +6304,7 @@ export {
|
|
|
6297
6304
|
Sn as FormSection,
|
|
6298
6305
|
ia as Heading,
|
|
6299
6306
|
gr as IDENTITY_TONE_COUNT,
|
|
6300
|
-
|
|
6307
|
+
Q as Icon,
|
|
6301
6308
|
ks as Image,
|
|
6302
6309
|
ra as ImageField,
|
|
6303
6310
|
Js as Kbd,
|
|
@@ -6318,14 +6325,14 @@ export {
|
|
|
6318
6325
|
sa as ParticipantTile,
|
|
6319
6326
|
nt as Popover,
|
|
6320
6327
|
Ys as ProgressBar,
|
|
6321
|
-
|
|
6328
|
+
ze as RichText,
|
|
6322
6329
|
ys as RowCard,
|
|
6323
6330
|
it as SearchField,
|
|
6324
6331
|
In as SearchableTextField,
|
|
6325
6332
|
_s as SectionCaption,
|
|
6326
6333
|
$s as SectionDivider,
|
|
6327
6334
|
lr as SegmentedToggle,
|
|
6328
|
-
|
|
6335
|
+
_e as Select,
|
|
6329
6336
|
Ls as SettingsFrameProvider,
|
|
6330
6337
|
Os as SettingsPage,
|
|
6331
6338
|
Ps as SettingsRow,
|
|
@@ -6364,8 +6371,8 @@ export {
|
|
|
6364
6371
|
hn as normalizeText,
|
|
6365
6372
|
Jt as resolveLucideIcon,
|
|
6366
6373
|
Bs as selectFilterHandler,
|
|
6367
|
-
|
|
6368
|
-
|
|
6374
|
+
De as text,
|
|
6375
|
+
Te as useAnchoredPosition,
|
|
6369
6376
|
Or as useSettingsFrame,
|
|
6370
6377
|
Is as useSettingsFrameHost
|
|
6371
6378
|
};
|