@opencxh/ui-kit 3.124.11 → 3.128.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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +683 -655
- package/dist/index.js.map +1 -1
- package/dist/src/forms/Form.d.ts +6 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/navigation/Sidebar.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx as Ke } from "clsx";
|
|
2
2
|
import { jsxs as c, jsx as e, Fragment as xe } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as _e, User as Ge, MicOff as Je, Mic as Ye, X as we, ChevronDown as
|
|
3
|
+
import { VideoOff as _e, User as Ge, MicOff as Je, Mic as Ye, X as we, ChevronDown as ge, ExternalLink as Xe, Calendar as Ze, ChevronLeft as ke, ChevronRight as Ce, ChevronDownIcon as Qe, Loader2 as et, Search as Se, Check as Te, ChevronUp as tt, ChevronsLeft as rt, ChevronsRight as nt, FileText as Ee, HardDrive as Ae, ArrowLeft as st, FolderPlus as at, Upload as lt, Folder as Le, Trash2 as ot, Plus as ct, Sparkles as it, ImageOff as dt, Pencil as ut, ArrowUpRight as mt } from "lucide-react";
|
|
4
4
|
import oe, { useRef as se, useEffect as Q, forwardRef as me, useState as R, useLayoutEffect as ft, useMemo as he, useCallback as ue, createContext as ht, Component as xt } from "react";
|
|
5
5
|
function d(...t) {
|
|
6
6
|
return Ke(t);
|
|
@@ -82,7 +82,7 @@ const bt = {
|
|
|
82
82
|
success: "bg-success text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
83
83
|
warning: "bg-warning text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
84
84
|
"danger-solid": "bg-danger text-text-inverse hover:opacity-90 disabled:bg-surface-hover"
|
|
85
|
-
},
|
|
85
|
+
}, pt = {
|
|
86
86
|
xs: "h-control-xs px-2 text-xs",
|
|
87
87
|
sm: "h-control-sm px-3 text-sm",
|
|
88
88
|
md: "h-control-md px-4 text-sm",
|
|
@@ -90,7 +90,7 @@ const bt = {
|
|
|
90
90
|
xl: "h-control-xl px-6 text-base",
|
|
91
91
|
"2xl": "h-control-2xl px-6 text-base",
|
|
92
92
|
full: "h-control-md px-4 text-sm"
|
|
93
|
-
},
|
|
93
|
+
}, gt = {
|
|
94
94
|
xs: "h-control-xs w-6",
|
|
95
95
|
sm: "h-control-sm w-7",
|
|
96
96
|
md: "h-control-md w-8",
|
|
@@ -108,16 +108,16 @@ const bt = {
|
|
|
108
108
|
rightIcon: o,
|
|
109
109
|
iconOnly: l = !1,
|
|
110
110
|
shape: u = "default",
|
|
111
|
-
className:
|
|
111
|
+
className: m,
|
|
112
112
|
children: y,
|
|
113
|
-
disabled:
|
|
114
|
-
...
|
|
115
|
-
},
|
|
116
|
-
const
|
|
113
|
+
disabled: h,
|
|
114
|
+
...f
|
|
115
|
+
}, x) => {
|
|
116
|
+
const p = h || s;
|
|
117
117
|
return /* @__PURE__ */ c(
|
|
118
118
|
"button",
|
|
119
119
|
{
|
|
120
|
-
ref:
|
|
120
|
+
ref: x,
|
|
121
121
|
type: "button",
|
|
122
122
|
className: d(
|
|
123
123
|
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
|
|
@@ -127,14 +127,14 @@ const bt = {
|
|
|
127
127
|
"disabled:cursor-not-allowed disabled:border-border-subtle",
|
|
128
128
|
"disabled:text-text-disabled",
|
|
129
129
|
bt[t],
|
|
130
|
-
l ?
|
|
130
|
+
l ? gt[r] : pt[r],
|
|
131
131
|
(n || r === "full") && "w-full",
|
|
132
132
|
s && "cursor-wait",
|
|
133
|
-
|
|
133
|
+
m
|
|
134
134
|
),
|
|
135
|
-
disabled:
|
|
135
|
+
disabled: p,
|
|
136
136
|
"aria-busy": s || void 0,
|
|
137
|
-
...
|
|
137
|
+
...f,
|
|
138
138
|
children: [
|
|
139
139
|
s && /* @__PURE__ */ e(
|
|
140
140
|
"span",
|
|
@@ -203,7 +203,7 @@ const Xr = ({
|
|
|
203
203
|
"aria-label": l,
|
|
204
204
|
...u
|
|
205
205
|
}) => {
|
|
206
|
-
const
|
|
206
|
+
const m = typeof r == "number" ? r : yt(r), y = d(
|
|
207
207
|
"inline-block shrink-0",
|
|
208
208
|
vt[n],
|
|
209
209
|
s && [
|
|
@@ -211,8 +211,8 @@ const Xr = ({
|
|
|
211
211
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
212
212
|
],
|
|
213
213
|
o
|
|
214
|
-
),
|
|
215
|
-
size:
|
|
214
|
+
), h = {
|
|
215
|
+
size: m,
|
|
216
216
|
strokeWidth: 2,
|
|
217
217
|
className: y,
|
|
218
218
|
onClick: s ? a : void 0,
|
|
@@ -220,12 +220,12 @@ const Xr = ({
|
|
|
220
220
|
"aria-hidden": l ? void 0 : !0,
|
|
221
221
|
role: s ? "button" : void 0,
|
|
222
222
|
tabIndex: s ? 0 : void 0,
|
|
223
|
-
onKeyDown: s ? (
|
|
224
|
-
(
|
|
223
|
+
onKeyDown: s ? (f) => {
|
|
224
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), a?.());
|
|
225
225
|
} : void 0,
|
|
226
226
|
...u
|
|
227
227
|
};
|
|
228
|
-
return /* @__PURE__ */ e(t, { ...
|
|
228
|
+
return /* @__PURE__ */ e(t, { ...h });
|
|
229
229
|
};
|
|
230
230
|
function yt(t) {
|
|
231
231
|
return {
|
|
@@ -252,43 +252,43 @@ function Zr({
|
|
|
252
252
|
active: o = !1,
|
|
253
253
|
caret: l = !1,
|
|
254
254
|
onClear: u,
|
|
255
|
-
clearLabel:
|
|
255
|
+
clearLabel: m = "Filter wissen",
|
|
256
256
|
onClick: y,
|
|
257
|
-
title:
|
|
258
|
-
className:
|
|
257
|
+
title: h,
|
|
258
|
+
className: f
|
|
259
259
|
}) {
|
|
260
|
-
const
|
|
260
|
+
const x = o && !!u, p = s === "pill" ? "rounded-full" : "rounded-md", w = d(
|
|
261
261
|
// A button's default cursor is an arrow, so it has to be asked for.
|
|
262
262
|
"inline-flex cursor-pointer select-none items-center text-sm font-semibold",
|
|
263
263
|
a === "sm" ? "h-control-sm" : "h-control-md",
|
|
264
264
|
"transition-colors duration-fast ease-out",
|
|
265
|
-
|
|
265
|
+
p,
|
|
266
266
|
// Picking a value outranks whatever the value happens to mean.
|
|
267
267
|
o ? "bg-accent text-accent-fg" : d("border", Nt[n]),
|
|
268
|
-
|
|
269
|
-
),
|
|
268
|
+
f
|
|
269
|
+
), g = /* @__PURE__ */ c(xe, { children: [
|
|
270
270
|
r,
|
|
271
271
|
t,
|
|
272
|
-
l && /* @__PURE__ */ e(Y, { icon:
|
|
272
|
+
l && /* @__PURE__ */ e(Y, { icon: ge, size: "xs" })
|
|
273
273
|
] }), b = d(
|
|
274
274
|
"inline-flex items-center gap-1.5 pl-3",
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
p,
|
|
276
|
+
x ? "pr-1.5" : "pr-3",
|
|
277
277
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
278
278
|
);
|
|
279
|
-
return
|
|
280
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: y, className: b, children:
|
|
279
|
+
return x ? /* @__PURE__ */ c("span", { className: w, title: h, children: [
|
|
280
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: y, className: b, children: g }),
|
|
281
281
|
/* @__PURE__ */ e(
|
|
282
282
|
"button",
|
|
283
283
|
{
|
|
284
284
|
type: "button",
|
|
285
|
-
"aria-label":
|
|
285
|
+
"aria-label": m,
|
|
286
286
|
onClick: u,
|
|
287
|
-
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring",
|
|
287
|
+
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
288
288
|
children: /* @__PURE__ */ e(Y, { icon: we, size: "xs" })
|
|
289
289
|
}
|
|
290
290
|
)
|
|
291
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title:
|
|
291
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: y, className: d(w, b), children: g });
|
|
292
292
|
}
|
|
293
293
|
const wt = {
|
|
294
294
|
xs: "text-xs",
|
|
@@ -323,11 +323,11 @@ const wt = {
|
|
|
323
323
|
className: o,
|
|
324
324
|
children: l,
|
|
325
325
|
href: u,
|
|
326
|
-
target:
|
|
326
|
+
target: m,
|
|
327
327
|
rel: y,
|
|
328
|
-
...
|
|
328
|
+
...h
|
|
329
329
|
}) => {
|
|
330
|
-
const
|
|
330
|
+
const f = a || u && (u.startsWith("http") || u.startsWith("mailto:")), x = d(
|
|
331
331
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
332
332
|
"transition-colors duration-fast ease-out",
|
|
333
333
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -341,16 +341,16 @@ const wt = {
|
|
|
341
341
|
],
|
|
342
342
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
343
343
|
o
|
|
344
|
-
),
|
|
345
|
-
...
|
|
344
|
+
), p = {
|
|
345
|
+
...h,
|
|
346
346
|
href: s ? void 0 : u,
|
|
347
|
-
target:
|
|
348
|
-
rel:
|
|
347
|
+
target: f ? "_blank" : m,
|
|
348
|
+
rel: f ? "noopener noreferrer" : y,
|
|
349
349
|
"aria-disabled": s || void 0
|
|
350
350
|
};
|
|
351
|
-
return /* @__PURE__ */ c("a", { className:
|
|
351
|
+
return /* @__PURE__ */ c("a", { className: x, ...p, children: [
|
|
352
352
|
l,
|
|
353
|
-
|
|
353
|
+
f && /* @__PURE__ */ e(Xe, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
354
354
|
] });
|
|
355
355
|
}, St = {
|
|
356
356
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -399,10 +399,10 @@ function ze(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
399
399
|
return ft(() => {
|
|
400
400
|
if (!t) return;
|
|
401
401
|
const u = () => {
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
const y =
|
|
405
|
-
w ? (
|
|
402
|
+
const m = r.current;
|
|
403
|
+
if (!m) return;
|
|
404
|
+
const y = m.getBoundingClientRect(), h = window.innerHeight - y.bottom, f = y.top, x = a.startsWith("top"), p = x ? f < 200 && h > f : h < 200 && f > h, w = x !== p, g = { position: "fixed" };
|
|
405
|
+
w ? (g.bottom = window.innerHeight - y.top + n, g.maxHeight = Math.max(120, f - n * 2)) : (g.top = y.bottom + n, g.maxHeight = Math.max(120, h - n * 2)), a.endsWith("end") ? g.right = window.innerWidth - y.right : g.left = y.left, s && (g.width = y.width), l(g);
|
|
406
406
|
};
|
|
407
407
|
return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
408
408
|
window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
@@ -419,31 +419,31 @@ const zt = ({
|
|
|
419
419
|
disabled: l = !1,
|
|
420
420
|
triggerLabel: u
|
|
421
421
|
}) => {
|
|
422
|
-
const [
|
|
422
|
+
const [m, y] = R(!1), h = se(null), f = se(null), x = ze(m, f, { placement: n });
|
|
423
423
|
Q(() => {
|
|
424
|
-
if (!
|
|
425
|
-
const
|
|
426
|
-
|
|
424
|
+
if (!m) return;
|
|
425
|
+
const g = (L) => {
|
|
426
|
+
h.current && !h.current.contains(L.target) && y(!1);
|
|
427
427
|
}, b = (L) => {
|
|
428
428
|
L.key === "Escape" && y(!1);
|
|
429
429
|
};
|
|
430
|
-
return document.addEventListener("mousedown",
|
|
431
|
-
document.removeEventListener("mousedown",
|
|
430
|
+
return document.addEventListener("mousedown", g), document.addEventListener("keydown", b), () => {
|
|
431
|
+
document.removeEventListener("mousedown", g), document.removeEventListener("keydown", b);
|
|
432
432
|
};
|
|
433
|
-
}, [
|
|
434
|
-
const
|
|
435
|
-
|
|
433
|
+
}, [m]);
|
|
434
|
+
const p = (g) => {
|
|
435
|
+
g.stopPropagation(), !l && y((b) => !b);
|
|
436
436
|
}, w = () => y(!1);
|
|
437
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
437
|
+
return /* @__PURE__ */ c("div", { ref: h, className: d("relative inline-flex", a), children: [
|
|
438
438
|
/* @__PURE__ */ e(
|
|
439
439
|
"button",
|
|
440
440
|
{
|
|
441
|
-
ref:
|
|
441
|
+
ref: f,
|
|
442
442
|
type: "button",
|
|
443
|
-
onClick:
|
|
443
|
+
onClick: p,
|
|
444
444
|
disabled: l,
|
|
445
445
|
"aria-label": u,
|
|
446
|
-
"aria-expanded":
|
|
446
|
+
"aria-expanded": m,
|
|
447
447
|
className: d(
|
|
448
448
|
"inline-flex items-center",
|
|
449
449
|
l && "cursor-not-allowed opacity-50",
|
|
@@ -452,7 +452,7 @@ const zt = ({
|
|
|
452
452
|
children: t
|
|
453
453
|
}
|
|
454
454
|
),
|
|
455
|
-
|
|
455
|
+
m && /* @__PURE__ */ e(
|
|
456
456
|
"div",
|
|
457
457
|
{
|
|
458
458
|
className: d(
|
|
@@ -461,7 +461,7 @@ const zt = ({
|
|
|
461
461
|
"fixed z-overlay overflow-y-auto rounded-lg border border-border bg-surface shadow-overlay",
|
|
462
462
|
s
|
|
463
463
|
),
|
|
464
|
-
style:
|
|
464
|
+
style: x,
|
|
465
465
|
children: typeof r == "function" ? r(w) : r
|
|
466
466
|
}
|
|
467
467
|
)
|
|
@@ -483,10 +483,10 @@ function Re({
|
|
|
483
483
|
options: o,
|
|
484
484
|
disabled: l = !1,
|
|
485
485
|
loading: u = !1,
|
|
486
|
-
menuPlacement:
|
|
486
|
+
menuPlacement: m = "bottom-end",
|
|
487
487
|
menuLabel: y = "More options"
|
|
488
488
|
}) {
|
|
489
|
-
const
|
|
489
|
+
const h = l || u, f = o.length > 0;
|
|
490
490
|
return /* @__PURE__ */ c("div", { className: d("inline-flex items-center", n === "primary" && "gap-0.5"), children: [
|
|
491
491
|
/* @__PURE__ */ e(
|
|
492
492
|
ne,
|
|
@@ -497,15 +497,15 @@ function Re({
|
|
|
497
497
|
disabled: l,
|
|
498
498
|
loading: u,
|
|
499
499
|
leftIcon: a,
|
|
500
|
-
className: d(
|
|
500
|
+
className: d(f && "rounded-r-none"),
|
|
501
501
|
children: t
|
|
502
502
|
}
|
|
503
503
|
),
|
|
504
|
-
|
|
504
|
+
f && /* @__PURE__ */ e(
|
|
505
505
|
zt,
|
|
506
506
|
{
|
|
507
|
-
placement:
|
|
508
|
-
disabled:
|
|
507
|
+
placement: m,
|
|
508
|
+
disabled: h,
|
|
509
509
|
triggerLabel: y,
|
|
510
510
|
className: "min-w-menu py-1",
|
|
511
511
|
trigger: /* @__PURE__ */ e(
|
|
@@ -517,30 +517,30 @@ function Re({
|
|
|
517
517
|
"transition-colors duration-fast ease-out",
|
|
518
518
|
Et[n],
|
|
519
519
|
Mt[s],
|
|
520
|
-
|
|
520
|
+
h && "cursor-not-allowed opacity-50"
|
|
521
521
|
),
|
|
522
|
-
children: /* @__PURE__ */ e(
|
|
522
|
+
children: /* @__PURE__ */ e(ge, { className: "size-icon-md" })
|
|
523
523
|
}
|
|
524
524
|
),
|
|
525
|
-
children: (
|
|
525
|
+
children: (x) => /* @__PURE__ */ e(xe, { children: o.map((p) => /* @__PURE__ */ c(
|
|
526
526
|
"button",
|
|
527
527
|
{
|
|
528
528
|
type: "button",
|
|
529
529
|
onClick: () => {
|
|
530
|
-
|
|
530
|
+
p.onClick(), x();
|
|
531
531
|
},
|
|
532
532
|
className: d(
|
|
533
533
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
534
534
|
"transition-colors duration-fast ease-out",
|
|
535
535
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
536
|
-
|
|
536
|
+
p.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
|
|
537
537
|
),
|
|
538
538
|
children: [
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
p.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: p.icon }),
|
|
540
|
+
p.label
|
|
541
541
|
]
|
|
542
542
|
},
|
|
543
|
-
|
|
543
|
+
p.id
|
|
544
544
|
)) })
|
|
545
545
|
}
|
|
546
546
|
)
|
|
@@ -561,7 +561,7 @@ const $t = {
|
|
|
561
561
|
md: "text-base",
|
|
562
562
|
lg: "text-md",
|
|
563
563
|
full: "text-base"
|
|
564
|
-
},
|
|
564
|
+
}, pe = me(
|
|
565
565
|
({
|
|
566
566
|
label: t,
|
|
567
567
|
helperText: r,
|
|
@@ -571,14 +571,14 @@ const $t = {
|
|
|
571
571
|
containerClassName: o,
|
|
572
572
|
labelClassName: l,
|
|
573
573
|
className: u,
|
|
574
|
-
id:
|
|
574
|
+
id: m,
|
|
575
575
|
...y
|
|
576
|
-
},
|
|
577
|
-
const
|
|
576
|
+
}, h) => {
|
|
577
|
+
const f = oe.useId(), x = m || `checkbox-${f}`, p = !!n, w = oe.useRef(null), g = oe.useCallback(
|
|
578
578
|
(b) => {
|
|
579
|
-
w.current = b, typeof
|
|
579
|
+
w.current = b, typeof h == "function" ? h(b) : h && typeof h == "object" && (h.current = b);
|
|
580
580
|
},
|
|
581
|
-
[
|
|
581
|
+
[h]
|
|
582
582
|
);
|
|
583
583
|
return oe.useEffect(() => {
|
|
584
584
|
w.current && (w.current.indeterminate = a);
|
|
@@ -587,10 +587,10 @@ const $t = {
|
|
|
587
587
|
/* @__PURE__ */ e(
|
|
588
588
|
"input",
|
|
589
589
|
{
|
|
590
|
-
ref:
|
|
591
|
-
id:
|
|
590
|
+
ref: g,
|
|
591
|
+
id: x,
|
|
592
592
|
type: "checkbox",
|
|
593
|
-
"aria-invalid":
|
|
593
|
+
"aria-invalid": p || void 0,
|
|
594
594
|
className: d(
|
|
595
595
|
// rounded-md, not rounded-sm: at 16px a 4px corner reads as a
|
|
596
596
|
// hard square, and the box is the one thing you aim at in a list.
|
|
@@ -599,7 +599,7 @@ const $t = {
|
|
|
599
599
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
600
600
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
601
601
|
$t[s],
|
|
602
|
-
|
|
602
|
+
p ? "border-danger-border" : "border-border-strong",
|
|
603
603
|
u
|
|
604
604
|
),
|
|
605
605
|
...y
|
|
@@ -609,10 +609,10 @@ const $t = {
|
|
|
609
609
|
/* @__PURE__ */ e(
|
|
610
610
|
"label",
|
|
611
611
|
{
|
|
612
|
-
htmlFor:
|
|
612
|
+
htmlFor: x,
|
|
613
613
|
className: d(
|
|
614
614
|
"cursor-pointer",
|
|
615
|
-
|
|
615
|
+
p ? "text-danger-fg" : "text-text",
|
|
616
616
|
Tt[s],
|
|
617
617
|
l
|
|
618
618
|
),
|
|
@@ -626,7 +626,7 @@ const $t = {
|
|
|
626
626
|
] });
|
|
627
627
|
}
|
|
628
628
|
);
|
|
629
|
-
|
|
629
|
+
pe.displayName = "Checkbox";
|
|
630
630
|
const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }), Lt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), It = () => /* @__PURE__ */ e(Y, { icon: Ce, size: "md", color: "current" }), $e = me(({
|
|
631
631
|
value: t,
|
|
632
632
|
onChange: r,
|
|
@@ -636,50 +636,50 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
636
636
|
size: o = "md",
|
|
637
637
|
className: l,
|
|
638
638
|
minDate: u,
|
|
639
|
-
maxDate:
|
|
639
|
+
maxDate: m,
|
|
640
640
|
format: y = "MM/dd/yyyy",
|
|
641
|
-
withTime:
|
|
642
|
-
},
|
|
643
|
-
const [
|
|
641
|
+
withTime: h = !1
|
|
642
|
+
}, f) => {
|
|
643
|
+
const [x, p] = R(!1), [w, g] = R(() => t || /* @__PURE__ */ new Date()), b = se(null), L = se(null), A = ze(x, L);
|
|
644
644
|
Q(() => {
|
|
645
645
|
const i = (S) => {
|
|
646
|
-
b.current && !b.current.contains(S.target) &&
|
|
646
|
+
b.current && !b.current.contains(S.target) && p(!1);
|
|
647
647
|
};
|
|
648
|
-
return
|
|
648
|
+
return x && document.addEventListener("mousedown", i), () => {
|
|
649
649
|
document.removeEventListener("mousedown", i);
|
|
650
650
|
};
|
|
651
|
-
}, [
|
|
651
|
+
}, [x]);
|
|
652
652
|
const _ = (i) => {
|
|
653
653
|
if (!i) return "";
|
|
654
|
-
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"),
|
|
655
|
-
return
|
|
654
|
+
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"), T = i.getFullYear(), k = y === "dd/MM/yyyy" ? `${S}/${N}/${T}` : y === "yyyy-MM-dd" ? `${T}-${N}-${S}` : `${N}/${S}/${T}`;
|
|
655
|
+
return h ? `${k} ${$(i)}` : k;
|
|
656
656
|
}, $ = (i) => `${i.getHours().toString().padStart(2, "0")}:${i.getMinutes().toString().padStart(2, "0")}`, X = (i) => {
|
|
657
657
|
const [S, N] = i.split(":").map(Number);
|
|
658
658
|
if (Number.isNaN(S) || Number.isNaN(N)) return;
|
|
659
|
-
const
|
|
660
|
-
|
|
659
|
+
const T = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
660
|
+
T.setHours(S, N, 0, 0), r?.(T);
|
|
661
661
|
}, W = () => {
|
|
662
|
-
const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1),
|
|
663
|
-
|
|
664
|
-
const k = [], ee = new Date(
|
|
662
|
+
const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1), T = new Date(N);
|
|
663
|
+
T.setDate(T.getDate() - N.getDay());
|
|
664
|
+
const k = [], ee = new Date(T);
|
|
665
665
|
for (let ae = 0; ae < 42; ae++)
|
|
666
666
|
k.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
|
|
667
667
|
return k;
|
|
668
668
|
}, j = (i) => {
|
|
669
|
-
if (i.getMonth() === w.getMonth() && !(u && i < u) && !(
|
|
670
|
-
if (
|
|
669
|
+
if (i.getMonth() === w.getMonth() && !(u && i < u) && !(m && i > m)) {
|
|
670
|
+
if (h) {
|
|
671
671
|
const N = new Date(i);
|
|
672
672
|
N.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(N);
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
|
-
r?.(i),
|
|
675
|
+
r?.(i), p(!1);
|
|
676
676
|
}
|
|
677
677
|
}, q = () => {
|
|
678
|
-
|
|
678
|
+
g(new Date(w.getFullYear(), w.getMonth() - 1, 1));
|
|
679
679
|
}, K = () => {
|
|
680
|
-
|
|
680
|
+
g(new Date(w.getFullYear(), w.getMonth() + 1, 1));
|
|
681
681
|
}, re = () => {
|
|
682
|
-
r?.(null),
|
|
682
|
+
r?.(null), p(!1);
|
|
683
683
|
}, O = d(
|
|
684
684
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
685
685
|
"bg-surface text-text",
|
|
@@ -712,14 +712,14 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
712
712
|
/* @__PURE__ */ e(
|
|
713
713
|
"input",
|
|
714
714
|
{
|
|
715
|
-
ref:
|
|
715
|
+
ref: f,
|
|
716
716
|
type: "text",
|
|
717
717
|
value: _(t ?? null),
|
|
718
718
|
placeholder: n,
|
|
719
719
|
disabled: s,
|
|
720
720
|
required: a,
|
|
721
721
|
readOnly: !0,
|
|
722
|
-
onClick: () => !s &&
|
|
722
|
+
onClick: () => !s && p(!x),
|
|
723
723
|
className: d(O, "pr-10 cursor-pointer")
|
|
724
724
|
}
|
|
725
725
|
),
|
|
@@ -727,14 +727,14 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
727
727
|
"button",
|
|
728
728
|
{
|
|
729
729
|
type: "button",
|
|
730
|
-
onClick: () => !s &&
|
|
730
|
+
onClick: () => !s && p(!x),
|
|
731
731
|
disabled: s,
|
|
732
732
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
733
733
|
children: /* @__PURE__ */ e(At, {})
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] }),
|
|
737
|
-
|
|
737
|
+
x && /* @__PURE__ */ c("div", { style: A, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
738
738
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
739
739
|
/* @__PURE__ */ e(
|
|
740
740
|
"button",
|
|
@@ -760,7 +760,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
760
760
|
] }),
|
|
761
761
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((i) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: i }, i)) }),
|
|
762
762
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ce.map((i, S) => {
|
|
763
|
-
const N = i.getMonth() === w.getMonth(),
|
|
763
|
+
const N = i.getMonth() === w.getMonth(), T = t && i.toDateString() === t.toDateString(), k = i.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), ee = !N || u && i < u || m && i > m;
|
|
764
764
|
return /* @__PURE__ */ e(
|
|
765
765
|
"button",
|
|
766
766
|
{
|
|
@@ -769,9 +769,9 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
769
769
|
className: d(
|
|
770
770
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
771
771
|
{
|
|
772
|
-
"text-text hover:bg-surface-hover": N && !
|
|
773
|
-
"bg-accent text-accent-fg":
|
|
774
|
-
"bg-surface-hover text-text": k && !
|
|
772
|
+
"text-text hover:bg-surface-hover": N && !T && !ee,
|
|
773
|
+
"bg-accent text-accent-fg": T,
|
|
774
|
+
"bg-surface-hover text-text": k && !T,
|
|
775
775
|
"text-text-muted cursor-not-allowed": ee
|
|
776
776
|
}
|
|
777
777
|
),
|
|
@@ -780,7 +780,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
780
780
|
S
|
|
781
781
|
);
|
|
782
782
|
}) }),
|
|
783
|
-
|
|
783
|
+
h && /* @__PURE__ */ c("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
784
784
|
/* @__PURE__ */ e("label", { htmlFor: "datepicker-time", className: "text-sm text-text-muted", children: "Tijd" }),
|
|
785
785
|
/* @__PURE__ */ e(
|
|
786
786
|
"input",
|
|
@@ -805,7 +805,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
805
805
|
/* @__PURE__ */ e(
|
|
806
806
|
"button",
|
|
807
807
|
{
|
|
808
|
-
onClick: () =>
|
|
808
|
+
onClick: () => p(!1),
|
|
809
809
|
className: "text-sm text-info-fg hover:underline",
|
|
810
810
|
children: "Close"
|
|
811
811
|
}
|
|
@@ -828,19 +828,19 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
828
828
|
disabled: o = !1,
|
|
829
829
|
options: l,
|
|
830
830
|
placeholder: u,
|
|
831
|
-
containerClassName:
|
|
831
|
+
containerClassName: m,
|
|
832
832
|
labelClassName: y,
|
|
833
|
-
className:
|
|
834
|
-
id:
|
|
835
|
-
searchable:
|
|
836
|
-
multiple:
|
|
833
|
+
className: h,
|
|
834
|
+
id: f,
|
|
835
|
+
searchable: x,
|
|
836
|
+
multiple: p,
|
|
837
837
|
value: w,
|
|
838
|
-
onChange:
|
|
838
|
+
onChange: g,
|
|
839
839
|
allowCreate: b,
|
|
840
840
|
onCreateOption: L,
|
|
841
|
-
...
|
|
841
|
+
...A
|
|
842
842
|
}, _) => {
|
|
843
|
-
const $ =
|
|
843
|
+
const $ = f || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [W, j] = oe.useState(!1), [q, K] = oe.useState(""), re = oe.useRef(null), O = oe.useRef(null), ce = ze(W, O, { matchWidth: !0 }), [C, i] = oe.useState(l);
|
|
844
844
|
oe.useImperativeHandle(_, () => re.current), oe.useEffect(() => {
|
|
845
845
|
const E = (D) => {
|
|
846
846
|
re.current && !re.current.contains(D.target) && j(!1);
|
|
@@ -870,17 +870,17 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
870
870
|
}), N(D, w);
|
|
871
871
|
});
|
|
872
872
|
}, [l, w, N, S]);
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
873
|
+
const T = (E) => {
|
|
874
|
+
if (p) {
|
|
875
875
|
const D = Array.isArray(w) ? w : [], z = D.includes(E) ? D.filter((V) => V !== E) : [...D, E];
|
|
876
|
-
|
|
876
|
+
g?.(z);
|
|
877
877
|
} else
|
|
878
|
-
|
|
879
|
-
}, k =
|
|
878
|
+
g?.(E), j(!1), K("");
|
|
879
|
+
}, k = p ? null : C.find((E) => E.value === w), ee = p ? C.filter(
|
|
880
880
|
(E) => Array.isArray(w) && w.includes(E.value)
|
|
881
|
-
) : [], ae =
|
|
881
|
+
) : [], ae = x && q ? C.filter(
|
|
882
882
|
(E) => E.label.toLowerCase().includes(q.toLowerCase())
|
|
883
|
-
) : C, le = !!b && !!
|
|
883
|
+
) : C, le = !!b && !!x && !!q.trim() && !S(C, q), G = (E) => {
|
|
884
884
|
const D = E.trim();
|
|
885
885
|
if (!D) return;
|
|
886
886
|
const z = L?.(D) ?? {
|
|
@@ -888,11 +888,11 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
888
888
|
label: D
|
|
889
889
|
};
|
|
890
890
|
if (S(C, z.value) || S(C, z.label)) {
|
|
891
|
-
|
|
891
|
+
T(z.value), K(""), p || j(!1);
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
|
-
i((V) => [...V, z]),
|
|
895
|
-
}, P = () =>
|
|
894
|
+
i((V) => [...V, z]), T(z.value), K(""), p || j(!1);
|
|
895
|
+
}, P = () => p ? ee.length > 0 ? ee.map((E) => E.label).join(", ") : u || "Select options" : k?.label || u || "Select an option";
|
|
896
896
|
return /* @__PURE__ */ c(
|
|
897
897
|
"div",
|
|
898
898
|
{
|
|
@@ -900,9 +900,9 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
900
900
|
className: d(
|
|
901
901
|
"relative flex flex-col",
|
|
902
902
|
a && "w-full",
|
|
903
|
-
|
|
903
|
+
m
|
|
904
904
|
),
|
|
905
|
-
...
|
|
905
|
+
...A,
|
|
906
906
|
children: [
|
|
907
907
|
t && /* @__PURE__ */ e(
|
|
908
908
|
"label",
|
|
@@ -933,7 +933,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
933
933
|
"bg-surface",
|
|
934
934
|
jt[s],
|
|
935
935
|
X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
936
|
-
|
|
936
|
+
h
|
|
937
937
|
),
|
|
938
938
|
children: [
|
|
939
939
|
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: P() }),
|
|
@@ -951,7 +951,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
951
951
|
}
|
|
952
952
|
),
|
|
953
953
|
W && /* @__PURE__ */ c("div", { style: ce, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
954
|
-
|
|
954
|
+
x && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
955
955
|
"input",
|
|
956
956
|
{
|
|
957
957
|
type: "text",
|
|
@@ -983,22 +983,22 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
983
983
|
}
|
|
984
984
|
),
|
|
985
985
|
/* @__PURE__ */ c("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
986
|
-
u && !
|
|
986
|
+
u && !p && /* @__PURE__ */ e(
|
|
987
987
|
"li",
|
|
988
988
|
{
|
|
989
989
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
990
990
|
onClick: () => {
|
|
991
|
-
|
|
991
|
+
g?.(""), j(!1);
|
|
992
992
|
},
|
|
993
993
|
children: u
|
|
994
994
|
}
|
|
995
995
|
),
|
|
996
996
|
ae.map((E) => {
|
|
997
|
-
const D =
|
|
997
|
+
const D = p ? Array.isArray(w) && w.includes(E.value) : w === E.value;
|
|
998
998
|
return /* @__PURE__ */ e(
|
|
999
999
|
"li",
|
|
1000
1000
|
{
|
|
1001
|
-
onClick: () => !E.disabled &&
|
|
1001
|
+
onClick: () => !E.disabled && T(E.value),
|
|
1002
1002
|
className: d(
|
|
1003
1003
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1004
1004
|
"text-text",
|
|
@@ -1006,7 +1006,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
1006
1006
|
D && "bg-accent-soft text-accent font-semibold"
|
|
1007
1007
|
),
|
|
1008
1008
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1009
|
-
|
|
1009
|
+
p && /* @__PURE__ */ e(
|
|
1010
1010
|
"input",
|
|
1011
1011
|
{
|
|
1012
1012
|
type: "checkbox",
|
|
@@ -1055,18 +1055,18 @@ const Pt = {
|
|
|
1055
1055
|
startIcon: o,
|
|
1056
1056
|
endIcon: l,
|
|
1057
1057
|
loading: u = !1,
|
|
1058
|
-
containerClassName:
|
|
1058
|
+
containerClassName: m,
|
|
1059
1059
|
labelClassName: y,
|
|
1060
|
-
className:
|
|
1061
|
-
id:
|
|
1062
|
-
...
|
|
1063
|
-
},
|
|
1064
|
-
const w = oe.useId(),
|
|
1065
|
-
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full",
|
|
1060
|
+
className: h,
|
|
1061
|
+
id: f,
|
|
1062
|
+
...x
|
|
1063
|
+
}, p) => {
|
|
1064
|
+
const w = oe.useId(), g = f || `textfield-${w}`, b = !!n, L = n || r ? `${g}-description` : void 0;
|
|
1065
|
+
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", m), children: [
|
|
1066
1066
|
t && /* @__PURE__ */ e(
|
|
1067
1067
|
"label",
|
|
1068
1068
|
{
|
|
1069
|
-
htmlFor:
|
|
1069
|
+
htmlFor: g,
|
|
1070
1070
|
className: d(
|
|
1071
1071
|
Ve,
|
|
1072
1072
|
b ? "text-danger-fg" : "text-text-subtle",
|
|
@@ -1080,8 +1080,8 @@ const Pt = {
|
|
|
1080
1080
|
/* @__PURE__ */ e(
|
|
1081
1081
|
"input",
|
|
1082
1082
|
{
|
|
1083
|
-
ref:
|
|
1084
|
-
id:
|
|
1083
|
+
ref: p,
|
|
1084
|
+
id: g,
|
|
1085
1085
|
"aria-invalid": b || void 0,
|
|
1086
1086
|
"aria-describedby": L,
|
|
1087
1087
|
className: d(
|
|
@@ -1094,9 +1094,9 @@ const Pt = {
|
|
|
1094
1094
|
o && "pl-9",
|
|
1095
1095
|
(l || u) && "pr-9",
|
|
1096
1096
|
b ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
1097
|
-
|
|
1097
|
+
h
|
|
1098
1098
|
),
|
|
1099
|
-
...
|
|
1099
|
+
...x
|
|
1100
1100
|
}
|
|
1101
1101
|
),
|
|
1102
1102
|
(l || u) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: u ? /* @__PURE__ */ e(
|
|
@@ -1129,27 +1129,27 @@ function Ot({
|
|
|
1129
1129
|
templatePlaceholder: l,
|
|
1130
1130
|
showTemplate: u = !0
|
|
1131
1131
|
}) {
|
|
1132
|
-
const [
|
|
1132
|
+
const [m, y] = R([]);
|
|
1133
1133
|
Q(() => {
|
|
1134
|
-
let
|
|
1135
|
-
return Promise.resolve(n?.()).then((
|
|
1136
|
-
|
|
1134
|
+
let f = !0;
|
|
1135
|
+
return Promise.resolve(n?.()).then((x) => {
|
|
1136
|
+
f && x && y(x.data ?? []);
|
|
1137
1137
|
}).catch(() => {
|
|
1138
1138
|
}), () => {
|
|
1139
|
-
|
|
1139
|
+
f = !1;
|
|
1140
1140
|
};
|
|
1141
1141
|
}, []);
|
|
1142
|
-
const
|
|
1142
|
+
const h = t ?? {};
|
|
1143
1143
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
1144
1144
|
/* @__PURE__ */ e(
|
|
1145
1145
|
Ne,
|
|
1146
1146
|
{
|
|
1147
1147
|
size: a,
|
|
1148
1148
|
fullWidth: !0,
|
|
1149
|
-
value:
|
|
1150
|
-
options:
|
|
1149
|
+
value: h.folderId ?? "",
|
|
1150
|
+
options: m.map((f) => ({ value: f.id, label: f.name })),
|
|
1151
1151
|
placeholder: o ?? "Select a folder",
|
|
1152
|
-
onChange: (
|
|
1152
|
+
onChange: (f) => r?.({ ...h, folderId: f })
|
|
1153
1153
|
}
|
|
1154
1154
|
),
|
|
1155
1155
|
u && /* @__PURE__ */ e(
|
|
@@ -1157,14 +1157,14 @@ function Ot({
|
|
|
1157
1157
|
{
|
|
1158
1158
|
size: a,
|
|
1159
1159
|
disabled: s ?? !1,
|
|
1160
|
-
value:
|
|
1160
|
+
value: h.pathTemplate ?? "",
|
|
1161
1161
|
placeholder: l ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
1162
|
-
onChange: (
|
|
1162
|
+
onChange: (f) => r?.({ ...h, pathTemplate: f.target.value })
|
|
1163
1163
|
}
|
|
1164
1164
|
)
|
|
1165
1165
|
] });
|
|
1166
1166
|
}
|
|
1167
|
-
const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Bt = (t) => /* @__PURE__ */ e(
|
|
1167
|
+
const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Bt = (t) => /* @__PURE__ */ e(ge, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Rt = {
|
|
1168
1168
|
sm: "h-control-sm px-3 text-sm",
|
|
1169
1169
|
md: "h-control-md px-3 text-base",
|
|
1170
1170
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1184,38 +1184,38 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1184
1184
|
startIcon: o = /* @__PURE__ */ e(Ft, {}),
|
|
1185
1185
|
loading: l = !1,
|
|
1186
1186
|
containerClassName: u,
|
|
1187
|
-
labelClassName:
|
|
1187
|
+
labelClassName: m,
|
|
1188
1188
|
className: y,
|
|
1189
|
-
id:
|
|
1190
|
-
options:
|
|
1191
|
-
onRemoteSearch:
|
|
1192
|
-
onSelect:
|
|
1189
|
+
id: h,
|
|
1190
|
+
options: f,
|
|
1191
|
+
onRemoteSearch: x,
|
|
1192
|
+
onSelect: p,
|
|
1193
1193
|
debounceTime: w = 500,
|
|
1194
|
-
showAllOnOpen:
|
|
1194
|
+
showAllOnOpen: g = !1,
|
|
1195
1195
|
value: b,
|
|
1196
1196
|
onChange: L,
|
|
1197
|
-
...
|
|
1197
|
+
...A
|
|
1198
1198
|
}, _) => {
|
|
1199
|
-
const $ =
|
|
1199
|
+
const $ = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n, W = se(null), j = se(null), [q, K] = R(b || ""), [re, O] = R(!1), [ce, C] = R(!1), [i, S] = R(!1);
|
|
1200
1200
|
Q(() => {
|
|
1201
1201
|
b !== void 0 && K(b);
|
|
1202
1202
|
}, [b]);
|
|
1203
1203
|
const N = he(() => {
|
|
1204
|
-
if (
|
|
1204
|
+
if (g && !i || !q) return f;
|
|
1205
1205
|
const P = String(q).toLowerCase();
|
|
1206
|
-
return
|
|
1206
|
+
return f.filter(
|
|
1207
1207
|
(E) => String(E.label).toLowerCase().includes(P)
|
|
1208
1208
|
);
|
|
1209
|
-
}, [q,
|
|
1209
|
+
}, [q, f, g, i]);
|
|
1210
1210
|
Q(() => {
|
|
1211
|
-
if (!
|
|
1211
|
+
if (!x || !q) {
|
|
1212
1212
|
C(!1);
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
1215
|
const P = setTimeout(async () => {
|
|
1216
1216
|
C(!0);
|
|
1217
1217
|
try {
|
|
1218
|
-
await
|
|
1218
|
+
await x(String(q));
|
|
1219
1219
|
} catch (E) {
|
|
1220
1220
|
console.error("Remote search failed:", E);
|
|
1221
1221
|
} finally {
|
|
@@ -1225,19 +1225,19 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1225
1225
|
return () => {
|
|
1226
1226
|
clearTimeout(P), C(!1);
|
|
1227
1227
|
};
|
|
1228
|
-
}, [q, w,
|
|
1228
|
+
}, [q, w, x]), Q(() => {
|
|
1229
1229
|
const P = (E) => {
|
|
1230
1230
|
W.current && !W.current.contains(E.target) && O(!1);
|
|
1231
1231
|
};
|
|
1232
1232
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
1233
1233
|
}, []);
|
|
1234
|
-
const
|
|
1234
|
+
const T = (P) => {
|
|
1235
1235
|
const E = P.target.value;
|
|
1236
1236
|
K(E), O(!0), S(!0), L && L(P);
|
|
1237
1237
|
}, k = (P) => {
|
|
1238
|
-
K(P.label), O(!1), S(!1),
|
|
1238
|
+
K(P.label), O(!1), S(!1), p && p(P.value);
|
|
1239
1239
|
}, ee = () => {
|
|
1240
|
-
(
|
|
1240
|
+
(f.length > 0 || x) && (O(!0), S(!1));
|
|
1241
1241
|
}, ae = l || ce, le = re && (N.length > 0 || ae), G = he(() => _ || j, [_]);
|
|
1242
1242
|
return /* @__PURE__ */ c(
|
|
1243
1243
|
"div",
|
|
@@ -1257,7 +1257,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1257
1257
|
className: fe(
|
|
1258
1258
|
"block text-sm font-medium mb-1",
|
|
1259
1259
|
X ? "text-danger-fg" : "text-text",
|
|
1260
|
-
|
|
1260
|
+
m || ""
|
|
1261
1261
|
),
|
|
1262
1262
|
children: t
|
|
1263
1263
|
}
|
|
@@ -1270,7 +1270,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1270
1270
|
ref: G,
|
|
1271
1271
|
id: $,
|
|
1272
1272
|
value: q,
|
|
1273
|
-
onChange:
|
|
1273
|
+
onChange: T,
|
|
1274
1274
|
onFocus: ee,
|
|
1275
1275
|
className: fe(
|
|
1276
1276
|
// Base styles
|
|
@@ -1287,7 +1287,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1287
1287
|
X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1288
1288
|
y || ""
|
|
1289
1289
|
),
|
|
1290
|
-
...
|
|
1290
|
+
...A
|
|
1291
1291
|
}
|
|
1292
1292
|
),
|
|
1293
1293
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ae || l ? (
|
|
@@ -1344,7 +1344,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1344
1344
|
children: n || r
|
|
1345
1345
|
}
|
|
1346
1346
|
),
|
|
1347
|
-
|
|
1347
|
+
x && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1348
1348
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1349
1349
|
String(q)
|
|
1350
1350
|
] })
|
|
@@ -1395,7 +1395,7 @@ const Ht = me(
|
|
|
1395
1395
|
role: "switch",
|
|
1396
1396
|
checked: t,
|
|
1397
1397
|
disabled: s,
|
|
1398
|
-
onChange: (
|
|
1398
|
+
onChange: (m) => r(m.target.checked),
|
|
1399
1399
|
className: "peer sr-only",
|
|
1400
1400
|
...o
|
|
1401
1401
|
}
|
|
@@ -1444,7 +1444,7 @@ function Ut({
|
|
|
1444
1444
|
{
|
|
1445
1445
|
className: "grid gap-2 border-t border-border-subtle p-3",
|
|
1446
1446
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1447
|
-
children: Array.from({ length: s }).map((
|
|
1447
|
+
children: Array.from({ length: s }).map((m, y) => /* @__PURE__ */ e(
|
|
1448
1448
|
"div",
|
|
1449
1449
|
{
|
|
1450
1450
|
className: "h-4 w-full rounded-sm bg-surface-hover"
|
|
@@ -1466,10 +1466,10 @@ const qt = ({
|
|
|
1466
1466
|
disabled: o = !1,
|
|
1467
1467
|
className: l,
|
|
1468
1468
|
showCheck: u = !0,
|
|
1469
|
-
header:
|
|
1469
|
+
header: m
|
|
1470
1470
|
}) => {
|
|
1471
|
-
const [y,
|
|
1472
|
-
|
|
1471
|
+
const [y, h] = R(!1), [f, x] = R(null), [p, w] = R({ top: 0, left: 0 }), g = se(null), b = se(null), L = se(null), A = se(null), _ = ze(y, b, { placement: a }), $ = se(null), X = () => Array.from(
|
|
1472
|
+
A.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1473
1473
|
);
|
|
1474
1474
|
Q(() => {
|
|
1475
1475
|
y && X()[0]?.focus();
|
|
@@ -1479,27 +1479,27 @@ const qt = ({
|
|
|
1479
1479
|
const N = X();
|
|
1480
1480
|
if (N.length === 0) return;
|
|
1481
1481
|
i.preventDefault();
|
|
1482
|
-
const
|
|
1482
|
+
const T = N.indexOf(document.activeElement), k = i.key === "Home" ? 0 : i.key === "End" ? N.length - 1 : i.key === "ArrowDown" ? (T + 1) % N.length : (T - 1 + N.length) % N.length;
|
|
1483
1483
|
N[k]?.focus();
|
|
1484
1484
|
};
|
|
1485
1485
|
Q(() => {
|
|
1486
1486
|
const i = (S) => {
|
|
1487
|
-
|
|
1487
|
+
g.current && (!g.current.contains(S.target) || L.current && !L.current.contains(S.target)) && (h(!1), x(null), $.current && (clearTimeout($.current), $.current = null));
|
|
1488
1488
|
};
|
|
1489
1489
|
return y && document.addEventListener("mousedown", i), () => {
|
|
1490
1490
|
document.removeEventListener("mousedown", i);
|
|
1491
1491
|
};
|
|
1492
1492
|
}, [y]), Q(() => {
|
|
1493
1493
|
const i = (S) => {
|
|
1494
|
-
S.key === "Escape" && (
|
|
1494
|
+
S.key === "Escape" && (h(!1), x(null), b.current?.focus(), $.current && (clearTimeout($.current), $.current = null));
|
|
1495
1495
|
};
|
|
1496
1496
|
return y && document.addEventListener("keydown", i), () => {
|
|
1497
1497
|
document.removeEventListener("keydown", i);
|
|
1498
1498
|
};
|
|
1499
1499
|
}, [y]), Q(() => {
|
|
1500
|
-
if (
|
|
1501
|
-
const i =
|
|
1502
|
-
`[data-option-value="${
|
|
1500
|
+
if (f && g.current) {
|
|
1501
|
+
const i = g.current.querySelector(
|
|
1502
|
+
`[data-option-value="${f}"]`
|
|
1503
1503
|
);
|
|
1504
1504
|
if (i) {
|
|
1505
1505
|
const S = i.getBoundingClientRect();
|
|
@@ -1509,21 +1509,21 @@ const qt = ({
|
|
|
1509
1509
|
});
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
}, [
|
|
1512
|
+
}, [f]), Q(() => () => {
|
|
1513
1513
|
$.current && clearTimeout($.current);
|
|
1514
1514
|
}, []);
|
|
1515
1515
|
const j = (i) => {
|
|
1516
|
-
i.stopPropagation(), !o && (
|
|
1516
|
+
i.stopPropagation(), !o && (h(!y), x(null), $.current && (clearTimeout($.current), $.current = null));
|
|
1517
1517
|
}, q = (i, S, N) => {
|
|
1518
|
-
i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, N),
|
|
1518
|
+
i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, N), h(!1), x(null));
|
|
1519
1519
|
}, K = (i) => {
|
|
1520
|
-
$.current && (clearTimeout($.current), $.current = null), i.children && i.children.length > 0 ?
|
|
1520
|
+
$.current && (clearTimeout($.current), $.current = null), i.children && i.children.length > 0 ? x(i.value) : x(null);
|
|
1521
1521
|
}, re = (i) => {
|
|
1522
1522
|
i.children && i.children.length > 0 ? $.current = setTimeout(() => {
|
|
1523
|
-
|
|
1524
|
-
}, 150) :
|
|
1523
|
+
x(null);
|
|
1524
|
+
}, 150) : x(null);
|
|
1525
1525
|
}, O = (i, S, N) => {
|
|
1526
|
-
i.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, N),
|
|
1526
|
+
i.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, N), h(!1), x(null));
|
|
1527
1527
|
}, ce = d(
|
|
1528
1528
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1529
1529
|
"max-h-60 overflow-auto"
|
|
@@ -1534,7 +1534,7 @@ const qt = ({
|
|
|
1534
1534
|
return /* @__PURE__ */ c(
|
|
1535
1535
|
"div",
|
|
1536
1536
|
{
|
|
1537
|
-
ref:
|
|
1537
|
+
ref: g,
|
|
1538
1538
|
className: d(
|
|
1539
1539
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1540
1540
|
l
|
|
@@ -1554,8 +1554,8 @@ const qt = ({
|
|
|
1554
1554
|
children: t
|
|
1555
1555
|
}
|
|
1556
1556
|
),
|
|
1557
|
-
y && /* @__PURE__ */ e("div", { ref:
|
|
1558
|
-
|
|
1557
|
+
y && /* @__PURE__ */ e("div", { ref: A, className: ce, style: _, onKeyDown: W, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1558
|
+
m && (typeof m == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: m }) : m),
|
|
1559
1559
|
r.map((i, S) => {
|
|
1560
1560
|
if (i.divider)
|
|
1561
1561
|
return /* @__PURE__ */ e(
|
|
@@ -1565,7 +1565,7 @@ const qt = ({
|
|
|
1565
1565
|
},
|
|
1566
1566
|
`divider-${S}`
|
|
1567
1567
|
);
|
|
1568
|
-
const N = i.children && i.children.length > 0,
|
|
1568
|
+
const N = i.children && i.children.length > 0, T = f === i.value;
|
|
1569
1569
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1570
1570
|
/* @__PURE__ */ c(
|
|
1571
1571
|
"button",
|
|
@@ -1581,7 +1581,7 @@ const qt = ({
|
|
|
1581
1581
|
"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",
|
|
1582
1582
|
{
|
|
1583
1583
|
"opacity-50 cursor-not-allowed": i.disabled,
|
|
1584
|
-
"bg-surface-hover":
|
|
1584
|
+
"bg-surface-hover": T && N
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
1587
|
children: [
|
|
@@ -1599,21 +1599,21 @@ const qt = ({
|
|
|
1599
1599
|
]
|
|
1600
1600
|
}
|
|
1601
1601
|
),
|
|
1602
|
-
N &&
|
|
1602
|
+
N && T && /* @__PURE__ */ e(
|
|
1603
1603
|
"div",
|
|
1604
1604
|
{
|
|
1605
1605
|
ref: L,
|
|
1606
1606
|
className: C,
|
|
1607
1607
|
style: {
|
|
1608
|
-
top: `${
|
|
1609
|
-
left: `${
|
|
1608
|
+
top: `${p.top}px`,
|
|
1609
|
+
left: `${p.left}px`
|
|
1610
1610
|
},
|
|
1611
1611
|
onMouseEnter: () => {
|
|
1612
|
-
$.current && (clearTimeout($.current), $.current = null),
|
|
1612
|
+
$.current && (clearTimeout($.current), $.current = null), x(i.value);
|
|
1613
1613
|
},
|
|
1614
1614
|
onMouseLeave: () => {
|
|
1615
1615
|
$.current = setTimeout(() => {
|
|
1616
|
-
|
|
1616
|
+
x(null);
|
|
1617
1617
|
}, 150);
|
|
1618
1618
|
},
|
|
1619
1619
|
children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((k, ee) => {
|
|
@@ -1664,8 +1664,8 @@ const qt = ({
|
|
|
1664
1664
|
(() => {
|
|
1665
1665
|
const i = r.reduce((S, N) => {
|
|
1666
1666
|
if (N.divider) return S;
|
|
1667
|
-
const
|
|
1668
|
-
return S + 1 +
|
|
1667
|
+
const T = N.children ? N.children.filter((k) => !k.divider).length : 0;
|
|
1668
|
+
return S + 1 + T;
|
|
1669
1669
|
}, 0);
|
|
1670
1670
|
return i > 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: [
|
|
1671
1671
|
i,
|
|
@@ -1686,7 +1686,7 @@ const qt = ({
|
|
|
1686
1686
|
sm: "pr-2",
|
|
1687
1687
|
md: "pr-4",
|
|
1688
1688
|
lg: "pr-6"
|
|
1689
|
-
}, Wt = () => /* @__PURE__ */ e(Y, { icon: Se, size: "md", color: "current" }), Kt = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: tt, size: "sm", className: t ? "text-text" : "text-text-subtle" }), _t = ({ active: t }) => /* @__PURE__ */ e(Y, { icon:
|
|
1689
|
+
}, Wt = () => /* @__PURE__ */ e(Y, { icon: Se, size: "md", color: "current" }), Kt = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: tt, size: "sm", className: t ? "text-text" : "text-text-subtle" }), _t = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: ge, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Gt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), Jt = () => /* @__PURE__ */ e(Y, { icon: Ce, size: "md", color: "current" }), Yt = () => /* @__PURE__ */ e(Y, { icon: rt, size: "md", color: "current" }), Xt = () => /* @__PURE__ */ e(Y, { icon: nt, size: "md", color: "current" }), He = () => /* @__PURE__ */ e(Y, { icon: ge, size: "md", color: "current" }), Zt = (t) => {
|
|
1690
1690
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1691
1691
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1692
1692
|
};
|
|
@@ -1742,17 +1742,17 @@ const qt = ({
|
|
|
1742
1742
|
filters: o = [],
|
|
1743
1743
|
paginated: l = !1,
|
|
1744
1744
|
pageSizeOptions: u = [10, 25, 50, 100],
|
|
1745
|
-
defaultPageSize:
|
|
1745
|
+
defaultPageSize: m = 10,
|
|
1746
1746
|
actions: y = [],
|
|
1747
|
-
onRowClick:
|
|
1748
|
-
selectable:
|
|
1749
|
-
selectedRows:
|
|
1750
|
-
onSelectionChange:
|
|
1747
|
+
onRowClick: h,
|
|
1748
|
+
selectable: f = !1,
|
|
1749
|
+
selectedRows: x = [],
|
|
1750
|
+
onSelectionChange: p,
|
|
1751
1751
|
getRowKey: w = (j, q) => q,
|
|
1752
|
-
emptyContent:
|
|
1752
|
+
emptyContent: g,
|
|
1753
1753
|
hoverable: b = !0,
|
|
1754
1754
|
bordered: L = !1,
|
|
1755
|
-
striped:
|
|
1755
|
+
striped: A = !1,
|
|
1756
1756
|
padding: _ = "md",
|
|
1757
1757
|
className: $,
|
|
1758
1758
|
rowClassName: X,
|
|
@@ -1763,7 +1763,7 @@ const qt = ({
|
|
|
1763
1763
|
direction: null
|
|
1764
1764
|
}), [O, ce] = R({
|
|
1765
1765
|
page: 0,
|
|
1766
|
-
pageSize:
|
|
1766
|
+
pageSize: m
|
|
1767
1767
|
}), C = se(null), i = he(() => {
|
|
1768
1768
|
let v = t;
|
|
1769
1769
|
if (s && j.trim()) {
|
|
@@ -1795,7 +1795,7 @@ const qt = ({
|
|
|
1795
1795
|
if (!l) return S;
|
|
1796
1796
|
const v = O.page * O.pageSize, U = v + O.pageSize;
|
|
1797
1797
|
return S.slice(v, U);
|
|
1798
|
-
}, [S, O, l]),
|
|
1798
|
+
}, [S, O, l]), T = ue(
|
|
1799
1799
|
(v) => {
|
|
1800
1800
|
r.find((Z) => Z.id === v)?.sortable && re((Z) => Z.column !== v ? { column: v, direction: "asc" } : Z.direction === "asc" ? { column: v, direction: "desc" } : { column: null, direction: null });
|
|
1801
1801
|
},
|
|
@@ -1806,18 +1806,18 @@ const qt = ({
|
|
|
1806
1806
|
ce({ page: 0, pageSize: v });
|
|
1807
1807
|
}, []), ae = ue(
|
|
1808
1808
|
(v, U) => {
|
|
1809
|
-
if (!
|
|
1809
|
+
if (!p) return;
|
|
1810
1810
|
const Z = w(v, 0);
|
|
1811
|
-
|
|
1812
|
-
(J, F) => w(
|
|
1811
|
+
x.map((J, F) => w(J, F)), p(U ? [...x, v] : x.filter(
|
|
1812
|
+
(J, F) => w(x[F], F) !== Z
|
|
1813
1813
|
));
|
|
1814
1814
|
},
|
|
1815
|
-
[
|
|
1815
|
+
[x, p, w]
|
|
1816
1816
|
), le = ue(
|
|
1817
1817
|
(v) => {
|
|
1818
|
-
|
|
1818
|
+
p && p(v ? [...N] : []);
|
|
1819
1819
|
},
|
|
1820
|
-
[N,
|
|
1820
|
+
[N, p]
|
|
1821
1821
|
);
|
|
1822
1822
|
Q(() => {
|
|
1823
1823
|
ce((v) => ({ ...v, page: 0 }));
|
|
@@ -1826,12 +1826,12 @@ const qt = ({
|
|
|
1826
1826
|
}, [o.map((v) => v.value).join(",")]);
|
|
1827
1827
|
const G = S.length, P = Math.ceil(G / O.pageSize), E = O.page * O.pageSize + 1, D = Math.min(E + O.pageSize - 1, G), z = N.length > 0 && N.every((v) => {
|
|
1828
1828
|
const U = w(v, 0);
|
|
1829
|
-
return
|
|
1829
|
+
return x.some(
|
|
1830
1830
|
(Z, J) => w(Z, J) === U
|
|
1831
1831
|
);
|
|
1832
1832
|
}), V = N.some((v) => {
|
|
1833
1833
|
const U = w(v, 0);
|
|
1834
|
-
return
|
|
1834
|
+
return x.some(
|
|
1835
1835
|
(Z, J) => w(Z, J) === U
|
|
1836
1836
|
);
|
|
1837
1837
|
}), B = d(
|
|
@@ -1841,7 +1841,7 @@ const qt = ({
|
|
|
1841
1841
|
"text-text border-b border-border p-2"
|
|
1842
1842
|
), te = d("h-row-lg", {
|
|
1843
1843
|
"hover:bg-surface-sunk": b,
|
|
1844
|
-
"cursor-pointer":
|
|
1844
|
+
"cursor-pointer": h
|
|
1845
1845
|
});
|
|
1846
1846
|
return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
1847
1847
|
(s || o.length > 0) && /* @__PURE__ */ e("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
@@ -1868,7 +1868,7 @@ const qt = ({
|
|
|
1868
1868
|
) }),
|
|
1869
1869
|
/* @__PURE__ */ c("table", { ref: C, className: d(B, "min-w-full"), children: [
|
|
1870
1870
|
/* @__PURE__ */ e("thead", { className: M, children: /* @__PURE__ */ c("tr", { children: [
|
|
1871
|
-
|
|
1871
|
+
f && /* @__PURE__ */ e("th", { className: d(I, "w-12"), children: /* @__PURE__ */ e(
|
|
1872
1872
|
"input",
|
|
1873
1873
|
{
|
|
1874
1874
|
type: "checkbox",
|
|
@@ -1899,7 +1899,7 @@ const qt = ({
|
|
|
1899
1899
|
U === r.length - 1 && je[_]
|
|
1900
1900
|
),
|
|
1901
1901
|
style: { width: v.width },
|
|
1902
|
-
onClick: () => v.sortable &&
|
|
1902
|
+
onClick: () => v.sortable && T(v.id),
|
|
1903
1903
|
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1904
1904
|
v.headerCell ? v.headerCell() : v.header,
|
|
1905
1905
|
v.sortable && /* @__PURE__ */ c(
|
|
@@ -1934,15 +1934,15 @@ const qt = ({
|
|
|
1934
1934
|
/* @__PURE__ */ e("tbody", { children: N.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1935
1935
|
"td",
|
|
1936
1936
|
{
|
|
1937
|
-
colSpan: r.length + (
|
|
1937
|
+
colSpan: r.length + (f ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1938
1938
|
className: d(
|
|
1939
1939
|
I,
|
|
1940
1940
|
"text-center py-8 text-text-muted"
|
|
1941
1941
|
),
|
|
1942
|
-
children:
|
|
1942
|
+
children: g || "No data available"
|
|
1943
1943
|
}
|
|
1944
1944
|
) }) : N.map((v, U) => {
|
|
1945
|
-
const Z = w(v, U), J =
|
|
1945
|
+
const Z = w(v, U), J = x.some(
|
|
1946
1946
|
(F, ie) => w(F, ie) === Z
|
|
1947
1947
|
);
|
|
1948
1948
|
return /* @__PURE__ */ c(
|
|
@@ -1954,10 +1954,10 @@ const qt = ({
|
|
|
1954
1954
|
X?.(v, U)
|
|
1955
1955
|
),
|
|
1956
1956
|
onClick: (F) => {
|
|
1957
|
-
F.stopPropagation(),
|
|
1957
|
+
F.stopPropagation(), h?.(v, U);
|
|
1958
1958
|
},
|
|
1959
1959
|
children: [
|
|
1960
|
-
|
|
1960
|
+
f && /* @__PURE__ */ e("td", { className: I, children: /* @__PURE__ */ e(
|
|
1961
1961
|
"input",
|
|
1962
1962
|
{
|
|
1963
1963
|
type: "checkbox",
|
|
@@ -2103,31 +2103,31 @@ const qt = ({
|
|
|
2103
2103
|
onTabChange: n,
|
|
2104
2104
|
className: s
|
|
2105
2105
|
}) => {
|
|
2106
|
-
const [a, o] = R(t[0]?.id || ""), l = r || a, u = (
|
|
2107
|
-
n ? n(
|
|
2106
|
+
const [a, o] = R(t[0]?.id || ""), l = r || a, u = (m) => {
|
|
2107
|
+
n ? n(m) : o(m);
|
|
2108
2108
|
};
|
|
2109
|
-
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((
|
|
2109
|
+
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((m) => /* @__PURE__ */ e(
|
|
2110
2110
|
"button",
|
|
2111
2111
|
{
|
|
2112
|
-
onClick: () => !
|
|
2113
|
-
disabled:
|
|
2112
|
+
onClick: () => !m.disabled && u(m.id),
|
|
2113
|
+
disabled: m.disabled,
|
|
2114
2114
|
className: d(
|
|
2115
2115
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
2116
2116
|
{
|
|
2117
|
-
"border-accent-border text-text": l ===
|
|
2118
|
-
"border-transparent text-text-muted hover:text-text": l !==
|
|
2119
|
-
"border-transparent text-disabled cursor-not-allowed":
|
|
2117
|
+
"border-accent-border text-text": l === m.id,
|
|
2118
|
+
"border-transparent text-text-muted hover:text-text": l !== m.id && !m.disabled,
|
|
2119
|
+
"border-transparent text-disabled cursor-not-allowed": m.disabled
|
|
2120
2120
|
}
|
|
2121
2121
|
),
|
|
2122
2122
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2123
|
-
|
|
2124
|
-
|
|
2123
|
+
m.label,
|
|
2124
|
+
m.badge && /* @__PURE__ */ e("span", { className: d(
|
|
2125
2125
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2126
|
-
l ===
|
|
2127
|
-
), children:
|
|
2126
|
+
l === m.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
|
|
2127
|
+
), children: m.badge })
|
|
2128
2128
|
] })
|
|
2129
2129
|
},
|
|
2130
|
-
|
|
2130
|
+
m.id
|
|
2131
2131
|
)) }) });
|
|
2132
2132
|
}, er = ({
|
|
2133
2133
|
items: t,
|
|
@@ -2138,14 +2138,14 @@ const qt = ({
|
|
|
2138
2138
|
size: o = "md",
|
|
2139
2139
|
className: l
|
|
2140
2140
|
}) => {
|
|
2141
|
-
const [u,
|
|
2141
|
+
const [u, m] = R(
|
|
2142
2142
|
r || n || t[0]?.id || ""
|
|
2143
|
-
), y = n || u,
|
|
2144
|
-
s ? s(
|
|
2145
|
-
},
|
|
2143
|
+
), y = n || u, h = (g) => {
|
|
2144
|
+
s ? s(g) : m(g);
|
|
2145
|
+
}, f = {
|
|
2146
2146
|
activeTab: y,
|
|
2147
|
-
setActiveTab:
|
|
2148
|
-
},
|
|
2147
|
+
setActiveTab: h
|
|
2148
|
+
}, x = t.find((g) => g.id === y), p = d(
|
|
2149
2149
|
"flex",
|
|
2150
2150
|
{
|
|
2151
2151
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2154,8 +2154,8 @@ const qt = ({
|
|
|
2154
2154
|
"space-x-8": a === "default" || a === "underline"
|
|
2155
2155
|
},
|
|
2156
2156
|
l
|
|
2157
|
-
), w = (
|
|
2158
|
-
const L = "transition-colors duration-fast font-medium",
|
|
2157
|
+
), w = (g, b) => {
|
|
2158
|
+
const L = "transition-colors duration-fast font-medium", A = {
|
|
2159
2159
|
"text-xs px-2 py-1": o === "sm",
|
|
2160
2160
|
"text-sm px-3 py-2": o === "md",
|
|
2161
2161
|
"text-base px-4 py-3": o === "lg"
|
|
@@ -2167,44 +2167,44 @@ const qt = ({
|
|
|
2167
2167
|
// Underline variant
|
|
2168
2168
|
"border-b-2 pb-2": a === "underline"
|
|
2169
2169
|
}, $ = {
|
|
2170
|
-
"opacity-50 cursor-not-allowed":
|
|
2171
|
-
"cursor-pointer": !
|
|
2170
|
+
"opacity-50 cursor-not-allowed": g.disabled,
|
|
2171
|
+
"cursor-pointer": !g.disabled
|
|
2172
2172
|
}, X = b ? {
|
|
2173
2173
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2174
2174
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2175
|
-
} : {}, W = !b && !
|
|
2175
|
+
} : {}, W = !b && !g.disabled ? {
|
|
2176
2176
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2177
2177
|
"text-text-muted hover:text-text": a === "pills",
|
|
2178
2178
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2179
2179
|
} : {};
|
|
2180
|
-
return d(L,
|
|
2180
|
+
return d(L, A, _, $, X, W);
|
|
2181
2181
|
};
|
|
2182
|
-
return /* @__PURE__ */ e(Qt.Provider, { value:
|
|
2183
|
-
/* @__PURE__ */ e("div", { className:
|
|
2182
|
+
return /* @__PURE__ */ e(Qt.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
|
|
2183
|
+
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((g) => /* @__PURE__ */ e(
|
|
2184
2184
|
"button",
|
|
2185
2185
|
{
|
|
2186
2186
|
type: "button",
|
|
2187
2187
|
role: "tab",
|
|
2188
|
-
"aria-selected": y ===
|
|
2189
|
-
"aria-controls": `tabpanel-${
|
|
2190
|
-
disabled:
|
|
2191
|
-
onClick: () => !
|
|
2192
|
-
className: w(
|
|
2188
|
+
"aria-selected": y === g.id,
|
|
2189
|
+
"aria-controls": `tabpanel-${g.id}`,
|
|
2190
|
+
disabled: g.disabled,
|
|
2191
|
+
onClick: () => !g.disabled && h(g.id),
|
|
2192
|
+
className: w(g, y === g.id),
|
|
2193
2193
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2194
|
-
|
|
2195
|
-
|
|
2194
|
+
g.label,
|
|
2195
|
+
g.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: g.badge })
|
|
2196
2196
|
] })
|
|
2197
2197
|
},
|
|
2198
|
-
|
|
2198
|
+
g.id
|
|
2199
2199
|
)) }),
|
|
2200
|
-
|
|
2200
|
+
x?.content && /* @__PURE__ */ e(
|
|
2201
2201
|
"div",
|
|
2202
2202
|
{
|
|
2203
2203
|
role: "tabpanel",
|
|
2204
2204
|
id: `tabpanel-${y}`,
|
|
2205
2205
|
"aria-labelledby": `tab-${y}`,
|
|
2206
2206
|
className: "mt-4",
|
|
2207
|
-
children:
|
|
2207
|
+
children: x.content
|
|
2208
2208
|
}
|
|
2209
2209
|
)
|
|
2210
2210
|
] }) });
|
|
@@ -2224,21 +2224,21 @@ function Ue({
|
|
|
2224
2224
|
closeOnEscape: o = !0,
|
|
2225
2225
|
className: l,
|
|
2226
2226
|
backdropClassName: u,
|
|
2227
|
-
children:
|
|
2227
|
+
children: m,
|
|
2228
2228
|
footer: y,
|
|
2229
|
-
showCloseButton:
|
|
2229
|
+
showCloseButton: h = !0
|
|
2230
2230
|
}) {
|
|
2231
|
-
const
|
|
2231
|
+
const f = se(null), x = se(null);
|
|
2232
2232
|
Q(() => {
|
|
2233
2233
|
if (!t || !o) return;
|
|
2234
|
-
const w = (
|
|
2235
|
-
|
|
2234
|
+
const w = (g) => {
|
|
2235
|
+
g.key === "Escape" && r();
|
|
2236
2236
|
};
|
|
2237
2237
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
2238
|
-
}, [t, o, r]), Q(() => (t ? (
|
|
2238
|
+
}, [t, o, r]), Q(() => (t ? (x.current = document.activeElement, f.current && f.current.focus(), document.body.style.overflow = "hidden") : (x.current && x.current.focus(), document.body.style.overflow = ""), () => {
|
|
2239
2239
|
document.body.style.overflow = "";
|
|
2240
2240
|
}), [t]);
|
|
2241
|
-
const
|
|
2241
|
+
const p = (w) => {
|
|
2242
2242
|
a && w.target === w.currentTarget && r();
|
|
2243
2243
|
};
|
|
2244
2244
|
return t ? /* @__PURE__ */ e(
|
|
@@ -2250,11 +2250,11 @@ function Ue({
|
|
|
2250
2250
|
// 'animate-fade-in',
|
|
2251
2251
|
u
|
|
2252
2252
|
),
|
|
2253
|
-
onClick:
|
|
2253
|
+
onClick: p,
|
|
2254
2254
|
children: /* @__PURE__ */ c(
|
|
2255
2255
|
"div",
|
|
2256
2256
|
{
|
|
2257
|
-
ref:
|
|
2257
|
+
ref: f,
|
|
2258
2258
|
className: d(
|
|
2259
2259
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2260
2260
|
// 'animate-scale-in',
|
|
@@ -2267,7 +2267,7 @@ function Ue({
|
|
|
2267
2267
|
"aria-labelledby": n ? "modal-title" : void 0,
|
|
2268
2268
|
tabIndex: -1,
|
|
2269
2269
|
children: [
|
|
2270
|
-
(n ||
|
|
2270
|
+
(n || h) && /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2271
2271
|
n && /* @__PURE__ */ e(
|
|
2272
2272
|
"span",
|
|
2273
2273
|
{
|
|
@@ -2276,7 +2276,7 @@ function Ue({
|
|
|
2276
2276
|
children: n
|
|
2277
2277
|
}
|
|
2278
2278
|
),
|
|
2279
|
-
|
|
2279
|
+
h && /* @__PURE__ */ e(
|
|
2280
2280
|
"button",
|
|
2281
2281
|
{
|
|
2282
2282
|
onClick: r,
|
|
@@ -2286,7 +2286,7 @@ function Ue({
|
|
|
2286
2286
|
}
|
|
2287
2287
|
)
|
|
2288
2288
|
] }),
|
|
2289
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2289
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: m }),
|
|
2290
2290
|
y && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: y })
|
|
2291
2291
|
]
|
|
2292
2292
|
}
|
|
@@ -2335,32 +2335,32 @@ const rr = {
|
|
|
2335
2335
|
truncate: o = !1,
|
|
2336
2336
|
italic: l = !1,
|
|
2337
2337
|
underline: u = !1,
|
|
2338
|
-
lineHeight:
|
|
2338
|
+
lineHeight: m = "normal",
|
|
2339
2339
|
as: y,
|
|
2340
|
-
className:
|
|
2341
|
-
children:
|
|
2342
|
-
...
|
|
2340
|
+
className: h,
|
|
2341
|
+
children: f,
|
|
2342
|
+
...x
|
|
2343
2343
|
}) => {
|
|
2344
|
-
const
|
|
2344
|
+
const p = y || or(t), w = t === "caption", g = t === "label", b = t === "code", L = d(
|
|
2345
2345
|
"font-sans",
|
|
2346
2346
|
// Variant — caption and label pin their own size/weight
|
|
2347
2347
|
w && "text-xs text-text-subtle",
|
|
2348
|
-
|
|
2348
|
+
g && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2349
2349
|
b && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2350
2350
|
// Size — only where the variant does not pin it
|
|
2351
|
-
!w && !
|
|
2351
|
+
!w && !g && !b && rr[r],
|
|
2352
2352
|
// Weight — label owns its weight
|
|
2353
|
-
!
|
|
2353
|
+
!g && nr[n],
|
|
2354
2354
|
sr[s],
|
|
2355
2355
|
ar[a],
|
|
2356
2356
|
// Line height only overrides the body variant
|
|
2357
|
-
t === "body" && lr[
|
|
2357
|
+
t === "body" && lr[m],
|
|
2358
2358
|
l && "italic",
|
|
2359
2359
|
u && "underline",
|
|
2360
2360
|
o && "truncate",
|
|
2361
|
-
|
|
2361
|
+
h
|
|
2362
2362
|
);
|
|
2363
|
-
return /* @__PURE__ */ e(
|
|
2363
|
+
return /* @__PURE__ */ e(p, { className: L, ...x, children: f });
|
|
2364
2364
|
};
|
|
2365
2365
|
function or(t) {
|
|
2366
2366
|
return {
|
|
@@ -2379,24 +2379,24 @@ const cr = ({
|
|
|
2379
2379
|
disabled: o,
|
|
2380
2380
|
accept: l,
|
|
2381
2381
|
onListFiles: u,
|
|
2382
|
-
onListMounts:
|
|
2382
|
+
onListMounts: m,
|
|
2383
2383
|
onUploadFile: y,
|
|
2384
|
-
onDownloadFile:
|
|
2385
|
-
onRegisterFile:
|
|
2384
|
+
onDownloadFile: h,
|
|
2385
|
+
onRegisterFile: f
|
|
2386
2386
|
}) => {
|
|
2387
|
-
const [
|
|
2387
|
+
const [x, p] = R(!1), [w, g] = R([]), [b, L] = R(null), [A, _] = R("/"), [$, X] = R([]), [W, j] = R(!1), [q, K] = R(""), [re, O] = R(
|
|
2388
2388
|
typeof t == "object" ? t : null
|
|
2389
2389
|
), [ce, C] = R(!1), [i, S] = R(""), N = se(null);
|
|
2390
2390
|
Q(() => {
|
|
2391
|
-
|
|
2392
|
-
}, [
|
|
2393
|
-
|
|
2394
|
-
}, [
|
|
2395
|
-
const
|
|
2391
|
+
x && T();
|
|
2392
|
+
}, [x]), Q(() => {
|
|
2393
|
+
x && b && k();
|
|
2394
|
+
}, [x, b, A, q]);
|
|
2395
|
+
const T = async () => {
|
|
2396
2396
|
j(!0);
|
|
2397
2397
|
try {
|
|
2398
|
-
const M = await
|
|
2399
|
-
M?.data &&
|
|
2398
|
+
const M = await m?.();
|
|
2399
|
+
M?.data && g(M.data);
|
|
2400
2400
|
} catch (M) {
|
|
2401
2401
|
console.error("Failed to load mounts", M);
|
|
2402
2402
|
} finally {
|
|
@@ -2406,7 +2406,7 @@ const cr = ({
|
|
|
2406
2406
|
if (b) {
|
|
2407
2407
|
j(!0);
|
|
2408
2408
|
try {
|
|
2409
|
-
const M = await u?.({ mountId: b.id, name: q, path:
|
|
2409
|
+
const M = await u?.({ mountId: b.id, name: q, path: A });
|
|
2410
2410
|
M?.data && X(M.data);
|
|
2411
2411
|
} catch (M) {
|
|
2412
2412
|
console.error("Failed to load files", M);
|
|
@@ -2430,7 +2430,7 @@ const cr = ({
|
|
|
2430
2430
|
providerKey: I.name,
|
|
2431
2431
|
ownerId: "me"
|
|
2432
2432
|
};
|
|
2433
|
-
O(U), r(U, v),
|
|
2433
|
+
O(U), r(U, v), p(!1);
|
|
2434
2434
|
} catch (te) {
|
|
2435
2435
|
console.error("Local file selection failed", te);
|
|
2436
2436
|
} finally {
|
|
@@ -2447,11 +2447,11 @@ const cr = ({
|
|
|
2447
2447
|
filename: I.name,
|
|
2448
2448
|
mimeType: I.type || "application/octet-stream",
|
|
2449
2449
|
mountId: b.id,
|
|
2450
|
-
path:
|
|
2450
|
+
path: A
|
|
2451
2451
|
});
|
|
2452
2452
|
if (v?.data) {
|
|
2453
2453
|
const U = v.data;
|
|
2454
|
-
O(U), r(U, new Uint8Array(te)),
|
|
2454
|
+
O(U), r(U, new Uint8Array(te)), p(!1);
|
|
2455
2455
|
}
|
|
2456
2456
|
} catch (te) {
|
|
2457
2457
|
console.error("Upload failed", te);
|
|
@@ -2463,11 +2463,11 @@ const cr = ({
|
|
|
2463
2463
|
if (!(!i || !b)) {
|
|
2464
2464
|
j(!0);
|
|
2465
2465
|
try {
|
|
2466
|
-
const M = `${
|
|
2467
|
-
|
|
2466
|
+
const M = `${A}${i}/`;
|
|
2467
|
+
f && (await f({
|
|
2468
2468
|
name: i,
|
|
2469
2469
|
type: "folder",
|
|
2470
|
-
path:
|
|
2470
|
+
path: A,
|
|
2471
2471
|
mimeType: "application/x-directory",
|
|
2472
2472
|
size: 0,
|
|
2473
2473
|
mountId: b.id,
|
|
@@ -2483,8 +2483,8 @@ const cr = ({
|
|
|
2483
2483
|
}, G = async (M) => {
|
|
2484
2484
|
j(!0);
|
|
2485
2485
|
try {
|
|
2486
|
-
const I = await
|
|
2487
|
-
O(M), r(M, I),
|
|
2486
|
+
const I = await h?.(M.id);
|
|
2487
|
+
O(M), r(M, I), p(!1);
|
|
2488
2488
|
} catch (I) {
|
|
2489
2489
|
console.error("Failed to download file", I);
|
|
2490
2490
|
} finally {
|
|
@@ -2496,19 +2496,19 @@ const cr = ({
|
|
|
2496
2496
|
const M = /* @__PURE__ */ new Set(), I = [];
|
|
2497
2497
|
return $.forEach((te) => {
|
|
2498
2498
|
if (te.type === "folder") {
|
|
2499
|
-
te.path ===
|
|
2499
|
+
te.path === A && M.add(te.name);
|
|
2500
2500
|
return;
|
|
2501
2501
|
}
|
|
2502
|
-
const v = te.providerKey || te.name, Z = (
|
|
2502
|
+
const v = te.providerKey || te.name, Z = (A ? v.substring(A.length) : v).split("/").filter((J) => J !== "");
|
|
2503
2503
|
Z.length > 1 ? M.add(Z[0]) : Z.length === 1 && I.push(te);
|
|
2504
2504
|
}), {
|
|
2505
2505
|
folders: Array.from(M).sort(),
|
|
2506
2506
|
files: I.sort((te, v) => te.name.localeCompare(v.name))
|
|
2507
2507
|
};
|
|
2508
|
-
}, [$,
|
|
2508
|
+
}, [$, A]), D = (M) => {
|
|
2509
2509
|
_((I) => `${I}${M}/`);
|
|
2510
2510
|
}, z = () => {
|
|
2511
|
-
const M =
|
|
2511
|
+
const M = A.split("/").filter((I) => I !== "");
|
|
2512
2512
|
M.pop(), M.length === 0 ? _("/") : _(`${M.join("/")}/`);
|
|
2513
2513
|
}, V = he(() => {
|
|
2514
2514
|
const M = E.folders.map((I) => ({
|
|
@@ -2590,7 +2590,7 @@ const cr = ({
|
|
|
2590
2590
|
/* @__PURE__ */ c(
|
|
2591
2591
|
"div",
|
|
2592
2592
|
{
|
|
2593
|
-
onClick: () => !o &&
|
|
2593
|
+
onClick: () => !o && p(!0),
|
|
2594
2594
|
className: d(
|
|
2595
2595
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2596
2596
|
"hover:border-border-strong bg-surface",
|
|
@@ -2615,9 +2615,9 @@ const cr = ({
|
|
|
2615
2615
|
/* @__PURE__ */ e(
|
|
2616
2616
|
Ue,
|
|
2617
2617
|
{
|
|
2618
|
-
open:
|
|
2618
|
+
open: x,
|
|
2619
2619
|
onClose: () => {
|
|
2620
|
-
|
|
2620
|
+
p(!1), L(null), _("/"), C(!1);
|
|
2621
2621
|
},
|
|
2622
2622
|
title: b ? `Explorer: ${b.name}` : "Select Storage Mount",
|
|
2623
2623
|
size: "lg",
|
|
@@ -2637,13 +2637,13 @@ const cr = ({
|
|
|
2637
2637
|
variant: "ghost",
|
|
2638
2638
|
size: "sm",
|
|
2639
2639
|
onClick: () => {
|
|
2640
|
-
|
|
2640
|
+
A && A !== "/" ? z() : L(null);
|
|
2641
2641
|
},
|
|
2642
2642
|
leftIcon: /* @__PURE__ */ e(Y, { icon: st, size: "xs" }),
|
|
2643
|
-
children:
|
|
2643
|
+
children: A ? "Back" : "Back to Mounts"
|
|
2644
2644
|
}
|
|
2645
2645
|
),
|
|
2646
|
-
/* @__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:
|
|
2646
|
+
/* @__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: A }) }),
|
|
2647
2647
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2648
2648
|
be,
|
|
2649
2649
|
{
|
|
@@ -2772,12 +2772,12 @@ const cr = ({
|
|
|
2772
2772
|
loading: o = !1,
|
|
2773
2773
|
containerClassName: l,
|
|
2774
2774
|
labelClassName: u,
|
|
2775
|
-
className:
|
|
2775
|
+
className: m,
|
|
2776
2776
|
id: y,
|
|
2777
|
-
rows:
|
|
2778
|
-
...
|
|
2779
|
-
},
|
|
2780
|
-
const
|
|
2777
|
+
rows: h = 4,
|
|
2778
|
+
...f
|
|
2779
|
+
}, x) => {
|
|
2780
|
+
const p = oe.useId(), w = y || `textarea-${p}`, g = !!n, b = n || r ? `${w}-description` : void 0;
|
|
2781
2781
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", l), children: [
|
|
2782
2782
|
t && /* @__PURE__ */ e(
|
|
2783
2783
|
"label",
|
|
@@ -2785,7 +2785,7 @@ const cr = ({
|
|
|
2785
2785
|
htmlFor: w,
|
|
2786
2786
|
className: d(
|
|
2787
2787
|
Ve,
|
|
2788
|
-
|
|
2788
|
+
g ? "text-danger-fg" : "text-text-subtle",
|
|
2789
2789
|
u
|
|
2790
2790
|
),
|
|
2791
2791
|
children: t
|
|
@@ -2795,10 +2795,10 @@ const cr = ({
|
|
|
2795
2795
|
/* @__PURE__ */ e(
|
|
2796
2796
|
"textarea",
|
|
2797
2797
|
{
|
|
2798
|
-
ref:
|
|
2798
|
+
ref: x,
|
|
2799
2799
|
id: w,
|
|
2800
|
-
rows:
|
|
2801
|
-
"aria-invalid":
|
|
2800
|
+
rows: h,
|
|
2801
|
+
"aria-invalid": g || void 0,
|
|
2802
2802
|
"aria-describedby": b,
|
|
2803
2803
|
className: d(
|
|
2804
2804
|
"block w-full resize-y rounded-md border bg-surface-input text-text",
|
|
@@ -2807,10 +2807,10 @@ const cr = ({
|
|
|
2807
2807
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2808
2808
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
2809
2809
|
ir[s],
|
|
2810
|
-
|
|
2811
|
-
|
|
2810
|
+
g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2811
|
+
m
|
|
2812
2812
|
),
|
|
2813
|
-
...
|
|
2813
|
+
...f
|
|
2814
2814
|
}
|
|
2815
2815
|
),
|
|
2816
2816
|
o && /* @__PURE__ */ e(
|
|
@@ -2825,7 +2825,7 @@ const cr = ({
|
|
|
2825
2825
|
"p",
|
|
2826
2826
|
{
|
|
2827
2827
|
id: b,
|
|
2828
|
-
className: d("mt-1 text-xs",
|
|
2828
|
+
className: d("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
|
|
2829
2829
|
children: n || r
|
|
2830
2830
|
}
|
|
2831
2831
|
)
|
|
@@ -2843,8 +2843,8 @@ function dr(t, r, n) {
|
|
|
2843
2843
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2844
2844
|
let o = a;
|
|
2845
2845
|
for (let l = 0; l < s.length - 1; l++) {
|
|
2846
|
-
const u = s[l],
|
|
2847
|
-
o[u] =
|
|
2846
|
+
const u = s[l], m = o[u];
|
|
2847
|
+
o[u] = m && typeof m == "object" ? Array.isArray(m) ? [...m] : { ...m } : {}, o = o[u];
|
|
2848
2848
|
}
|
|
2849
2849
|
return o[s[s.length - 1]] = n, a;
|
|
2850
2850
|
}
|
|
@@ -2867,22 +2867,22 @@ const rn = ({
|
|
|
2867
2867
|
transform: o,
|
|
2868
2868
|
validate: l,
|
|
2869
2869
|
submitButton: u = { label: "Submit", variant: "primary" },
|
|
2870
|
-
cancelButton:
|
|
2870
|
+
cancelButton: m = { label: "Cancel", variant: "outline" },
|
|
2871
2871
|
showButtons: y = !0,
|
|
2872
|
-
layout:
|
|
2873
|
-
size:
|
|
2874
|
-
loading:
|
|
2875
|
-
className:
|
|
2872
|
+
layout: h = "vertical",
|
|
2873
|
+
size: f = "md",
|
|
2874
|
+
loading: x = !1,
|
|
2875
|
+
className: p,
|
|
2876
2876
|
ref: w,
|
|
2877
|
-
sdk:
|
|
2877
|
+
sdk: g
|
|
2878
2878
|
}) => {
|
|
2879
|
-
const [b, L] = R(r || {}), [
|
|
2879
|
+
const [b, L] = R(r || {}), [A, _] = R({}), [$, X] = R({});
|
|
2880
2880
|
Q(() => {
|
|
2881
2881
|
r && L({ ...r });
|
|
2882
2882
|
}, [r]);
|
|
2883
2883
|
const W = ue(
|
|
2884
2884
|
(C, i, S) => {
|
|
2885
|
-
const N = t.flatMap((
|
|
2885
|
+
const N = t.flatMap((T) => T.items).find((T) => T.name === C);
|
|
2886
2886
|
if (!N) return null;
|
|
2887
2887
|
if (N.required && (i == null || i === ""))
|
|
2888
2888
|
return `${N.label} is required`;
|
|
@@ -2892,7 +2892,7 @@ const rn = ({
|
|
|
2892
2892
|
if (i && !Array.isArray(i))
|
|
2893
2893
|
return `${N.label} must be an array.`;
|
|
2894
2894
|
if (Array.isArray(i) && N.arrayFields) {
|
|
2895
|
-
const
|
|
2895
|
+
const T = [];
|
|
2896
2896
|
let k = !1;
|
|
2897
2897
|
if (i.forEach((ee, ae) => {
|
|
2898
2898
|
const le = {};
|
|
@@ -2905,9 +2905,9 @@ const rn = ({
|
|
|
2905
2905
|
E && (le[G.name] = E, k = !0);
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
|
-
|
|
2908
|
+
T[ae] = le;
|
|
2909
2909
|
}), k)
|
|
2910
|
-
return JSON.stringify(
|
|
2910
|
+
return JSON.stringify(T);
|
|
2911
2911
|
}
|
|
2912
2912
|
}
|
|
2913
2913
|
return N.validator ? N.validator(i, S) : null;
|
|
@@ -2921,40 +2921,40 @@ const rn = ({
|
|
|
2921
2921
|
i
|
|
2922
2922
|
);
|
|
2923
2923
|
t.flatMap((k) => k.items).find((k) => k.name === C)?.removeIfEmpty && (i == null || i === "") && (S = ur(S, C)), L(S), X((k) => ({ ...k, [C]: !0 }));
|
|
2924
|
-
const
|
|
2924
|
+
const T = W(C, i, S);
|
|
2925
2925
|
_((k) => ({
|
|
2926
2926
|
...k,
|
|
2927
|
-
[C]:
|
|
2927
|
+
[C]: T || ""
|
|
2928
2928
|
})), a?.(S, C);
|
|
2929
2929
|
},
|
|
2930
2930
|
[b, t, W, a]
|
|
2931
2931
|
), q = ue(
|
|
2932
2932
|
async (C) => {
|
|
2933
|
-
if (C.preventDefault(),
|
|
2934
|
-
const i = {}, S = t.flatMap((
|
|
2935
|
-
for (const
|
|
2936
|
-
if (
|
|
2933
|
+
if (C.preventDefault(), x) return;
|
|
2934
|
+
const i = {}, S = t.flatMap((T) => T.items);
|
|
2935
|
+
for (const T of S) {
|
|
2936
|
+
if (T.hidden || T.conditional && !T.conditional(b))
|
|
2937
2937
|
continue;
|
|
2938
2938
|
const k = W(
|
|
2939
|
-
|
|
2940
|
-
Oe(b,
|
|
2939
|
+
T.name,
|
|
2940
|
+
Oe(b, T.name),
|
|
2941
2941
|
b
|
|
2942
2942
|
);
|
|
2943
|
-
k && (i[
|
|
2943
|
+
k && (i[T.name] = k);
|
|
2944
2944
|
}
|
|
2945
2945
|
if (l) {
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2946
|
+
const T = l(b);
|
|
2947
|
+
T && Object.assign(i, T);
|
|
2948
2948
|
}
|
|
2949
|
-
if (_(i), Object.keys(i).some((
|
|
2949
|
+
if (_(i), Object.keys(i).some((T) => i[T]))
|
|
2950
2950
|
return;
|
|
2951
2951
|
const N = o ? o(b) : b;
|
|
2952
2952
|
await n?.(b, N);
|
|
2953
2953
|
},
|
|
2954
|
-
[b, t, W, l, o, n,
|
|
2954
|
+
[b, t, W, l, o, n, x]
|
|
2955
2955
|
), K = ue(
|
|
2956
2956
|
(C) => {
|
|
2957
|
-
const i = Oe(b, C.name), S = $[C.name] ?
|
|
2957
|
+
const i = Oe(b, C.name), S = $[C.name] ? A[C.name] : void 0, N = C.disabled || x, T = {
|
|
2958
2958
|
value: i || "",
|
|
2959
2959
|
disabled: N,
|
|
2960
2960
|
required: C.required,
|
|
@@ -2971,30 +2971,30 @@ const rn = ({
|
|
|
2971
2971
|
return /* @__PURE__ */ e(
|
|
2972
2972
|
be,
|
|
2973
2973
|
{
|
|
2974
|
-
...
|
|
2974
|
+
...T,
|
|
2975
2975
|
onChange: (k) => j(C.name, k.target.value),
|
|
2976
2976
|
type: C.textType || C.type,
|
|
2977
2977
|
autoComplete: C.autocomplete,
|
|
2978
2978
|
error: S,
|
|
2979
|
-
size:
|
|
2979
|
+
size: f
|
|
2980
2980
|
}
|
|
2981
2981
|
);
|
|
2982
2982
|
case "textarea":
|
|
2983
2983
|
return /* @__PURE__ */ e(
|
|
2984
2984
|
De,
|
|
2985
2985
|
{
|
|
2986
|
-
...
|
|
2986
|
+
...T,
|
|
2987
2987
|
onChange: (k) => j(C.name, k.target.value),
|
|
2988
2988
|
rows: 4,
|
|
2989
2989
|
error: S,
|
|
2990
|
-
size:
|
|
2990
|
+
size: f
|
|
2991
2991
|
}
|
|
2992
2992
|
);
|
|
2993
2993
|
case "select":
|
|
2994
2994
|
return /* @__PURE__ */ e(
|
|
2995
2995
|
Ne,
|
|
2996
2996
|
{
|
|
2997
|
-
...
|
|
2997
|
+
...T,
|
|
2998
2998
|
onChange: (k) => j(C.name, k),
|
|
2999
2999
|
options: (C.options || []).map((k) => ({
|
|
3000
3000
|
...k,
|
|
@@ -3004,18 +3004,18 @@ const rn = ({
|
|
|
3004
3004
|
multiple: C.multiple,
|
|
3005
3005
|
allowCreate: C.allowCreate,
|
|
3006
3006
|
error: S,
|
|
3007
|
-
size:
|
|
3007
|
+
size: f
|
|
3008
3008
|
}
|
|
3009
3009
|
);
|
|
3010
3010
|
case "checkbox":
|
|
3011
3011
|
return /* @__PURE__ */ e(
|
|
3012
|
-
|
|
3012
|
+
pe,
|
|
3013
3013
|
{
|
|
3014
|
-
...
|
|
3014
|
+
...T,
|
|
3015
3015
|
label: C.label,
|
|
3016
3016
|
checked: !!i,
|
|
3017
3017
|
onChange: (k) => j(C.name, k.target.checked),
|
|
3018
|
-
size:
|
|
3018
|
+
size: f
|
|
3019
3019
|
}
|
|
3020
3020
|
);
|
|
3021
3021
|
case "radio":
|
|
@@ -3045,39 +3045,39 @@ const rn = ({
|
|
|
3045
3045
|
return /* @__PURE__ */ e(
|
|
3046
3046
|
$e,
|
|
3047
3047
|
{
|
|
3048
|
-
...
|
|
3048
|
+
...T,
|
|
3049
3049
|
value: i ? new Date(i) : null,
|
|
3050
3050
|
onChange: (k) => j(C.name, k),
|
|
3051
|
-
size:
|
|
3051
|
+
size: f
|
|
3052
3052
|
}
|
|
3053
3053
|
);
|
|
3054
3054
|
case "file":
|
|
3055
3055
|
return /* @__PURE__ */ e(
|
|
3056
3056
|
cr,
|
|
3057
3057
|
{
|
|
3058
|
-
...
|
|
3058
|
+
...T,
|
|
3059
3059
|
value: i,
|
|
3060
3060
|
onChange: (k) => j(C.name, k),
|
|
3061
3061
|
error: S,
|
|
3062
|
-
onListFiles: (k) =>
|
|
3062
|
+
onListFiles: (k) => g?.http.invoke({
|
|
3063
3063
|
method: "POST",
|
|
3064
3064
|
action: "storage.file.list",
|
|
3065
3065
|
body: k
|
|
3066
3066
|
}),
|
|
3067
|
-
onListMounts: () =>
|
|
3067
|
+
onListMounts: () => g?.http.invoke({
|
|
3068
3068
|
method: "GET",
|
|
3069
3069
|
action: "storage.mount"
|
|
3070
3070
|
}),
|
|
3071
|
-
onUploadFile: (k) =>
|
|
3071
|
+
onUploadFile: (k) => g?.http.invoke({
|
|
3072
3072
|
method: "POST",
|
|
3073
3073
|
action: "storage.file.upload",
|
|
3074
3074
|
body: k
|
|
3075
3075
|
}),
|
|
3076
|
-
onDownloadFile: (k) =>
|
|
3076
|
+
onDownloadFile: (k) => g?.http.invoke({
|
|
3077
3077
|
method: "GET",
|
|
3078
3078
|
action: `storage.file.${k}.download`
|
|
3079
3079
|
}),
|
|
3080
|
-
onRegisterFile: (k) =>
|
|
3080
|
+
onRegisterFile: (k) => g?.http.invoke({
|
|
3081
3081
|
method: "POST",
|
|
3082
3082
|
action: "storage.file.folder",
|
|
3083
3083
|
body: k
|
|
@@ -3090,12 +3090,12 @@ const rn = ({
|
|
|
3090
3090
|
{
|
|
3091
3091
|
value: i || {},
|
|
3092
3092
|
onChange: (k) => j(C.name, k),
|
|
3093
|
-
onListFolders: () =>
|
|
3093
|
+
onListFolders: () => g?.http.invoke({
|
|
3094
3094
|
method: "GET",
|
|
3095
3095
|
action: "storage.mount"
|
|
3096
3096
|
}),
|
|
3097
3097
|
disabled: N,
|
|
3098
|
-
size:
|
|
3098
|
+
size: f,
|
|
3099
3099
|
placeholder: C.placeholder
|
|
3100
3100
|
}
|
|
3101
3101
|
);
|
|
@@ -3168,7 +3168,7 @@ const rn = ({
|
|
|
3168
3168
|
type: D.textType || D.type,
|
|
3169
3169
|
autoComplete: D.autocomplete,
|
|
3170
3170
|
error: z,
|
|
3171
|
-
size:
|
|
3171
|
+
size: f
|
|
3172
3172
|
}
|
|
3173
3173
|
);
|
|
3174
3174
|
case "textarea":
|
|
@@ -3183,7 +3183,7 @@ const rn = ({
|
|
|
3183
3183
|
),
|
|
3184
3184
|
rows: 4,
|
|
3185
3185
|
error: z,
|
|
3186
|
-
size:
|
|
3186
|
+
size: f
|
|
3187
3187
|
}
|
|
3188
3188
|
);
|
|
3189
3189
|
case "select":
|
|
@@ -3206,12 +3206,12 @@ const rn = ({
|
|
|
3206
3206
|
multiple: D.multiple,
|
|
3207
3207
|
allowCreate: D.allowCreate,
|
|
3208
3208
|
error: z,
|
|
3209
|
-
size:
|
|
3209
|
+
size: f
|
|
3210
3210
|
}
|
|
3211
3211
|
);
|
|
3212
3212
|
case "checkbox":
|
|
3213
3213
|
return /* @__PURE__ */ e(
|
|
3214
|
-
|
|
3214
|
+
pe,
|
|
3215
3215
|
{
|
|
3216
3216
|
...V,
|
|
3217
3217
|
checked: !!P?.[D.name],
|
|
@@ -3220,7 +3220,7 @@ const rn = ({
|
|
|
3220
3220
|
D.name,
|
|
3221
3221
|
B.target.checked
|
|
3222
3222
|
),
|
|
3223
|
-
size:
|
|
3223
|
+
size: f
|
|
3224
3224
|
}
|
|
3225
3225
|
);
|
|
3226
3226
|
case "radio":
|
|
@@ -3262,7 +3262,7 @@ const rn = ({
|
|
|
3262
3262
|
D.name,
|
|
3263
3263
|
H
|
|
3264
3264
|
),
|
|
3265
|
-
size:
|
|
3265
|
+
size: f
|
|
3266
3266
|
}
|
|
3267
3267
|
);
|
|
3268
3268
|
}
|
|
@@ -3328,7 +3328,7 @@ const rn = ({
|
|
|
3328
3328
|
return null;
|
|
3329
3329
|
}
|
|
3330
3330
|
},
|
|
3331
|
-
[b, $,
|
|
3331
|
+
[b, $, A, x, f, j]
|
|
3332
3332
|
), re = ue(
|
|
3333
3333
|
(C) => {
|
|
3334
3334
|
if (C.conditional && !C.conditional(b))
|
|
@@ -3354,43 +3354,47 @@ const rn = ({
|
|
|
3354
3354
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: C.title }),
|
|
3355
3355
|
C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
|
|
3356
3356
|
] }),
|
|
3357
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) =>
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3357
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) => {
|
|
3358
|
+
const T = $[N.name] ? A[N.name] : void 0;
|
|
3359
|
+
return /* @__PURE__ */ c(
|
|
3360
|
+
"div",
|
|
3361
|
+
{
|
|
3362
|
+
className: d(
|
|
3363
|
+
"flex min-w-0 flex-col gap-1.5",
|
|
3364
|
+
N.type === "checkbox" && "justify-center"
|
|
3365
|
+
),
|
|
3366
|
+
style: {
|
|
3367
|
+
width: typeof N.width == "string" ? N.width : void 0,
|
|
3368
|
+
gridColumn: typeof N.width == "number" ? `span ${N.width} / span ${N.width}` : void 0
|
|
3369
|
+
},
|
|
3370
|
+
children: [
|
|
3371
|
+
N.type !== "custom" && N.type !== "checkbox" && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3372
|
+
N.label,
|
|
3373
|
+
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3374
|
+
] }),
|
|
3375
|
+
K(N),
|
|
3376
|
+
N.help && !T && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: N.help })
|
|
3377
|
+
]
|
|
3367
3378
|
},
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3372
|
-
] }),
|
|
3373
|
-
K(N)
|
|
3374
|
-
]
|
|
3375
|
-
},
|
|
3376
|
-
N.name
|
|
3377
|
-
))) }) })
|
|
3379
|
+
N.name
|
|
3380
|
+
);
|
|
3381
|
+
}) }) })
|
|
3378
3382
|
]
|
|
3379
3383
|
},
|
|
3380
3384
|
C.id
|
|
3381
3385
|
);
|
|
3382
3386
|
},
|
|
3383
|
-
[b, $,
|
|
3387
|
+
[b, $, A, K]
|
|
3384
3388
|
), O = d(
|
|
3385
3389
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3386
3390
|
{
|
|
3387
|
-
"max-w-md":
|
|
3388
|
-
"max-w-2xl":
|
|
3389
|
-
"max-w-4xl":
|
|
3390
|
-
"max-w-full":
|
|
3391
|
+
"max-w-md": f === "sm",
|
|
3392
|
+
"max-w-2xl": f === "md",
|
|
3393
|
+
"max-w-4xl": f === "lg",
|
|
3394
|
+
"max-w-full": f === "full"
|
|
3391
3395
|
},
|
|
3392
|
-
|
|
3393
|
-
), ce =
|
|
3396
|
+
p
|
|
3397
|
+
), ce = f === "full" ? "md" : f;
|
|
3394
3398
|
return /* @__PURE__ */ c("form", { ref: w, onSubmit: q, className: O, children: [
|
|
3395
3399
|
!y && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3396
3400
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(re) }),
|
|
@@ -3400,12 +3404,12 @@ const rn = ({
|
|
|
3400
3404
|
ne,
|
|
3401
3405
|
{
|
|
3402
3406
|
type: "button",
|
|
3403
|
-
variant:
|
|
3404
|
-
size:
|
|
3405
|
-
disabled:
|
|
3407
|
+
variant: m.variant ?? "ghost",
|
|
3408
|
+
size: m.size || ce,
|
|
3409
|
+
disabled: m.disabled || x,
|
|
3406
3410
|
onClick: s,
|
|
3407
|
-
className:
|
|
3408
|
-
children:
|
|
3411
|
+
className: m.className,
|
|
3412
|
+
children: m.label
|
|
3409
3413
|
}
|
|
3410
3414
|
),
|
|
3411
3415
|
/* @__PURE__ */ e(
|
|
@@ -3414,8 +3418,8 @@ const rn = ({
|
|
|
3414
3418
|
type: "submit",
|
|
3415
3419
|
variant: u.variant,
|
|
3416
3420
|
size: u.size || ce,
|
|
3417
|
-
disabled: u.disabled ||
|
|
3418
|
-
loading:
|
|
3421
|
+
disabled: u.disabled || x,
|
|
3422
|
+
loading: x,
|
|
3419
3423
|
className: u.className,
|
|
3420
3424
|
children: u.label
|
|
3421
3425
|
}
|
|
@@ -3432,17 +3436,17 @@ function nn({
|
|
|
3432
3436
|
tone: o = "default",
|
|
3433
3437
|
loading: l = !1,
|
|
3434
3438
|
onConfirm: u,
|
|
3435
|
-
onCancel:
|
|
3439
|
+
onCancel: m
|
|
3436
3440
|
}) {
|
|
3437
3441
|
return /* @__PURE__ */ e(
|
|
3438
3442
|
Ue,
|
|
3439
3443
|
{
|
|
3440
3444
|
open: t,
|
|
3441
|
-
onClose:
|
|
3445
|
+
onClose: m,
|
|
3442
3446
|
title: r,
|
|
3443
3447
|
size: "sm",
|
|
3444
3448
|
footer: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3445
|
-
/* @__PURE__ */ e(ne, { variant: "ghost", onClick:
|
|
3449
|
+
/* @__PURE__ */ e(ne, { variant: "ghost", onClick: m, disabled: l, children: a }),
|
|
3446
3450
|
/* @__PURE__ */ e(
|
|
3447
3451
|
ne,
|
|
3448
3452
|
{
|
|
@@ -3490,7 +3494,7 @@ function sn({
|
|
|
3490
3494
|
onDismiss: o,
|
|
3491
3495
|
className: l,
|
|
3492
3496
|
children: u,
|
|
3493
|
-
...
|
|
3497
|
+
...m
|
|
3494
3498
|
}) {
|
|
3495
3499
|
return /* @__PURE__ */ c(
|
|
3496
3500
|
"span",
|
|
@@ -3504,7 +3508,7 @@ function sn({
|
|
|
3504
3508
|
fr[r],
|
|
3505
3509
|
l
|
|
3506
3510
|
),
|
|
3507
|
-
...
|
|
3511
|
+
...m,
|
|
3508
3512
|
children: [
|
|
3509
3513
|
n && /* @__PURE__ */ e(
|
|
3510
3514
|
"span",
|
|
@@ -3578,7 +3582,7 @@ function ln({ children: t, className: r, ...n }) {
|
|
|
3578
3582
|
const br = {
|
|
3579
3583
|
sm: "h-1",
|
|
3580
3584
|
md: "h-1.5"
|
|
3581
|
-
},
|
|
3585
|
+
}, pr = {
|
|
3582
3586
|
accent: "bg-accent",
|
|
3583
3587
|
success: "bg-success"
|
|
3584
3588
|
};
|
|
@@ -3596,14 +3600,14 @@ function on({ value: t, variant: r = "accent", size: n = "md", className: s, ...
|
|
|
3596
3600
|
children: /* @__PURE__ */ e(
|
|
3597
3601
|
"div",
|
|
3598
3602
|
{
|
|
3599
|
-
className: d("h-full rounded-full transition-[width] duration-300 ease-out",
|
|
3603
|
+
className: d("h-full rounded-full transition-[width] duration-300 ease-out", pr[r]),
|
|
3600
3604
|
style: { width: `${o}%` }
|
|
3601
3605
|
}
|
|
3602
3606
|
)
|
|
3603
3607
|
}
|
|
3604
3608
|
);
|
|
3605
3609
|
}
|
|
3606
|
-
const
|
|
3610
|
+
const gr = {
|
|
3607
3611
|
xs: "h-3 w-3",
|
|
3608
3612
|
sm: "h-4 w-4",
|
|
3609
3613
|
md: "h-6 w-6",
|
|
@@ -3644,7 +3648,7 @@ function cn({
|
|
|
3644
3648
|
{
|
|
3645
3649
|
className: d(
|
|
3646
3650
|
"animate-spin",
|
|
3647
|
-
|
|
3651
|
+
gr[t],
|
|
3648
3652
|
vr[r]
|
|
3649
3653
|
),
|
|
3650
3654
|
fill: "none",
|
|
@@ -3734,32 +3738,32 @@ function un({
|
|
|
3734
3738
|
className: a
|
|
3735
3739
|
}) {
|
|
3736
3740
|
const o = t.indexOf(r), l = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
3737
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-1.5", a), children: t.map((u,
|
|
3741
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-1.5", a), children: t.map((u, m) => /* @__PURE__ */ e(
|
|
3738
3742
|
"span",
|
|
3739
3743
|
{
|
|
3740
3744
|
className: d(
|
|
3741
3745
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3746
|
+
m === o ? "w-5 bg-accent" : "w-3.5",
|
|
3747
|
+
m < o && "bg-border-strong",
|
|
3748
|
+
m > o && "bg-border"
|
|
3745
3749
|
)
|
|
3746
3750
|
},
|
|
3747
3751
|
u
|
|
3748
|
-
)) }) : /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-2", a), children: t.map((u,
|
|
3752
|
+
)) }) : /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-2", a), children: t.map((u, m) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
3749
3753
|
/* @__PURE__ */ e(
|
|
3750
3754
|
"span",
|
|
3751
3755
|
{
|
|
3752
|
-
"aria-current":
|
|
3756
|
+
"aria-current": m === o ? "step" : void 0,
|
|
3753
3757
|
className: d(
|
|
3754
3758
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3759
|
+
m === o && "bg-accent text-accent-fg",
|
|
3760
|
+
m < o && "bg-accent-soft text-accent",
|
|
3761
|
+
m > o && "bg-surface-hover text-text-muted"
|
|
3758
3762
|
),
|
|
3759
|
-
children:
|
|
3763
|
+
children: m + 1
|
|
3760
3764
|
}
|
|
3761
3765
|
),
|
|
3762
|
-
|
|
3766
|
+
m < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3763
3767
|
] }, u)) });
|
|
3764
3768
|
}
|
|
3765
3769
|
function mn({ title: t, icon: r = /* @__PURE__ */ e(it, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...o }) {
|
|
@@ -3881,21 +3885,21 @@ const xn = ({
|
|
|
3881
3885
|
showLoading: o = !0,
|
|
3882
3886
|
showError: l = !0,
|
|
3883
3887
|
fallback: u,
|
|
3884
|
-
loadingContent:
|
|
3888
|
+
loadingContent: m,
|
|
3885
3889
|
errorContent: y,
|
|
3886
|
-
className:
|
|
3887
|
-
onLoad:
|
|
3888
|
-
onError:
|
|
3889
|
-
...
|
|
3890
|
+
className: h,
|
|
3891
|
+
onLoad: f,
|
|
3892
|
+
onError: x,
|
|
3893
|
+
...p
|
|
3890
3894
|
}) => {
|
|
3891
|
-
const [w,
|
|
3892
|
-
|
|
3895
|
+
const [w, g] = R(!0), [b, L] = R(!1), [A, _] = R(t), $ = (O) => {
|
|
3896
|
+
g(!1), L(!1), f?.(O);
|
|
3893
3897
|
}, X = (O) => {
|
|
3894
|
-
if (
|
|
3895
|
-
_(u), L(!1),
|
|
3898
|
+
if (g(!1), L(!0), u && A !== u) {
|
|
3899
|
+
_(u), L(!1), g(!0);
|
|
3896
3900
|
return;
|
|
3897
3901
|
}
|
|
3898
|
-
|
|
3902
|
+
x?.(O);
|
|
3899
3903
|
}, W = d(
|
|
3900
3904
|
"relative overflow-hidden bg-surface-hover",
|
|
3901
3905
|
// Size variants
|
|
@@ -3923,7 +3927,7 @@ const xn = ({
|
|
|
3923
3927
|
"rounded-xl": a === "xl",
|
|
3924
3928
|
"rounded-full": a === "full"
|
|
3925
3929
|
},
|
|
3926
|
-
|
|
3930
|
+
h
|
|
3927
3931
|
), j = d(
|
|
3928
3932
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3929
3933
|
{
|
|
@@ -3941,15 +3945,15 @@ const xn = ({
|
|
|
3941
3945
|
/* @__PURE__ */ e(
|
|
3942
3946
|
"img",
|
|
3943
3947
|
{
|
|
3944
|
-
...
|
|
3945
|
-
src:
|
|
3948
|
+
...p,
|
|
3949
|
+
src: A,
|
|
3946
3950
|
alt: r,
|
|
3947
3951
|
className: j,
|
|
3948
3952
|
onLoad: $,
|
|
3949
3953
|
onError: X
|
|
3950
3954
|
}
|
|
3951
3955
|
),
|
|
3952
|
-
w && o && /* @__PURE__ */ e("div", { className: q, children:
|
|
3956
|
+
w && o && /* @__PURE__ */ e("div", { className: q, children: m || K }),
|
|
3953
3957
|
b && l && /* @__PURE__ */ e("div", { className: q, children: y || re })
|
|
3954
3958
|
] });
|
|
3955
3959
|
};
|
|
@@ -3962,17 +3966,17 @@ function bn({
|
|
|
3962
3966
|
trailing: o,
|
|
3963
3967
|
onSelect: l,
|
|
3964
3968
|
onActiveIndexChange: u,
|
|
3965
|
-
isActive:
|
|
3969
|
+
isActive: m,
|
|
3966
3970
|
unread: y,
|
|
3967
|
-
dimmed:
|
|
3968
|
-
groupBy:
|
|
3969
|
-
groups:
|
|
3970
|
-
renderGroupHeader:
|
|
3971
|
+
dimmed: h,
|
|
3972
|
+
groupBy: f,
|
|
3973
|
+
groups: x,
|
|
3974
|
+
renderGroupHeader: p,
|
|
3971
3975
|
stickyGroupHeaders: w = !1,
|
|
3972
|
-
collapsibleGroups:
|
|
3976
|
+
collapsibleGroups: g = !1,
|
|
3973
3977
|
hideGroupCount: b = !1,
|
|
3974
3978
|
selectable: L = !1,
|
|
3975
|
-
selectedItems:
|
|
3979
|
+
selectedItems: A = [],
|
|
3976
3980
|
onSelectionChange: _,
|
|
3977
3981
|
bulkActions: $,
|
|
3978
3982
|
header: X,
|
|
@@ -3986,7 +3990,7 @@ function bn({
|
|
|
3986
3990
|
}) {
|
|
3987
3991
|
const [C, i] = oe.useState(
|
|
3988
3992
|
() => Object.fromEntries(
|
|
3989
|
-
(
|
|
3993
|
+
(x ?? []).filter((z) => z.defaultCollapsed).map((z) => [z.id, !0])
|
|
3990
3994
|
)
|
|
3991
3995
|
), S = oe.useRef(null), N = (z) => {
|
|
3992
3996
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(z.key)) return;
|
|
@@ -3997,9 +4001,9 @@ function bn({
|
|
|
3997
4001
|
z.preventDefault();
|
|
3998
4002
|
const H = B.indexOf(document.activeElement), M = z.key === "Home" ? 0 : z.key === "End" ? B.length - 1 : z.key === "ArrowDown" ? (H + 1) % B.length : (H - 1 + B.length) % B.length;
|
|
3999
4003
|
B[M]?.focus();
|
|
4000
|
-
},
|
|
4004
|
+
}, T = (z, V) => r ? r(z, V) : V, k = (z) => A.includes(z), ee = (z, V) => {
|
|
4001
4005
|
_ && _(
|
|
4002
|
-
V ? [...
|
|
4006
|
+
V ? [...A, z] : A.filter((B) => B !== z)
|
|
4003
4007
|
);
|
|
4004
4008
|
}, ae = (z) => _?.(z ? [...t] : []), le = d(
|
|
4005
4009
|
"flex flex-col",
|
|
@@ -4025,8 +4029,8 @@ function bn({
|
|
|
4025
4029
|
)) });
|
|
4026
4030
|
if (t.length === 0 && q)
|
|
4027
4031
|
return /* @__PURE__ */ e("div", { className: le, children: q });
|
|
4028
|
-
const G = t.length > 0 &&
|
|
4029
|
-
const H =
|
|
4032
|
+
const G = t.length > 0 && A.length === t.length, P = A.length > 0 && !G, E = (z, V, B) => {
|
|
4033
|
+
const H = m?.(z, V) ?? !1, M = y?.(z, V) ?? !1, I = h?.(z, V) ?? !1, te = L && k(z);
|
|
4030
4034
|
return /* @__PURE__ */ c(
|
|
4031
4035
|
"li",
|
|
4032
4036
|
{
|
|
@@ -4052,7 +4056,7 @@ function bn({
|
|
|
4052
4056
|
),
|
|
4053
4057
|
children: [
|
|
4054
4058
|
L && /* @__PURE__ */ e("span", { onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4055
|
-
|
|
4059
|
+
pe,
|
|
4056
4060
|
{
|
|
4057
4061
|
checked: k(z),
|
|
4058
4062
|
onChange: (v) => ee(z, v.target.checked),
|
|
@@ -4071,25 +4075,25 @@ function bn({
|
|
|
4071
4075
|
o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z, V) })
|
|
4072
4076
|
]
|
|
4073
4077
|
},
|
|
4074
|
-
|
|
4078
|
+
T(z, V)
|
|
4075
4079
|
);
|
|
4076
4080
|
}, D = (() => {
|
|
4077
|
-
if (!
|
|
4081
|
+
if (!f)
|
|
4078
4082
|
return t.map((H, M) => E(H, M, M === 0));
|
|
4079
4083
|
const z = /* @__PURE__ */ new Map();
|
|
4080
4084
|
t.forEach((H, M) => {
|
|
4081
|
-
const I =
|
|
4085
|
+
const I = f(H, M);
|
|
4082
4086
|
z.has(I) || z.set(I, []), z.get(I).push({ item: H, index: M });
|
|
4083
4087
|
});
|
|
4084
|
-
const V =
|
|
4088
|
+
const V = x ?? [];
|
|
4085
4089
|
return [
|
|
4086
4090
|
...V.filter((H) => z.has(H.id)),
|
|
4087
4091
|
...[...z.keys()].filter((H) => !V.some((M) => M.id === H)).map((H) => ({ id: H }))
|
|
4088
4092
|
].flatMap((H, M) => {
|
|
4089
|
-
const I = z.get(H.id) ?? [], te =
|
|
4093
|
+
const I = z.get(H.id) ?? [], te = g && C[H.id], v = H.title ?? H.id, U = H.count ?? I.length, Z = /* @__PURE__ */ e(
|
|
4090
4094
|
"li",
|
|
4091
4095
|
{
|
|
4092
|
-
onClick:
|
|
4096
|
+
onClick: g ? () => i((J) => ({ ...J, [H.id]: !J[H.id] })) : void 0,
|
|
4093
4097
|
className: d(
|
|
4094
4098
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4095
4099
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4097,12 +4101,12 @@ function bn({
|
|
|
4097
4101
|
M > 0 && "border-t",
|
|
4098
4102
|
"border-b",
|
|
4099
4103
|
w && "sticky z-10",
|
|
4100
|
-
|
|
4104
|
+
g && "cursor-pointer select-none hover:text-text"
|
|
4101
4105
|
),
|
|
4102
|
-
"aria-expanded":
|
|
4106
|
+
"aria-expanded": g ? !te : void 0,
|
|
4103
4107
|
style: w ? { top: W ? 28 : 0 } : void 0,
|
|
4104
|
-
children:
|
|
4105
|
-
|
|
4108
|
+
children: p ? p(H, I.map((J) => J.item)) : /* @__PURE__ */ c(xe, { children: [
|
|
4109
|
+
g && /* @__PURE__ */ e(
|
|
4106
4110
|
Ce,
|
|
4107
4111
|
{
|
|
4108
4112
|
"aria-hidden": !0,
|
|
@@ -4127,9 +4131,9 @@ function bn({
|
|
|
4127
4131
|
});
|
|
4128
4132
|
})();
|
|
4129
4133
|
return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? N : void 0, children: [
|
|
4130
|
-
L &&
|
|
4134
|
+
L && A.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4131
4135
|
/* @__PURE__ */ e(
|
|
4132
|
-
|
|
4136
|
+
pe,
|
|
4133
4137
|
{
|
|
4134
4138
|
checked: G,
|
|
4135
4139
|
indeterminate: P,
|
|
@@ -4138,7 +4142,7 @@ function bn({
|
|
|
4138
4142
|
}
|
|
4139
4143
|
),
|
|
4140
4144
|
/* @__PURE__ */ c("span", { className: "text-xs text-text-subtle", children: [
|
|
4141
|
-
|
|
4145
|
+
A.length,
|
|
4142
4146
|
" geselecteerd"
|
|
4143
4147
|
] }),
|
|
4144
4148
|
$ && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: $ })
|
|
@@ -4157,7 +4161,7 @@ function bn({
|
|
|
4157
4161
|
/* @__PURE__ */ e("ul", { "aria-label": ce, className: "flex flex-col", children: D })
|
|
4158
4162
|
] });
|
|
4159
4163
|
}
|
|
4160
|
-
function
|
|
4164
|
+
function pn({
|
|
4161
4165
|
side: t,
|
|
4162
4166
|
continued: r = !1,
|
|
4163
4167
|
tone: n = "default",
|
|
@@ -4192,7 +4196,7 @@ const Er = {
|
|
|
4192
4196
|
urgent: "text-danger-fg",
|
|
4193
4197
|
success: "text-success-fg"
|
|
4194
4198
|
};
|
|
4195
|
-
function
|
|
4199
|
+
function gn({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4196
4200
|
return /* @__PURE__ */ c("div", { className: d("rounded-xl shadow-sm bg-surface px-4 py-3.5", s), ...a, children: [
|
|
4197
4201
|
/* @__PURE__ */ e("div", { className: d("text-2xl font-semibold", Er[n]), children: t }),
|
|
4198
4202
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
@@ -4207,23 +4211,23 @@ const vn = ({
|
|
|
4207
4211
|
children: o,
|
|
4208
4212
|
className: l,
|
|
4209
4213
|
backLabel: u = "Back",
|
|
4210
|
-
backClassName:
|
|
4214
|
+
backClassName: m,
|
|
4211
4215
|
onBack: y,
|
|
4212
|
-
editable:
|
|
4213
|
-
onTitleChange:
|
|
4216
|
+
editable: h = !1,
|
|
4217
|
+
onTitleChange: f
|
|
4214
4218
|
}) => {
|
|
4215
|
-
const [
|
|
4219
|
+
const [x, p] = R(!1), [w, g] = R(r), b = se(null);
|
|
4216
4220
|
Q(() => {
|
|
4217
|
-
|
|
4221
|
+
g(r);
|
|
4218
4222
|
}, [r]), Q(() => {
|
|
4219
|
-
|
|
4220
|
-
}, [
|
|
4223
|
+
x && b.current && (b.current.focus(), b.current.select());
|
|
4224
|
+
}, [x]);
|
|
4221
4225
|
const L = () => {
|
|
4222
|
-
|
|
4223
|
-
},
|
|
4224
|
-
|
|
4226
|
+
h && p(!0);
|
|
4227
|
+
}, A = () => {
|
|
4228
|
+
p(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : g(r);
|
|
4225
4229
|
}, _ = ($) => {
|
|
4226
|
-
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (
|
|
4230
|
+
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (g(r), p(!1));
|
|
4227
4231
|
};
|
|
4228
4232
|
return /* @__PURE__ */ c(
|
|
4229
4233
|
"div",
|
|
@@ -4239,14 +4243,14 @@ const vn = ({
|
|
|
4239
4243
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
4240
4244
|
y && /* @__PURE__ */ e(ne, { variant: "outline", onClick: y, leftIcon: /* @__PURE__ */ e(Y, { icon: ke, size: "sm" }), iconOnly: !0 }),
|
|
4241
4245
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
4242
|
-
|
|
4246
|
+
x ? /* @__PURE__ */ e(
|
|
4243
4247
|
"input",
|
|
4244
4248
|
{
|
|
4245
4249
|
ref: b,
|
|
4246
4250
|
type: "text",
|
|
4247
4251
|
value: w,
|
|
4248
|
-
onChange: ($) =>
|
|
4249
|
-
onBlur:
|
|
4252
|
+
onChange: ($) => g($.target.value),
|
|
4253
|
+
onBlur: A,
|
|
4250
4254
|
onKeyDown: _,
|
|
4251
4255
|
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"
|
|
4252
4256
|
}
|
|
@@ -4257,14 +4261,14 @@ const vn = ({
|
|
|
4257
4261
|
onClick: L,
|
|
4258
4262
|
className: d(
|
|
4259
4263
|
"text-xl font-semibold truncate",
|
|
4260
|
-
|
|
4264
|
+
h && "cursor-pointer"
|
|
4261
4265
|
),
|
|
4262
|
-
title:
|
|
4266
|
+
title: h ? "Click to edit" : void 0,
|
|
4263
4267
|
children: r
|
|
4264
4268
|
}
|
|
4265
4269
|
),
|
|
4266
4270
|
n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
|
|
4267
|
-
|
|
4271
|
+
h && /* @__PURE__ */ e(
|
|
4268
4272
|
ut,
|
|
4269
4273
|
{
|
|
4270
4274
|
size: 15,
|
|
@@ -4436,27 +4440,27 @@ const Sn = ({
|
|
|
4436
4440
|
size: n = "md",
|
|
4437
4441
|
className: s
|
|
4438
4442
|
}) => {
|
|
4439
|
-
const a = (
|
|
4440
|
-
if (!
|
|
4443
|
+
const a = (h) => {
|
|
4444
|
+
if (!h) return "-";
|
|
4441
4445
|
try {
|
|
4442
|
-
return new Date(
|
|
4446
|
+
return new Date(h).toLocaleDateString("nl-NL", {
|
|
4443
4447
|
year: "numeric",
|
|
4444
4448
|
month: "long",
|
|
4445
4449
|
day: "numeric"
|
|
4446
4450
|
});
|
|
4447
4451
|
} catch {
|
|
4448
|
-
return String(
|
|
4452
|
+
return String(h);
|
|
4449
4453
|
}
|
|
4450
|
-
}, o = (
|
|
4451
|
-
if (!
|
|
4452
|
-
const
|
|
4453
|
-
return
|
|
4454
|
+
}, o = (h) => h ? "Ja" : "Nee", l = (h, f) => {
|
|
4455
|
+
if (!f) return String(h || "-");
|
|
4456
|
+
const x = f.find((p) => p.value === h);
|
|
4457
|
+
return x ? x.label : String(h || "-");
|
|
4454
4458
|
}, u = ue(
|
|
4455
|
-
(
|
|
4456
|
-
const
|
|
4457
|
-
if (
|
|
4458
|
-
const
|
|
4459
|
-
return !
|
|
4459
|
+
(h) => {
|
|
4460
|
+
const f = $r(r, h.name);
|
|
4461
|
+
if (h.type === "array") {
|
|
4462
|
+
const p = f;
|
|
4463
|
+
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
4460
4464
|
de,
|
|
4461
4465
|
{
|
|
4462
4466
|
variant: "body",
|
|
@@ -4464,7 +4468,7 @@ const Sn = ({
|
|
|
4464
4468
|
className: "text-text-muted",
|
|
4465
4469
|
children: "Geen items"
|
|
4466
4470
|
}
|
|
4467
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
4471
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((w, g) => /* @__PURE__ */ c(
|
|
4468
4472
|
"div",
|
|
4469
4473
|
{
|
|
4470
4474
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4477,15 +4481,15 @@ const Sn = ({
|
|
|
4477
4481
|
weight: "medium",
|
|
4478
4482
|
className: "text-text-muted",
|
|
4479
4483
|
children: [
|
|
4480
|
-
|
|
4484
|
+
h.label,
|
|
4481
4485
|
" ",
|
|
4482
|
-
|
|
4486
|
+
g + 1
|
|
4483
4487
|
]
|
|
4484
4488
|
}
|
|
4485
4489
|
) }),
|
|
4486
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
4490
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((b) => {
|
|
4487
4491
|
const L = w?.[b.name];
|
|
4488
|
-
let
|
|
4492
|
+
let A = "-";
|
|
4489
4493
|
switch (b.type) {
|
|
4490
4494
|
case "text":
|
|
4491
4495
|
case "email":
|
|
@@ -4493,30 +4497,30 @@ const Sn = ({
|
|
|
4493
4497
|
case "tel":
|
|
4494
4498
|
case "url":
|
|
4495
4499
|
case "textarea":
|
|
4496
|
-
|
|
4500
|
+
A = L || "-";
|
|
4497
4501
|
break;
|
|
4498
4502
|
case "select":
|
|
4499
4503
|
case "radio":
|
|
4500
|
-
|
|
4504
|
+
A = l(
|
|
4501
4505
|
L,
|
|
4502
4506
|
b.options
|
|
4503
4507
|
);
|
|
4504
4508
|
break;
|
|
4505
4509
|
case "checkbox":
|
|
4506
|
-
|
|
4510
|
+
A = o(L);
|
|
4507
4511
|
break;
|
|
4508
4512
|
case "date":
|
|
4509
|
-
|
|
4513
|
+
A = a(L);
|
|
4510
4514
|
break;
|
|
4511
4515
|
case "custom":
|
|
4512
|
-
|
|
4516
|
+
A = b.customComponent?.({
|
|
4513
4517
|
value: L
|
|
4514
4518
|
});
|
|
4515
4519
|
break;
|
|
4516
4520
|
default:
|
|
4517
|
-
|
|
4521
|
+
A = String(L || "-");
|
|
4518
4522
|
}
|
|
4519
|
-
return b.format && (
|
|
4523
|
+
return b.format && (A = b.format(L, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
4520
4524
|
/* @__PURE__ */ e(
|
|
4521
4525
|
de,
|
|
4522
4526
|
{
|
|
@@ -4532,55 +4536,55 @@ const Sn = ({
|
|
|
4532
4536
|
variant: "body",
|
|
4533
4537
|
size: "sm",
|
|
4534
4538
|
className: "text-text",
|
|
4535
|
-
children:
|
|
4539
|
+
children: A
|
|
4536
4540
|
}
|
|
4537
4541
|
)
|
|
4538
4542
|
] }, b.name);
|
|
4539
4543
|
}) })
|
|
4540
4544
|
]
|
|
4541
4545
|
},
|
|
4542
|
-
|
|
4546
|
+
g
|
|
4543
4547
|
)) });
|
|
4544
4548
|
}
|
|
4545
|
-
if (
|
|
4546
|
-
return
|
|
4547
|
-
if (
|
|
4548
|
-
const
|
|
4549
|
+
if (h.type === "custom" && h.customComponent)
|
|
4550
|
+
return h.customComponent({ value: f });
|
|
4551
|
+
if (h.format) {
|
|
4552
|
+
const p = h.format(f, r);
|
|
4549
4553
|
return /* @__PURE__ */ e(
|
|
4550
4554
|
de,
|
|
4551
4555
|
{
|
|
4552
4556
|
variant: "body",
|
|
4553
4557
|
size: "sm",
|
|
4554
4558
|
className: "text-text",
|
|
4555
|
-
children:
|
|
4559
|
+
children: p
|
|
4556
4560
|
}
|
|
4557
4561
|
);
|
|
4558
4562
|
}
|
|
4559
|
-
let
|
|
4560
|
-
switch (
|
|
4563
|
+
let x = "-";
|
|
4564
|
+
switch (h.type) {
|
|
4561
4565
|
case "text":
|
|
4562
4566
|
case "email":
|
|
4563
4567
|
case "password":
|
|
4564
4568
|
case "number":
|
|
4565
4569
|
case "tel":
|
|
4566
4570
|
case "url":
|
|
4567
|
-
|
|
4571
|
+
x = f ? String(f) : "-";
|
|
4568
4572
|
break;
|
|
4569
4573
|
case "textarea":
|
|
4570
|
-
|
|
4574
|
+
x = f ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(f || "-") }) : "-";
|
|
4571
4575
|
break;
|
|
4572
4576
|
case "select":
|
|
4573
4577
|
case "radio":
|
|
4574
|
-
|
|
4578
|
+
x = l(f, h.options);
|
|
4575
4579
|
break;
|
|
4576
4580
|
case "checkbox":
|
|
4577
|
-
|
|
4581
|
+
x = o(f);
|
|
4578
4582
|
break;
|
|
4579
4583
|
case "date":
|
|
4580
|
-
|
|
4584
|
+
x = a(f);
|
|
4581
4585
|
break;
|
|
4582
4586
|
default:
|
|
4583
|
-
|
|
4587
|
+
x = f ? String(f) : "-";
|
|
4584
4588
|
}
|
|
4585
4589
|
return /* @__PURE__ */ e(
|
|
4586
4590
|
de,
|
|
@@ -4588,30 +4592,30 @@ const Sn = ({
|
|
|
4588
4592
|
variant: "body",
|
|
4589
4593
|
size: "sm",
|
|
4590
4594
|
className: "text-text",
|
|
4591
|
-
children:
|
|
4595
|
+
children: x
|
|
4592
4596
|
}
|
|
4593
4597
|
);
|
|
4594
4598
|
},
|
|
4595
4599
|
[r]
|
|
4596
|
-
),
|
|
4597
|
-
(
|
|
4598
|
-
if (
|
|
4600
|
+
), m = ue(
|
|
4601
|
+
(h) => {
|
|
4602
|
+
if (h.conditional && !h.conditional(r))
|
|
4599
4603
|
return null;
|
|
4600
|
-
const
|
|
4601
|
-
if (
|
|
4602
|
-
const
|
|
4604
|
+
const f = h.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
|
|
4605
|
+
if (f.length === 0) return null;
|
|
4606
|
+
const x = d(
|
|
4603
4607
|
"space-y-4",
|
|
4604
4608
|
{
|
|
4605
|
-
"grid gap-4":
|
|
4606
|
-
"flex flex-wrap gap-4":
|
|
4609
|
+
"grid gap-4": h.layout === "grid",
|
|
4610
|
+
"flex flex-wrap gap-4": h.layout === "flex"
|
|
4607
4611
|
},
|
|
4608
|
-
|
|
4609
|
-
"grid-cols-1": !
|
|
4610
|
-
"grid-cols-2":
|
|
4611
|
-
"grid-cols-3":
|
|
4612
|
-
"grid-cols-4":
|
|
4612
|
+
h.layout === "grid" && {
|
|
4613
|
+
"grid-cols-1": !h.columns || h.columns === 1,
|
|
4614
|
+
"grid-cols-2": h.columns === 2,
|
|
4615
|
+
"grid-cols-3": h.columns === 3,
|
|
4616
|
+
"grid-cols-4": h.columns === 4
|
|
4613
4617
|
},
|
|
4614
|
-
|
|
4618
|
+
h.className
|
|
4615
4619
|
);
|
|
4616
4620
|
return /* @__PURE__ */ c(
|
|
4617
4621
|
"div",
|
|
@@ -4626,45 +4630,45 @@ const Sn = ({
|
|
|
4626
4630
|
size: "lg",
|
|
4627
4631
|
weight: "semibold",
|
|
4628
4632
|
className: "text-text",
|
|
4629
|
-
children:
|
|
4633
|
+
children: h.title
|
|
4630
4634
|
}
|
|
4631
4635
|
),
|
|
4632
|
-
|
|
4636
|
+
h.description && /* @__PURE__ */ e(
|
|
4633
4637
|
de,
|
|
4634
4638
|
{
|
|
4635
4639
|
variant: "body",
|
|
4636
4640
|
size: "sm",
|
|
4637
4641
|
className: "text-text-muted mt-1",
|
|
4638
|
-
children:
|
|
4642
|
+
children: h.description
|
|
4639
4643
|
}
|
|
4640
4644
|
)
|
|
4641
4645
|
] }),
|
|
4642
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4646
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: x, children: f.map((p) => /* @__PURE__ */ c(
|
|
4643
4647
|
"div",
|
|
4644
4648
|
{
|
|
4645
4649
|
className: "space-y-1",
|
|
4646
4650
|
style: {
|
|
4647
|
-
width: typeof
|
|
4648
|
-
gridColumn: typeof
|
|
4651
|
+
width: typeof p.width == "string" ? p.width : void 0,
|
|
4652
|
+
gridColumn: typeof p.width == "number" ? `span ${p.width} / span ${p.width}` : void 0
|
|
4649
4653
|
},
|
|
4650
4654
|
children: [
|
|
4651
|
-
|
|
4655
|
+
p.type !== "custom" && /* @__PURE__ */ e(
|
|
4652
4656
|
de,
|
|
4653
4657
|
{
|
|
4654
4658
|
variant: "label",
|
|
4655
4659
|
size: "sm",
|
|
4656
4660
|
className: "font-medium text-text-muted",
|
|
4657
|
-
children:
|
|
4661
|
+
children: p.label
|
|
4658
4662
|
}
|
|
4659
4663
|
),
|
|
4660
|
-
u(
|
|
4664
|
+
u(p)
|
|
4661
4665
|
]
|
|
4662
4666
|
},
|
|
4663
|
-
|
|
4667
|
+
p.name
|
|
4664
4668
|
)) }) })
|
|
4665
4669
|
]
|
|
4666
4670
|
},
|
|
4667
|
-
|
|
4671
|
+
h.id
|
|
4668
4672
|
);
|
|
4669
4673
|
},
|
|
4670
4674
|
[r, u]
|
|
@@ -4678,43 +4682,46 @@ const Sn = ({
|
|
|
4678
4682
|
},
|
|
4679
4683
|
s
|
|
4680
4684
|
);
|
|
4681
|
-
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
4685
|
+
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(m) }) });
|
|
4682
4686
|
}, qe = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
|
|
4683
4687
|
const a = !!(t.children && t.children.length > 0), o = r ? r(t.path) : !1;
|
|
4684
|
-
|
|
4685
|
-
/* @__PURE__ */ c(
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4688
|
+
if (a)
|
|
4689
|
+
return /* @__PURE__ */ c("li", { children: [
|
|
4690
|
+
/* @__PURE__ */ c(
|
|
4691
|
+
"div",
|
|
4692
|
+
{
|
|
4693
|
+
className: d(
|
|
4694
|
+
"flex items-center gap-2 px-2 pt-4 pb-1 text-xs font-semibold uppercase tracking-label text-text-subtle"
|
|
4695
|
+
),
|
|
4696
|
+
children: [
|
|
4697
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: t.label }),
|
|
4698
|
+
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "font-normal tabular-nums", children: t.count })
|
|
4699
|
+
]
|
|
4700
|
+
}
|
|
4701
|
+
),
|
|
4702
|
+
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((m, y) => /* @__PURE__ */ e(
|
|
4703
|
+
qe,
|
|
4704
|
+
{
|
|
4705
|
+
item: m,
|
|
4706
|
+
isSelectedHandler: r,
|
|
4707
|
+
onClick: n,
|
|
4708
|
+
depth: s + 1
|
|
4709
|
+
},
|
|
4710
|
+
y
|
|
4711
|
+
)) })
|
|
4712
|
+
] });
|
|
4713
|
+
const l = t.action, u = l?.visibility !== "always";
|
|
4714
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
4708
4715
|
"div",
|
|
4709
4716
|
{
|
|
4710
4717
|
role: "button",
|
|
4711
4718
|
tabIndex: 0,
|
|
4712
4719
|
onClick: () => t.path && n?.(t.path),
|
|
4713
|
-
onKeyDown: (
|
|
4714
|
-
(
|
|
4720
|
+
onKeyDown: (m) => {
|
|
4721
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), t.path && n?.(t.path));
|
|
4715
4722
|
},
|
|
4716
4723
|
className: d(
|
|
4717
|
-
"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4724
|
+
"group/item flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4718
4725
|
"transition-colors duration-fast ease-out",
|
|
4719
4726
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
4720
4727
|
o ? "bg-accent-soft font-semibold text-accent" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
@@ -4727,10 +4734,31 @@ const Sn = ({
|
|
|
4727
4734
|
{
|
|
4728
4735
|
className: d(
|
|
4729
4736
|
"shrink-0 text-xs tabular-nums",
|
|
4730
|
-
o ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle"
|
|
4737
|
+
o ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle",
|
|
4738
|
+
l && u && "group-hover/item:hidden group-focus-within/item:hidden"
|
|
4731
4739
|
),
|
|
4732
4740
|
children: t.count
|
|
4733
4741
|
}
|
|
4742
|
+
),
|
|
4743
|
+
l && /* @__PURE__ */ e(
|
|
4744
|
+
"button",
|
|
4745
|
+
{
|
|
4746
|
+
type: "button",
|
|
4747
|
+
"aria-label": l.label,
|
|
4748
|
+
title: l.label,
|
|
4749
|
+
onClick: (m) => {
|
|
4750
|
+
m.stopPropagation(), l.onClick();
|
|
4751
|
+
},
|
|
4752
|
+
onKeyDown: (m) => m.stopPropagation(),
|
|
4753
|
+
className: d(
|
|
4754
|
+
"flex size-5 shrink-0 items-center justify-center rounded",
|
|
4755
|
+
"text-text-subtle transition-colors duration-fast ease-out",
|
|
4756
|
+
"hover:bg-surface-hover hover:text-text",
|
|
4757
|
+
"focus-visible:outline-none focus-visible:focus-ring",
|
|
4758
|
+
u && "opacity-0 group-hover/item:opacity-100 focus-visible:opacity-100"
|
|
4759
|
+
),
|
|
4760
|
+
children: l.icon
|
|
4761
|
+
}
|
|
4734
4762
|
)
|
|
4735
4763
|
]
|
|
4736
4764
|
}
|
|
@@ -4808,9 +4836,9 @@ const Sn = ({
|
|
|
4808
4836
|
truncate: o = !1,
|
|
4809
4837
|
className: l,
|
|
4810
4838
|
children: u,
|
|
4811
|
-
...
|
|
4839
|
+
...m
|
|
4812
4840
|
}) => {
|
|
4813
|
-
const y = `h${t}`,
|
|
4841
|
+
const y = `h${t}`, h = d(
|
|
4814
4842
|
"font-sans text-pretty",
|
|
4815
4843
|
Dr[r || Ir(t)],
|
|
4816
4844
|
Tr[n],
|
|
@@ -4819,7 +4847,7 @@ const Sn = ({
|
|
|
4819
4847
|
o && "truncate",
|
|
4820
4848
|
l
|
|
4821
4849
|
);
|
|
4822
|
-
return /* @__PURE__ */ e(y, { className:
|
|
4850
|
+
return /* @__PURE__ */ e(y, { className: h, ...m, children: u });
|
|
4823
4851
|
};
|
|
4824
4852
|
function Ir(t) {
|
|
4825
4853
|
return {
|
|
@@ -4839,44 +4867,44 @@ const Mn = ({
|
|
|
4839
4867
|
initialCommandPath: a,
|
|
4840
4868
|
initialActiveIndex: o
|
|
4841
4869
|
}) => {
|
|
4842
|
-
const [l, u] = R(""), [
|
|
4870
|
+
const [l, u] = R(""), [m, y] = R(a || []), [h, f] = R(o || 0), x = se(null), p = se(null), g = (m.length ? t.find((b) => b.id === m[0])?.subCommands || [] : t).filter(
|
|
4843
4871
|
(b) => b.label.toLowerCase().includes(l.toLowerCase())
|
|
4844
4872
|
);
|
|
4845
4873
|
return Q(() => {
|
|
4846
|
-
r || (u(""), y(a || []),
|
|
4874
|
+
r || (u(""), y(a || []), f(o || 0));
|
|
4847
4875
|
}, [r]), Q(() => {
|
|
4848
4876
|
const b = (L) => {
|
|
4849
4877
|
if (r) {
|
|
4850
4878
|
if (L.key === "Escape")
|
|
4851
4879
|
n();
|
|
4852
4880
|
else if (L.key === "ArrowUp")
|
|
4853
|
-
|
|
4854
|
-
(
|
|
4881
|
+
f(
|
|
4882
|
+
(A) => A > 0 ? A - 1 : g.length - 1
|
|
4855
4883
|
);
|
|
4856
4884
|
else if (L.key === "ArrowDown")
|
|
4857
|
-
|
|
4858
|
-
(
|
|
4885
|
+
f(
|
|
4886
|
+
(A) => A < g.length - 1 ? A + 1 : 0
|
|
4859
4887
|
);
|
|
4860
4888
|
else if (L.key === "Enter") {
|
|
4861
|
-
const
|
|
4862
|
-
|
|
4889
|
+
const A = g[h];
|
|
4890
|
+
A && (A.subCommands ? (y([...m, A.id]), f(0)) : A.action && (A.action(), n()));
|
|
4863
4891
|
}
|
|
4864
4892
|
}
|
|
4865
4893
|
};
|
|
4866
4894
|
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
4867
|
-
}, [r, n,
|
|
4895
|
+
}, [r, n, g, h, m]), Q(() => {
|
|
4868
4896
|
const b = (L) => {
|
|
4869
|
-
|
|
4897
|
+
x.current && !x.current.contains(L.target) && n();
|
|
4870
4898
|
};
|
|
4871
4899
|
return r && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
4872
4900
|
}, [r, n]), Q(() => {
|
|
4873
4901
|
if (!r) return;
|
|
4874
|
-
|
|
4875
|
-
}, [
|
|
4902
|
+
p.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4903
|
+
}, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
|
|
4876
4904
|
"div",
|
|
4877
4905
|
{
|
|
4878
4906
|
className: "flex flex-col w-full max-w-lg max-h-dialog p-2 mx-auto rounded-lg border border-border shadow-modal bg-surface",
|
|
4879
|
-
ref:
|
|
4907
|
+
ref: x,
|
|
4880
4908
|
children: [
|
|
4881
4909
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4882
4910
|
/* @__PURE__ */ e(Se, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
@@ -4895,19 +4923,19 @@ const Mn = ({
|
|
|
4895
4923
|
/* @__PURE__ */ c(
|
|
4896
4924
|
"div",
|
|
4897
4925
|
{
|
|
4898
|
-
ref:
|
|
4926
|
+
ref: p,
|
|
4899
4927
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4900
4928
|
children: [
|
|
4901
|
-
|
|
4902
|
-
|
|
4929
|
+
g.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4930
|
+
g.map((b, L) => /* @__PURE__ */ c(
|
|
4903
4931
|
"div",
|
|
4904
4932
|
{
|
|
4905
4933
|
"data-index": L,
|
|
4906
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${L ===
|
|
4934
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${L === h ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4907
4935
|
onClick: () => {
|
|
4908
|
-
b.subCommands ? (y([...
|
|
4936
|
+
b.subCommands ? (y([...m, b.id]), f(0)) : b.action && (b.action(), n());
|
|
4909
4937
|
},
|
|
4910
|
-
onMouseEnter: () =>
|
|
4938
|
+
onMouseEnter: () => f(L),
|
|
4911
4939
|
children: [
|
|
4912
4940
|
b.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: b.icon }),
|
|
4913
4941
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: b.label }),
|
|
@@ -5007,12 +5035,12 @@ const Mn = ({
|
|
|
5007
5035
|
border: o,
|
|
5008
5036
|
borderColor: l,
|
|
5009
5037
|
className: u,
|
|
5010
|
-
children:
|
|
5038
|
+
children: m,
|
|
5011
5039
|
...y
|
|
5012
|
-
},
|
|
5040
|
+
}, h) => /* @__PURE__ */ e(
|
|
5013
5041
|
"div",
|
|
5014
5042
|
{
|
|
5015
|
-
ref:
|
|
5043
|
+
ref: h,
|
|
5016
5044
|
className: d(
|
|
5017
5045
|
t && jr[t],
|
|
5018
5046
|
r && Pr[r],
|
|
@@ -5024,7 +5052,7 @@ const Mn = ({
|
|
|
5024
5052
|
u
|
|
5025
5053
|
),
|
|
5026
5054
|
...y,
|
|
5027
|
-
children:
|
|
5055
|
+
children: m
|
|
5028
5056
|
}
|
|
5029
5057
|
)
|
|
5030
5058
|
);
|
|
@@ -5052,41 +5080,41 @@ function Dn({
|
|
|
5052
5080
|
componentProps: a,
|
|
5053
5081
|
className: o
|
|
5054
5082
|
}) {
|
|
5055
|
-
const l = se(null), [u,
|
|
5083
|
+
const l = se(null), [u, m] = R(!0), [y, h] = R(null), f = se(null);
|
|
5056
5084
|
return se(null), Q(() => {
|
|
5057
|
-
let
|
|
5085
|
+
let x = !0;
|
|
5058
5086
|
return (async () => {
|
|
5059
|
-
|
|
5087
|
+
m(!0);
|
|
5060
5088
|
try {
|
|
5061
5089
|
const w = await r();
|
|
5062
|
-
if (!
|
|
5063
|
-
const
|
|
5064
|
-
|
|
5090
|
+
if (!x) return;
|
|
5091
|
+
const g = w.component || w.default || w;
|
|
5092
|
+
h(n === "react" ? () => g : () => w);
|
|
5065
5093
|
} catch (w) {
|
|
5066
5094
|
console.error(`[FederatedResource] Load failed: ${t}`, w);
|
|
5067
5095
|
} finally {
|
|
5068
|
-
|
|
5096
|
+
x && m(!1);
|
|
5069
5097
|
}
|
|
5070
5098
|
})(), () => {
|
|
5071
|
-
|
|
5099
|
+
x = !1;
|
|
5072
5100
|
};
|
|
5073
5101
|
}, [t, r]), Q(() => {
|
|
5074
5102
|
if (u || !y || n === "react") return;
|
|
5075
|
-
const
|
|
5076
|
-
if (
|
|
5103
|
+
const x = l.current;
|
|
5104
|
+
if (x) {
|
|
5077
5105
|
if (n === "svelte") {
|
|
5078
|
-
const
|
|
5079
|
-
return
|
|
5106
|
+
const p = y.default || y, w = new p({ target: x, props: a || {} });
|
|
5107
|
+
return f.current = w, () => w.$destroy();
|
|
5080
5108
|
}
|
|
5081
5109
|
if (y.mount) {
|
|
5082
|
-
const
|
|
5110
|
+
const p = y.mount({ container: x, props: a || {} });
|
|
5083
5111
|
return () => {
|
|
5084
|
-
typeof
|
|
5112
|
+
typeof p == "function" ? p() : y.unmount?.(x);
|
|
5085
5113
|
};
|
|
5086
5114
|
}
|
|
5087
5115
|
}
|
|
5088
5116
|
}, [y, n, u]), Q(() => {
|
|
5089
|
-
n === "svelte" &&
|
|
5117
|
+
n === "svelte" && f.current && f.current.$set?.(a);
|
|
5090
5118
|
}, [a, n]), /* @__PURE__ */ c("div", { ref: l, className: o, style: { display: "contents" }, children: [
|
|
5091
5119
|
u && s,
|
|
5092
5120
|
n === "react" && y && /* @__PURE__ */ e(y, { ...a })
|
|
@@ -5130,7 +5158,7 @@ export {
|
|
|
5130
5158
|
Xr as ButtonGroup,
|
|
5131
5159
|
$n as Card,
|
|
5132
5160
|
hn as ChannelBadge,
|
|
5133
|
-
|
|
5161
|
+
pe as Checkbox,
|
|
5134
5162
|
Mn as CommandPalette,
|
|
5135
5163
|
nn as ConfirmDialog,
|
|
5136
5164
|
Ut as ContentLoading,
|
|
@@ -5146,11 +5174,11 @@ export {
|
|
|
5146
5174
|
Y as Icon,
|
|
5147
5175
|
xn as Image,
|
|
5148
5176
|
ln as Kbd,
|
|
5149
|
-
|
|
5177
|
+
gn as KpiCard,
|
|
5150
5178
|
Qr as Link,
|
|
5151
5179
|
bn as List,
|
|
5152
5180
|
Gr as MeetingGrid,
|
|
5153
|
-
|
|
5181
|
+
pn as MessageBubble,
|
|
5154
5182
|
Ue as Modal,
|
|
5155
5183
|
vn as PageHeader,
|
|
5156
5184
|
yn as PageToolbar,
|