@opencxh/ui-kit 3.124.10 → 3.125.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 +577 -553
- package/dist/index.js.map +1 -1
- 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);
|
|
@@ -74,7 +74,7 @@ const bt = {
|
|
|
74
74
|
secondary: "bg-gray-100 text-text hover:bg-surface-hover disabled:bg-surface-hover",
|
|
75
75
|
// No resting fill, so no disabled fill either — a greyed-out plate where
|
|
76
76
|
// there was nothing reads as a different control, not as a disabled one.
|
|
77
|
-
outline: "border border-border text-accent hover:bg-
|
|
77
|
+
outline: "border border-border text-accent hover:bg-surface-hover",
|
|
78
78
|
ghost: "text-text-muted hover:bg-surface-hover hover:text-text",
|
|
79
79
|
destructive: "border border-danger-border bg-danger-soft text-danger-fg hover:border-danger disabled:bg-surface-hover",
|
|
80
80
|
// Solid status fills. Reserved for a control whose colour IS the answer —
|
|
@@ -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,23 +636,23 @@ 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), T = 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
654
|
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"), A = i.getFullYear(), k = y === "dd/MM/yyyy" ? `${S}/${N}/${A}` : y === "yyyy-MM-dd" ? `${A}-${N}-${S}` : `${N}/${S}/${A}`;
|
|
655
|
-
return
|
|
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;
|
|
@@ -666,20 +666,20 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
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: T, 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(), A = t && i.toDateString() === t.toDateString(), k = i.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), ee = !N || u && i < u ||
|
|
763
|
+
const N = i.getMonth() === w.getMonth(), A = 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
|
{
|
|
@@ -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
|
...T
|
|
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);
|
|
@@ -871,16 +871,16 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
871
871
|
});
|
|
872
872
|
}, [l, w, N, S]);
|
|
873
873
|
const A = (E) => {
|
|
874
|
-
if (
|
|
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
|
-
A(z.value), K(""),
|
|
891
|
+
A(z.value), K(""), p || j(!1);
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
|
-
i((V) => [...V, z]), A(z.value), K(""),
|
|
895
|
-
}, P = () =>
|
|
894
|
+
i((V) => [...V, z]), A(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,7 +900,7 @@ 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
|
...T,
|
|
906
906
|
children: [
|
|
@@ -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,18 +983,18 @@ 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
|
{
|
|
@@ -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
|
...T
|
|
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,7 +1225,7 @@ 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
|
};
|
|
@@ -1235,9 +1235,9 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
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
|
}
|
|
@@ -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,9 +1466,9 @@ 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,
|
|
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), T = se(null), _ = ze(y, b, { placement: a }), $ = se(null), X = () => Array.from(
|
|
1472
1472
|
T.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1473
1473
|
);
|
|
1474
1474
|
Q(() => {
|
|
@@ -1484,22 +1484,22 @@ const qt = ({
|
|
|
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
|
|
@@ -1555,7 +1555,7 @@ const qt = ({
|
|
|
1555
1555
|
}
|
|
1556
1556
|
),
|
|
1557
1557
|
y && /* @__PURE__ */ e("div", { ref: T, className: ce, style: _, onKeyDown: W, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1558
|
-
|
|
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, A =
|
|
1568
|
+
const N = i.children && i.children.length > 0, A = f === i.value;
|
|
1569
1569
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1570
1570
|
/* @__PURE__ */ c(
|
|
1571
1571
|
"button",
|
|
@@ -1605,15 +1605,15 @@ const qt = ({
|
|
|
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) => {
|
|
@@ -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,14 +1742,14 @@ 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
1755
|
striped: T = !1,
|
|
@@ -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()) {
|
|
@@ -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",
|
|
@@ -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,7 +2154,7 @@ const qt = ({
|
|
|
2154
2154
|
"space-x-8": a === "default" || a === "underline"
|
|
2155
2155
|
},
|
|
2156
2156
|
l
|
|
2157
|
-
), w = (
|
|
2157
|
+
), w = (g, b) => {
|
|
2158
2158
|
const L = "transition-colors duration-fast font-medium", T = {
|
|
2159
2159
|
"text-xs px-2 py-1": o === "sm",
|
|
2160
2160
|
"text-sm px-3 py-2": o === "md",
|
|
@@ -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
2180
|
return d(L, T, _, $, 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), [T, _] = 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
|
-
}, [
|
|
2391
|
+
x && A();
|
|
2392
|
+
}, [x]), Q(() => {
|
|
2393
|
+
x && b && k();
|
|
2394
|
+
}, [x, b, T, q]);
|
|
2395
2395
|
const A = 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 {
|
|
@@ -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 {
|
|
@@ -2451,7 +2451,7 @@ const cr = ({
|
|
|
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);
|
|
@@ -2464,7 +2464,7 @@ const cr = ({
|
|
|
2464
2464
|
j(!0);
|
|
2465
2465
|
try {
|
|
2466
2466
|
const M = `${T}${i}/`;
|
|
2467
|
-
|
|
2467
|
+
f && (await f({
|
|
2468
2468
|
name: i,
|
|
2469
2469
|
type: "folder",
|
|
2470
2470
|
path: T,
|
|
@@ -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 {
|
|
@@ -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",
|
|
@@ -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,14 +2867,14 @@ 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
2879
|
const [b, L] = R(r || {}), [T, _] = R({}), [$, X] = R({});
|
|
2880
2880
|
Q(() => {
|
|
@@ -2930,7 +2930,7 @@ const rn = ({
|
|
|
2930
2930
|
[b, t, W, a]
|
|
2931
2931
|
), q = ue(
|
|
2932
2932
|
async (C) => {
|
|
2933
|
-
if (C.preventDefault(),
|
|
2933
|
+
if (C.preventDefault(), x) return;
|
|
2934
2934
|
const i = {}, S = t.flatMap((A) => A.items);
|
|
2935
2935
|
for (const A of S) {
|
|
2936
2936
|
if (A.hidden || A.conditional && !A.conditional(b))
|
|
@@ -2951,10 +2951,10 @@ const rn = ({
|
|
|
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] ? T[C.name] : void 0, N = C.disabled ||
|
|
2957
|
+
const i = Oe(b, C.name), S = $[C.name] ? T[C.name] : void 0, N = C.disabled || x, A = {
|
|
2958
2958
|
value: i || "",
|
|
2959
2959
|
disabled: N,
|
|
2960
2960
|
required: C.required,
|
|
@@ -2976,7 +2976,7 @@ const rn = ({
|
|
|
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":
|
|
@@ -2987,7 +2987,7 @@ const rn = ({
|
|
|
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":
|
|
@@ -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
|
...A,
|
|
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":
|
|
@@ -3048,7 +3048,7 @@ const rn = ({
|
|
|
3048
3048
|
...A,
|
|
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":
|
|
@@ -3059,25 +3059,25 @@ const rn = ({
|
|
|
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, $, T,
|
|
3331
|
+
[b, $, T, x, f, j]
|
|
3332
3332
|
), re = ue(
|
|
3333
3333
|
(C) => {
|
|
3334
3334
|
if (C.conditional && !C.conditional(b))
|
|
@@ -3384,13 +3384,13 @@ const rn = ({
|
|
|
3384
3384
|
), O = d(
|
|
3385
3385
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3386
3386
|
{
|
|
3387
|
-
"max-w-md":
|
|
3388
|
-
"max-w-2xl":
|
|
3389
|
-
"max-w-4xl":
|
|
3390
|
-
"max-w-full":
|
|
3387
|
+
"max-w-md": f === "sm",
|
|
3388
|
+
"max-w-2xl": f === "md",
|
|
3389
|
+
"max-w-4xl": f === "lg",
|
|
3390
|
+
"max-w-full": f === "full"
|
|
3391
3391
|
},
|
|
3392
|
-
|
|
3393
|
-
), ce =
|
|
3392
|
+
p
|
|
3393
|
+
), ce = f === "full" ? "md" : f;
|
|
3394
3394
|
return /* @__PURE__ */ c("form", { ref: w, onSubmit: q, className: O, children: [
|
|
3395
3395
|
!y && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3396
3396
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(re) }),
|
|
@@ -3400,12 +3400,12 @@ const rn = ({
|
|
|
3400
3400
|
ne,
|
|
3401
3401
|
{
|
|
3402
3402
|
type: "button",
|
|
3403
|
-
variant:
|
|
3404
|
-
size:
|
|
3405
|
-
disabled:
|
|
3403
|
+
variant: m.variant ?? "ghost",
|
|
3404
|
+
size: m.size || ce,
|
|
3405
|
+
disabled: m.disabled || x,
|
|
3406
3406
|
onClick: s,
|
|
3407
|
-
className:
|
|
3408
|
-
children:
|
|
3407
|
+
className: m.className,
|
|
3408
|
+
children: m.label
|
|
3409
3409
|
}
|
|
3410
3410
|
),
|
|
3411
3411
|
/* @__PURE__ */ e(
|
|
@@ -3414,8 +3414,8 @@ const rn = ({
|
|
|
3414
3414
|
type: "submit",
|
|
3415
3415
|
variant: u.variant,
|
|
3416
3416
|
size: u.size || ce,
|
|
3417
|
-
disabled: u.disabled ||
|
|
3418
|
-
loading:
|
|
3417
|
+
disabled: u.disabled || x,
|
|
3418
|
+
loading: x,
|
|
3419
3419
|
className: u.className,
|
|
3420
3420
|
children: u.label
|
|
3421
3421
|
}
|
|
@@ -3432,17 +3432,17 @@ function nn({
|
|
|
3432
3432
|
tone: o = "default",
|
|
3433
3433
|
loading: l = !1,
|
|
3434
3434
|
onConfirm: u,
|
|
3435
|
-
onCancel:
|
|
3435
|
+
onCancel: m
|
|
3436
3436
|
}) {
|
|
3437
3437
|
return /* @__PURE__ */ e(
|
|
3438
3438
|
Ue,
|
|
3439
3439
|
{
|
|
3440
3440
|
open: t,
|
|
3441
|
-
onClose:
|
|
3441
|
+
onClose: m,
|
|
3442
3442
|
title: r,
|
|
3443
3443
|
size: "sm",
|
|
3444
3444
|
footer: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3445
|
-
/* @__PURE__ */ e(ne, { variant: "ghost", onClick:
|
|
3445
|
+
/* @__PURE__ */ e(ne, { variant: "ghost", onClick: m, disabled: l, children: a }),
|
|
3446
3446
|
/* @__PURE__ */ e(
|
|
3447
3447
|
ne,
|
|
3448
3448
|
{
|
|
@@ -3490,7 +3490,7 @@ function sn({
|
|
|
3490
3490
|
onDismiss: o,
|
|
3491
3491
|
className: l,
|
|
3492
3492
|
children: u,
|
|
3493
|
-
...
|
|
3493
|
+
...m
|
|
3494
3494
|
}) {
|
|
3495
3495
|
return /* @__PURE__ */ c(
|
|
3496
3496
|
"span",
|
|
@@ -3504,7 +3504,7 @@ function sn({
|
|
|
3504
3504
|
fr[r],
|
|
3505
3505
|
l
|
|
3506
3506
|
),
|
|
3507
|
-
...
|
|
3507
|
+
...m,
|
|
3508
3508
|
children: [
|
|
3509
3509
|
n && /* @__PURE__ */ e(
|
|
3510
3510
|
"span",
|
|
@@ -3578,7 +3578,7 @@ function ln({ children: t, className: r, ...n }) {
|
|
|
3578
3578
|
const br = {
|
|
3579
3579
|
sm: "h-1",
|
|
3580
3580
|
md: "h-1.5"
|
|
3581
|
-
},
|
|
3581
|
+
}, pr = {
|
|
3582
3582
|
accent: "bg-accent",
|
|
3583
3583
|
success: "bg-success"
|
|
3584
3584
|
};
|
|
@@ -3596,14 +3596,14 @@ function on({ value: t, variant: r = "accent", size: n = "md", className: s, ...
|
|
|
3596
3596
|
children: /* @__PURE__ */ e(
|
|
3597
3597
|
"div",
|
|
3598
3598
|
{
|
|
3599
|
-
className: d("h-full rounded-full transition-[width] duration-300 ease-out",
|
|
3599
|
+
className: d("h-full rounded-full transition-[width] duration-300 ease-out", pr[r]),
|
|
3600
3600
|
style: { width: `${o}%` }
|
|
3601
3601
|
}
|
|
3602
3602
|
)
|
|
3603
3603
|
}
|
|
3604
3604
|
);
|
|
3605
3605
|
}
|
|
3606
|
-
const
|
|
3606
|
+
const gr = {
|
|
3607
3607
|
xs: "h-3 w-3",
|
|
3608
3608
|
sm: "h-4 w-4",
|
|
3609
3609
|
md: "h-6 w-6",
|
|
@@ -3644,7 +3644,7 @@ function cn({
|
|
|
3644
3644
|
{
|
|
3645
3645
|
className: d(
|
|
3646
3646
|
"animate-spin",
|
|
3647
|
-
|
|
3647
|
+
gr[t],
|
|
3648
3648
|
vr[r]
|
|
3649
3649
|
),
|
|
3650
3650
|
fill: "none",
|
|
@@ -3734,32 +3734,32 @@ function un({
|
|
|
3734
3734
|
className: a
|
|
3735
3735
|
}) {
|
|
3736
3736
|
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,
|
|
3737
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-1.5", a), children: t.map((u, m) => /* @__PURE__ */ e(
|
|
3738
3738
|
"span",
|
|
3739
3739
|
{
|
|
3740
3740
|
className: d(
|
|
3741
3741
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3742
|
+
m === o ? "w-5 bg-accent" : "w-3.5",
|
|
3743
|
+
m < o && "bg-border-strong",
|
|
3744
|
+
m > o && "bg-border"
|
|
3745
3745
|
)
|
|
3746
3746
|
},
|
|
3747
3747
|
u
|
|
3748
|
-
)) }) : /* @__PURE__ */ e("div", { ...l, className: d("flex items-center gap-2", a), children: t.map((u,
|
|
3748
|
+
)) }) : /* @__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
3749
|
/* @__PURE__ */ e(
|
|
3750
3750
|
"span",
|
|
3751
3751
|
{
|
|
3752
|
-
"aria-current":
|
|
3752
|
+
"aria-current": m === o ? "step" : void 0,
|
|
3753
3753
|
className: d(
|
|
3754
3754
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3755
|
+
m === o && "bg-accent text-accent-fg",
|
|
3756
|
+
m < o && "bg-accent-soft text-accent",
|
|
3757
|
+
m > o && "bg-surface-hover text-text-muted"
|
|
3758
3758
|
),
|
|
3759
|
-
children:
|
|
3759
|
+
children: m + 1
|
|
3760
3760
|
}
|
|
3761
3761
|
),
|
|
3762
|
-
|
|
3762
|
+
m < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3763
3763
|
] }, u)) });
|
|
3764
3764
|
}
|
|
3765
3765
|
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 +3881,21 @@ const xn = ({
|
|
|
3881
3881
|
showLoading: o = !0,
|
|
3882
3882
|
showError: l = !0,
|
|
3883
3883
|
fallback: u,
|
|
3884
|
-
loadingContent:
|
|
3884
|
+
loadingContent: m,
|
|
3885
3885
|
errorContent: y,
|
|
3886
|
-
className:
|
|
3887
|
-
onLoad:
|
|
3888
|
-
onError:
|
|
3889
|
-
...
|
|
3886
|
+
className: h,
|
|
3887
|
+
onLoad: f,
|
|
3888
|
+
onError: x,
|
|
3889
|
+
...p
|
|
3890
3890
|
}) => {
|
|
3891
|
-
const [w,
|
|
3892
|
-
|
|
3891
|
+
const [w, g] = R(!0), [b, L] = R(!1), [T, _] = R(t), $ = (O) => {
|
|
3892
|
+
g(!1), L(!1), f?.(O);
|
|
3893
3893
|
}, X = (O) => {
|
|
3894
|
-
if (
|
|
3895
|
-
_(u), L(!1),
|
|
3894
|
+
if (g(!1), L(!0), u && T !== u) {
|
|
3895
|
+
_(u), L(!1), g(!0);
|
|
3896
3896
|
return;
|
|
3897
3897
|
}
|
|
3898
|
-
|
|
3898
|
+
x?.(O);
|
|
3899
3899
|
}, W = d(
|
|
3900
3900
|
"relative overflow-hidden bg-surface-hover",
|
|
3901
3901
|
// Size variants
|
|
@@ -3923,7 +3923,7 @@ const xn = ({
|
|
|
3923
3923
|
"rounded-xl": a === "xl",
|
|
3924
3924
|
"rounded-full": a === "full"
|
|
3925
3925
|
},
|
|
3926
|
-
|
|
3926
|
+
h
|
|
3927
3927
|
), j = d(
|
|
3928
3928
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3929
3929
|
{
|
|
@@ -3941,7 +3941,7 @@ const xn = ({
|
|
|
3941
3941
|
/* @__PURE__ */ e(
|
|
3942
3942
|
"img",
|
|
3943
3943
|
{
|
|
3944
|
-
...
|
|
3944
|
+
...p,
|
|
3945
3945
|
src: T,
|
|
3946
3946
|
alt: r,
|
|
3947
3947
|
className: j,
|
|
@@ -3949,7 +3949,7 @@ const xn = ({
|
|
|
3949
3949
|
onError: X
|
|
3950
3950
|
}
|
|
3951
3951
|
),
|
|
3952
|
-
w && o && /* @__PURE__ */ e("div", { className: q, children:
|
|
3952
|
+
w && o && /* @__PURE__ */ e("div", { className: q, children: m || K }),
|
|
3953
3953
|
b && l && /* @__PURE__ */ e("div", { className: q, children: y || re })
|
|
3954
3954
|
] });
|
|
3955
3955
|
};
|
|
@@ -3962,14 +3962,14 @@ function bn({
|
|
|
3962
3962
|
trailing: o,
|
|
3963
3963
|
onSelect: l,
|
|
3964
3964
|
onActiveIndexChange: u,
|
|
3965
|
-
isActive:
|
|
3965
|
+
isActive: m,
|
|
3966
3966
|
unread: y,
|
|
3967
|
-
dimmed:
|
|
3968
|
-
groupBy:
|
|
3969
|
-
groups:
|
|
3970
|
-
renderGroupHeader:
|
|
3967
|
+
dimmed: h,
|
|
3968
|
+
groupBy: f,
|
|
3969
|
+
groups: x,
|
|
3970
|
+
renderGroupHeader: p,
|
|
3971
3971
|
stickyGroupHeaders: w = !1,
|
|
3972
|
-
collapsibleGroups:
|
|
3972
|
+
collapsibleGroups: g = !1,
|
|
3973
3973
|
hideGroupCount: b = !1,
|
|
3974
3974
|
selectable: L = !1,
|
|
3975
3975
|
selectedItems: T = [],
|
|
@@ -3986,7 +3986,7 @@ function bn({
|
|
|
3986
3986
|
}) {
|
|
3987
3987
|
const [C, i] = oe.useState(
|
|
3988
3988
|
() => Object.fromEntries(
|
|
3989
|
-
(
|
|
3989
|
+
(x ?? []).filter((z) => z.defaultCollapsed).map((z) => [z.id, !0])
|
|
3990
3990
|
)
|
|
3991
3991
|
), S = oe.useRef(null), N = (z) => {
|
|
3992
3992
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(z.key)) return;
|
|
@@ -4026,7 +4026,7 @@ function bn({
|
|
|
4026
4026
|
if (t.length === 0 && q)
|
|
4027
4027
|
return /* @__PURE__ */ e("div", { className: le, children: q });
|
|
4028
4028
|
const G = t.length > 0 && T.length === t.length, P = T.length > 0 && !G, E = (z, V, B) => {
|
|
4029
|
-
const H =
|
|
4029
|
+
const H = m?.(z, V) ?? !1, M = y?.(z, V) ?? !1, I = h?.(z, V) ?? !1, te = L && k(z);
|
|
4030
4030
|
return /* @__PURE__ */ c(
|
|
4031
4031
|
"li",
|
|
4032
4032
|
{
|
|
@@ -4052,7 +4052,7 @@ function bn({
|
|
|
4052
4052
|
),
|
|
4053
4053
|
children: [
|
|
4054
4054
|
L && /* @__PURE__ */ e("span", { onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4055
|
-
|
|
4055
|
+
pe,
|
|
4056
4056
|
{
|
|
4057
4057
|
checked: k(z),
|
|
4058
4058
|
onChange: (v) => ee(z, v.target.checked),
|
|
@@ -4074,22 +4074,22 @@ function bn({
|
|
|
4074
4074
|
A(z, V)
|
|
4075
4075
|
);
|
|
4076
4076
|
}, D = (() => {
|
|
4077
|
-
if (!
|
|
4077
|
+
if (!f)
|
|
4078
4078
|
return t.map((H, M) => E(H, M, M === 0));
|
|
4079
4079
|
const z = /* @__PURE__ */ new Map();
|
|
4080
4080
|
t.forEach((H, M) => {
|
|
4081
|
-
const I =
|
|
4081
|
+
const I = f(H, M);
|
|
4082
4082
|
z.has(I) || z.set(I, []), z.get(I).push({ item: H, index: M });
|
|
4083
4083
|
});
|
|
4084
|
-
const V =
|
|
4084
|
+
const V = x ?? [];
|
|
4085
4085
|
return [
|
|
4086
4086
|
...V.filter((H) => z.has(H.id)),
|
|
4087
4087
|
...[...z.keys()].filter((H) => !V.some((M) => M.id === H)).map((H) => ({ id: H }))
|
|
4088
4088
|
].flatMap((H, M) => {
|
|
4089
|
-
const I = z.get(H.id) ?? [], te =
|
|
4089
|
+
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
4090
|
"li",
|
|
4091
4091
|
{
|
|
4092
|
-
onClick:
|
|
4092
|
+
onClick: g ? () => i((J) => ({ ...J, [H.id]: !J[H.id] })) : void 0,
|
|
4093
4093
|
className: d(
|
|
4094
4094
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4095
4095
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4097,12 +4097,12 @@ function bn({
|
|
|
4097
4097
|
M > 0 && "border-t",
|
|
4098
4098
|
"border-b",
|
|
4099
4099
|
w && "sticky z-10",
|
|
4100
|
-
|
|
4100
|
+
g && "cursor-pointer select-none hover:text-text"
|
|
4101
4101
|
),
|
|
4102
|
-
"aria-expanded":
|
|
4102
|
+
"aria-expanded": g ? !te : void 0,
|
|
4103
4103
|
style: w ? { top: W ? 28 : 0 } : void 0,
|
|
4104
|
-
children:
|
|
4105
|
-
|
|
4104
|
+
children: p ? p(H, I.map((J) => J.item)) : /* @__PURE__ */ c(xe, { children: [
|
|
4105
|
+
g && /* @__PURE__ */ e(
|
|
4106
4106
|
Ce,
|
|
4107
4107
|
{
|
|
4108
4108
|
"aria-hidden": !0,
|
|
@@ -4129,7 +4129,7 @@ function bn({
|
|
|
4129
4129
|
return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? N : void 0, children: [
|
|
4130
4130
|
L && T.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
4131
|
/* @__PURE__ */ e(
|
|
4132
|
-
|
|
4132
|
+
pe,
|
|
4133
4133
|
{
|
|
4134
4134
|
checked: G,
|
|
4135
4135
|
indeterminate: P,
|
|
@@ -4157,7 +4157,7 @@ function bn({
|
|
|
4157
4157
|
/* @__PURE__ */ e("ul", { "aria-label": ce, className: "flex flex-col", children: D })
|
|
4158
4158
|
] });
|
|
4159
4159
|
}
|
|
4160
|
-
function
|
|
4160
|
+
function pn({
|
|
4161
4161
|
side: t,
|
|
4162
4162
|
continued: r = !1,
|
|
4163
4163
|
tone: n = "default",
|
|
@@ -4192,7 +4192,7 @@ const Er = {
|
|
|
4192
4192
|
urgent: "text-danger-fg",
|
|
4193
4193
|
success: "text-success-fg"
|
|
4194
4194
|
};
|
|
4195
|
-
function
|
|
4195
|
+
function gn({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4196
4196
|
return /* @__PURE__ */ c("div", { className: d("rounded-xl shadow-sm bg-surface px-4 py-3.5", s), ...a, children: [
|
|
4197
4197
|
/* @__PURE__ */ e("div", { className: d("text-2xl font-semibold", Er[n]), children: t }),
|
|
4198
4198
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
@@ -4207,23 +4207,23 @@ const vn = ({
|
|
|
4207
4207
|
children: o,
|
|
4208
4208
|
className: l,
|
|
4209
4209
|
backLabel: u = "Back",
|
|
4210
|
-
backClassName:
|
|
4210
|
+
backClassName: m,
|
|
4211
4211
|
onBack: y,
|
|
4212
|
-
editable:
|
|
4213
|
-
onTitleChange:
|
|
4212
|
+
editable: h = !1,
|
|
4213
|
+
onTitleChange: f
|
|
4214
4214
|
}) => {
|
|
4215
|
-
const [
|
|
4215
|
+
const [x, p] = R(!1), [w, g] = R(r), b = se(null);
|
|
4216
4216
|
Q(() => {
|
|
4217
|
-
|
|
4217
|
+
g(r);
|
|
4218
4218
|
}, [r]), Q(() => {
|
|
4219
|
-
|
|
4220
|
-
}, [
|
|
4219
|
+
x && b.current && (b.current.focus(), b.current.select());
|
|
4220
|
+
}, [x]);
|
|
4221
4221
|
const L = () => {
|
|
4222
|
-
|
|
4222
|
+
h && p(!0);
|
|
4223
4223
|
}, T = () => {
|
|
4224
|
-
|
|
4224
|
+
p(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : g(r);
|
|
4225
4225
|
}, _ = ($) => {
|
|
4226
|
-
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (
|
|
4226
|
+
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (g(r), p(!1));
|
|
4227
4227
|
};
|
|
4228
4228
|
return /* @__PURE__ */ c(
|
|
4229
4229
|
"div",
|
|
@@ -4239,13 +4239,13 @@ const vn = ({
|
|
|
4239
4239
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
4240
4240
|
y && /* @__PURE__ */ e(ne, { variant: "outline", onClick: y, leftIcon: /* @__PURE__ */ e(Y, { icon: ke, size: "sm" }), iconOnly: !0 }),
|
|
4241
4241
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
4242
|
-
|
|
4242
|
+
x ? /* @__PURE__ */ e(
|
|
4243
4243
|
"input",
|
|
4244
4244
|
{
|
|
4245
4245
|
ref: b,
|
|
4246
4246
|
type: "text",
|
|
4247
4247
|
value: w,
|
|
4248
|
-
onChange: ($) =>
|
|
4248
|
+
onChange: ($) => g($.target.value),
|
|
4249
4249
|
onBlur: T,
|
|
4250
4250
|
onKeyDown: _,
|
|
4251
4251
|
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"
|
|
@@ -4257,14 +4257,14 @@ const vn = ({
|
|
|
4257
4257
|
onClick: L,
|
|
4258
4258
|
className: d(
|
|
4259
4259
|
"text-xl font-semibold truncate",
|
|
4260
|
-
|
|
4260
|
+
h && "cursor-pointer"
|
|
4261
4261
|
),
|
|
4262
|
-
title:
|
|
4262
|
+
title: h ? "Click to edit" : void 0,
|
|
4263
4263
|
children: r
|
|
4264
4264
|
}
|
|
4265
4265
|
),
|
|
4266
4266
|
n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
|
|
4267
|
-
|
|
4267
|
+
h && /* @__PURE__ */ e(
|
|
4268
4268
|
ut,
|
|
4269
4269
|
{
|
|
4270
4270
|
size: 15,
|
|
@@ -4436,27 +4436,27 @@ const Sn = ({
|
|
|
4436
4436
|
size: n = "md",
|
|
4437
4437
|
className: s
|
|
4438
4438
|
}) => {
|
|
4439
|
-
const a = (
|
|
4440
|
-
if (!
|
|
4439
|
+
const a = (h) => {
|
|
4440
|
+
if (!h) return "-";
|
|
4441
4441
|
try {
|
|
4442
|
-
return new Date(
|
|
4442
|
+
return new Date(h).toLocaleDateString("nl-NL", {
|
|
4443
4443
|
year: "numeric",
|
|
4444
4444
|
month: "long",
|
|
4445
4445
|
day: "numeric"
|
|
4446
4446
|
});
|
|
4447
4447
|
} catch {
|
|
4448
|
-
return String(
|
|
4448
|
+
return String(h);
|
|
4449
4449
|
}
|
|
4450
|
-
}, o = (
|
|
4451
|
-
if (!
|
|
4452
|
-
const
|
|
4453
|
-
return
|
|
4450
|
+
}, o = (h) => h ? "Ja" : "Nee", l = (h, f) => {
|
|
4451
|
+
if (!f) return String(h || "-");
|
|
4452
|
+
const x = f.find((p) => p.value === h);
|
|
4453
|
+
return x ? x.label : String(h || "-");
|
|
4454
4454
|
}, u = ue(
|
|
4455
|
-
(
|
|
4456
|
-
const
|
|
4457
|
-
if (
|
|
4458
|
-
const
|
|
4459
|
-
return !
|
|
4455
|
+
(h) => {
|
|
4456
|
+
const f = $r(r, h.name);
|
|
4457
|
+
if (h.type === "array") {
|
|
4458
|
+
const p = f;
|
|
4459
|
+
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
4460
4460
|
de,
|
|
4461
4461
|
{
|
|
4462
4462
|
variant: "body",
|
|
@@ -4464,7 +4464,7 @@ const Sn = ({
|
|
|
4464
4464
|
className: "text-text-muted",
|
|
4465
4465
|
children: "Geen items"
|
|
4466
4466
|
}
|
|
4467
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
4467
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((w, g) => /* @__PURE__ */ c(
|
|
4468
4468
|
"div",
|
|
4469
4469
|
{
|
|
4470
4470
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4477,13 +4477,13 @@ const Sn = ({
|
|
|
4477
4477
|
weight: "medium",
|
|
4478
4478
|
className: "text-text-muted",
|
|
4479
4479
|
children: [
|
|
4480
|
-
|
|
4480
|
+
h.label,
|
|
4481
4481
|
" ",
|
|
4482
|
-
|
|
4482
|
+
g + 1
|
|
4483
4483
|
]
|
|
4484
4484
|
}
|
|
4485
4485
|
) }),
|
|
4486
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
4486
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((b) => {
|
|
4487
4487
|
const L = w?.[b.name];
|
|
4488
4488
|
let T = "-";
|
|
4489
4489
|
switch (b.type) {
|
|
@@ -4539,48 +4539,48 @@ const Sn = ({
|
|
|
4539
4539
|
}) })
|
|
4540
4540
|
]
|
|
4541
4541
|
},
|
|
4542
|
-
|
|
4542
|
+
g
|
|
4543
4543
|
)) });
|
|
4544
4544
|
}
|
|
4545
|
-
if (
|
|
4546
|
-
return
|
|
4547
|
-
if (
|
|
4548
|
-
const
|
|
4545
|
+
if (h.type === "custom" && h.customComponent)
|
|
4546
|
+
return h.customComponent({ value: f });
|
|
4547
|
+
if (h.format) {
|
|
4548
|
+
const p = h.format(f, r);
|
|
4549
4549
|
return /* @__PURE__ */ e(
|
|
4550
4550
|
de,
|
|
4551
4551
|
{
|
|
4552
4552
|
variant: "body",
|
|
4553
4553
|
size: "sm",
|
|
4554
4554
|
className: "text-text",
|
|
4555
|
-
children:
|
|
4555
|
+
children: p
|
|
4556
4556
|
}
|
|
4557
4557
|
);
|
|
4558
4558
|
}
|
|
4559
|
-
let
|
|
4560
|
-
switch (
|
|
4559
|
+
let x = "-";
|
|
4560
|
+
switch (h.type) {
|
|
4561
4561
|
case "text":
|
|
4562
4562
|
case "email":
|
|
4563
4563
|
case "password":
|
|
4564
4564
|
case "number":
|
|
4565
4565
|
case "tel":
|
|
4566
4566
|
case "url":
|
|
4567
|
-
|
|
4567
|
+
x = f ? String(f) : "-";
|
|
4568
4568
|
break;
|
|
4569
4569
|
case "textarea":
|
|
4570
|
-
|
|
4570
|
+
x = f ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(f || "-") }) : "-";
|
|
4571
4571
|
break;
|
|
4572
4572
|
case "select":
|
|
4573
4573
|
case "radio":
|
|
4574
|
-
|
|
4574
|
+
x = l(f, h.options);
|
|
4575
4575
|
break;
|
|
4576
4576
|
case "checkbox":
|
|
4577
|
-
|
|
4577
|
+
x = o(f);
|
|
4578
4578
|
break;
|
|
4579
4579
|
case "date":
|
|
4580
|
-
|
|
4580
|
+
x = a(f);
|
|
4581
4581
|
break;
|
|
4582
4582
|
default:
|
|
4583
|
-
|
|
4583
|
+
x = f ? String(f) : "-";
|
|
4584
4584
|
}
|
|
4585
4585
|
return /* @__PURE__ */ e(
|
|
4586
4586
|
de,
|
|
@@ -4588,30 +4588,30 @@ const Sn = ({
|
|
|
4588
4588
|
variant: "body",
|
|
4589
4589
|
size: "sm",
|
|
4590
4590
|
className: "text-text",
|
|
4591
|
-
children:
|
|
4591
|
+
children: x
|
|
4592
4592
|
}
|
|
4593
4593
|
);
|
|
4594
4594
|
},
|
|
4595
4595
|
[r]
|
|
4596
|
-
),
|
|
4597
|
-
(
|
|
4598
|
-
if (
|
|
4596
|
+
), m = ue(
|
|
4597
|
+
(h) => {
|
|
4598
|
+
if (h.conditional && !h.conditional(r))
|
|
4599
4599
|
return null;
|
|
4600
|
-
const
|
|
4601
|
-
if (
|
|
4602
|
-
const
|
|
4600
|
+
const f = h.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
|
|
4601
|
+
if (f.length === 0) return null;
|
|
4602
|
+
const x = d(
|
|
4603
4603
|
"space-y-4",
|
|
4604
4604
|
{
|
|
4605
|
-
"grid gap-4":
|
|
4606
|
-
"flex flex-wrap gap-4":
|
|
4605
|
+
"grid gap-4": h.layout === "grid",
|
|
4606
|
+
"flex flex-wrap gap-4": h.layout === "flex"
|
|
4607
4607
|
},
|
|
4608
|
-
|
|
4609
|
-
"grid-cols-1": !
|
|
4610
|
-
"grid-cols-2":
|
|
4611
|
-
"grid-cols-3":
|
|
4612
|
-
"grid-cols-4":
|
|
4608
|
+
h.layout === "grid" && {
|
|
4609
|
+
"grid-cols-1": !h.columns || h.columns === 1,
|
|
4610
|
+
"grid-cols-2": h.columns === 2,
|
|
4611
|
+
"grid-cols-3": h.columns === 3,
|
|
4612
|
+
"grid-cols-4": h.columns === 4
|
|
4613
4613
|
},
|
|
4614
|
-
|
|
4614
|
+
h.className
|
|
4615
4615
|
);
|
|
4616
4616
|
return /* @__PURE__ */ c(
|
|
4617
4617
|
"div",
|
|
@@ -4626,45 +4626,45 @@ const Sn = ({
|
|
|
4626
4626
|
size: "lg",
|
|
4627
4627
|
weight: "semibold",
|
|
4628
4628
|
className: "text-text",
|
|
4629
|
-
children:
|
|
4629
|
+
children: h.title
|
|
4630
4630
|
}
|
|
4631
4631
|
),
|
|
4632
|
-
|
|
4632
|
+
h.description && /* @__PURE__ */ e(
|
|
4633
4633
|
de,
|
|
4634
4634
|
{
|
|
4635
4635
|
variant: "body",
|
|
4636
4636
|
size: "sm",
|
|
4637
4637
|
className: "text-text-muted mt-1",
|
|
4638
|
-
children:
|
|
4638
|
+
children: h.description
|
|
4639
4639
|
}
|
|
4640
4640
|
)
|
|
4641
4641
|
] }),
|
|
4642
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4642
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: x, children: f.map((p) => /* @__PURE__ */ c(
|
|
4643
4643
|
"div",
|
|
4644
4644
|
{
|
|
4645
4645
|
className: "space-y-1",
|
|
4646
4646
|
style: {
|
|
4647
|
-
width: typeof
|
|
4648
|
-
gridColumn: typeof
|
|
4647
|
+
width: typeof p.width == "string" ? p.width : void 0,
|
|
4648
|
+
gridColumn: typeof p.width == "number" ? `span ${p.width} / span ${p.width}` : void 0
|
|
4649
4649
|
},
|
|
4650
4650
|
children: [
|
|
4651
|
-
|
|
4651
|
+
p.type !== "custom" && /* @__PURE__ */ e(
|
|
4652
4652
|
de,
|
|
4653
4653
|
{
|
|
4654
4654
|
variant: "label",
|
|
4655
4655
|
size: "sm",
|
|
4656
4656
|
className: "font-medium text-text-muted",
|
|
4657
|
-
children:
|
|
4657
|
+
children: p.label
|
|
4658
4658
|
}
|
|
4659
4659
|
),
|
|
4660
|
-
u(
|
|
4660
|
+
u(p)
|
|
4661
4661
|
]
|
|
4662
4662
|
},
|
|
4663
|
-
|
|
4663
|
+
p.name
|
|
4664
4664
|
)) }) })
|
|
4665
4665
|
]
|
|
4666
4666
|
},
|
|
4667
|
-
|
|
4667
|
+
h.id
|
|
4668
4668
|
);
|
|
4669
4669
|
},
|
|
4670
4670
|
[r, u]
|
|
@@ -4678,43 +4678,46 @@ const Sn = ({
|
|
|
4678
4678
|
},
|
|
4679
4679
|
s
|
|
4680
4680
|
);
|
|
4681
|
-
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
4681
|
+
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(m) }) });
|
|
4682
4682
|
}, qe = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
|
|
4683
4683
|
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
|
-
|
|
4684
|
+
if (a)
|
|
4685
|
+
return /* @__PURE__ */ c("li", { children: [
|
|
4686
|
+
/* @__PURE__ */ c(
|
|
4687
|
+
"div",
|
|
4688
|
+
{
|
|
4689
|
+
className: d(
|
|
4690
|
+
"flex items-center gap-2 px-2 pt-4 pb-1 text-xs font-semibold uppercase tracking-label text-text-subtle"
|
|
4691
|
+
),
|
|
4692
|
+
children: [
|
|
4693
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: t.label }),
|
|
4694
|
+
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "font-normal tabular-nums", children: t.count })
|
|
4695
|
+
]
|
|
4696
|
+
}
|
|
4697
|
+
),
|
|
4698
|
+
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((m, y) => /* @__PURE__ */ e(
|
|
4699
|
+
qe,
|
|
4700
|
+
{
|
|
4701
|
+
item: m,
|
|
4702
|
+
isSelectedHandler: r,
|
|
4703
|
+
onClick: n,
|
|
4704
|
+
depth: s + 1
|
|
4705
|
+
},
|
|
4706
|
+
y
|
|
4707
|
+
)) })
|
|
4708
|
+
] });
|
|
4709
|
+
const l = t.action, u = l?.visibility !== "always";
|
|
4710
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
4708
4711
|
"div",
|
|
4709
4712
|
{
|
|
4710
4713
|
role: "button",
|
|
4711
4714
|
tabIndex: 0,
|
|
4712
4715
|
onClick: () => t.path && n?.(t.path),
|
|
4713
|
-
onKeyDown: (
|
|
4714
|
-
(
|
|
4716
|
+
onKeyDown: (m) => {
|
|
4717
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), t.path && n?.(t.path));
|
|
4715
4718
|
},
|
|
4716
4719
|
className: d(
|
|
4717
|
-
"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4720
|
+
"group/item flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4718
4721
|
"transition-colors duration-fast ease-out",
|
|
4719
4722
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
4720
4723
|
o ? "bg-accent-soft font-semibold text-accent" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
@@ -4727,10 +4730,31 @@ const Sn = ({
|
|
|
4727
4730
|
{
|
|
4728
4731
|
className: d(
|
|
4729
4732
|
"shrink-0 text-xs tabular-nums",
|
|
4730
|
-
o ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle"
|
|
4733
|
+
o ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle",
|
|
4734
|
+
l && u && "group-hover/item:hidden group-focus-within/item:hidden"
|
|
4731
4735
|
),
|
|
4732
4736
|
children: t.count
|
|
4733
4737
|
}
|
|
4738
|
+
),
|
|
4739
|
+
l && /* @__PURE__ */ e(
|
|
4740
|
+
"button",
|
|
4741
|
+
{
|
|
4742
|
+
type: "button",
|
|
4743
|
+
"aria-label": l.label,
|
|
4744
|
+
title: l.label,
|
|
4745
|
+
onClick: (m) => {
|
|
4746
|
+
m.stopPropagation(), l.onClick();
|
|
4747
|
+
},
|
|
4748
|
+
onKeyDown: (m) => m.stopPropagation(),
|
|
4749
|
+
className: d(
|
|
4750
|
+
"flex size-5 shrink-0 items-center justify-center rounded",
|
|
4751
|
+
"text-text-subtle transition-colors duration-fast ease-out",
|
|
4752
|
+
"hover:bg-surface-hover hover:text-text",
|
|
4753
|
+
"focus-visible:outline-none focus-visible:focus-ring",
|
|
4754
|
+
u && "opacity-0 group-hover/item:opacity-100 focus-visible:opacity-100"
|
|
4755
|
+
),
|
|
4756
|
+
children: l.icon
|
|
4757
|
+
}
|
|
4734
4758
|
)
|
|
4735
4759
|
]
|
|
4736
4760
|
}
|
|
@@ -4808,9 +4832,9 @@ const Sn = ({
|
|
|
4808
4832
|
truncate: o = !1,
|
|
4809
4833
|
className: l,
|
|
4810
4834
|
children: u,
|
|
4811
|
-
...
|
|
4835
|
+
...m
|
|
4812
4836
|
}) => {
|
|
4813
|
-
const y = `h${t}`,
|
|
4837
|
+
const y = `h${t}`, h = d(
|
|
4814
4838
|
"font-sans text-pretty",
|
|
4815
4839
|
Dr[r || Ir(t)],
|
|
4816
4840
|
Tr[n],
|
|
@@ -4819,7 +4843,7 @@ const Sn = ({
|
|
|
4819
4843
|
o && "truncate",
|
|
4820
4844
|
l
|
|
4821
4845
|
);
|
|
4822
|
-
return /* @__PURE__ */ e(y, { className:
|
|
4846
|
+
return /* @__PURE__ */ e(y, { className: h, ...m, children: u });
|
|
4823
4847
|
};
|
|
4824
4848
|
function Ir(t) {
|
|
4825
4849
|
return {
|
|
@@ -4839,44 +4863,44 @@ const Mn = ({
|
|
|
4839
4863
|
initialCommandPath: a,
|
|
4840
4864
|
initialActiveIndex: o
|
|
4841
4865
|
}) => {
|
|
4842
|
-
const [l, u] = R(""), [
|
|
4866
|
+
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
4867
|
(b) => b.label.toLowerCase().includes(l.toLowerCase())
|
|
4844
4868
|
);
|
|
4845
4869
|
return Q(() => {
|
|
4846
|
-
r || (u(""), y(a || []),
|
|
4870
|
+
r || (u(""), y(a || []), f(o || 0));
|
|
4847
4871
|
}, [r]), Q(() => {
|
|
4848
4872
|
const b = (L) => {
|
|
4849
4873
|
if (r) {
|
|
4850
4874
|
if (L.key === "Escape")
|
|
4851
4875
|
n();
|
|
4852
4876
|
else if (L.key === "ArrowUp")
|
|
4853
|
-
|
|
4854
|
-
(T) => T > 0 ? T - 1 :
|
|
4877
|
+
f(
|
|
4878
|
+
(T) => T > 0 ? T - 1 : g.length - 1
|
|
4855
4879
|
);
|
|
4856
4880
|
else if (L.key === "ArrowDown")
|
|
4857
|
-
|
|
4858
|
-
(T) => T <
|
|
4881
|
+
f(
|
|
4882
|
+
(T) => T < g.length - 1 ? T + 1 : 0
|
|
4859
4883
|
);
|
|
4860
4884
|
else if (L.key === "Enter") {
|
|
4861
|
-
const T =
|
|
4862
|
-
T && (T.subCommands ? (y([...
|
|
4885
|
+
const T = g[h];
|
|
4886
|
+
T && (T.subCommands ? (y([...m, T.id]), f(0)) : T.action && (T.action(), n()));
|
|
4863
4887
|
}
|
|
4864
4888
|
}
|
|
4865
4889
|
};
|
|
4866
4890
|
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
4867
|
-
}, [r, n,
|
|
4891
|
+
}, [r, n, g, h, m]), Q(() => {
|
|
4868
4892
|
const b = (L) => {
|
|
4869
|
-
|
|
4893
|
+
x.current && !x.current.contains(L.target) && n();
|
|
4870
4894
|
};
|
|
4871
4895
|
return r && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
4872
4896
|
}, [r, n]), Q(() => {
|
|
4873
4897
|
if (!r) return;
|
|
4874
|
-
|
|
4875
|
-
}, [
|
|
4898
|
+
p.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4899
|
+
}, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
|
|
4876
4900
|
"div",
|
|
4877
4901
|
{
|
|
4878
4902
|
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:
|
|
4903
|
+
ref: x,
|
|
4880
4904
|
children: [
|
|
4881
4905
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4882
4906
|
/* @__PURE__ */ e(Se, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
@@ -4895,19 +4919,19 @@ const Mn = ({
|
|
|
4895
4919
|
/* @__PURE__ */ c(
|
|
4896
4920
|
"div",
|
|
4897
4921
|
{
|
|
4898
|
-
ref:
|
|
4922
|
+
ref: p,
|
|
4899
4923
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4900
4924
|
children: [
|
|
4901
|
-
|
|
4902
|
-
|
|
4925
|
+
g.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4926
|
+
g.map((b, L) => /* @__PURE__ */ c(
|
|
4903
4927
|
"div",
|
|
4904
4928
|
{
|
|
4905
4929
|
"data-index": L,
|
|
4906
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${L ===
|
|
4930
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${L === h ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4907
4931
|
onClick: () => {
|
|
4908
|
-
b.subCommands ? (y([...
|
|
4932
|
+
b.subCommands ? (y([...m, b.id]), f(0)) : b.action && (b.action(), n());
|
|
4909
4933
|
},
|
|
4910
|
-
onMouseEnter: () =>
|
|
4934
|
+
onMouseEnter: () => f(L),
|
|
4911
4935
|
children: [
|
|
4912
4936
|
b.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: b.icon }),
|
|
4913
4937
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: b.label }),
|
|
@@ -5007,12 +5031,12 @@ const Mn = ({
|
|
|
5007
5031
|
border: o,
|
|
5008
5032
|
borderColor: l,
|
|
5009
5033
|
className: u,
|
|
5010
|
-
children:
|
|
5034
|
+
children: m,
|
|
5011
5035
|
...y
|
|
5012
|
-
},
|
|
5036
|
+
}, h) => /* @__PURE__ */ e(
|
|
5013
5037
|
"div",
|
|
5014
5038
|
{
|
|
5015
|
-
ref:
|
|
5039
|
+
ref: h,
|
|
5016
5040
|
className: d(
|
|
5017
5041
|
t && jr[t],
|
|
5018
5042
|
r && Pr[r],
|
|
@@ -5024,7 +5048,7 @@ const Mn = ({
|
|
|
5024
5048
|
u
|
|
5025
5049
|
),
|
|
5026
5050
|
...y,
|
|
5027
|
-
children:
|
|
5051
|
+
children: m
|
|
5028
5052
|
}
|
|
5029
5053
|
)
|
|
5030
5054
|
);
|
|
@@ -5052,41 +5076,41 @@ function Dn({
|
|
|
5052
5076
|
componentProps: a,
|
|
5053
5077
|
className: o
|
|
5054
5078
|
}) {
|
|
5055
|
-
const l = se(null), [u,
|
|
5079
|
+
const l = se(null), [u, m] = R(!0), [y, h] = R(null), f = se(null);
|
|
5056
5080
|
return se(null), Q(() => {
|
|
5057
|
-
let
|
|
5081
|
+
let x = !0;
|
|
5058
5082
|
return (async () => {
|
|
5059
|
-
|
|
5083
|
+
m(!0);
|
|
5060
5084
|
try {
|
|
5061
5085
|
const w = await r();
|
|
5062
|
-
if (!
|
|
5063
|
-
const
|
|
5064
|
-
|
|
5086
|
+
if (!x) return;
|
|
5087
|
+
const g = w.component || w.default || w;
|
|
5088
|
+
h(n === "react" ? () => g : () => w);
|
|
5065
5089
|
} catch (w) {
|
|
5066
5090
|
console.error(`[FederatedResource] Load failed: ${t}`, w);
|
|
5067
5091
|
} finally {
|
|
5068
|
-
|
|
5092
|
+
x && m(!1);
|
|
5069
5093
|
}
|
|
5070
5094
|
})(), () => {
|
|
5071
|
-
|
|
5095
|
+
x = !1;
|
|
5072
5096
|
};
|
|
5073
5097
|
}, [t, r]), Q(() => {
|
|
5074
5098
|
if (u || !y || n === "react") return;
|
|
5075
|
-
const
|
|
5076
|
-
if (
|
|
5099
|
+
const x = l.current;
|
|
5100
|
+
if (x) {
|
|
5077
5101
|
if (n === "svelte") {
|
|
5078
|
-
const
|
|
5079
|
-
return
|
|
5102
|
+
const p = y.default || y, w = new p({ target: x, props: a || {} });
|
|
5103
|
+
return f.current = w, () => w.$destroy();
|
|
5080
5104
|
}
|
|
5081
5105
|
if (y.mount) {
|
|
5082
|
-
const
|
|
5106
|
+
const p = y.mount({ container: x, props: a || {} });
|
|
5083
5107
|
return () => {
|
|
5084
|
-
typeof
|
|
5108
|
+
typeof p == "function" ? p() : y.unmount?.(x);
|
|
5085
5109
|
};
|
|
5086
5110
|
}
|
|
5087
5111
|
}
|
|
5088
5112
|
}, [y, n, u]), Q(() => {
|
|
5089
|
-
n === "svelte" &&
|
|
5113
|
+
n === "svelte" && f.current && f.current.$set?.(a);
|
|
5090
5114
|
}, [a, n]), /* @__PURE__ */ c("div", { ref: l, className: o, style: { display: "contents" }, children: [
|
|
5091
5115
|
u && s,
|
|
5092
5116
|
n === "react" && y && /* @__PURE__ */ e(y, { ...a })
|
|
@@ -5130,7 +5154,7 @@ export {
|
|
|
5130
5154
|
Xr as ButtonGroup,
|
|
5131
5155
|
$n as Card,
|
|
5132
5156
|
hn as ChannelBadge,
|
|
5133
|
-
|
|
5157
|
+
pe as Checkbox,
|
|
5134
5158
|
Mn as CommandPalette,
|
|
5135
5159
|
nn as ConfirmDialog,
|
|
5136
5160
|
Ut as ContentLoading,
|
|
@@ -5146,11 +5170,11 @@ export {
|
|
|
5146
5170
|
Y as Icon,
|
|
5147
5171
|
xn as Image,
|
|
5148
5172
|
ln as Kbd,
|
|
5149
|
-
|
|
5173
|
+
gn as KpiCard,
|
|
5150
5174
|
Qr as Link,
|
|
5151
5175
|
bn as List,
|
|
5152
5176
|
Gr as MeetingGrid,
|
|
5153
|
-
|
|
5177
|
+
pn as MessageBubble,
|
|
5154
5178
|
Ue as Modal,
|
|
5155
5179
|
vn as PageHeader,
|
|
5156
5180
|
yn as PageToolbar,
|