@opencxh/ui-kit 3.113.0 → 3.113.1
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 +1126 -1126
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { clsx as Ue } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
3
3
|
import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as je, ChevronRight as ye, ChevronDownIcon as Xe, Loader2 as Ze, Search as Ne, Check as Me, ChevronUp as Qe, ChevronsLeft as et, ChevronsRight as tt, FileText as ke, HardDrive as $e, ArrowLeft as Ee, FolderPlus as rt, Upload as nt, Folder as De, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
|
|
4
|
-
import le, { useRef as
|
|
5
|
-
function
|
|
4
|
+
import le, { useRef as ae, useEffect as Y, forwardRef as de, useState as R, useLayoutEffect as dt, useMemo as me, useCallback as ce, createContext as ut, Component as mt } from "react";
|
|
5
|
+
function m(...t) {
|
|
6
6
|
return Ue(t);
|
|
7
7
|
}
|
|
8
8
|
function qr(t) {
|
|
@@ -13,12 +13,12 @@ function Ur(t) {
|
|
|
13
13
|
}
|
|
14
14
|
function Wr({ tiles: t, pinned: r, className: n }) {
|
|
15
15
|
if (r)
|
|
16
|
-
return /* @__PURE__ */ i("div", { className:
|
|
16
|
+
return /* @__PURE__ */ i("div", { className: m("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
|
|
17
17
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: r }),
|
|
18
18
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((a, l) => /* @__PURE__ */ e("div", { className: "min-w-40 md:min-w-0", children: a }, l)) })
|
|
19
19
|
] });
|
|
20
20
|
const s = t.length <= 1 ? "grid-cols-1" : t.length <= 4 ? "grid-cols-2" : t.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
|
-
return /* @__PURE__ */ e("div", { className:
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: m("grid gap-2 h-full", s, n), children: t.map((a, l) => /* @__PURE__ */ e("div", { children: a }, l)) });
|
|
22
22
|
}
|
|
23
23
|
function Kr({
|
|
24
24
|
name: t,
|
|
@@ -33,7 +33,7 @@ function Kr({
|
|
|
33
33
|
return /* @__PURE__ */ i(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: m(
|
|
37
37
|
"relative rounded-lg overflow-hidden bg-video-surface flex items-center justify-center",
|
|
38
38
|
h ? "h-full w-full" : "aspect-video",
|
|
39
39
|
s && "ring-2 ring-speaking",
|
|
@@ -50,7 +50,7 @@ function Kr({
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
53
|
-
const a =
|
|
53
|
+
const a = ae(null);
|
|
54
54
|
return Y(() => {
|
|
55
55
|
if (!r || !a.current) return;
|
|
56
56
|
const l = t(a.current);
|
|
@@ -61,7 +61,7 @@ function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
63
|
ref: a,
|
|
64
|
-
className:
|
|
64
|
+
className: m(
|
|
65
65
|
"w-full h-full bg-video-surface-strong overflow-hidden",
|
|
66
66
|
n && "[&>*]:scale-x-[-1]",
|
|
67
67
|
s
|
|
@@ -96,7 +96,7 @@ const ft = {
|
|
|
96
96
|
xl: "h-control-xl w-10",
|
|
97
97
|
"2xl": "h-control-2xl w-12",
|
|
98
98
|
full: "h-control-md w-8"
|
|
99
|
-
},
|
|
99
|
+
}, re = de(
|
|
100
100
|
({
|
|
101
101
|
variant: t = "primary",
|
|
102
102
|
size: r = "md",
|
|
@@ -106,18 +106,18 @@ const ft = {
|
|
|
106
106
|
rightIcon: l,
|
|
107
107
|
iconOnly: c = !1,
|
|
108
108
|
shape: h = "default",
|
|
109
|
-
className:
|
|
110
|
-
children:
|
|
109
|
+
className: b,
|
|
110
|
+
children: y,
|
|
111
111
|
disabled: x,
|
|
112
|
-
...
|
|
112
|
+
...u
|
|
113
113
|
}, f) => {
|
|
114
|
-
const
|
|
114
|
+
const p = x || s;
|
|
115
115
|
return /* @__PURE__ */ i(
|
|
116
116
|
"button",
|
|
117
117
|
{
|
|
118
118
|
ref: f,
|
|
119
119
|
type: "button",
|
|
120
|
-
className:
|
|
120
|
+
className: m(
|
|
121
121
|
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
|
|
122
122
|
h === "circle" ? "rounded-full" : "rounded-md",
|
|
123
123
|
"transition-colors duration-fast ease-out",
|
|
@@ -128,11 +128,11 @@ const ft = {
|
|
|
128
128
|
c ? xt[r] : ht[r],
|
|
129
129
|
(n || r === "full") && "w-full",
|
|
130
130
|
s && "cursor-wait",
|
|
131
|
-
|
|
131
|
+
b
|
|
132
132
|
),
|
|
133
|
-
disabled:
|
|
133
|
+
disabled: p,
|
|
134
134
|
"aria-busy": s || void 0,
|
|
135
|
-
...
|
|
135
|
+
...u,
|
|
136
136
|
children: [
|
|
137
137
|
s && /* @__PURE__ */ e(
|
|
138
138
|
"span",
|
|
@@ -142,15 +142,15 @@ const ft = {
|
|
|
142
142
|
}
|
|
143
143
|
),
|
|
144
144
|
!s && a && /* @__PURE__ */ e("span", { className: "shrink-0", children: a }),
|
|
145
|
-
!c &&
|
|
145
|
+
!c && y,
|
|
146
146
|
!s && l && /* @__PURE__ */ e("span", { className: "shrink-0", children: l }),
|
|
147
|
-
c && !s && !a && !l &&
|
|
147
|
+
c && !s && !a && !l && y
|
|
148
148
|
]
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
|
|
153
|
+
re.displayName = "Button";
|
|
154
154
|
const Gr = ({
|
|
155
155
|
children: t,
|
|
156
156
|
size: r = "md",
|
|
@@ -158,7 +158,7 @@ const Gr = ({
|
|
|
158
158
|
attached: s = !0,
|
|
159
159
|
className: a
|
|
160
160
|
}) => {
|
|
161
|
-
const l =
|
|
161
|
+
const l = m(
|
|
162
162
|
"inline-flex",
|
|
163
163
|
{
|
|
164
164
|
// Orientation
|
|
@@ -201,7 +201,7 @@ const Gr = ({
|
|
|
201
201
|
"aria-label": c,
|
|
202
202
|
...h
|
|
203
203
|
}) => {
|
|
204
|
-
const
|
|
204
|
+
const b = typeof r == "number" ? r : gt(r), y = m(
|
|
205
205
|
"inline-block shrink-0",
|
|
206
206
|
bt[n],
|
|
207
207
|
s && [
|
|
@@ -210,16 +210,16 @@ const Gr = ({
|
|
|
210
210
|
],
|
|
211
211
|
l
|
|
212
212
|
), x = {
|
|
213
|
-
size:
|
|
213
|
+
size: b,
|
|
214
214
|
strokeWidth: 2,
|
|
215
|
-
className:
|
|
215
|
+
className: y,
|
|
216
216
|
onClick: s ? a : void 0,
|
|
217
217
|
"aria-label": c,
|
|
218
218
|
"aria-hidden": c ? void 0 : !0,
|
|
219
219
|
role: s ? "button" : void 0,
|
|
220
220
|
tabIndex: s ? 0 : void 0,
|
|
221
|
-
onKeyDown: s ? (
|
|
222
|
-
(
|
|
221
|
+
onKeyDown: s ? (u) => {
|
|
222
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), a?.());
|
|
223
223
|
} : void 0,
|
|
224
224
|
...h
|
|
225
225
|
};
|
|
@@ -249,43 +249,43 @@ function Jr({
|
|
|
249
249
|
active: l = !1,
|
|
250
250
|
caret: c = !1,
|
|
251
251
|
onClear: h,
|
|
252
|
-
clearLabel:
|
|
253
|
-
onClick:
|
|
252
|
+
clearLabel: b = "Filter wissen",
|
|
253
|
+
onClick: y,
|
|
254
254
|
title: x,
|
|
255
|
-
className:
|
|
255
|
+
className: u
|
|
256
256
|
}) {
|
|
257
|
-
const f = l && !!h,
|
|
257
|
+
const f = l && !!h, p = s === "pill" ? "rounded-full" : "rounded-md", k = m(
|
|
258
258
|
// A button's default cursor is an arrow, so it has to be asked for.
|
|
259
259
|
"inline-flex cursor-pointer select-none items-center text-sm font-semibold",
|
|
260
260
|
a === "sm" ? "h-control-sm" : "h-control-md",
|
|
261
261
|
"transition-colors duration-fast ease-out",
|
|
262
|
-
|
|
262
|
+
p,
|
|
263
263
|
// Picking a value outranks whatever the value happens to mean.
|
|
264
|
-
l ? "bg-accent text-accent-fg" :
|
|
265
|
-
|
|
266
|
-
),
|
|
264
|
+
l ? "bg-accent text-accent-fg" : m("border", pt[n]),
|
|
265
|
+
u
|
|
266
|
+
), v = /* @__PURE__ */ i(fe, { children: [
|
|
267
267
|
r,
|
|
268
268
|
t,
|
|
269
269
|
c && /* @__PURE__ */ e(J, { icon: be, size: "xs" })
|
|
270
|
-
] }),
|
|
270
|
+
] }), g = m(
|
|
271
271
|
"inline-flex items-center gap-1.5 pl-3",
|
|
272
|
-
|
|
272
|
+
p,
|
|
273
273
|
f ? "pr-1.5" : "pr-3",
|
|
274
274
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
275
275
|
);
|
|
276
|
-
return f ? /* @__PURE__ */ i("span", { className:
|
|
277
|
-
/* @__PURE__ */ e("button", { type: "button", onClick:
|
|
276
|
+
return f ? /* @__PURE__ */ i("span", { className: k, title: x, children: [
|
|
277
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: y, className: g, children: v }),
|
|
278
278
|
/* @__PURE__ */ e(
|
|
279
279
|
"button",
|
|
280
280
|
{
|
|
281
281
|
type: "button",
|
|
282
|
-
"aria-label":
|
|
282
|
+
"aria-label": b,
|
|
283
283
|
onClick: h,
|
|
284
|
-
className:
|
|
284
|
+
className: m("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
285
285
|
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title: x, onClick:
|
|
288
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: x, onClick: y, className: m(k, g), children: v });
|
|
289
289
|
}
|
|
290
290
|
const vt = {
|
|
291
291
|
xs: "text-xs",
|
|
@@ -320,11 +320,11 @@ const vt = {
|
|
|
320
320
|
className: l,
|
|
321
321
|
children: c,
|
|
322
322
|
href: h,
|
|
323
|
-
target:
|
|
324
|
-
rel:
|
|
323
|
+
target: b,
|
|
324
|
+
rel: y,
|
|
325
325
|
...x
|
|
326
326
|
}) => {
|
|
327
|
-
const
|
|
327
|
+
const u = a || h && (h.startsWith("http") || h.startsWith("mailto:")), f = m(
|
|
328
328
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
329
329
|
"transition-colors duration-fast ease-out",
|
|
330
330
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -338,16 +338,16 @@ const vt = {
|
|
|
338
338
|
],
|
|
339
339
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
340
340
|
l
|
|
341
|
-
),
|
|
341
|
+
), p = {
|
|
342
342
|
...x,
|
|
343
343
|
href: s ? void 0 : h,
|
|
344
|
-
target:
|
|
345
|
-
rel:
|
|
344
|
+
target: u ? "_blank" : b,
|
|
345
|
+
rel: u ? "noopener noreferrer" : y,
|
|
346
346
|
"aria-disabled": s || void 0
|
|
347
347
|
};
|
|
348
|
-
return /* @__PURE__ */ i("a", { className: f, ...
|
|
348
|
+
return /* @__PURE__ */ i("a", { className: f, ...p, children: [
|
|
349
349
|
c,
|
|
350
|
-
|
|
350
|
+
u && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
351
351
|
] });
|
|
352
352
|
}, wt = {
|
|
353
353
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -366,7 +366,7 @@ function Xr({
|
|
|
366
366
|
{
|
|
367
367
|
role: "tablist",
|
|
368
368
|
"aria-label": l,
|
|
369
|
-
className:
|
|
369
|
+
className: m("inline-flex gap-0.5 rounded-md bg-surface-hover p-0.5", a),
|
|
370
370
|
children: t.map((c) => {
|
|
371
371
|
const h = c.value === r;
|
|
372
372
|
return /* @__PURE__ */ e(
|
|
@@ -376,7 +376,7 @@ function Xr({
|
|
|
376
376
|
"aria-selected": h,
|
|
377
377
|
type: "button",
|
|
378
378
|
onClick: () => n(c.value),
|
|
379
|
-
className:
|
|
379
|
+
className: m(
|
|
380
380
|
"inline-flex items-center justify-center rounded-sm",
|
|
381
381
|
"transition-colors duration-fast ease-out",
|
|
382
382
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -396,10 +396,10 @@ function we(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
396
396
|
return dt(() => {
|
|
397
397
|
if (!t) return;
|
|
398
398
|
const h = () => {
|
|
399
|
-
const
|
|
400
|
-
if (!
|
|
401
|
-
const
|
|
402
|
-
|
|
399
|
+
const b = r.current;
|
|
400
|
+
if (!b) return;
|
|
401
|
+
const y = b.getBoundingClientRect(), x = window.innerHeight - y.bottom, u = y.top, f = a.startsWith("top"), p = f ? u < 200 && x > u : x < 200 && u > x, k = f !== p, v = { position: "fixed" };
|
|
402
|
+
k ? (v.bottom = window.innerHeight - y.top + n, v.maxHeight = Math.max(120, u - n * 2)) : (v.top = y.bottom + n, v.maxHeight = Math.max(120, x - n * 2)), a.endsWith("end") ? v.right = window.innerWidth - y.right : v.left = y.left, s && (v.width = y.width), c(v);
|
|
403
403
|
};
|
|
404
404
|
return h(), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
|
|
405
405
|
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
@@ -416,32 +416,32 @@ const kt = ({
|
|
|
416
416
|
disabled: c = !1,
|
|
417
417
|
triggerLabel: h
|
|
418
418
|
}) => {
|
|
419
|
-
const [
|
|
419
|
+
const [b, y] = R(!1), x = ae(null), u = ae(null), f = we(b, u, { placement: n });
|
|
420
420
|
Y(() => {
|
|
421
|
-
if (!
|
|
422
|
-
const
|
|
423
|
-
x.current && !x.current.contains(
|
|
424
|
-
},
|
|
425
|
-
|
|
421
|
+
if (!b) return;
|
|
422
|
+
const v = ($) => {
|
|
423
|
+
x.current && !x.current.contains($.target) && y(!1);
|
|
424
|
+
}, g = ($) => {
|
|
425
|
+
$.key === "Escape" && y(!1);
|
|
426
426
|
};
|
|
427
|
-
return document.addEventListener("mousedown",
|
|
428
|
-
document.removeEventListener("mousedown",
|
|
427
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", g), () => {
|
|
428
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", g);
|
|
429
429
|
};
|
|
430
|
-
}, [
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
return /* @__PURE__ */ i("div", { ref: x, className:
|
|
430
|
+
}, [b]);
|
|
431
|
+
const p = (v) => {
|
|
432
|
+
v.stopPropagation(), !c && y((g) => !g);
|
|
433
|
+
}, k = () => y(!1);
|
|
434
|
+
return /* @__PURE__ */ i("div", { ref: x, className: m("relative inline-flex", a), children: [
|
|
435
435
|
/* @__PURE__ */ e(
|
|
436
436
|
"button",
|
|
437
437
|
{
|
|
438
|
-
ref:
|
|
438
|
+
ref: u,
|
|
439
439
|
type: "button",
|
|
440
|
-
onClick:
|
|
440
|
+
onClick: p,
|
|
441
441
|
disabled: c,
|
|
442
442
|
"aria-label": h,
|
|
443
|
-
"aria-expanded":
|
|
444
|
-
className:
|
|
443
|
+
"aria-expanded": b,
|
|
444
|
+
className: m(
|
|
445
445
|
"inline-flex items-center",
|
|
446
446
|
c && "cursor-not-allowed opacity-50",
|
|
447
447
|
l
|
|
@@ -449,17 +449,17 @@ const kt = ({
|
|
|
449
449
|
children: t
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
|
-
|
|
452
|
+
b && /* @__PURE__ */ e(
|
|
453
453
|
"div",
|
|
454
454
|
{
|
|
455
|
-
className:
|
|
455
|
+
className: m(
|
|
456
456
|
// overflow-y-auto pairs with the hook's max-height: without it a
|
|
457
457
|
// panel taller than the space available is simply cut off.
|
|
458
458
|
"fixed z-overlay overflow-y-auto rounded-lg border border-border bg-surface shadow-overlay",
|
|
459
459
|
s
|
|
460
460
|
),
|
|
461
461
|
style: f,
|
|
462
|
-
children: typeof r == "function" ? r(
|
|
462
|
+
children: typeof r == "function" ? r(k) : r
|
|
463
463
|
}
|
|
464
464
|
)
|
|
465
465
|
] });
|
|
@@ -480,13 +480,13 @@ function Pe({
|
|
|
480
480
|
options: l,
|
|
481
481
|
disabled: c = !1,
|
|
482
482
|
loading: h = !1,
|
|
483
|
-
menuPlacement:
|
|
484
|
-
menuLabel:
|
|
483
|
+
menuPlacement: b = "bottom-end",
|
|
484
|
+
menuLabel: y = "More options"
|
|
485
485
|
}) {
|
|
486
|
-
const x = c || h,
|
|
486
|
+
const x = c || h, u = l.length > 0;
|
|
487
487
|
return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
|
|
488
488
|
/* @__PURE__ */ e(
|
|
489
|
-
|
|
489
|
+
re,
|
|
490
490
|
{
|
|
491
491
|
variant: n,
|
|
492
492
|
size: s,
|
|
@@ -494,22 +494,22 @@ function Pe({
|
|
|
494
494
|
disabled: c,
|
|
495
495
|
loading: h,
|
|
496
496
|
leftIcon: a,
|
|
497
|
-
className: u
|
|
497
|
+
className: m(u && "rounded-r-none"),
|
|
498
498
|
children: t
|
|
499
499
|
}
|
|
500
500
|
),
|
|
501
|
-
|
|
501
|
+
u && /* @__PURE__ */ e(
|
|
502
502
|
kt,
|
|
503
503
|
{
|
|
504
|
-
placement:
|
|
504
|
+
placement: b,
|
|
505
505
|
disabled: x,
|
|
506
|
-
triggerLabel:
|
|
506
|
+
triggerLabel: y,
|
|
507
507
|
className: "min-w-menu py-1",
|
|
508
508
|
trigger: /* @__PURE__ */ e(
|
|
509
509
|
"span",
|
|
510
510
|
{
|
|
511
511
|
"aria-hidden": "true",
|
|
512
|
-
className:
|
|
512
|
+
className: m(
|
|
513
513
|
"inline-flex items-center justify-center rounded-md rounded-l-none",
|
|
514
514
|
"transition-colors duration-fast ease-out",
|
|
515
515
|
Ct[n],
|
|
@@ -519,25 +519,25 @@ function Pe({
|
|
|
519
519
|
children: /* @__PURE__ */ e(be, { className: "size-icon-md" })
|
|
520
520
|
}
|
|
521
521
|
),
|
|
522
|
-
children: (f) => /* @__PURE__ */ e(fe, { children: l.map((
|
|
522
|
+
children: (f) => /* @__PURE__ */ e(fe, { children: l.map((p) => /* @__PURE__ */ i(
|
|
523
523
|
"button",
|
|
524
524
|
{
|
|
525
525
|
type: "button",
|
|
526
526
|
onClick: () => {
|
|
527
|
-
|
|
527
|
+
p.onClick(), f();
|
|
528
528
|
},
|
|
529
|
-
className:
|
|
529
|
+
className: m(
|
|
530
530
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
531
531
|
"transition-colors duration-fast ease-out",
|
|
532
532
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
533
|
-
|
|
533
|
+
p.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
|
|
534
534
|
),
|
|
535
535
|
children: [
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
p.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: p.icon }),
|
|
537
|
+
p.label
|
|
538
538
|
]
|
|
539
539
|
},
|
|
540
|
-
|
|
540
|
+
p.id
|
|
541
541
|
)) })
|
|
542
542
|
}
|
|
543
543
|
)
|
|
@@ -568,36 +568,36 @@ const zt = {
|
|
|
568
568
|
shape: l = "square",
|
|
569
569
|
containerClassName: c,
|
|
570
570
|
labelClassName: h,
|
|
571
|
-
className:
|
|
572
|
-
id:
|
|
571
|
+
className: b,
|
|
572
|
+
id: y,
|
|
573
573
|
...x
|
|
574
|
-
},
|
|
575
|
-
const f = le.useId(),
|
|
576
|
-
(
|
|
577
|
-
|
|
574
|
+
}, u) => {
|
|
575
|
+
const f = le.useId(), p = y || `checkbox-${f}`, k = !!n, v = le.useRef(null), g = le.useCallback(
|
|
576
|
+
($) => {
|
|
577
|
+
v.current = $, typeof u == "function" ? u($) : u && typeof u == "object" && (u.current = $);
|
|
578
578
|
},
|
|
579
|
-
[
|
|
579
|
+
[u]
|
|
580
580
|
);
|
|
581
581
|
return le.useEffect(() => {
|
|
582
|
-
|
|
583
|
-
}, [a]), /* @__PURE__ */ i("div", { className:
|
|
584
|
-
/* @__PURE__ */ i("div", { className:
|
|
582
|
+
v.current && (v.current.indeterminate = a);
|
|
583
|
+
}, [a]), /* @__PURE__ */ i("div", { className: m("flex flex-col", c), children: [
|
|
584
|
+
/* @__PURE__ */ i("div", { className: m("flex items-center gap-3", Et[s]), children: [
|
|
585
585
|
/* @__PURE__ */ e(
|
|
586
586
|
"input",
|
|
587
587
|
{
|
|
588
|
-
ref:
|
|
589
|
-
id:
|
|
588
|
+
ref: g,
|
|
589
|
+
id: p,
|
|
590
590
|
type: "checkbox",
|
|
591
|
-
"aria-invalid":
|
|
592
|
-
className:
|
|
591
|
+
"aria-invalid": k || void 0,
|
|
592
|
+
className: m(
|
|
593
593
|
"shrink-0 border bg-surface-input accent-accent",
|
|
594
594
|
l === "circle" ? "rounded-full" : "rounded-sm",
|
|
595
595
|
"transition-colors duration-fast ease-out",
|
|
596
596
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
597
597
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
598
598
|
zt[s],
|
|
599
|
-
|
|
600
|
-
|
|
599
|
+
k ? "border-danger-border" : "border-border-strong",
|
|
600
|
+
b
|
|
601
601
|
),
|
|
602
602
|
...x
|
|
603
603
|
}
|
|
@@ -606,10 +606,10 @@ const zt = {
|
|
|
606
606
|
/* @__PURE__ */ e(
|
|
607
607
|
"label",
|
|
608
608
|
{
|
|
609
|
-
htmlFor:
|
|
610
|
-
className:
|
|
609
|
+
htmlFor: p,
|
|
610
|
+
className: m(
|
|
611
611
|
"cursor-pointer",
|
|
612
|
-
|
|
612
|
+
k ? "text-danger-fg" : "text-text",
|
|
613
613
|
Mt[s],
|
|
614
614
|
h
|
|
615
615
|
),
|
|
@@ -633,51 +633,51 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
633
633
|
size: l = "md",
|
|
634
634
|
className: c,
|
|
635
635
|
minDate: h,
|
|
636
|
-
maxDate:
|
|
637
|
-
format:
|
|
636
|
+
maxDate: b,
|
|
637
|
+
format: y = "MM/dd/yyyy",
|
|
638
638
|
withTime: x = !1
|
|
639
|
-
},
|
|
640
|
-
const [f,
|
|
639
|
+
}, u) => {
|
|
640
|
+
const [f, p] = R(!1), [k, v] = R(() => t || /* @__PURE__ */ new Date()), g = ae(null), $ = ae(null), D = we(f, $);
|
|
641
641
|
Y(() => {
|
|
642
|
-
const
|
|
643
|
-
|
|
642
|
+
const d = (E) => {
|
|
643
|
+
g.current && !g.current.contains(E.target) && p(!1);
|
|
644
644
|
};
|
|
645
|
-
return f && document.addEventListener("mousedown",
|
|
646
|
-
document.removeEventListener("mousedown",
|
|
645
|
+
return f && document.addEventListener("mousedown", d), () => {
|
|
646
|
+
document.removeEventListener("mousedown", d);
|
|
647
647
|
};
|
|
648
648
|
}, [f]);
|
|
649
|
-
const
|
|
650
|
-
if (!
|
|
651
|
-
const
|
|
652
|
-
return x ? `${
|
|
653
|
-
},
|
|
654
|
-
const [
|
|
655
|
-
if (Number.isNaN(
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
},
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
for (let
|
|
663
|
-
|
|
664
|
-
return
|
|
665
|
-
},
|
|
666
|
-
if (
|
|
649
|
+
const _ = (d) => {
|
|
650
|
+
if (!d) return "";
|
|
651
|
+
const E = d.getDate().toString().padStart(2, "0"), N = (d.getMonth() + 1).toString().padStart(2, "0"), L = d.getFullYear(), w = y === "dd/MM/yyyy" ? `${E}/${N}/${L}` : y === "yyyy-MM-dd" ? `${L}-${N}-${E}` : `${N}/${E}/${L}`;
|
|
652
|
+
return x ? `${w} ${M(d)}` : w;
|
|
653
|
+
}, M = (d) => `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}`, q = (d) => {
|
|
654
|
+
const [E, N] = d.split(":").map(Number);
|
|
655
|
+
if (Number.isNaN(E) || Number.isNaN(N)) return;
|
|
656
|
+
const L = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
657
|
+
L.setHours(E, N, 0, 0), r?.(L);
|
|
658
|
+
}, V = () => {
|
|
659
|
+
const d = k.getFullYear(), E = k.getMonth(), N = new Date(d, E, 1), L = new Date(N);
|
|
660
|
+
L.setDate(L.getDate() - N.getDay());
|
|
661
|
+
const w = [], Q = new Date(L);
|
|
662
|
+
for (let te = 0; te < 42; te++)
|
|
663
|
+
w.push(new Date(Q)), Q.setDate(Q.getDate() + 1);
|
|
664
|
+
return w;
|
|
665
|
+
}, j = (d) => {
|
|
666
|
+
if (d.getMonth() === k.getMonth() && !(h && d < h) && !(b && d > b)) {
|
|
667
667
|
if (x) {
|
|
668
|
-
const
|
|
669
|
-
|
|
668
|
+
const N = new Date(d);
|
|
669
|
+
N.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(N);
|
|
670
670
|
return;
|
|
671
671
|
}
|
|
672
|
-
r?.(
|
|
672
|
+
r?.(d), p(!1);
|
|
673
673
|
}
|
|
674
|
-
}, I = () => {
|
|
675
|
-
y(new Date(C.getFullYear(), C.getMonth() - 1, 1));
|
|
676
674
|
}, W = () => {
|
|
677
|
-
|
|
675
|
+
v(new Date(k.getFullYear(), k.getMonth() - 1, 1));
|
|
678
676
|
}, H = () => {
|
|
679
|
-
|
|
680
|
-
}, X =
|
|
677
|
+
v(new Date(k.getFullYear(), k.getMonth() + 1, 1));
|
|
678
|
+
}, X = () => {
|
|
679
|
+
r?.(null), p(!1);
|
|
680
|
+
}, Z = m(
|
|
681
681
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
682
682
|
"bg-surface text-text",
|
|
683
683
|
"placeholder:text-text-muted",
|
|
@@ -690,7 +690,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
690
690
|
"h-control-md w-full px-3 text-base": l === "full"
|
|
691
691
|
},
|
|
692
692
|
c
|
|
693
|
-
),
|
|
693
|
+
), ee = V(), C = [
|
|
694
694
|
"January",
|
|
695
695
|
"February",
|
|
696
696
|
"March",
|
|
@@ -704,77 +704,77 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
704
704
|
"November",
|
|
705
705
|
"December"
|
|
706
706
|
];
|
|
707
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
708
|
-
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
707
|
+
return /* @__PURE__ */ i("div", { ref: g, className: "relative", children: [
|
|
708
|
+
/* @__PURE__ */ i("div", { ref: $, className: "relative", children: [
|
|
709
709
|
/* @__PURE__ */ e(
|
|
710
710
|
"input",
|
|
711
711
|
{
|
|
712
|
-
ref:
|
|
712
|
+
ref: u,
|
|
713
713
|
type: "text",
|
|
714
|
-
value:
|
|
714
|
+
value: _(t ?? null),
|
|
715
715
|
placeholder: n,
|
|
716
716
|
disabled: s,
|
|
717
717
|
required: a,
|
|
718
718
|
readOnly: !0,
|
|
719
|
-
onClick: () => !s &&
|
|
720
|
-
className:
|
|
719
|
+
onClick: () => !s && p(!f),
|
|
720
|
+
className: m(Z, "pr-10 cursor-pointer")
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
723
|
/* @__PURE__ */ e(
|
|
724
724
|
"button",
|
|
725
725
|
{
|
|
726
726
|
type: "button",
|
|
727
|
-
onClick: () => !s &&
|
|
727
|
+
onClick: () => !s && p(!f),
|
|
728
728
|
disabled: s,
|
|
729
729
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
730
730
|
children: /* @__PURE__ */ e($t, {})
|
|
731
731
|
}
|
|
732
732
|
)
|
|
733
733
|
] }),
|
|
734
|
-
f && /* @__PURE__ */ i("div", { style: D, className: "z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
734
|
+
f && /* @__PURE__ */ i("div", { style: D, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
735
735
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
736
736
|
/* @__PURE__ */ e(
|
|
737
737
|
"button",
|
|
738
738
|
{
|
|
739
|
-
onClick:
|
|
739
|
+
onClick: W,
|
|
740
740
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
741
741
|
children: /* @__PURE__ */ e(Dt, {})
|
|
742
742
|
}
|
|
743
743
|
),
|
|
744
744
|
/* @__PURE__ */ i("h3", { className: "text-sm font-medium text-text", children: [
|
|
745
|
-
|
|
745
|
+
C[k.getMonth()],
|
|
746
746
|
" ",
|
|
747
|
-
|
|
747
|
+
k.getFullYear()
|
|
748
748
|
] }),
|
|
749
749
|
/* @__PURE__ */ e(
|
|
750
750
|
"button",
|
|
751
751
|
{
|
|
752
|
-
onClick:
|
|
752
|
+
onClick: H,
|
|
753
753
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
754
754
|
children: /* @__PURE__ */ e(Tt, {})
|
|
755
755
|
}
|
|
756
756
|
)
|
|
757
757
|
] }),
|
|
758
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((
|
|
759
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children:
|
|
760
|
-
const
|
|
758
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: d }, d)) }),
|
|
759
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ee.map((d, E) => {
|
|
760
|
+
const N = d.getMonth() === k.getMonth(), L = t && d.toDateString() === t.toDateString(), w = d.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), Q = !N || h && d < h || b && d > b;
|
|
761
761
|
return /* @__PURE__ */ e(
|
|
762
762
|
"button",
|
|
763
763
|
{
|
|
764
|
-
onClick: () => !
|
|
765
|
-
disabled:
|
|
766
|
-
className:
|
|
764
|
+
onClick: () => !Q && j(d),
|
|
765
|
+
disabled: Q,
|
|
766
|
+
className: m(
|
|
767
767
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
768
768
|
{
|
|
769
|
-
"text-text hover:bg-surface-hover":
|
|
770
|
-
"bg-accent text-accent-fg":
|
|
771
|
-
"bg-surface-hover text-text":
|
|
772
|
-
"text-text-muted cursor-not-allowed":
|
|
769
|
+
"text-text hover:bg-surface-hover": N && !L && !Q,
|
|
770
|
+
"bg-accent text-accent-fg": L,
|
|
771
|
+
"bg-surface-hover text-text": w && !L,
|
|
772
|
+
"text-text-muted cursor-not-allowed": Q
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
|
-
children:
|
|
775
|
+
children: d.getDate()
|
|
776
776
|
},
|
|
777
|
-
|
|
777
|
+
E
|
|
778
778
|
);
|
|
779
779
|
}) }),
|
|
780
780
|
x && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
@@ -784,8 +784,8 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
784
784
|
{
|
|
785
785
|
id: "datepicker-time",
|
|
786
786
|
type: "time",
|
|
787
|
-
value: t ?
|
|
788
|
-
onChange: (
|
|
787
|
+
value: t ? M(t) : "",
|
|
788
|
+
onChange: (d) => q(d.target.value),
|
|
789
789
|
className: "h-control-sm rounded-md border border-border bg-surface-input px-2 text-sm text-text focus-visible:outline-none focus-visible:focus-ring"
|
|
790
790
|
}
|
|
791
791
|
)
|
|
@@ -794,7 +794,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
794
794
|
/* @__PURE__ */ e(
|
|
795
795
|
"button",
|
|
796
796
|
{
|
|
797
|
-
onClick:
|
|
797
|
+
onClick: X,
|
|
798
798
|
className: "text-sm text-text-muted hover:text-text",
|
|
799
799
|
children: "Clear"
|
|
800
800
|
}
|
|
@@ -802,7 +802,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
802
802
|
/* @__PURE__ */ e(
|
|
803
803
|
"button",
|
|
804
804
|
{
|
|
805
|
-
onClick: () =>
|
|
805
|
+
onClick: () => p(!1),
|
|
806
806
|
className: "text-sm text-info-fg hover:underline",
|
|
807
807
|
children: "Close"
|
|
808
808
|
}
|
|
@@ -825,90 +825,90 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
825
825
|
options: l,
|
|
826
826
|
placeholder: c,
|
|
827
827
|
containerClassName: h,
|
|
828
|
-
labelClassName:
|
|
829
|
-
className:
|
|
828
|
+
labelClassName: b,
|
|
829
|
+
className: y,
|
|
830
830
|
id: x,
|
|
831
|
-
searchable:
|
|
831
|
+
searchable: u,
|
|
832
832
|
multiple: f,
|
|
833
|
-
value:
|
|
834
|
-
onChange:
|
|
835
|
-
allowCreate:
|
|
836
|
-
onCreateOption:
|
|
837
|
-
|
|
838
|
-
},
|
|
839
|
-
const _ = x || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [q, V] = le.useState(!1), [
|
|
840
|
-
le.useImperativeHandle(
|
|
833
|
+
value: p,
|
|
834
|
+
onChange: k,
|
|
835
|
+
allowCreate: v,
|
|
836
|
+
onCreateOption: g,
|
|
837
|
+
...$
|
|
838
|
+
}, D) => {
|
|
839
|
+
const _ = x || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [q, V] = le.useState(!1), [j, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = we(q, X, { matchWidth: !0 }), [ee, C] = le.useState(l);
|
|
840
|
+
le.useImperativeHandle(D, () => H.current), le.useEffect(() => {
|
|
841
841
|
const S = (A) => {
|
|
842
842
|
H.current && !H.current.contains(A.target) && V(!1);
|
|
843
843
|
};
|
|
844
844
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
845
845
|
}, []);
|
|
846
|
-
const
|
|
846
|
+
const d = le.useCallback(
|
|
847
847
|
(S, A) => S.some(
|
|
848
|
-
(
|
|
848
|
+
(I) => ge(I.value) === ge(A) || ge(I.label) === ge(A)
|
|
849
849
|
),
|
|
850
850
|
[]
|
|
851
851
|
), E = le.useCallback(
|
|
852
852
|
(S, A) => {
|
|
853
|
-
const
|
|
853
|
+
const I = [...S], T = (U) => {
|
|
854
854
|
const P = (U ?? "").trim();
|
|
855
|
-
P && (
|
|
855
|
+
P && (d(I, P) || I.push({ value: P, label: P }));
|
|
856
856
|
};
|
|
857
|
-
return Array.isArray(A) ? A.forEach(T) : T(A),
|
|
857
|
+
return Array.isArray(A) ? A.forEach(T) : T(A), I;
|
|
858
858
|
},
|
|
859
|
-
[
|
|
859
|
+
[d]
|
|
860
860
|
);
|
|
861
861
|
le.useEffect(() => {
|
|
862
|
-
|
|
862
|
+
C((S) => {
|
|
863
863
|
const A = [...l];
|
|
864
|
-
return S.forEach((
|
|
865
|
-
!
|
|
866
|
-
}), E(A,
|
|
864
|
+
return S.forEach((I) => {
|
|
865
|
+
!d(A, I.value) && !d(A, I.label) && A.push(I);
|
|
866
|
+
}), E(A, p);
|
|
867
867
|
});
|
|
868
|
-
}, [l,
|
|
869
|
-
const
|
|
868
|
+
}, [l, p, E, d]);
|
|
869
|
+
const N = (S) => {
|
|
870
870
|
if (f) {
|
|
871
|
-
const A = Array.isArray(
|
|
872
|
-
|
|
871
|
+
const A = Array.isArray(p) ? p : [], I = A.includes(S) ? A.filter((T) => T !== S) : [...A, S];
|
|
872
|
+
k?.(I);
|
|
873
873
|
} else
|
|
874
|
-
|
|
875
|
-
},
|
|
876
|
-
(S) => Array.isArray(
|
|
877
|
-
) : [],
|
|
878
|
-
(S) => S.label.toLowerCase().includes(
|
|
879
|
-
) :
|
|
874
|
+
k?.(S), V(!1), W("");
|
|
875
|
+
}, L = f ? null : ee.find((S) => S.value === p), w = f ? ee.filter(
|
|
876
|
+
(S) => Array.isArray(p) && p.includes(S.value)
|
|
877
|
+
) : [], Q = u && j ? ee.filter(
|
|
878
|
+
(S) => S.label.toLowerCase().includes(j.toLowerCase())
|
|
879
|
+
) : ee, te = !!v && !!u && !!j.trim() && !d(ee, j), ne = (S) => {
|
|
880
880
|
const A = S.trim();
|
|
881
881
|
if (!A) return;
|
|
882
|
-
const
|
|
882
|
+
const I = g?.(A) ?? {
|
|
883
883
|
value: A,
|
|
884
884
|
label: A
|
|
885
885
|
};
|
|
886
|
-
if (
|
|
887
|
-
|
|
886
|
+
if (d(ee, I.value) || d(ee, I.label)) {
|
|
887
|
+
N(I.value), W(""), f || V(!1);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
|
|
891
|
-
}, G = () => f ?
|
|
890
|
+
C((T) => [...T, I]), N(I.value), W(""), f || V(!1);
|
|
891
|
+
}, G = () => f ? w.length > 0 ? w.map((S) => S.label).join(", ") : c || "Select options" : L?.label || c || "Select an option";
|
|
892
892
|
return /* @__PURE__ */ i(
|
|
893
893
|
"div",
|
|
894
894
|
{
|
|
895
895
|
ref: H,
|
|
896
|
-
className:
|
|
896
|
+
className: m(
|
|
897
897
|
"relative flex flex-col",
|
|
898
898
|
a && "w-full",
|
|
899
899
|
h
|
|
900
900
|
),
|
|
901
|
-
|
|
901
|
+
...$,
|
|
902
902
|
children: [
|
|
903
903
|
t && /* @__PURE__ */ e(
|
|
904
904
|
"label",
|
|
905
905
|
{
|
|
906
906
|
htmlFor: _,
|
|
907
907
|
onClick: () => V(!q),
|
|
908
|
-
className:
|
|
908
|
+
className: m(
|
|
909
909
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
910
910
|
M ? "text-danger-fg" : "text-text-muted",
|
|
911
|
-
|
|
911
|
+
b
|
|
912
912
|
),
|
|
913
913
|
children: t
|
|
914
914
|
}
|
|
@@ -921,14 +921,14 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
921
921
|
type: "button",
|
|
922
922
|
id: _,
|
|
923
923
|
onClick: () => V(!q),
|
|
924
|
-
className:
|
|
924
|
+
className: m(
|
|
925
925
|
"flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
|
|
926
926
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
927
927
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
928
928
|
"bg-surface",
|
|
929
929
|
At[s],
|
|
930
930
|
M ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
931
|
-
|
|
931
|
+
y
|
|
932
932
|
),
|
|
933
933
|
children: [
|
|
934
934
|
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: G() }),
|
|
@@ -936,7 +936,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
936
936
|
Xe,
|
|
937
937
|
{
|
|
938
938
|
size: 16,
|
|
939
|
-
className:
|
|
939
|
+
className: m(
|
|
940
940
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
941
941
|
q && "rotate-180"
|
|
942
942
|
)
|
|
@@ -945,34 +945,34 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
945
945
|
]
|
|
946
946
|
}
|
|
947
947
|
),
|
|
948
|
-
q && /* @__PURE__ */ i("div", { style: Z, className: "z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
949
|
-
|
|
948
|
+
q && /* @__PURE__ */ i("div", { style: Z, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
949
|
+
u && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
950
950
|
"input",
|
|
951
951
|
{
|
|
952
952
|
type: "text",
|
|
953
953
|
placeholder: "Search...",
|
|
954
|
-
value:
|
|
954
|
+
value: j,
|
|
955
955
|
onChange: (S) => W(S.target.value),
|
|
956
956
|
onKeyDown: (S) => {
|
|
957
|
-
S.key === "Enter" &&
|
|
957
|
+
S.key === "Enter" && te && (S.preventDefault(), ne(j));
|
|
958
958
|
},
|
|
959
|
-
className:
|
|
959
|
+
className: m(
|
|
960
960
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
961
961
|
"text-text border-border focus-visible:outline-none focus-visible:focus-ring"
|
|
962
962
|
)
|
|
963
963
|
}
|
|
964
964
|
) }),
|
|
965
|
-
|
|
965
|
+
te && /* @__PURE__ */ i(
|
|
966
966
|
"div",
|
|
967
967
|
{
|
|
968
|
-
className:
|
|
968
|
+
className: m(
|
|
969
969
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
970
970
|
"text-info-fg hover:bg-surface-hover"
|
|
971
971
|
),
|
|
972
|
-
onClick: () =>
|
|
972
|
+
onClick: () => ne(j),
|
|
973
973
|
children: [
|
|
974
974
|
"+: “",
|
|
975
|
-
|
|
975
|
+
j.trim(),
|
|
976
976
|
"”"
|
|
977
977
|
]
|
|
978
978
|
}
|
|
@@ -983,18 +983,18 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
983
983
|
{
|
|
984
984
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
985
985
|
onClick: () => {
|
|
986
|
-
|
|
986
|
+
k?.(""), V(!1);
|
|
987
987
|
},
|
|
988
988
|
children: c
|
|
989
989
|
}
|
|
990
990
|
),
|
|
991
|
-
|
|
992
|
-
const A = f ? Array.isArray(
|
|
991
|
+
Q.map((S) => {
|
|
992
|
+
const A = f ? Array.isArray(p) && p.includes(S.value) : p === S.value;
|
|
993
993
|
return /* @__PURE__ */ e(
|
|
994
994
|
"li",
|
|
995
995
|
{
|
|
996
|
-
onClick: () => !S.disabled &&
|
|
997
|
-
className:
|
|
996
|
+
onClick: () => !S.disabled && N(S.value),
|
|
997
|
+
className: m(
|
|
998
998
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
999
999
|
"text-text",
|
|
1000
1000
|
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
@@ -1022,7 +1022,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
1022
1022
|
(n || r) && /* @__PURE__ */ e(
|
|
1023
1023
|
"p",
|
|
1024
1024
|
{
|
|
1025
|
-
className:
|
|
1025
|
+
className: m(
|
|
1026
1026
|
"mt-1 text-xs",
|
|
1027
1027
|
M ? "text-danger-fg" : "text-text-muted"
|
|
1028
1028
|
),
|
|
@@ -1050,22 +1050,22 @@ const Lt = {
|
|
|
1050
1050
|
startIcon: l,
|
|
1051
1051
|
endIcon: c,
|
|
1052
1052
|
loading: h = !1,
|
|
1053
|
-
containerClassName:
|
|
1054
|
-
labelClassName:
|
|
1053
|
+
containerClassName: b,
|
|
1054
|
+
labelClassName: y,
|
|
1055
1055
|
className: x,
|
|
1056
|
-
id:
|
|
1056
|
+
id: u,
|
|
1057
1057
|
...f
|
|
1058
|
-
},
|
|
1059
|
-
const
|
|
1060
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1058
|
+
}, p) => {
|
|
1059
|
+
const k = le.useId(), v = u || `textfield-${k}`, g = !!n, $ = n || r ? `${v}-description` : void 0;
|
|
1060
|
+
return /* @__PURE__ */ i("div", { className: m("flex flex-col", a && "w-full", b), children: [
|
|
1061
1061
|
t && /* @__PURE__ */ e(
|
|
1062
1062
|
"label",
|
|
1063
1063
|
{
|
|
1064
|
-
htmlFor:
|
|
1065
|
-
className:
|
|
1064
|
+
htmlFor: v,
|
|
1065
|
+
className: m(
|
|
1066
1066
|
Oe,
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
g ? "text-danger-fg" : "text-text-subtle",
|
|
1068
|
+
y
|
|
1069
1069
|
),
|
|
1070
1070
|
children: t
|
|
1071
1071
|
}
|
|
@@ -1075,11 +1075,11 @@ const Lt = {
|
|
|
1075
1075
|
/* @__PURE__ */ e(
|
|
1076
1076
|
"input",
|
|
1077
1077
|
{
|
|
1078
|
-
ref:
|
|
1079
|
-
id:
|
|
1080
|
-
"aria-invalid":
|
|
1081
|
-
"aria-describedby":
|
|
1082
|
-
className:
|
|
1078
|
+
ref: p,
|
|
1079
|
+
id: v,
|
|
1080
|
+
"aria-invalid": g || void 0,
|
|
1081
|
+
"aria-describedby": $,
|
|
1082
|
+
className: m(
|
|
1083
1083
|
"block w-full rounded-md border bg-surface-input text-text",
|
|
1084
1084
|
"transition-colors duration-fast ease-out",
|
|
1085
1085
|
"placeholder:text-text-subtle",
|
|
@@ -1088,7 +1088,7 @@ const Lt = {
|
|
|
1088
1088
|
Lt[s],
|
|
1089
1089
|
l && "pl-9",
|
|
1090
1090
|
(c || h) && "pr-9",
|
|
1091
|
-
|
|
1091
|
+
g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
1092
1092
|
x
|
|
1093
1093
|
),
|
|
1094
1094
|
...f
|
|
@@ -1105,8 +1105,8 @@ const Lt = {
|
|
|
1105
1105
|
(n || r) && /* @__PURE__ */ e(
|
|
1106
1106
|
"p",
|
|
1107
1107
|
{
|
|
1108
|
-
id:
|
|
1109
|
-
className:
|
|
1108
|
+
id: $,
|
|
1109
|
+
className: m("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
|
|
1110
1110
|
children: n || r
|
|
1111
1111
|
}
|
|
1112
1112
|
)
|
|
@@ -1124,14 +1124,14 @@ function It({
|
|
|
1124
1124
|
templatePlaceholder: c,
|
|
1125
1125
|
showTemplate: h = !0
|
|
1126
1126
|
}) {
|
|
1127
|
-
const [
|
|
1127
|
+
const [b, y] = R([]);
|
|
1128
1128
|
Y(() => {
|
|
1129
|
-
let
|
|
1129
|
+
let u = !0;
|
|
1130
1130
|
return Promise.resolve(n?.()).then((f) => {
|
|
1131
|
-
|
|
1131
|
+
u && f && y(f.data ?? []);
|
|
1132
1132
|
}).catch(() => {
|
|
1133
1133
|
}), () => {
|
|
1134
|
-
|
|
1134
|
+
u = !1;
|
|
1135
1135
|
};
|
|
1136
1136
|
}, []);
|
|
1137
1137
|
const x = t ?? {};
|
|
@@ -1142,9 +1142,9 @@ function It({
|
|
|
1142
1142
|
size: a,
|
|
1143
1143
|
fullWidth: !0,
|
|
1144
1144
|
value: x.folderId ?? "",
|
|
1145
|
-
options:
|
|
1145
|
+
options: b.map((u) => ({ value: u.id, label: u.name })),
|
|
1146
1146
|
placeholder: l ?? "Select a folder",
|
|
1147
|
-
onChange: (
|
|
1147
|
+
onChange: (u) => r?.({ ...x, folderId: u })
|
|
1148
1148
|
}
|
|
1149
1149
|
),
|
|
1150
1150
|
h && /* @__PURE__ */ e(
|
|
@@ -1154,7 +1154,7 @@ function It({
|
|
|
1154
1154
|
disabled: s ?? !1,
|
|
1155
1155
|
value: x.pathTemplate ?? "",
|
|
1156
1156
|
placeholder: c ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
1157
|
-
onChange: (
|
|
1157
|
+
onChange: (u) => r?.({ ...x, pathTemplate: u.target.value })
|
|
1158
1158
|
}
|
|
1159
1159
|
)
|
|
1160
1160
|
] });
|
|
@@ -1179,61 +1179,61 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1179
1179
|
startIcon: l = /* @__PURE__ */ e(jt, {}),
|
|
1180
1180
|
loading: c = !1,
|
|
1181
1181
|
containerClassName: h,
|
|
1182
|
-
labelClassName:
|
|
1183
|
-
className:
|
|
1182
|
+
labelClassName: b,
|
|
1183
|
+
className: y,
|
|
1184
1184
|
id: x,
|
|
1185
|
-
options:
|
|
1185
|
+
options: u,
|
|
1186
1186
|
onRemoteSearch: f,
|
|
1187
|
-
onSelect:
|
|
1188
|
-
debounceTime:
|
|
1189
|
-
showAllOnOpen:
|
|
1190
|
-
value:
|
|
1191
|
-
onChange:
|
|
1192
|
-
|
|
1187
|
+
onSelect: p,
|
|
1188
|
+
debounceTime: k = 500,
|
|
1189
|
+
showAllOnOpen: v = !1,
|
|
1190
|
+
value: g,
|
|
1191
|
+
onChange: $,
|
|
1192
|
+
...D
|
|
1193
1193
|
}, _) => {
|
|
1194
|
-
const M = x || `searchfield-${Math.random().toString(36).substr(2, 9)}`, q = !!n, V =
|
|
1194
|
+
const M = x || `searchfield-${Math.random().toString(36).substr(2, 9)}`, q = !!n, V = ae(null), j = ae(null), [W, H] = R(g || ""), [X, Z] = R(!1), [ee, C] = R(!1), [d, E] = R(!1);
|
|
1195
1195
|
Y(() => {
|
|
1196
|
-
|
|
1197
|
-
}, [
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1196
|
+
g !== void 0 && H(g);
|
|
1197
|
+
}, [g]);
|
|
1198
|
+
const N = me(() => {
|
|
1199
|
+
if (v && !d || !W) return u;
|
|
1200
1200
|
const S = String(W).toLowerCase();
|
|
1201
|
-
return
|
|
1201
|
+
return u.filter(
|
|
1202
1202
|
(A) => String(A.label).toLowerCase().includes(S)
|
|
1203
1203
|
);
|
|
1204
|
-
}, [W,
|
|
1204
|
+
}, [W, u, v, d]);
|
|
1205
1205
|
Y(() => {
|
|
1206
1206
|
if (!f || !W) {
|
|
1207
|
-
|
|
1207
|
+
C(!1);
|
|
1208
1208
|
return;
|
|
1209
1209
|
}
|
|
1210
1210
|
const S = setTimeout(async () => {
|
|
1211
|
-
|
|
1211
|
+
C(!0);
|
|
1212
1212
|
try {
|
|
1213
1213
|
await f(String(W));
|
|
1214
1214
|
} catch (A) {
|
|
1215
1215
|
console.error("Remote search failed:", A);
|
|
1216
1216
|
} finally {
|
|
1217
|
-
|
|
1217
|
+
C(!1);
|
|
1218
1218
|
}
|
|
1219
|
-
},
|
|
1219
|
+
}, k);
|
|
1220
1220
|
return () => {
|
|
1221
|
-
clearTimeout(S),
|
|
1221
|
+
clearTimeout(S), C(!1);
|
|
1222
1222
|
};
|
|
1223
|
-
}, [W,
|
|
1223
|
+
}, [W, k, f]), Y(() => {
|
|
1224
1224
|
const S = (A) => {
|
|
1225
1225
|
V.current && !V.current.contains(A.target) && Z(!1);
|
|
1226
1226
|
};
|
|
1227
1227
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
1228
1228
|
}, []);
|
|
1229
|
-
const
|
|
1229
|
+
const L = (S) => {
|
|
1230
1230
|
const A = S.target.value;
|
|
1231
|
-
H(A), Z(!0), E(!0),
|
|
1232
|
-
},
|
|
1233
|
-
H(S.label), Z(!1), E(!1),
|
|
1234
|
-
},
|
|
1235
|
-
(
|
|
1236
|
-
},
|
|
1231
|
+
H(A), Z(!0), E(!0), $ && $(S);
|
|
1232
|
+
}, w = (S) => {
|
|
1233
|
+
H(S.label), Z(!1), E(!1), p && p(S.value);
|
|
1234
|
+
}, Q = () => {
|
|
1235
|
+
(u.length > 0 || f) && (Z(!0), E(!1));
|
|
1236
|
+
}, te = c || ee, ne = X && (N.length > 0 || te), G = me(() => _ || j, [_]);
|
|
1237
1237
|
return /* @__PURE__ */ i(
|
|
1238
1238
|
"div",
|
|
1239
1239
|
{
|
|
@@ -1252,7 +1252,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1252
1252
|
className: ue(
|
|
1253
1253
|
"block text-sm font-medium mb-1",
|
|
1254
1254
|
q ? "text-danger-fg" : "text-text",
|
|
1255
|
-
|
|
1255
|
+
b || ""
|
|
1256
1256
|
),
|
|
1257
1257
|
children: t
|
|
1258
1258
|
}
|
|
@@ -1265,8 +1265,8 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1265
1265
|
ref: G,
|
|
1266
1266
|
id: M,
|
|
1267
1267
|
value: W,
|
|
1268
|
-
onChange:
|
|
1269
|
-
onFocus:
|
|
1268
|
+
onChange: L,
|
|
1269
|
+
onFocus: Q,
|
|
1270
1270
|
className: ue(
|
|
1271
1271
|
// Base styles
|
|
1272
1272
|
"block w-full rounded-md border bg-surface-input transition-colors duration-fast ease-out",
|
|
@@ -1280,12 +1280,12 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1280
1280
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
1281
1281
|
// State styles
|
|
1282
1282
|
q ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1283
|
-
|
|
1283
|
+
y || ""
|
|
1284
1284
|
),
|
|
1285
|
-
|
|
1285
|
+
...D
|
|
1286
1286
|
}
|
|
1287
1287
|
),
|
|
1288
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children:
|
|
1288
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: te || c ? (
|
|
1289
1289
|
// Loading Spinner
|
|
1290
1290
|
/* @__PURE__ */ e(
|
|
1291
1291
|
Ze,
|
|
@@ -1311,22 +1311,22 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1311
1311
|
)
|
|
1312
1312
|
) })
|
|
1313
1313
|
] }),
|
|
1314
|
-
|
|
1314
|
+
ne && /* @__PURE__ */ e(
|
|
1315
1315
|
"ul",
|
|
1316
1316
|
{
|
|
1317
1317
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
1318
1318
|
role: "listbox",
|
|
1319
|
-
children:
|
|
1319
|
+
children: N.length > 0 ? N.map((S) => /* @__PURE__ */ e(
|
|
1320
1320
|
"li",
|
|
1321
1321
|
{
|
|
1322
1322
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
1323
|
-
onClick: () =>
|
|
1323
|
+
onClick: () => w(S),
|
|
1324
1324
|
role: "option",
|
|
1325
1325
|
"aria-selected": W === S.label,
|
|
1326
1326
|
children: S.label
|
|
1327
1327
|
},
|
|
1328
1328
|
S.value
|
|
1329
|
-
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children:
|
|
1329
|
+
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children: te || c ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
1330
1330
|
}
|
|
1331
1331
|
),
|
|
1332
1332
|
(n || r) && /* @__PURE__ */ e(
|
|
@@ -1355,7 +1355,7 @@ const Ft = de(
|
|
|
1355
1355
|
"span",
|
|
1356
1356
|
{
|
|
1357
1357
|
"aria-hidden": !0,
|
|
1358
|
-
className:
|
|
1358
|
+
className: m(
|
|
1359
1359
|
"relative inline-flex size-switch-track shrink-0 items-center rounded-full",
|
|
1360
1360
|
"transition-colors duration-fast ease-out",
|
|
1361
1361
|
t ? "bg-accent" : "bg-surface-hover",
|
|
@@ -1364,7 +1364,7 @@ const Ft = de(
|
|
|
1364
1364
|
children: /* @__PURE__ */ e(
|
|
1365
1365
|
"span",
|
|
1366
1366
|
{
|
|
1367
|
-
className:
|
|
1367
|
+
className: m(
|
|
1368
1368
|
"absolute left-0.5 size-switch-knob rounded-full bg-surface shadow-overlay",
|
|
1369
1369
|
"transition-transform duration-fast ease-out",
|
|
1370
1370
|
t && "translate-switch"
|
|
@@ -1376,7 +1376,7 @@ const Ft = de(
|
|
|
1376
1376
|
return /* @__PURE__ */ i(
|
|
1377
1377
|
"label",
|
|
1378
1378
|
{
|
|
1379
|
-
className:
|
|
1379
|
+
className: m(
|
|
1380
1380
|
"inline-flex items-center gap-2",
|
|
1381
1381
|
s ? "cursor-not-allowed" : "cursor-pointer",
|
|
1382
1382
|
a
|
|
@@ -1390,7 +1390,7 @@ const Ft = de(
|
|
|
1390
1390
|
role: "switch",
|
|
1391
1391
|
checked: t,
|
|
1392
1392
|
disabled: s,
|
|
1393
|
-
onChange: (
|
|
1393
|
+
onChange: (b) => r(b.target.checked),
|
|
1394
1394
|
className: "peer sr-only",
|
|
1395
1395
|
...l
|
|
1396
1396
|
}
|
|
@@ -1439,12 +1439,12 @@ function Rt({
|
|
|
1439
1439
|
{
|
|
1440
1440
|
className: "grid gap-2 border-t border-border-subtle p-3",
|
|
1441
1441
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1442
|
-
children: Array.from({ length: s }).map((
|
|
1442
|
+
children: Array.from({ length: s }).map((b, y) => /* @__PURE__ */ e(
|
|
1443
1443
|
"div",
|
|
1444
1444
|
{
|
|
1445
1445
|
className: "h-4 w-full rounded-sm bg-surface-hover"
|
|
1446
1446
|
},
|
|
1447
|
-
`cell-${h}-${
|
|
1447
|
+
`cell-${h}-${y}`
|
|
1448
1448
|
))
|
|
1449
1449
|
},
|
|
1450
1450
|
`row-${h}`
|
|
@@ -1461,76 +1461,76 @@ const Vt = ({
|
|
|
1461
1461
|
disabled: l = !1,
|
|
1462
1462
|
className: c,
|
|
1463
1463
|
showCheck: h = !0,
|
|
1464
|
-
header:
|
|
1464
|
+
header: b
|
|
1465
1465
|
}) => {
|
|
1466
|
-
const [
|
|
1467
|
-
|
|
1466
|
+
const [y, x] = R(!1), [u, f] = R(null), [p, k] = R({ top: 0, left: 0 }), v = ae(null), g = ae(null), $ = ae(null), D = ae(null), _ = we(y, g, { placement: a }), M = ae(null), q = () => Array.from(
|
|
1467
|
+
D.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1468
1468
|
);
|
|
1469
1469
|
Y(() => {
|
|
1470
|
-
|
|
1471
|
-
}, [
|
|
1472
|
-
const V = (
|
|
1473
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
1474
|
-
const
|
|
1475
|
-
if (
|
|
1476
|
-
|
|
1477
|
-
const
|
|
1478
|
-
w
|
|
1470
|
+
y && q()[0]?.focus();
|
|
1471
|
+
}, [y]);
|
|
1472
|
+
const V = (d) => {
|
|
1473
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(d.key)) return;
|
|
1474
|
+
const N = q();
|
|
1475
|
+
if (N.length === 0) return;
|
|
1476
|
+
d.preventDefault();
|
|
1477
|
+
const L = N.indexOf(document.activeElement), w = d.key === "Home" ? 0 : d.key === "End" ? N.length - 1 : d.key === "ArrowDown" ? (L + 1) % N.length : (L - 1 + N.length) % N.length;
|
|
1478
|
+
N[w]?.focus();
|
|
1479
1479
|
};
|
|
1480
1480
|
Y(() => {
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1481
|
+
const d = (E) => {
|
|
1482
|
+
v.current && (!v.current.contains(E.target) || $.current && !$.current.contains(E.target)) && (x(!1), f(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1483
1483
|
};
|
|
1484
|
-
return
|
|
1485
|
-
document.removeEventListener("mousedown",
|
|
1484
|
+
return y && document.addEventListener("mousedown", d), () => {
|
|
1485
|
+
document.removeEventListener("mousedown", d);
|
|
1486
1486
|
};
|
|
1487
|
-
}, [
|
|
1488
|
-
const
|
|
1489
|
-
E.key === "Escape" && (x(!1), f(null),
|
|
1487
|
+
}, [y]), Y(() => {
|
|
1488
|
+
const d = (E) => {
|
|
1489
|
+
E.key === "Escape" && (x(!1), f(null), g.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
|
|
1490
1490
|
};
|
|
1491
|
-
return
|
|
1492
|
-
document.removeEventListener("keydown",
|
|
1491
|
+
return y && document.addEventListener("keydown", d), () => {
|
|
1492
|
+
document.removeEventListener("keydown", d);
|
|
1493
1493
|
};
|
|
1494
|
-
}, [
|
|
1495
|
-
if (
|
|
1496
|
-
const
|
|
1497
|
-
`[data-option-value="${
|
|
1494
|
+
}, [y]), Y(() => {
|
|
1495
|
+
if (u && v.current) {
|
|
1496
|
+
const d = v.current.querySelector(
|
|
1497
|
+
`[data-option-value="${u}"]`
|
|
1498
1498
|
);
|
|
1499
|
-
if (
|
|
1500
|
-
const E =
|
|
1501
|
-
|
|
1499
|
+
if (d) {
|
|
1500
|
+
const E = d.getBoundingClientRect();
|
|
1501
|
+
k({
|
|
1502
1502
|
top: E.top,
|
|
1503
1503
|
left: E.right + 8
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
1506
|
}
|
|
1507
|
-
}, [
|
|
1507
|
+
}, [u]), Y(() => () => {
|
|
1508
1508
|
M.current && clearTimeout(M.current);
|
|
1509
1509
|
}, []);
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
}, W = (
|
|
1513
|
-
|
|
1514
|
-
}, H = (
|
|
1515
|
-
M.current && (clearTimeout(M.current), M.current = null),
|
|
1516
|
-
}, X = (
|
|
1517
|
-
|
|
1510
|
+
const j = (d) => {
|
|
1511
|
+
d.stopPropagation(), !l && (x(!y), f(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1512
|
+
}, W = (d, E, N) => {
|
|
1513
|
+
d.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, N), x(!1), f(null));
|
|
1514
|
+
}, H = (d) => {
|
|
1515
|
+
M.current && (clearTimeout(M.current), M.current = null), d.children && d.children.length > 0 ? f(d.value) : f(null);
|
|
1516
|
+
}, X = (d) => {
|
|
1517
|
+
d.children && d.children.length > 0 ? M.current = setTimeout(() => {
|
|
1518
1518
|
f(null);
|
|
1519
1519
|
}, 150) : f(null);
|
|
1520
|
-
}, Z = (
|
|
1521
|
-
|
|
1522
|
-
},
|
|
1520
|
+
}, Z = (d, E, N) => {
|
|
1521
|
+
d.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, N), x(!1), f(null));
|
|
1522
|
+
}, ee = m(
|
|
1523
1523
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1524
1524
|
"max-h-60 overflow-auto"
|
|
1525
|
-
),
|
|
1525
|
+
), C = m(
|
|
1526
1526
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1527
1527
|
"max-h-60 overflow-auto"
|
|
1528
1528
|
);
|
|
1529
1529
|
return /* @__PURE__ */ i(
|
|
1530
1530
|
"div",
|
|
1531
1531
|
{
|
|
1532
|
-
ref:
|
|
1533
|
-
className:
|
|
1532
|
+
ref: v,
|
|
1533
|
+
className: m(
|
|
1534
1534
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1535
1535
|
c
|
|
1536
1536
|
),
|
|
@@ -1538,21 +1538,21 @@ const Vt = ({
|
|
|
1538
1538
|
/* @__PURE__ */ e(
|
|
1539
1539
|
"button",
|
|
1540
1540
|
{
|
|
1541
|
-
ref:
|
|
1542
|
-
onClick:
|
|
1541
|
+
ref: g,
|
|
1542
|
+
onClick: j,
|
|
1543
1543
|
disabled: l,
|
|
1544
1544
|
"aria-haspopup": "menu",
|
|
1545
|
-
"aria-expanded":
|
|
1546
|
-
className:
|
|
1545
|
+
"aria-expanded": y,
|
|
1546
|
+
className: m("inline-flex items-center justify-center", {
|
|
1547
1547
|
"opacity-50 cursor-not-allowed": l
|
|
1548
1548
|
}),
|
|
1549
1549
|
children: t
|
|
1550
1550
|
}
|
|
1551
1551
|
),
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
r.map((
|
|
1555
|
-
if (
|
|
1552
|
+
y && /* @__PURE__ */ e("div", { ref: D, className: ee, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
|
|
1553
|
+
b && (typeof b == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: b }) : b),
|
|
1554
|
+
r.map((d, E) => {
|
|
1555
|
+
if (d.divider)
|
|
1556
1556
|
return /* @__PURE__ */ e(
|
|
1557
1557
|
"div",
|
|
1558
1558
|
{
|
|
@@ -1560,110 +1560,110 @@ const Vt = ({
|
|
|
1560
1560
|
},
|
|
1561
1561
|
`divider-${E}`
|
|
1562
1562
|
);
|
|
1563
|
-
const
|
|
1563
|
+
const N = d.children && d.children.length > 0, L = u === d.value;
|
|
1564
1564
|
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1565
1565
|
/* @__PURE__ */ i(
|
|
1566
1566
|
"button",
|
|
1567
1567
|
{
|
|
1568
|
-
"data-option-value":
|
|
1568
|
+
"data-option-value": d.value,
|
|
1569
1569
|
role: "menuitem",
|
|
1570
|
-
"aria-haspopup":
|
|
1571
|
-
onClick: (
|
|
1572
|
-
onMouseEnter: () => H(
|
|
1573
|
-
onMouseLeave: () => X(
|
|
1574
|
-
disabled:
|
|
1575
|
-
className:
|
|
1570
|
+
"aria-haspopup": N ? "menu" : void 0,
|
|
1571
|
+
onClick: (w) => W(w, d),
|
|
1572
|
+
onMouseEnter: () => H(d),
|
|
1573
|
+
onMouseLeave: () => X(d),
|
|
1574
|
+
disabled: d.disabled,
|
|
1575
|
+
className: m(
|
|
1576
1576
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
1577
1577
|
{
|
|
1578
|
-
"opacity-50 cursor-not-allowed":
|
|
1579
|
-
"bg-surface-hover":
|
|
1578
|
+
"opacity-50 cursor-not-allowed": d.disabled,
|
|
1579
|
+
"bg-surface-hover": L && N
|
|
1580
1580
|
}
|
|
1581
1581
|
),
|
|
1582
1582
|
children: [
|
|
1583
1583
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1584
|
-
|
|
1584
|
+
d.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: d.icon }),
|
|
1585
1585
|
/* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1586
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1587
|
-
|
|
1586
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: d.label }),
|
|
1587
|
+
d.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: d.description })
|
|
1588
1588
|
] })
|
|
1589
1589
|
] }),
|
|
1590
1590
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1591
|
-
h && n ===
|
|
1592
|
-
|
|
1591
|
+
h && n === d.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1592
|
+
N && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1593
1593
|
] })
|
|
1594
1594
|
]
|
|
1595
1595
|
}
|
|
1596
1596
|
),
|
|
1597
|
-
|
|
1597
|
+
N && L && /* @__PURE__ */ e(
|
|
1598
1598
|
"div",
|
|
1599
1599
|
{
|
|
1600
|
-
ref:
|
|
1601
|
-
className:
|
|
1600
|
+
ref: $,
|
|
1601
|
+
className: C,
|
|
1602
1602
|
style: {
|
|
1603
|
-
top: `${
|
|
1604
|
-
left: `${
|
|
1603
|
+
top: `${p.top}px`,
|
|
1604
|
+
left: `${p.left}px`
|
|
1605
1605
|
},
|
|
1606
1606
|
onMouseEnter: () => {
|
|
1607
|
-
M.current && (clearTimeout(M.current), M.current = null), f(
|
|
1607
|
+
M.current && (clearTimeout(M.current), M.current = null), f(d.value);
|
|
1608
1608
|
},
|
|
1609
1609
|
onMouseLeave: () => {
|
|
1610
1610
|
M.current = setTimeout(() => {
|
|
1611
1611
|
f(null);
|
|
1612
1612
|
}, 150);
|
|
1613
1613
|
},
|
|
1614
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children:
|
|
1615
|
-
if (
|
|
1614
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: d.children.map((w, Q) => {
|
|
1615
|
+
if (w.divider)
|
|
1616
1616
|
return /* @__PURE__ */ e(
|
|
1617
1617
|
"div",
|
|
1618
1618
|
{
|
|
1619
1619
|
className: "border-t border-border my-2"
|
|
1620
1620
|
},
|
|
1621
|
-
`divider-${
|
|
1621
|
+
`divider-${Q}`
|
|
1622
1622
|
);
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
) || n ===
|
|
1623
|
+
const te = typeof n == "object" && n[d.value] && n[d.value].includes(
|
|
1624
|
+
w.value
|
|
1625
|
+
) || n === w.value;
|
|
1626
1626
|
return /* @__PURE__ */ i(
|
|
1627
1627
|
"button",
|
|
1628
1628
|
{
|
|
1629
|
-
onClick: (
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1629
|
+
onClick: (ne) => Z(
|
|
1630
|
+
ne,
|
|
1631
|
+
w,
|
|
1632
|
+
d.value
|
|
1633
1633
|
),
|
|
1634
|
-
disabled:
|
|
1635
|
-
className:
|
|
1634
|
+
disabled: w.disabled,
|
|
1635
|
+
className: m(
|
|
1636
1636
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
1637
1637
|
{
|
|
1638
|
-
"opacity-50 cursor-not-allowed":
|
|
1638
|
+
"opacity-50 cursor-not-allowed": w.disabled
|
|
1639
1639
|
}
|
|
1640
1640
|
),
|
|
1641
1641
|
children: [
|
|
1642
1642
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1643
|
-
|
|
1643
|
+
w.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: w.icon }),
|
|
1644
1644
|
/* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1645
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1646
|
-
|
|
1645
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: w.label }),
|
|
1646
|
+
w.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: w.description })
|
|
1647
1647
|
] })
|
|
1648
1648
|
] }),
|
|
1649
|
-
h &&
|
|
1649
|
+
h && te && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
|
|
1650
1650
|
]
|
|
1651
1651
|
},
|
|
1652
|
-
|
|
1652
|
+
w.value
|
|
1653
1653
|
);
|
|
1654
1654
|
}) })
|
|
1655
1655
|
}
|
|
1656
1656
|
)
|
|
1657
|
-
] },
|
|
1657
|
+
] }, d.value);
|
|
1658
1658
|
}),
|
|
1659
1659
|
(() => {
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
const
|
|
1663
|
-
return E + 1 +
|
|
1660
|
+
const d = r.reduce((E, N) => {
|
|
1661
|
+
if (N.divider) return E;
|
|
1662
|
+
const L = N.children ? N.children.filter((w) => !w.divider).length : 0;
|
|
1663
|
+
return E + 1 + L;
|
|
1664
1664
|
}, 0);
|
|
1665
|
-
return
|
|
1666
|
-
|
|
1665
|
+
return d > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
1666
|
+
d,
|
|
1667
1667
|
" options available"
|
|
1668
1668
|
] }) });
|
|
1669
1669
|
})()
|
|
@@ -1701,7 +1701,7 @@ const Vt = ({
|
|
|
1701
1701
|
children: /* @__PURE__ */ e(
|
|
1702
1702
|
"span",
|
|
1703
1703
|
{
|
|
1704
|
-
className:
|
|
1704
|
+
className: m(r(s.value) && "text-accent"),
|
|
1705
1705
|
children: s.label
|
|
1706
1706
|
}
|
|
1707
1707
|
)
|
|
@@ -1727,103 +1727,103 @@ const Vt = ({
|
|
|
1727
1727
|
filters: l = [],
|
|
1728
1728
|
paginated: c = !1,
|
|
1729
1729
|
pageSizeOptions: h = [10, 25, 50, 100],
|
|
1730
|
-
defaultPageSize:
|
|
1731
|
-
actions:
|
|
1730
|
+
defaultPageSize: b = 10,
|
|
1731
|
+
actions: y = [],
|
|
1732
1732
|
onRowClick: x,
|
|
1733
|
-
selectable:
|
|
1733
|
+
selectable: u = !1,
|
|
1734
1734
|
selectedRows: f = [],
|
|
1735
|
-
onSelectionChange:
|
|
1736
|
-
getRowKey:
|
|
1737
|
-
emptyContent:
|
|
1738
|
-
hoverable:
|
|
1739
|
-
bordered:
|
|
1740
|
-
striped:
|
|
1735
|
+
onSelectionChange: p,
|
|
1736
|
+
getRowKey: k = (q, V) => V,
|
|
1737
|
+
emptyContent: v,
|
|
1738
|
+
hoverable: g = !0,
|
|
1739
|
+
bordered: $ = !1,
|
|
1740
|
+
striped: D = !1,
|
|
1741
1741
|
className: _,
|
|
1742
1742
|
rowClassName: M
|
|
1743
1743
|
}) => {
|
|
1744
|
-
const [q, V] = R(""), [
|
|
1744
|
+
const [q, V] = R(""), [j, W] = R({
|
|
1745
1745
|
column: null,
|
|
1746
1746
|
direction: null
|
|
1747
1747
|
}), [H, X] = R({
|
|
1748
1748
|
page: 0,
|
|
1749
|
-
pageSize:
|
|
1750
|
-
}), Z =
|
|
1749
|
+
pageSize: b
|
|
1750
|
+
}), Z = ae(null), ee = me(() => {
|
|
1751
1751
|
let o = t;
|
|
1752
1752
|
if (s && q.trim()) {
|
|
1753
1753
|
const z = r.filter(
|
|
1754
1754
|
(F) => F.searchable !== !1
|
|
1755
1755
|
), B = q.toLowerCase();
|
|
1756
1756
|
o = o.filter((F) => z.some((O) => {
|
|
1757
|
-
const
|
|
1758
|
-
return String(
|
|
1757
|
+
const se = typeof O.accessor == "function" ? O.accessor(F) : F[O.accessor];
|
|
1758
|
+
return String(se || "").toLowerCase().includes(B);
|
|
1759
1759
|
}));
|
|
1760
1760
|
}
|
|
1761
1761
|
return l.forEach((z) => {
|
|
1762
1762
|
z.value && z.value !== "all" && (o = o.filter((B) => {
|
|
1763
|
-
const F = r.find((
|
|
1763
|
+
const F = r.find((se) => se.id === z.id);
|
|
1764
1764
|
if (!F) return !0;
|
|
1765
1765
|
const O = typeof F.accessor == "function" ? F.accessor(B) : B[F.accessor];
|
|
1766
1766
|
return String(O || "") === z.value;
|
|
1767
1767
|
}));
|
|
1768
1768
|
}), o;
|
|
1769
|
-
}, [t, q, r, s, l]),
|
|
1770
|
-
if (!
|
|
1771
|
-
const o = r.find((z) => z.id ===
|
|
1772
|
-
return o ? [...
|
|
1769
|
+
}, [t, q, r, s, l]), C = me(() => {
|
|
1770
|
+
if (!j.column || !j.direction) return ee;
|
|
1771
|
+
const o = r.find((z) => z.id === j.column);
|
|
1772
|
+
return o ? [...ee].sort((z, B) => {
|
|
1773
1773
|
const F = typeof o.accessor == "function" ? o.accessor(z) : z[o.accessor], O = typeof o.accessor == "function" ? o.accessor(B) : B[o.accessor];
|
|
1774
|
-
let
|
|
1775
|
-
return F < O ?
|
|
1776
|
-
}) :
|
|
1777
|
-
}, [
|
|
1778
|
-
if (!c) return
|
|
1774
|
+
let se = 0;
|
|
1775
|
+
return F < O ? se = -1 : F > O && (se = 1), j.direction === "desc" ? -se : se;
|
|
1776
|
+
}) : ee;
|
|
1777
|
+
}, [ee, j, r]), d = me(() => {
|
|
1778
|
+
if (!c) return C;
|
|
1779
1779
|
const o = H.page * H.pageSize, z = o + H.pageSize;
|
|
1780
|
-
return
|
|
1781
|
-
}, [
|
|
1780
|
+
return C.slice(o, z);
|
|
1781
|
+
}, [C, H, c]), E = ce(
|
|
1782
1782
|
(o) => {
|
|
1783
1783
|
r.find((B) => B.id === o)?.sortable && W((B) => B.column !== o ? { column: o, direction: "asc" } : B.direction === "asc" ? { column: o, direction: "desc" } : { column: null, direction: null });
|
|
1784
1784
|
},
|
|
1785
1785
|
[r]
|
|
1786
|
-
),
|
|
1786
|
+
), N = ce((o) => {
|
|
1787
1787
|
X((z) => ({ ...z, page: o }));
|
|
1788
|
-
}, []),
|
|
1788
|
+
}, []), L = ce((o) => {
|
|
1789
1789
|
X({ page: 0, pageSize: o });
|
|
1790
|
-
}, []),
|
|
1790
|
+
}, []), w = ce(
|
|
1791
1791
|
(o, z) => {
|
|
1792
|
-
if (!
|
|
1793
|
-
const B =
|
|
1794
|
-
f.map((F, O) =>
|
|
1795
|
-
(F, O) =>
|
|
1792
|
+
if (!p) return;
|
|
1793
|
+
const B = k(o, 0);
|
|
1794
|
+
f.map((F, O) => k(F, O)), p(z ? [...f, o] : f.filter(
|
|
1795
|
+
(F, O) => k(f[O], O) !== B
|
|
1796
1796
|
));
|
|
1797
1797
|
},
|
|
1798
|
-
[f,
|
|
1799
|
-
),
|
|
1798
|
+
[f, p, k]
|
|
1799
|
+
), Q = ce(
|
|
1800
1800
|
(o) => {
|
|
1801
|
-
|
|
1801
|
+
p && p(o ? [...d] : []);
|
|
1802
1802
|
},
|
|
1803
|
-
[
|
|
1803
|
+
[d, p]
|
|
1804
1804
|
);
|
|
1805
1805
|
Y(() => {
|
|
1806
1806
|
X((o) => ({ ...o, page: 0 }));
|
|
1807
|
-
}, [q,
|
|
1807
|
+
}, [q, j]), Y(() => {
|
|
1808
1808
|
X((o) => ({ ...o, page: 0 }));
|
|
1809
1809
|
}, [l.map((o) => o.value).join(",")]);
|
|
1810
|
-
const
|
|
1811
|
-
const z =
|
|
1810
|
+
const te = C.length, ne = Math.ceil(te / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, te), A = d.length > 0 && d.every((o) => {
|
|
1811
|
+
const z = k(o, 0);
|
|
1812
1812
|
return f.some(
|
|
1813
|
-
(B, F) =>
|
|
1813
|
+
(B, F) => k(B, F) === z
|
|
1814
1814
|
);
|
|
1815
|
-
}),
|
|
1816
|
-
const z =
|
|
1815
|
+
}), I = d.some((o) => {
|
|
1816
|
+
const z = k(o, 0);
|
|
1817
1817
|
return f.some(
|
|
1818
|
-
(B, F) =>
|
|
1818
|
+
(B, F) => k(B, F) === z
|
|
1819
1819
|
);
|
|
1820
|
-
}), T =
|
|
1820
|
+
}), T = m(
|
|
1821
1821
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1822
1822
|
_
|
|
1823
|
-
), U =
|
|
1823
|
+
), U = m("bg-surface"), P = m(
|
|
1824
1824
|
"text-text p-3 border-b border-border"
|
|
1825
|
-
), K =
|
|
1826
|
-
"hover:bg-surface-sunk":
|
|
1825
|
+
), K = m("h-row-lg", {
|
|
1826
|
+
"hover:bg-surface-sunk": g,
|
|
1827
1827
|
"cursor-pointer": x
|
|
1828
1828
|
});
|
|
1829
1829
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
@@ -1849,24 +1849,24 @@ const Vt = ({
|
|
|
1849
1849
|
tableColumns: r.length
|
|
1850
1850
|
}
|
|
1851
1851
|
) }),
|
|
1852
|
-
/* @__PURE__ */ i("table", { ref: Z, className:
|
|
1852
|
+
/* @__PURE__ */ i("table", { ref: Z, className: m(T, "min-w-full"), children: [
|
|
1853
1853
|
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ i("tr", { children: [
|
|
1854
|
-
|
|
1854
|
+
u && /* @__PURE__ */ e("th", { className: m(P, "w-12"), children: /* @__PURE__ */ e(
|
|
1855
1855
|
"input",
|
|
1856
1856
|
{
|
|
1857
1857
|
type: "checkbox",
|
|
1858
1858
|
checked: A,
|
|
1859
1859
|
ref: (o) => {
|
|
1860
|
-
o && (o.indeterminate =
|
|
1860
|
+
o && (o.indeterminate = I && !A);
|
|
1861
1861
|
},
|
|
1862
|
-
onChange: (o) =>
|
|
1862
|
+
onChange: (o) => Q(o.target.checked),
|
|
1863
1863
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1864
1864
|
}
|
|
1865
1865
|
) }),
|
|
1866
1866
|
!n && r.map((o) => /* @__PURE__ */ e(
|
|
1867
1867
|
"th",
|
|
1868
1868
|
{
|
|
1869
|
-
className:
|
|
1869
|
+
className: m(
|
|
1870
1870
|
P,
|
|
1871
1871
|
"font-semibold text-xs text-text-muted uppercase tracking-label",
|
|
1872
1872
|
"group",
|
|
@@ -1886,21 +1886,21 @@ const Vt = ({
|
|
|
1886
1886
|
o.sortable && /* @__PURE__ */ i(
|
|
1887
1887
|
"div",
|
|
1888
1888
|
{
|
|
1889
|
-
className:
|
|
1889
|
+
className: m(
|
|
1890
1890
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1891
|
-
|
|
1891
|
+
j.column === o.id && "opacity-100"
|
|
1892
1892
|
),
|
|
1893
1893
|
children: [
|
|
1894
1894
|
/* @__PURE__ */ e(
|
|
1895
1895
|
qt,
|
|
1896
1896
|
{
|
|
1897
|
-
active:
|
|
1897
|
+
active: j.column === o.id && j.direction === "asc"
|
|
1898
1898
|
}
|
|
1899
1899
|
),
|
|
1900
1900
|
/* @__PURE__ */ e(
|
|
1901
1901
|
Ut,
|
|
1902
1902
|
{
|
|
1903
|
-
active:
|
|
1903
|
+
active: j.column === o.id && j.direction === "desc"
|
|
1904
1904
|
}
|
|
1905
1905
|
)
|
|
1906
1906
|
]
|
|
@@ -1910,26 +1910,26 @@ const Vt = ({
|
|
|
1910
1910
|
},
|
|
1911
1911
|
o.id
|
|
1912
1912
|
)),
|
|
1913
|
-
|
|
1913
|
+
y.length > 0 && /* @__PURE__ */ e("th", { className: m(P, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1914
1914
|
] }) }),
|
|
1915
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
1915
|
+
/* @__PURE__ */ e("tbody", { children: d.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1916
1916
|
"td",
|
|
1917
1917
|
{
|
|
1918
|
-
colSpan: r.length + (
|
|
1919
|
-
className:
|
|
1918
|
+
colSpan: r.length + (u ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1919
|
+
className: m(
|
|
1920
1920
|
P,
|
|
1921
1921
|
"text-center py-8 text-text-muted"
|
|
1922
1922
|
),
|
|
1923
|
-
children:
|
|
1923
|
+
children: v || "No data available"
|
|
1924
1924
|
}
|
|
1925
|
-
) }) :
|
|
1926
|
-
const B =
|
|
1927
|
-
(O,
|
|
1925
|
+
) }) : d.map((o, z) => {
|
|
1926
|
+
const B = k(o, z), F = f.some(
|
|
1927
|
+
(O, se) => k(O, se) === B
|
|
1928
1928
|
);
|
|
1929
1929
|
return /* @__PURE__ */ i(
|
|
1930
1930
|
"tr",
|
|
1931
1931
|
{
|
|
1932
|
-
className:
|
|
1932
|
+
className: m(
|
|
1933
1933
|
K,
|
|
1934
1934
|
{ "bg-accent-soft": F },
|
|
1935
1935
|
M?.(o, z)
|
|
@@ -1938,52 +1938,52 @@ const Vt = ({
|
|
|
1938
1938
|
O.stopPropagation(), x?.(o, z);
|
|
1939
1939
|
},
|
|
1940
1940
|
children: [
|
|
1941
|
-
|
|
1941
|
+
u && /* @__PURE__ */ e("td", { className: P, children: /* @__PURE__ */ e(
|
|
1942
1942
|
"input",
|
|
1943
1943
|
{
|
|
1944
1944
|
type: "checkbox",
|
|
1945
1945
|
checked: F,
|
|
1946
1946
|
onChange: (O) => {
|
|
1947
|
-
O.stopPropagation(),
|
|
1947
|
+
O.stopPropagation(), w(o, O.target.checked);
|
|
1948
1948
|
},
|
|
1949
1949
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1950
1950
|
}
|
|
1951
1951
|
) }),
|
|
1952
1952
|
r.map((O) => {
|
|
1953
|
-
const
|
|
1953
|
+
const se = typeof O.accessor == "function" ? O.accessor(o) : o[O.accessor];
|
|
1954
1954
|
return /* @__PURE__ */ e(
|
|
1955
1955
|
"td",
|
|
1956
1956
|
{
|
|
1957
|
-
className:
|
|
1957
|
+
className: m(P, {
|
|
1958
1958
|
"text-left": O.align === "left" || !O.align,
|
|
1959
1959
|
"text-center": O.align === "center",
|
|
1960
1960
|
"text-right": O.align === "right",
|
|
1961
1961
|
"sticky left-0 bg-surface": O.sticky === "left",
|
|
1962
1962
|
"sticky right-0 bg-surface": O.sticky === "right"
|
|
1963
1963
|
}),
|
|
1964
|
-
children: O.cell ? O.cell(
|
|
1964
|
+
children: O.cell ? O.cell(se, o, z) : String(se || "")
|
|
1965
1965
|
},
|
|
1966
1966
|
O.id
|
|
1967
1967
|
);
|
|
1968
1968
|
}),
|
|
1969
|
-
|
|
1969
|
+
y.length > 0 && /* @__PURE__ */ e("td", { className: P, children: /* @__PURE__ */ e(
|
|
1970
1970
|
Vt,
|
|
1971
1971
|
{
|
|
1972
1972
|
trigger: /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-text-muted hover:text-text", children: [
|
|
1973
1973
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
1974
1974
|
/* @__PURE__ */ e(Be, {})
|
|
1975
1975
|
] }),
|
|
1976
|
-
options:
|
|
1976
|
+
options: y.map((O) => ({
|
|
1977
1977
|
value: O.id,
|
|
1978
1978
|
label: O.label,
|
|
1979
1979
|
icon: O.icon,
|
|
1980
1980
|
disabled: O.disabled?.(o)
|
|
1981
1981
|
})),
|
|
1982
1982
|
onSelect: (O) => {
|
|
1983
|
-
const
|
|
1983
|
+
const se = y.find(
|
|
1984
1984
|
(ie) => ie.id === O
|
|
1985
1985
|
);
|
|
1986
|
-
|
|
1986
|
+
se && se.onClick(o, z);
|
|
1987
1987
|
},
|
|
1988
1988
|
placement: "bottom-end"
|
|
1989
1989
|
}
|
|
@@ -1995,7 +1995,7 @@ const Vt = ({
|
|
|
1995
1995
|
}) })
|
|
1996
1996
|
] })
|
|
1997
1997
|
] }),
|
|
1998
|
-
c &&
|
|
1998
|
+
c && te > 0 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between px-6", children: [
|
|
1999
1999
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
2000
2000
|
/* @__PURE__ */ i("span", { className: "text-sm text-text-muted", children: [
|
|
2001
2001
|
"Showing ",
|
|
@@ -2003,7 +2003,7 @@ const Vt = ({
|
|
|
2003
2003
|
" to ",
|
|
2004
2004
|
S,
|
|
2005
2005
|
" of ",
|
|
2006
|
-
|
|
2006
|
+
te,
|
|
2007
2007
|
" results"
|
|
2008
2008
|
] }),
|
|
2009
2009
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
@@ -2012,7 +2012,7 @@ const Vt = ({
|
|
|
2012
2012
|
"select",
|
|
2013
2013
|
{
|
|
2014
2014
|
value: H.pageSize,
|
|
2015
|
-
onChange: (o) =>
|
|
2015
|
+
onChange: (o) => L(Number(o.target.value)),
|
|
2016
2016
|
className: "h-control-sm w-16 rounded-md border border-border bg-surface-input px-2 text-sm text-text",
|
|
2017
2017
|
children: h.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
2018
2018
|
}
|
|
@@ -2021,22 +2021,22 @@ const Vt = ({
|
|
|
2021
2021
|
] }),
|
|
2022
2022
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2023
2023
|
/* @__PURE__ */ e(
|
|
2024
|
-
|
|
2024
|
+
re,
|
|
2025
2025
|
{
|
|
2026
2026
|
size: "sm",
|
|
2027
2027
|
variant: "ghost",
|
|
2028
|
-
onClick: () =>
|
|
2028
|
+
onClick: () => N(0),
|
|
2029
2029
|
disabled: H.page === 0,
|
|
2030
2030
|
iconOnly: !0,
|
|
2031
2031
|
children: /* @__PURE__ */ e(_t, {})
|
|
2032
2032
|
}
|
|
2033
2033
|
),
|
|
2034
2034
|
/* @__PURE__ */ e(
|
|
2035
|
-
|
|
2035
|
+
re,
|
|
2036
2036
|
{
|
|
2037
2037
|
size: "sm",
|
|
2038
2038
|
variant: "ghost",
|
|
2039
|
-
onClick: () =>
|
|
2039
|
+
onClick: () => N(H.page - 1),
|
|
2040
2040
|
disabled: H.page === 0,
|
|
2041
2041
|
iconOnly: !0,
|
|
2042
2042
|
children: /* @__PURE__ */ e(Wt, {})
|
|
@@ -2046,26 +2046,26 @@ const Vt = ({
|
|
|
2046
2046
|
"Page ",
|
|
2047
2047
|
H.page + 1,
|
|
2048
2048
|
" of ",
|
|
2049
|
-
|
|
2049
|
+
ne
|
|
2050
2050
|
] }),
|
|
2051
2051
|
/* @__PURE__ */ e(
|
|
2052
|
-
|
|
2052
|
+
re,
|
|
2053
2053
|
{
|
|
2054
2054
|
size: "sm",
|
|
2055
2055
|
variant: "ghost",
|
|
2056
|
-
onClick: () =>
|
|
2057
|
-
disabled: H.page >=
|
|
2056
|
+
onClick: () => N(H.page + 1),
|
|
2057
|
+
disabled: H.page >= ne - 1,
|
|
2058
2058
|
iconOnly: !0,
|
|
2059
2059
|
children: /* @__PURE__ */ e(Kt, {})
|
|
2060
2060
|
}
|
|
2061
2061
|
),
|
|
2062
2062
|
/* @__PURE__ */ e(
|
|
2063
|
-
|
|
2063
|
+
re,
|
|
2064
2064
|
{
|
|
2065
2065
|
size: "sm",
|
|
2066
2066
|
variant: "ghost",
|
|
2067
|
-
onClick: () =>
|
|
2068
|
-
disabled: H.page >=
|
|
2067
|
+
onClick: () => N(ne - 1),
|
|
2068
|
+
disabled: H.page >= ne - 1,
|
|
2069
2069
|
iconOnly: !0,
|
|
2070
2070
|
children: /* @__PURE__ */ e(Gt, {})
|
|
2071
2071
|
}
|
|
@@ -2079,31 +2079,31 @@ const Vt = ({
|
|
|
2079
2079
|
onTabChange: n,
|
|
2080
2080
|
className: s
|
|
2081
2081
|
}) => {
|
|
2082
|
-
const [a, l] = R(t[0]?.id || ""), c = r || a, h = (
|
|
2083
|
-
n ? n(
|
|
2082
|
+
const [a, l] = R(t[0]?.id || ""), c = r || a, h = (b) => {
|
|
2083
|
+
n ? n(b) : l(b);
|
|
2084
2084
|
};
|
|
2085
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2085
|
+
return /* @__PURE__ */ e("div", { className: m("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((b) => /* @__PURE__ */ e(
|
|
2086
2086
|
"button",
|
|
2087
2087
|
{
|
|
2088
|
-
onClick: () => !
|
|
2089
|
-
disabled:
|
|
2090
|
-
className:
|
|
2088
|
+
onClick: () => !b.disabled && h(b.id),
|
|
2089
|
+
disabled: b.disabled,
|
|
2090
|
+
className: m(
|
|
2091
2091
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
2092
2092
|
{
|
|
2093
|
-
"border-accent-border text-text": c ===
|
|
2094
|
-
"border-transparent text-text-muted hover:text-text": c !==
|
|
2095
|
-
"border-transparent text-disabled cursor-not-allowed":
|
|
2093
|
+
"border-accent-border text-text": c === b.id,
|
|
2094
|
+
"border-transparent text-text-muted hover:text-text": c !== b.id && !b.disabled,
|
|
2095
|
+
"border-transparent text-disabled cursor-not-allowed": b.disabled
|
|
2096
2096
|
}
|
|
2097
2097
|
),
|
|
2098
2098
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2099
|
-
|
|
2100
|
-
|
|
2099
|
+
b.label,
|
|
2100
|
+
b.badge && /* @__PURE__ */ e("span", { className: m(
|
|
2101
2101
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2102
|
-
c ===
|
|
2103
|
-
), children:
|
|
2102
|
+
c === b.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
|
|
2103
|
+
), children: b.badge })
|
|
2104
2104
|
] })
|
|
2105
2105
|
},
|
|
2106
|
-
|
|
2106
|
+
b.id
|
|
2107
2107
|
)) }) });
|
|
2108
2108
|
}, Xt = ({
|
|
2109
2109
|
items: t,
|
|
@@ -2114,14 +2114,14 @@ const Vt = ({
|
|
|
2114
2114
|
size: l = "md",
|
|
2115
2115
|
className: c
|
|
2116
2116
|
}) => {
|
|
2117
|
-
const [h,
|
|
2117
|
+
const [h, b] = R(
|
|
2118
2118
|
r || n || t[0]?.id || ""
|
|
2119
|
-
),
|
|
2120
|
-
s ? s(
|
|
2121
|
-
},
|
|
2122
|
-
activeTab:
|
|
2119
|
+
), y = n || h, x = (v) => {
|
|
2120
|
+
s ? s(v) : b(v);
|
|
2121
|
+
}, u = {
|
|
2122
|
+
activeTab: y,
|
|
2123
2123
|
setActiveTab: x
|
|
2124
|
-
}, f = t.find((
|
|
2124
|
+
}, f = t.find((v) => v.id === y), p = m(
|
|
2125
2125
|
"flex",
|
|
2126
2126
|
{
|
|
2127
2127
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2130,8 +2130,8 @@ const Vt = ({
|
|
|
2130
2130
|
"space-x-8": a === "default" || a === "underline"
|
|
2131
2131
|
},
|
|
2132
2132
|
c
|
|
2133
|
-
),
|
|
2134
|
-
const
|
|
2133
|
+
), k = (v, g) => {
|
|
2134
|
+
const $ = "transition-colors duration-fast font-medium", D = {
|
|
2135
2135
|
"text-xs px-2 py-1": l === "sm",
|
|
2136
2136
|
"text-sm px-3 py-2": l === "md",
|
|
2137
2137
|
"text-base px-4 py-3": l === "lg"
|
|
@@ -2143,42 +2143,42 @@ const Vt = ({
|
|
|
2143
2143
|
// Underline variant
|
|
2144
2144
|
"border-b-2 pb-2": a === "underline"
|
|
2145
2145
|
}, M = {
|
|
2146
|
-
"opacity-50 cursor-not-allowed":
|
|
2147
|
-
"cursor-pointer": !
|
|
2148
|
-
}, q =
|
|
2146
|
+
"opacity-50 cursor-not-allowed": v.disabled,
|
|
2147
|
+
"cursor-pointer": !v.disabled
|
|
2148
|
+
}, q = g ? {
|
|
2149
2149
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2150
2150
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2151
|
-
} : {}, V = !
|
|
2151
|
+
} : {}, V = !g && !v.disabled ? {
|
|
2152
2152
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2153
2153
|
"text-text-muted hover:text-text": a === "pills",
|
|
2154
2154
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2155
2155
|
} : {};
|
|
2156
|
-
return
|
|
2156
|
+
return m($, D, _, M, q, V);
|
|
2157
2157
|
};
|
|
2158
|
-
return /* @__PURE__ */ e(Yt.Provider, { value:
|
|
2159
|
-
/* @__PURE__ */ e("div", { className:
|
|
2158
|
+
return /* @__PURE__ */ e(Yt.Provider, { value: u, children: /* @__PURE__ */ i("div", { children: [
|
|
2159
|
+
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((v) => /* @__PURE__ */ e(
|
|
2160
2160
|
"button",
|
|
2161
2161
|
{
|
|
2162
2162
|
type: "button",
|
|
2163
2163
|
role: "tab",
|
|
2164
|
-
"aria-selected":
|
|
2165
|
-
"aria-controls": `tabpanel-${
|
|
2166
|
-
disabled:
|
|
2167
|
-
onClick: () => !
|
|
2168
|
-
className:
|
|
2164
|
+
"aria-selected": y === v.id,
|
|
2165
|
+
"aria-controls": `tabpanel-${v.id}`,
|
|
2166
|
+
disabled: v.disabled,
|
|
2167
|
+
onClick: () => !v.disabled && x(v.id),
|
|
2168
|
+
className: k(v, y === v.id),
|
|
2169
2169
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2170
|
-
|
|
2171
|
-
|
|
2170
|
+
v.label,
|
|
2171
|
+
v.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-surface-hover text-text-muted", children: v.badge })
|
|
2172
2172
|
] })
|
|
2173
2173
|
},
|
|
2174
|
-
|
|
2174
|
+
v.id
|
|
2175
2175
|
)) }),
|
|
2176
2176
|
f?.content && /* @__PURE__ */ e(
|
|
2177
2177
|
"div",
|
|
2178
2178
|
{
|
|
2179
2179
|
role: "tabpanel",
|
|
2180
|
-
id: `tabpanel-${
|
|
2181
|
-
"aria-labelledby": `tab-${
|
|
2180
|
+
id: `tabpanel-${y}`,
|
|
2181
|
+
"aria-labelledby": `tab-${y}`,
|
|
2182
2182
|
className: "mt-4",
|
|
2183
2183
|
children: f.content
|
|
2184
2184
|
}
|
|
@@ -2200,38 +2200,38 @@ function Fe({
|
|
|
2200
2200
|
closeOnEscape: l = !0,
|
|
2201
2201
|
className: c,
|
|
2202
2202
|
backdropClassName: h,
|
|
2203
|
-
children:
|
|
2204
|
-
footer:
|
|
2203
|
+
children: b,
|
|
2204
|
+
footer: y,
|
|
2205
2205
|
showCloseButton: x = !0
|
|
2206
2206
|
}) {
|
|
2207
|
-
const
|
|
2207
|
+
const u = ae(null), f = ae(null);
|
|
2208
2208
|
Y(() => {
|
|
2209
2209
|
if (!t || !l) return;
|
|
2210
|
-
const
|
|
2211
|
-
|
|
2210
|
+
const k = (v) => {
|
|
2211
|
+
v.key === "Escape" && r();
|
|
2212
2212
|
};
|
|
2213
|
-
return document.addEventListener("keydown",
|
|
2214
|
-
}, [t, l, r]), Y(() => (t ? (f.current = document.activeElement,
|
|
2213
|
+
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2214
|
+
}, [t, l, r]), Y(() => (t ? (f.current = document.activeElement, u.current && u.current.focus(), document.body.style.overflow = "hidden") : (f.current && f.current.focus(), document.body.style.overflow = ""), () => {
|
|
2215
2215
|
document.body.style.overflow = "";
|
|
2216
2216
|
}), [t]);
|
|
2217
|
-
const
|
|
2218
|
-
a &&
|
|
2217
|
+
const p = (k) => {
|
|
2218
|
+
a && k.target === k.currentTarget && r();
|
|
2219
2219
|
};
|
|
2220
2220
|
return t ? /* @__PURE__ */ e(
|
|
2221
2221
|
"div",
|
|
2222
2222
|
{
|
|
2223
|
-
className:
|
|
2223
|
+
className: m(
|
|
2224
2224
|
"fixed inset-0 z-modal flex items-center justify-center p-4",
|
|
2225
2225
|
"bg-scrim",
|
|
2226
2226
|
// 'animate-fade-in',
|
|
2227
2227
|
h
|
|
2228
2228
|
),
|
|
2229
|
-
onClick:
|
|
2229
|
+
onClick: p,
|
|
2230
2230
|
children: /* @__PURE__ */ i(
|
|
2231
2231
|
"div",
|
|
2232
2232
|
{
|
|
2233
|
-
ref:
|
|
2234
|
-
className:
|
|
2233
|
+
ref: u,
|
|
2234
|
+
className: m(
|
|
2235
2235
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2236
2236
|
// 'animate-scale-in',
|
|
2237
2237
|
"focus:outline-none",
|
|
@@ -2262,8 +2262,8 @@ function Fe({
|
|
|
2262
2262
|
}
|
|
2263
2263
|
)
|
|
2264
2264
|
] }),
|
|
2265
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2266
|
-
|
|
2265
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: b }),
|
|
2266
|
+
y && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: y })
|
|
2267
2267
|
]
|
|
2268
2268
|
}
|
|
2269
2269
|
)
|
|
@@ -2311,32 +2311,32 @@ const Qt = {
|
|
|
2311
2311
|
truncate: l = !1,
|
|
2312
2312
|
italic: c = !1,
|
|
2313
2313
|
underline: h = !1,
|
|
2314
|
-
lineHeight:
|
|
2315
|
-
as:
|
|
2314
|
+
lineHeight: b = "normal",
|
|
2315
|
+
as: y,
|
|
2316
2316
|
className: x,
|
|
2317
|
-
children:
|
|
2317
|
+
children: u,
|
|
2318
2318
|
...f
|
|
2319
2319
|
}) => {
|
|
2320
|
-
const
|
|
2320
|
+
const p = y || sr(t), k = t === "caption", v = t === "label", g = t === "code", $ = m(
|
|
2321
2321
|
"font-sans",
|
|
2322
2322
|
// Variant — caption and label pin their own size/weight
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2323
|
+
k && "text-xs text-text-subtle",
|
|
2324
|
+
v && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2325
|
+
g && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2326
2326
|
// Size — only where the variant does not pin it
|
|
2327
|
-
!
|
|
2327
|
+
!k && !v && !g && Qt[r],
|
|
2328
2328
|
// Weight — label owns its weight
|
|
2329
|
-
!
|
|
2329
|
+
!v && er[n],
|
|
2330
2330
|
tr[s],
|
|
2331
2331
|
rr[a],
|
|
2332
2332
|
// Line height only overrides the body variant
|
|
2333
|
-
t === "body" && nr[
|
|
2333
|
+
t === "body" && nr[b],
|
|
2334
2334
|
c && "italic",
|
|
2335
2335
|
h && "underline",
|
|
2336
2336
|
l && "truncate",
|
|
2337
2337
|
x
|
|
2338
2338
|
);
|
|
2339
|
-
return /* @__PURE__ */ e(
|
|
2339
|
+
return /* @__PURE__ */ e(p, { className: $, ...f, children: u });
|
|
2340
2340
|
};
|
|
2341
2341
|
function sr(t) {
|
|
2342
2342
|
return {
|
|
@@ -2355,45 +2355,45 @@ const ar = ({
|
|
|
2355
2355
|
disabled: l,
|
|
2356
2356
|
accept: c,
|
|
2357
2357
|
onListFiles: h,
|
|
2358
|
-
onListMounts:
|
|
2359
|
-
onUploadFile:
|
|
2358
|
+
onListMounts: b,
|
|
2359
|
+
onUploadFile: y,
|
|
2360
2360
|
onDownloadFile: x,
|
|
2361
|
-
onRegisterFile:
|
|
2361
|
+
onRegisterFile: u
|
|
2362
2362
|
}) => {
|
|
2363
|
-
const [f,
|
|
2363
|
+
const [f, p] = R(!1), [k, v] = R([]), [g, $] = R(null), [D, _] = R("/"), [M, q] = R([]), [V, j] = R(!1), [W, H] = R(""), [X, Z] = R(
|
|
2364
2364
|
typeof t == "object" ? t : null
|
|
2365
|
-
), [
|
|
2365
|
+
), [ee, C] = R(!1), [d, E] = R(""), N = ae(null);
|
|
2366
2366
|
Y(() => {
|
|
2367
|
-
f &&
|
|
2367
|
+
f && L();
|
|
2368
2368
|
}, [f]), Y(() => {
|
|
2369
|
-
f &&
|
|
2370
|
-
}, [f,
|
|
2371
|
-
const
|
|
2372
|
-
|
|
2369
|
+
f && g && w();
|
|
2370
|
+
}, [f, g, D, W]);
|
|
2371
|
+
const L = async () => {
|
|
2372
|
+
j(!0);
|
|
2373
2373
|
try {
|
|
2374
|
-
const o = await
|
|
2375
|
-
o?.data &&
|
|
2374
|
+
const o = await b?.();
|
|
2375
|
+
o?.data && v(o.data);
|
|
2376
2376
|
} catch (o) {
|
|
2377
2377
|
console.error("Failed to load mounts", o);
|
|
2378
2378
|
} finally {
|
|
2379
|
-
|
|
2379
|
+
j(!1);
|
|
2380
2380
|
}
|
|
2381
|
-
},
|
|
2382
|
-
if (
|
|
2383
|
-
|
|
2381
|
+
}, w = async () => {
|
|
2382
|
+
if (g) {
|
|
2383
|
+
j(!0);
|
|
2384
2384
|
try {
|
|
2385
|
-
const o = await h?.({ mountId:
|
|
2385
|
+
const o = await h?.({ mountId: g.id, name: W, path: D });
|
|
2386
2386
|
o?.data && q(o.data);
|
|
2387
2387
|
} catch (o) {
|
|
2388
2388
|
console.error("Failed to load files", o);
|
|
2389
2389
|
} finally {
|
|
2390
|
-
|
|
2390
|
+
j(!1);
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
|
-
},
|
|
2393
|
+
}, Q = async (o) => {
|
|
2394
2394
|
const z = o.target.files?.[0];
|
|
2395
2395
|
if (z) {
|
|
2396
|
-
|
|
2396
|
+
j(!0);
|
|
2397
2397
|
try {
|
|
2398
2398
|
const B = await z.arrayBuffer(), F = new Uint8Array(B), O = {
|
|
2399
2399
|
id: `local-${Date.now()}`,
|
|
@@ -2406,65 +2406,65 @@ const ar = ({
|
|
|
2406
2406
|
providerKey: z.name,
|
|
2407
2407
|
ownerId: "me"
|
|
2408
2408
|
};
|
|
2409
|
-
Z(O), r(O, F),
|
|
2409
|
+
Z(O), r(O, F), p(!1);
|
|
2410
2410
|
} catch (B) {
|
|
2411
2411
|
console.error("Local file selection failed", B);
|
|
2412
2412
|
} finally {
|
|
2413
|
-
|
|
2413
|
+
j(!1);
|
|
2414
2414
|
}
|
|
2415
2415
|
}
|
|
2416
|
-
},
|
|
2416
|
+
}, te = async (o) => {
|
|
2417
2417
|
const z = o.target.files?.[0];
|
|
2418
|
-
if (!(!z || !
|
|
2419
|
-
|
|
2418
|
+
if (!(!z || !g)) {
|
|
2419
|
+
j(!0);
|
|
2420
2420
|
try {
|
|
2421
|
-
const B = await z.arrayBuffer(), F = await
|
|
2421
|
+
const B = await z.arrayBuffer(), F = await y?.({
|
|
2422
2422
|
file: new Uint8Array(B),
|
|
2423
2423
|
filename: z.name,
|
|
2424
2424
|
mimeType: z.type || "application/octet-stream",
|
|
2425
|
-
mountId:
|
|
2426
|
-
path:
|
|
2425
|
+
mountId: g.id,
|
|
2426
|
+
path: D
|
|
2427
2427
|
});
|
|
2428
2428
|
if (F?.data) {
|
|
2429
2429
|
const O = F.data;
|
|
2430
|
-
Z(O), r(O, new Uint8Array(B)),
|
|
2430
|
+
Z(O), r(O, new Uint8Array(B)), p(!1);
|
|
2431
2431
|
}
|
|
2432
2432
|
} catch (B) {
|
|
2433
2433
|
console.error("Upload failed", B);
|
|
2434
2434
|
} finally {
|
|
2435
|
-
|
|
2435
|
+
j(!1);
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
2438
|
-
},
|
|
2439
|
-
if (!(!
|
|
2440
|
-
|
|
2438
|
+
}, ne = async () => {
|
|
2439
|
+
if (!(!d || !g)) {
|
|
2440
|
+
j(!0);
|
|
2441
2441
|
try {
|
|
2442
|
-
const o = `${
|
|
2443
|
-
|
|
2444
|
-
name:
|
|
2442
|
+
const o = `${D}${d}/`;
|
|
2443
|
+
u && (await u({
|
|
2444
|
+
name: d,
|
|
2445
2445
|
type: "folder",
|
|
2446
|
-
path:
|
|
2446
|
+
path: D,
|
|
2447
2447
|
mimeType: "application/x-directory",
|
|
2448
2448
|
size: 0,
|
|
2449
|
-
mountId:
|
|
2449
|
+
mountId: g.id,
|
|
2450
2450
|
providerKey: o,
|
|
2451
2451
|
ownerId: "me"
|
|
2452
|
-
}), await
|
|
2452
|
+
}), await w()), C(!1), E("");
|
|
2453
2453
|
} catch (o) {
|
|
2454
2454
|
console.error("Failed to create folder", o);
|
|
2455
2455
|
} finally {
|
|
2456
|
-
|
|
2456
|
+
j(!1);
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
}, G = async (o) => {
|
|
2460
|
-
|
|
2460
|
+
j(!0);
|
|
2461
2461
|
try {
|
|
2462
2462
|
const z = await x?.(o.id);
|
|
2463
|
-
Z(o), r(o, z),
|
|
2463
|
+
Z(o), r(o, z), p(!1);
|
|
2464
2464
|
} catch (z) {
|
|
2465
2465
|
console.error("Failed to download file", z);
|
|
2466
2466
|
} finally {
|
|
2467
|
-
|
|
2467
|
+
j(!1);
|
|
2468
2468
|
}
|
|
2469
2469
|
}, S = (o) => {
|
|
2470
2470
|
o.stopPropagation(), Z(null), r(null);
|
|
@@ -2472,19 +2472,19 @@ const ar = ({
|
|
|
2472
2472
|
const o = /* @__PURE__ */ new Set(), z = [];
|
|
2473
2473
|
return M.forEach((B) => {
|
|
2474
2474
|
if (B.type === "folder") {
|
|
2475
|
-
B.path ===
|
|
2475
|
+
B.path === D && o.add(B.name);
|
|
2476
2476
|
return;
|
|
2477
2477
|
}
|
|
2478
|
-
const F = B.providerKey || B.name,
|
|
2479
|
-
|
|
2478
|
+
const F = B.providerKey || B.name, se = (D ? F.substring(D.length) : F).split("/").filter((ie) => ie !== "");
|
|
2479
|
+
se.length > 1 ? o.add(se[0]) : se.length === 1 && z.push(B);
|
|
2480
2480
|
}), {
|
|
2481
2481
|
folders: Array.from(o).sort(),
|
|
2482
2482
|
files: z.sort((B, F) => B.name.localeCompare(F.name))
|
|
2483
2483
|
};
|
|
2484
|
-
}, [M,
|
|
2484
|
+
}, [M, D]), I = (o) => {
|
|
2485
2485
|
_((z) => `${z}${o}/`);
|
|
2486
2486
|
}, T = () => {
|
|
2487
|
-
const o =
|
|
2487
|
+
const o = D.split("/").filter((z) => z !== "");
|
|
2488
2488
|
o.pop(), o.length === 0 ? _("/") : _(`${o.join("/")}/`);
|
|
2489
2489
|
}, U = me(() => {
|
|
2490
2490
|
const o = A.folders.map((z) => ({
|
|
@@ -2512,7 +2512,7 @@ const ar = ({
|
|
|
2512
2512
|
color: z.type === "folder" ? "warning" : "secondary"
|
|
2513
2513
|
}
|
|
2514
2514
|
),
|
|
2515
|
-
/* @__PURE__ */ e("span", { className:
|
|
2515
|
+
/* @__PURE__ */ e("span", { className: m(z.type === "folder" && "font-medium"), children: o })
|
|
2516
2516
|
] })
|
|
2517
2517
|
},
|
|
2518
2518
|
{
|
|
@@ -2531,12 +2531,12 @@ const ar = ({
|
|
|
2531
2531
|
accessor: "id",
|
|
2532
2532
|
align: "right",
|
|
2533
2533
|
cell: (o, z) => /* @__PURE__ */ e(
|
|
2534
|
-
|
|
2534
|
+
re,
|
|
2535
2535
|
{
|
|
2536
2536
|
size: "sm",
|
|
2537
2537
|
variant: "outline",
|
|
2538
2538
|
onClick: (B) => {
|
|
2539
|
-
B.stopPropagation(), z.type === "folder" ?
|
|
2539
|
+
B.stopPropagation(), z.type === "folder" ? I(z.name) : G(z);
|
|
2540
2540
|
},
|
|
2541
2541
|
loading: V && z.type === "file" && X?.id === z.id,
|
|
2542
2542
|
children: z.type === "folder" ? "Open" : "Select"
|
|
@@ -2558,7 +2558,7 @@ const ar = ({
|
|
|
2558
2558
|
header: "",
|
|
2559
2559
|
accessor: "id",
|
|
2560
2560
|
align: "right",
|
|
2561
|
-
cell: (o, z) => /* @__PURE__ */ e(
|
|
2561
|
+
cell: (o, z) => /* @__PURE__ */ e(re, { size: "sm", variant: "outline", onClick: () => $(z), children: "Open" })
|
|
2562
2562
|
}
|
|
2563
2563
|
];
|
|
2564
2564
|
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
@@ -2566,8 +2566,8 @@ const ar = ({
|
|
|
2566
2566
|
/* @__PURE__ */ i(
|
|
2567
2567
|
"div",
|
|
2568
2568
|
{
|
|
2569
|
-
onClick: () => !l &&
|
|
2570
|
-
className:
|
|
2569
|
+
onClick: () => !l && p(!0),
|
|
2570
|
+
className: m(
|
|
2571
2571
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2572
2572
|
"hover:border-border-strong bg-surface",
|
|
2573
2573
|
a ? "border-danger-border" : "border-border",
|
|
@@ -2593,9 +2593,9 @@ const ar = ({
|
|
|
2593
2593
|
{
|
|
2594
2594
|
open: f,
|
|
2595
2595
|
onClose: () => {
|
|
2596
|
-
|
|
2596
|
+
p(!1), $(null), _("/"), C(!1);
|
|
2597
2597
|
},
|
|
2598
|
-
title:
|
|
2598
|
+
title: g ? `Explorer: ${g.name}` : "Select Storage Mount",
|
|
2599
2599
|
size: "lg",
|
|
2600
2600
|
children: /* @__PURE__ */ e(
|
|
2601
2601
|
Xt,
|
|
@@ -2605,21 +2605,21 @@ const ar = ({
|
|
|
2605
2605
|
{
|
|
2606
2606
|
id: "remote",
|
|
2607
2607
|
label: "Platform Storage",
|
|
2608
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2608
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: g ? /* @__PURE__ */ i(fe, { children: [
|
|
2609
2609
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2610
2610
|
/* @__PURE__ */ e(
|
|
2611
|
-
|
|
2611
|
+
re,
|
|
2612
2612
|
{
|
|
2613
2613
|
variant: "ghost",
|
|
2614
2614
|
size: "sm",
|
|
2615
2615
|
onClick: () => {
|
|
2616
|
-
|
|
2616
|
+
D && D !== "/" ? T() : $(null);
|
|
2617
2617
|
},
|
|
2618
2618
|
leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "xs" }),
|
|
2619
|
-
children:
|
|
2619
|
+
children: D ? "Back" : "Back to Mounts"
|
|
2620
2620
|
}
|
|
2621
2621
|
),
|
|
2622
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2622
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: D }) }),
|
|
2623
2623
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2624
2624
|
he,
|
|
2625
2625
|
{
|
|
@@ -2633,21 +2633,21 @@ const ar = ({
|
|
|
2633
2633
|
) }),
|
|
2634
2634
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2635
2635
|
/* @__PURE__ */ e(
|
|
2636
|
-
|
|
2636
|
+
re,
|
|
2637
2637
|
{
|
|
2638
2638
|
variant: "outline",
|
|
2639
2639
|
size: "sm",
|
|
2640
|
-
onClick: () =>
|
|
2640
|
+
onClick: () => C(!0),
|
|
2641
2641
|
leftIcon: /* @__PURE__ */ e(J, { icon: rt, size: "xs" }),
|
|
2642
2642
|
children: "New Folder"
|
|
2643
2643
|
}
|
|
2644
2644
|
),
|
|
2645
2645
|
/* @__PURE__ */ e(
|
|
2646
|
-
|
|
2646
|
+
re,
|
|
2647
2647
|
{
|
|
2648
2648
|
variant: "primary",
|
|
2649
2649
|
size: "sm",
|
|
2650
|
-
onClick: () =>
|
|
2650
|
+
onClick: () => N.current?.click(),
|
|
2651
2651
|
leftIcon: /* @__PURE__ */ e(J, { icon: nt, size: "xs" }),
|
|
2652
2652
|
loading: V,
|
|
2653
2653
|
children: "Upload"
|
|
@@ -2658,27 +2658,27 @@ const ar = ({
|
|
|
2658
2658
|
{
|
|
2659
2659
|
type: "file",
|
|
2660
2660
|
className: "hidden",
|
|
2661
|
-
ref:
|
|
2662
|
-
onChange:
|
|
2661
|
+
ref: N,
|
|
2662
|
+
onChange: te,
|
|
2663
2663
|
accept: c
|
|
2664
2664
|
}
|
|
2665
2665
|
)
|
|
2666
2666
|
] })
|
|
2667
2667
|
] }),
|
|
2668
|
-
|
|
2668
|
+
ee && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
2669
2669
|
/* @__PURE__ */ e(J, { icon: De, size: "sm", color: "warning" }),
|
|
2670
2670
|
/* @__PURE__ */ e(
|
|
2671
2671
|
he,
|
|
2672
2672
|
{
|
|
2673
2673
|
size: "sm",
|
|
2674
2674
|
placeholder: "Folder name",
|
|
2675
|
-
value:
|
|
2675
|
+
value: d,
|
|
2676
2676
|
onChange: (o) => E(o.target.value),
|
|
2677
2677
|
autoFocus: !0
|
|
2678
2678
|
}
|
|
2679
2679
|
),
|
|
2680
|
-
/* @__PURE__ */ e(
|
|
2681
|
-
/* @__PURE__ */ e(
|
|
2680
|
+
/* @__PURE__ */ e(re, { size: "sm", onClick: ne, loading: V, children: "Create" }),
|
|
2681
|
+
/* @__PURE__ */ e(re, { size: "sm", variant: "ghost", onClick: () => C(!1), children: "Cancel" })
|
|
2682
2682
|
] }),
|
|
2683
2683
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2684
2684
|
Te,
|
|
@@ -2687,17 +2687,17 @@ const ar = ({
|
|
|
2687
2687
|
columns: P,
|
|
2688
2688
|
loading: V,
|
|
2689
2689
|
emptyContent: "This folder is empty",
|
|
2690
|
-
onRowClick: (o) => o.type === "folder" ?
|
|
2690
|
+
onRowClick: (o) => o.type === "folder" ? I(o.name) : G(o)
|
|
2691
2691
|
}
|
|
2692
2692
|
) })
|
|
2693
2693
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2694
2694
|
Te,
|
|
2695
2695
|
{
|
|
2696
|
-
data:
|
|
2696
|
+
data: k,
|
|
2697
2697
|
columns: K,
|
|
2698
2698
|
loading: V,
|
|
2699
2699
|
emptyContent: "No storage mounts configured",
|
|
2700
|
-
onRowClick: (o) =>
|
|
2700
|
+
onRowClick: (o) => $(o)
|
|
2701
2701
|
}
|
|
2702
2702
|
) }) })
|
|
2703
2703
|
},
|
|
@@ -2713,13 +2713,13 @@ const ar = ({
|
|
|
2713
2713
|
" be uploaded to platform storage."
|
|
2714
2714
|
] }),
|
|
2715
2715
|
/* @__PURE__ */ i("label", { className: "cursor-pointer", children: [
|
|
2716
|
-
/* @__PURE__ */ e(
|
|
2716
|
+
/* @__PURE__ */ e(re, { variant: "primary", size: "lg", loading: V, className: "pointer-events-none", children: "Browse Local File" }),
|
|
2717
2717
|
/* @__PURE__ */ e(
|
|
2718
2718
|
"input",
|
|
2719
2719
|
{
|
|
2720
2720
|
type: "file",
|
|
2721
2721
|
className: "hidden",
|
|
2722
|
-
onChange:
|
|
2722
|
+
onChange: Q,
|
|
2723
2723
|
accept: c,
|
|
2724
2724
|
disabled: V
|
|
2725
2725
|
}
|
|
@@ -2748,20 +2748,20 @@ const ar = ({
|
|
|
2748
2748
|
loading: l = !1,
|
|
2749
2749
|
containerClassName: c,
|
|
2750
2750
|
labelClassName: h,
|
|
2751
|
-
className:
|
|
2752
|
-
id:
|
|
2751
|
+
className: b,
|
|
2752
|
+
id: y,
|
|
2753
2753
|
rows: x = 4,
|
|
2754
|
-
...
|
|
2754
|
+
...u
|
|
2755
2755
|
}, f) => {
|
|
2756
|
-
const
|
|
2757
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2756
|
+
const p = le.useId(), k = y || `textarea-${p}`, v = !!n, g = n || r ? `${k}-description` : void 0;
|
|
2757
|
+
return /* @__PURE__ */ i("div", { className: m("flex flex-col", a && "w-full", c), children: [
|
|
2758
2758
|
t && /* @__PURE__ */ e(
|
|
2759
2759
|
"label",
|
|
2760
2760
|
{
|
|
2761
|
-
htmlFor:
|
|
2762
|
-
className:
|
|
2761
|
+
htmlFor: k,
|
|
2762
|
+
className: m(
|
|
2763
2763
|
Oe,
|
|
2764
|
-
|
|
2764
|
+
v ? "text-danger-fg" : "text-text-subtle",
|
|
2765
2765
|
h
|
|
2766
2766
|
),
|
|
2767
2767
|
children: t
|
|
@@ -2772,21 +2772,21 @@ const ar = ({
|
|
|
2772
2772
|
"textarea",
|
|
2773
2773
|
{
|
|
2774
2774
|
ref: f,
|
|
2775
|
-
id:
|
|
2775
|
+
id: k,
|
|
2776
2776
|
rows: x,
|
|
2777
|
-
"aria-invalid":
|
|
2778
|
-
"aria-describedby":
|
|
2779
|
-
className:
|
|
2777
|
+
"aria-invalid": v || void 0,
|
|
2778
|
+
"aria-describedby": g,
|
|
2779
|
+
className: m(
|
|
2780
2780
|
"block w-full resize-y rounded-md border bg-surface-input text-text",
|
|
2781
2781
|
"transition-colors duration-fast ease-out",
|
|
2782
2782
|
"placeholder:text-text-subtle",
|
|
2783
2783
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2784
2784
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
2785
2785
|
lr[s],
|
|
2786
|
-
|
|
2787
|
-
|
|
2786
|
+
v ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2787
|
+
b
|
|
2788
2788
|
),
|
|
2789
|
-
...
|
|
2789
|
+
...u
|
|
2790
2790
|
}
|
|
2791
2791
|
),
|
|
2792
2792
|
l && /* @__PURE__ */ e(
|
|
@@ -2800,8 +2800,8 @@ const ar = ({
|
|
|
2800
2800
|
(n || r) && /* @__PURE__ */ e(
|
|
2801
2801
|
"p",
|
|
2802
2802
|
{
|
|
2803
|
-
id:
|
|
2804
|
-
className:
|
|
2803
|
+
id: g,
|
|
2804
|
+
className: m("mt-1 text-xs", v ? "text-danger-fg" : "text-text-subtle"),
|
|
2805
2805
|
children: n || r
|
|
2806
2806
|
}
|
|
2807
2807
|
)
|
|
@@ -2819,8 +2819,8 @@ function or(t, r, n) {
|
|
|
2819
2819
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2820
2820
|
let l = a;
|
|
2821
2821
|
for (let c = 0; c < s.length - 1; c++) {
|
|
2822
|
-
const h = s[c],
|
|
2823
|
-
l[h] =
|
|
2822
|
+
const h = s[c], b = l[h];
|
|
2823
|
+
l[h] = b && typeof b == "object" ? Array.isArray(b) ? [...b] : { ...b } : {}, l = l[h];
|
|
2824
2824
|
}
|
|
2825
2825
|
return l[s[s.length - 1]] = n, a;
|
|
2826
2826
|
}
|
|
@@ -2843,101 +2843,101 @@ const Qr = ({
|
|
|
2843
2843
|
transform: l,
|
|
2844
2844
|
validate: c,
|
|
2845
2845
|
submitButton: h = { label: "Submit", variant: "primary" },
|
|
2846
|
-
cancelButton:
|
|
2847
|
-
showButtons:
|
|
2846
|
+
cancelButton: b = { label: "Cancel", variant: "outline" },
|
|
2847
|
+
showButtons: y = !0,
|
|
2848
2848
|
layout: x = "vertical",
|
|
2849
|
-
size:
|
|
2849
|
+
size: u = "md",
|
|
2850
2850
|
loading: f = !1,
|
|
2851
|
-
className:
|
|
2852
|
-
ref:
|
|
2853
|
-
sdk:
|
|
2851
|
+
className: p,
|
|
2852
|
+
ref: k,
|
|
2853
|
+
sdk: v
|
|
2854
2854
|
}) => {
|
|
2855
|
-
const [
|
|
2855
|
+
const [g, $] = R(r || {}), [D, _] = R({}), [M, q] = R({});
|
|
2856
2856
|
Y(() => {
|
|
2857
|
-
r &&
|
|
2857
|
+
r && $({ ...r });
|
|
2858
2858
|
}, [r]);
|
|
2859
2859
|
const V = ce(
|
|
2860
|
-
(
|
|
2861
|
-
const
|
|
2862
|
-
if (!
|
|
2863
|
-
if (
|
|
2864
|
-
return `${
|
|
2865
|
-
if (
|
|
2866
|
-
if (
|
|
2867
|
-
return `${
|
|
2868
|
-
if (
|
|
2869
|
-
return `${
|
|
2870
|
-
if (Array.isArray(
|
|
2871
|
-
const
|
|
2872
|
-
let
|
|
2873
|
-
if (
|
|
2874
|
-
const
|
|
2875
|
-
for (const G of
|
|
2876
|
-
const S =
|
|
2860
|
+
(C, d, E) => {
|
|
2861
|
+
const N = t.flatMap((L) => L.items).find((L) => L.name === C);
|
|
2862
|
+
if (!N) return null;
|
|
2863
|
+
if (N.required && (d == null || d === ""))
|
|
2864
|
+
return `${N.label} is required`;
|
|
2865
|
+
if (N.type === "array") {
|
|
2866
|
+
if (N.required && (!d || d.length === 0))
|
|
2867
|
+
return `${N.label} cannot be empty.`;
|
|
2868
|
+
if (d && !Array.isArray(d))
|
|
2869
|
+
return `${N.label} must be an array.`;
|
|
2870
|
+
if (Array.isArray(d) && N.arrayFields) {
|
|
2871
|
+
const L = [];
|
|
2872
|
+
let w = !1;
|
|
2873
|
+
if (d.forEach((Q, te) => {
|
|
2874
|
+
const ne = {};
|
|
2875
|
+
for (const G of N.arrayFields) {
|
|
2876
|
+
const S = Q?.[G.name];
|
|
2877
2877
|
if (G.required && (S == null || S === ""))
|
|
2878
|
-
|
|
2878
|
+
ne[G.name] = `${G.label} is required`, w = !0;
|
|
2879
2879
|
else if (G.validator) {
|
|
2880
|
-
const A = G.validator(S,
|
|
2881
|
-
A && (
|
|
2880
|
+
const A = G.validator(S, Q);
|
|
2881
|
+
A && (ne[G.name] = A, w = !0);
|
|
2882
2882
|
}
|
|
2883
2883
|
}
|
|
2884
|
-
|
|
2885
|
-
}),
|
|
2886
|
-
return JSON.stringify(
|
|
2884
|
+
L[te] = ne;
|
|
2885
|
+
}), w)
|
|
2886
|
+
return JSON.stringify(L);
|
|
2887
2887
|
}
|
|
2888
2888
|
}
|
|
2889
|
-
return
|
|
2889
|
+
return N.validator ? N.validator(d, E) : null;
|
|
2890
2890
|
},
|
|
2891
2891
|
[t]
|
|
2892
|
-
),
|
|
2893
|
-
(
|
|
2892
|
+
), j = ce(
|
|
2893
|
+
(C, d) => {
|
|
2894
2894
|
let E = or(
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2895
|
+
g,
|
|
2896
|
+
C,
|
|
2897
|
+
d
|
|
2898
2898
|
);
|
|
2899
|
-
t.flatMap((
|
|
2900
|
-
const
|
|
2901
|
-
_((
|
|
2902
|
-
...
|
|
2903
|
-
[
|
|
2904
|
-
})), a?.(E,
|
|
2899
|
+
t.flatMap((w) => w.items).find((w) => w.name === C)?.removeIfEmpty && (d == null || d === "") && (E = cr(E, C)), $(E), q((w) => ({ ...w, [C]: !0 }));
|
|
2900
|
+
const L = V(C, d, E);
|
|
2901
|
+
_((w) => ({
|
|
2902
|
+
...w,
|
|
2903
|
+
[C]: L || ""
|
|
2904
|
+
})), a?.(E, C);
|
|
2905
2905
|
},
|
|
2906
|
-
[
|
|
2906
|
+
[g, t, V, a]
|
|
2907
2907
|
), W = ce(
|
|
2908
|
-
async (
|
|
2909
|
-
if (
|
|
2910
|
-
const
|
|
2911
|
-
for (const
|
|
2912
|
-
if (
|
|
2908
|
+
async (C) => {
|
|
2909
|
+
if (C.preventDefault(), f) return;
|
|
2910
|
+
const d = {}, E = t.flatMap((L) => L.items);
|
|
2911
|
+
for (const L of E) {
|
|
2912
|
+
if (L.hidden || L.conditional && !L.conditional(g))
|
|
2913
2913
|
continue;
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2916
|
-
Ae(
|
|
2917
|
-
|
|
2914
|
+
const w = V(
|
|
2915
|
+
L.name,
|
|
2916
|
+
Ae(g, L.name),
|
|
2917
|
+
g
|
|
2918
2918
|
);
|
|
2919
|
-
|
|
2919
|
+
w && (d[L.name] = w);
|
|
2920
2920
|
}
|
|
2921
2921
|
if (c) {
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2922
|
+
const L = c(g);
|
|
2923
|
+
L && Object.assign(d, L);
|
|
2924
2924
|
}
|
|
2925
|
-
if (_(
|
|
2925
|
+
if (_(d), Object.keys(d).some((L) => d[L]))
|
|
2926
2926
|
return;
|
|
2927
|
-
const
|
|
2928
|
-
await n?.(
|
|
2927
|
+
const N = l ? l(g) : g;
|
|
2928
|
+
await n?.(g, N);
|
|
2929
2929
|
},
|
|
2930
|
-
[
|
|
2930
|
+
[g, t, V, c, l, n, f]
|
|
2931
2931
|
), H = ce(
|
|
2932
|
-
(
|
|
2933
|
-
const
|
|
2934
|
-
value:
|
|
2935
|
-
disabled:
|
|
2936
|
-
required:
|
|
2937
|
-
placeholder:
|
|
2938
|
-
...
|
|
2932
|
+
(C) => {
|
|
2933
|
+
const d = Ae(g, C.name), E = M[C.name] ? D[C.name] : void 0, N = C.disabled || f, L = {
|
|
2934
|
+
value: d || "",
|
|
2935
|
+
disabled: N,
|
|
2936
|
+
required: C.required,
|
|
2937
|
+
placeholder: C.placeholder,
|
|
2938
|
+
...C.fieldProps
|
|
2939
2939
|
};
|
|
2940
|
-
switch (
|
|
2940
|
+
switch (C.type) {
|
|
2941
2941
|
case "text":
|
|
2942
2942
|
case "email":
|
|
2943
2943
|
case "password":
|
|
@@ -2947,54 +2947,54 @@ const Qr = ({
|
|
|
2947
2947
|
return /* @__PURE__ */ e(
|
|
2948
2948
|
he,
|
|
2949
2949
|
{
|
|
2950
|
-
...
|
|
2951
|
-
onChange: (
|
|
2952
|
-
type:
|
|
2953
|
-
autoComplete:
|
|
2950
|
+
...L,
|
|
2951
|
+
onChange: (w) => j(C.name, w.target.value),
|
|
2952
|
+
type: C.textType || C.type,
|
|
2953
|
+
autoComplete: C.autocomplete,
|
|
2954
2954
|
error: E,
|
|
2955
|
-
size:
|
|
2955
|
+
size: u
|
|
2956
2956
|
}
|
|
2957
2957
|
);
|
|
2958
2958
|
case "textarea":
|
|
2959
2959
|
return /* @__PURE__ */ e(
|
|
2960
2960
|
ze,
|
|
2961
2961
|
{
|
|
2962
|
-
...
|
|
2963
|
-
onChange: (
|
|
2962
|
+
...L,
|
|
2963
|
+
onChange: (w) => j(C.name, w.target.value),
|
|
2964
2964
|
rows: 4,
|
|
2965
2965
|
error: E,
|
|
2966
|
-
size:
|
|
2966
|
+
size: u
|
|
2967
2967
|
}
|
|
2968
2968
|
);
|
|
2969
2969
|
case "select":
|
|
2970
2970
|
return /* @__PURE__ */ e(
|
|
2971
2971
|
pe,
|
|
2972
2972
|
{
|
|
2973
|
-
...
|
|
2974
|
-
onChange: (
|
|
2975
|
-
options: (
|
|
2976
|
-
...
|
|
2977
|
-
value: String(
|
|
2973
|
+
...L,
|
|
2974
|
+
onChange: (w) => j(C.name, w),
|
|
2975
|
+
options: (C.options || []).map((w) => ({
|
|
2976
|
+
...w,
|
|
2977
|
+
value: String(w.value)
|
|
2978
2978
|
})),
|
|
2979
|
-
searchable:
|
|
2980
|
-
multiple:
|
|
2981
|
-
allowCreate:
|
|
2979
|
+
searchable: C.searchable,
|
|
2980
|
+
multiple: C.multiple,
|
|
2981
|
+
allowCreate: C.allowCreate,
|
|
2982
2982
|
error: E,
|
|
2983
|
-
size:
|
|
2983
|
+
size: u
|
|
2984
2984
|
}
|
|
2985
2985
|
);
|
|
2986
2986
|
case "checkbox":
|
|
2987
2987
|
return /* @__PURE__ */ e(
|
|
2988
2988
|
xe,
|
|
2989
2989
|
{
|
|
2990
|
-
...
|
|
2991
|
-
checked: !!
|
|
2992
|
-
onChange: (
|
|
2993
|
-
size:
|
|
2990
|
+
...L,
|
|
2991
|
+
checked: !!d,
|
|
2992
|
+
onChange: (w) => j(C.name, w.target.checked),
|
|
2993
|
+
size: u
|
|
2994
2994
|
}
|
|
2995
2995
|
);
|
|
2996
2996
|
case "radio":
|
|
2997
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
2997
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: C.options?.map((w) => /* @__PURE__ */ i(
|
|
2998
2998
|
"label",
|
|
2999
2999
|
{
|
|
3000
3000
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3003,59 +3003,59 @@ const Qr = ({
|
|
|
3003
3003
|
"input",
|
|
3004
3004
|
{
|
|
3005
3005
|
type: "radio",
|
|
3006
|
-
name:
|
|
3007
|
-
value:
|
|
3008
|
-
checked:
|
|
3009
|
-
onChange: () =>
|
|
3010
|
-
disabled:
|
|
3006
|
+
name: C.name,
|
|
3007
|
+
value: w.value,
|
|
3008
|
+
checked: d === w.value,
|
|
3009
|
+
onChange: () => j(C.name, w.value),
|
|
3010
|
+
disabled: N || w.disabled,
|
|
3011
3011
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3012
3012
|
}
|
|
3013
3013
|
),
|
|
3014
|
-
|
|
3014
|
+
w.label
|
|
3015
3015
|
]
|
|
3016
3016
|
},
|
|
3017
|
-
|
|
3017
|
+
w.value
|
|
3018
3018
|
)) });
|
|
3019
3019
|
case "date":
|
|
3020
3020
|
return /* @__PURE__ */ e(
|
|
3021
3021
|
Se,
|
|
3022
3022
|
{
|
|
3023
|
-
...
|
|
3024
|
-
value:
|
|
3025
|
-
onChange: (
|
|
3026
|
-
size:
|
|
3023
|
+
...L,
|
|
3024
|
+
value: d ? new Date(d) : null,
|
|
3025
|
+
onChange: (w) => j(C.name, w),
|
|
3026
|
+
size: u
|
|
3027
3027
|
}
|
|
3028
3028
|
);
|
|
3029
3029
|
case "file":
|
|
3030
3030
|
return /* @__PURE__ */ e(
|
|
3031
3031
|
ar,
|
|
3032
3032
|
{
|
|
3033
|
-
...
|
|
3034
|
-
value:
|
|
3035
|
-
onChange: (
|
|
3033
|
+
...L,
|
|
3034
|
+
value: d,
|
|
3035
|
+
onChange: (w) => j(C.name, w),
|
|
3036
3036
|
error: E,
|
|
3037
|
-
onListFiles: (
|
|
3037
|
+
onListFiles: (w) => v?.http.invoke({
|
|
3038
3038
|
method: "POST",
|
|
3039
3039
|
action: "storage.file.list",
|
|
3040
|
-
body:
|
|
3040
|
+
body: w
|
|
3041
3041
|
}),
|
|
3042
|
-
onListMounts: () =>
|
|
3042
|
+
onListMounts: () => v?.http.invoke({
|
|
3043
3043
|
method: "GET",
|
|
3044
3044
|
action: "storage.mount"
|
|
3045
3045
|
}),
|
|
3046
|
-
onUploadFile: (
|
|
3046
|
+
onUploadFile: (w) => v?.http.invoke({
|
|
3047
3047
|
method: "POST",
|
|
3048
3048
|
action: "storage.file.upload",
|
|
3049
|
-
body:
|
|
3049
|
+
body: w
|
|
3050
3050
|
}),
|
|
3051
|
-
onDownloadFile: (
|
|
3051
|
+
onDownloadFile: (w) => v?.http.invoke({
|
|
3052
3052
|
method: "GET",
|
|
3053
|
-
action: `storage.file.${
|
|
3053
|
+
action: `storage.file.${w}.download`
|
|
3054
3054
|
}),
|
|
3055
|
-
onRegisterFile: (
|
|
3055
|
+
onRegisterFile: (w) => v?.http.invoke({
|
|
3056
3056
|
method: "POST",
|
|
3057
3057
|
action: "storage.file.folder",
|
|
3058
|
-
body:
|
|
3058
|
+
body: w
|
|
3059
3059
|
})
|
|
3060
3060
|
}
|
|
3061
3061
|
);
|
|
@@ -3063,68 +3063,68 @@ const Qr = ({
|
|
|
3063
3063
|
return /* @__PURE__ */ e(
|
|
3064
3064
|
It,
|
|
3065
3065
|
{
|
|
3066
|
-
value:
|
|
3067
|
-
onChange: (
|
|
3068
|
-
onListFolders: () =>
|
|
3066
|
+
value: d || {},
|
|
3067
|
+
onChange: (w) => j(C.name, w),
|
|
3068
|
+
onListFolders: () => v?.http.invoke({
|
|
3069
3069
|
method: "GET",
|
|
3070
3070
|
action: "storage.mount"
|
|
3071
3071
|
}),
|
|
3072
|
-
disabled:
|
|
3073
|
-
size:
|
|
3074
|
-
placeholder:
|
|
3072
|
+
disabled: N,
|
|
3073
|
+
size: u,
|
|
3074
|
+
placeholder: C.placeholder
|
|
3075
3075
|
}
|
|
3076
3076
|
);
|
|
3077
3077
|
case "custom":
|
|
3078
|
-
return
|
|
3079
|
-
value:
|
|
3080
|
-
onChange: (
|
|
3078
|
+
return C.customComponent?.({
|
|
3079
|
+
value: d,
|
|
3080
|
+
onChange: (w) => j(C.name, w),
|
|
3081
3081
|
error: E,
|
|
3082
|
-
disabled:
|
|
3082
|
+
disabled: N
|
|
3083
3083
|
});
|
|
3084
3084
|
case "array": {
|
|
3085
|
-
const
|
|
3086
|
-
let
|
|
3085
|
+
const w = d || [];
|
|
3086
|
+
let Q = [];
|
|
3087
3087
|
if (typeof E == "string" && E.startsWith("["))
|
|
3088
3088
|
try {
|
|
3089
|
-
|
|
3089
|
+
Q = JSON.parse(E);
|
|
3090
3090
|
} catch {
|
|
3091
3091
|
}
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3094
|
-
},
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3092
|
+
const te = () => {
|
|
3093
|
+
j(C.name, [...w, {}]);
|
|
3094
|
+
}, ne = (S) => {
|
|
3095
|
+
j(
|
|
3096
|
+
C.name,
|
|
3097
|
+
w.filter((A, I) => I !== S)
|
|
3098
3098
|
);
|
|
3099
|
-
}, G = (S, A,
|
|
3100
|
-
const T = [...
|
|
3099
|
+
}, G = (S, A, I) => {
|
|
3100
|
+
const T = [...w];
|
|
3101
3101
|
T[S] = {
|
|
3102
3102
|
...T[S],
|
|
3103
|
-
[A]:
|
|
3104
|
-
},
|
|
3103
|
+
[A]: I
|
|
3104
|
+
}, j(C.name, T);
|
|
3105
3105
|
};
|
|
3106
3106
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
3107
|
-
|
|
3108
|
-
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children:
|
|
3109
|
-
const T =
|
|
3107
|
+
w.map((S, A) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
3108
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: C.arrayFields?.map((I) => {
|
|
3109
|
+
const T = Q?.[A]?.[I.name];
|
|
3110
3110
|
return /* @__PURE__ */ i(
|
|
3111
3111
|
"div",
|
|
3112
3112
|
{
|
|
3113
3113
|
className: "flex flex-col gap-1",
|
|
3114
3114
|
children: [
|
|
3115
3115
|
A === 0 && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3116
|
-
|
|
3117
|
-
|
|
3116
|
+
I.label,
|
|
3117
|
+
I.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3118
3118
|
] }),
|
|
3119
3119
|
(() => {
|
|
3120
3120
|
const U = {
|
|
3121
|
-
value: S?.[
|
|
3122
|
-
disabled:
|
|
3123
|
-
required:
|
|
3124
|
-
placeholder:
|
|
3125
|
-
...
|
|
3121
|
+
value: S?.[I.name] || "",
|
|
3122
|
+
disabled: N,
|
|
3123
|
+
required: I.required,
|
|
3124
|
+
placeholder: I.placeholder,
|
|
3125
|
+
...I.fieldProps
|
|
3126
3126
|
};
|
|
3127
|
-
switch (
|
|
3127
|
+
switch (I.type) {
|
|
3128
3128
|
case "text":
|
|
3129
3129
|
case "email":
|
|
3130
3130
|
case "password":
|
|
@@ -3137,13 +3137,13 @@ const Qr = ({
|
|
|
3137
3137
|
...U,
|
|
3138
3138
|
onChange: (P) => G(
|
|
3139
3139
|
A,
|
|
3140
|
-
|
|
3140
|
+
I.name,
|
|
3141
3141
|
P.target.value
|
|
3142
3142
|
),
|
|
3143
|
-
type:
|
|
3144
|
-
autoComplete:
|
|
3143
|
+
type: I.textType || I.type,
|
|
3144
|
+
autoComplete: I.autocomplete,
|
|
3145
3145
|
error: T,
|
|
3146
|
-
size:
|
|
3146
|
+
size: u
|
|
3147
3147
|
}
|
|
3148
3148
|
);
|
|
3149
3149
|
case "textarea":
|
|
@@ -3153,12 +3153,12 @@ const Qr = ({
|
|
|
3153
3153
|
...U,
|
|
3154
3154
|
onChange: (P) => G(
|
|
3155
3155
|
A,
|
|
3156
|
-
|
|
3156
|
+
I.name,
|
|
3157
3157
|
P.target.value
|
|
3158
3158
|
),
|
|
3159
3159
|
rows: 4,
|
|
3160
3160
|
error: T,
|
|
3161
|
-
size:
|
|
3161
|
+
size: u
|
|
3162
3162
|
}
|
|
3163
3163
|
);
|
|
3164
3164
|
case "select":
|
|
@@ -3168,20 +3168,20 @@ const Qr = ({
|
|
|
3168
3168
|
...U,
|
|
3169
3169
|
onChange: (P) => G(
|
|
3170
3170
|
A,
|
|
3171
|
-
|
|
3171
|
+
I.name,
|
|
3172
3172
|
P
|
|
3173
3173
|
),
|
|
3174
|
-
options: (
|
|
3174
|
+
options: (I.options || []).map(
|
|
3175
3175
|
(P) => ({
|
|
3176
3176
|
...P,
|
|
3177
3177
|
value: String(P.value)
|
|
3178
3178
|
})
|
|
3179
3179
|
),
|
|
3180
|
-
searchable:
|
|
3181
|
-
multiple:
|
|
3182
|
-
allowCreate:
|
|
3180
|
+
searchable: I.searchable,
|
|
3181
|
+
multiple: I.multiple,
|
|
3182
|
+
allowCreate: I.allowCreate,
|
|
3183
3183
|
error: T,
|
|
3184
|
-
size:
|
|
3184
|
+
size: u
|
|
3185
3185
|
}
|
|
3186
3186
|
);
|
|
3187
3187
|
case "checkbox":
|
|
@@ -3189,17 +3189,17 @@ const Qr = ({
|
|
|
3189
3189
|
xe,
|
|
3190
3190
|
{
|
|
3191
3191
|
...U,
|
|
3192
|
-
checked: !!S?.[
|
|
3192
|
+
checked: !!S?.[I.name],
|
|
3193
3193
|
onChange: (P) => G(
|
|
3194
3194
|
A,
|
|
3195
|
-
|
|
3195
|
+
I.name,
|
|
3196
3196
|
P.target.checked
|
|
3197
3197
|
),
|
|
3198
|
-
size:
|
|
3198
|
+
size: u
|
|
3199
3199
|
}
|
|
3200
3200
|
);
|
|
3201
3201
|
case "radio":
|
|
3202
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
3202
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: I.options?.map((P) => /* @__PURE__ */ i(
|
|
3203
3203
|
"label",
|
|
3204
3204
|
{
|
|
3205
3205
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3208,15 +3208,15 @@ const Qr = ({
|
|
|
3208
3208
|
"input",
|
|
3209
3209
|
{
|
|
3210
3210
|
type: "radio",
|
|
3211
|
-
name: `${
|
|
3211
|
+
name: `${C.name}.${A}.${I.name}`,
|
|
3212
3212
|
value: P.value,
|
|
3213
|
-
checked: S?.[
|
|
3213
|
+
checked: S?.[I.name] === P.value,
|
|
3214
3214
|
onChange: () => G(
|
|
3215
3215
|
A,
|
|
3216
|
-
|
|
3216
|
+
I.name,
|
|
3217
3217
|
P.value
|
|
3218
3218
|
),
|
|
3219
|
-
disabled:
|
|
3219
|
+
disabled: N || P.disabled,
|
|
3220
3220
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3221
3221
|
}
|
|
3222
3222
|
),
|
|
@@ -3226,7 +3226,7 @@ const Qr = ({
|
|
|
3226
3226
|
P.value
|
|
3227
3227
|
)) });
|
|
3228
3228
|
case "date": {
|
|
3229
|
-
const P = S?.[
|
|
3229
|
+
const P = S?.[I.name];
|
|
3230
3230
|
return /* @__PURE__ */ e(
|
|
3231
3231
|
Se,
|
|
3232
3232
|
{
|
|
@@ -3234,65 +3234,65 @@ const Qr = ({
|
|
|
3234
3234
|
value: P ? new Date(P) : null,
|
|
3235
3235
|
onChange: (K) => G(
|
|
3236
3236
|
A,
|
|
3237
|
-
|
|
3237
|
+
I.name,
|
|
3238
3238
|
K
|
|
3239
3239
|
),
|
|
3240
|
-
size:
|
|
3240
|
+
size: u
|
|
3241
3241
|
}
|
|
3242
3242
|
);
|
|
3243
3243
|
}
|
|
3244
3244
|
case "custom":
|
|
3245
|
-
return
|
|
3246
|
-
value: S?.[
|
|
3245
|
+
return I.customComponent?.({
|
|
3246
|
+
value: S?.[I.name],
|
|
3247
3247
|
onChange: (P) => G(
|
|
3248
3248
|
A,
|
|
3249
|
-
|
|
3249
|
+
I.name,
|
|
3250
3250
|
P
|
|
3251
3251
|
),
|
|
3252
3252
|
error: T,
|
|
3253
|
-
disabled:
|
|
3253
|
+
disabled: N
|
|
3254
3254
|
});
|
|
3255
3255
|
// Add other field types here as needed
|
|
3256
3256
|
default:
|
|
3257
3257
|
return /* @__PURE__ */ i("p", { children: [
|
|
3258
3258
|
"Unsupported field type in array:",
|
|
3259
3259
|
" ",
|
|
3260
|
-
|
|
3260
|
+
I.type
|
|
3261
3261
|
] });
|
|
3262
3262
|
}
|
|
3263
3263
|
})(),
|
|
3264
3264
|
T && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: T })
|
|
3265
3265
|
]
|
|
3266
3266
|
},
|
|
3267
|
-
|
|
3267
|
+
I.name
|
|
3268
3268
|
);
|
|
3269
3269
|
}) }),
|
|
3270
3270
|
/* @__PURE__ */ e(
|
|
3271
|
-
|
|
3271
|
+
re,
|
|
3272
3272
|
{
|
|
3273
3273
|
type: "button",
|
|
3274
3274
|
iconOnly: !0,
|
|
3275
3275
|
variant: "ghost",
|
|
3276
3276
|
size: "md",
|
|
3277
|
-
"aria-label": `${
|
|
3278
|
-
onClick: () =>
|
|
3279
|
-
disabled:
|
|
3280
|
-
className:
|
|
3277
|
+
"aria-label": `${C.label} verwijderen`,
|
|
3278
|
+
onClick: () => ne(A),
|
|
3279
|
+
disabled: N,
|
|
3280
|
+
className: m("shrink-0", A === 0 && "mt-5"),
|
|
3281
3281
|
children: /* @__PURE__ */ e(st, { className: "size-icon-md" })
|
|
3282
3282
|
}
|
|
3283
3283
|
)
|
|
3284
3284
|
] }, A)),
|
|
3285
3285
|
/* @__PURE__ */ i(
|
|
3286
|
-
|
|
3286
|
+
re,
|
|
3287
3287
|
{
|
|
3288
3288
|
type: "button",
|
|
3289
3289
|
variant: "secondary",
|
|
3290
3290
|
size: "sm",
|
|
3291
3291
|
leftIcon: /* @__PURE__ */ e(at, { className: "size-icon-sm" }),
|
|
3292
|
-
onClick:
|
|
3293
|
-
disabled:
|
|
3292
|
+
onClick: te,
|
|
3293
|
+
disabled: N,
|
|
3294
3294
|
children: [
|
|
3295
|
-
|
|
3295
|
+
C.label,
|
|
3296
3296
|
" toevoegen"
|
|
3297
3297
|
]
|
|
3298
3298
|
}
|
|
@@ -3303,22 +3303,22 @@ const Qr = ({
|
|
|
3303
3303
|
return null;
|
|
3304
3304
|
}
|
|
3305
3305
|
},
|
|
3306
|
-
[
|
|
3306
|
+
[g, M, D, f, u, j]
|
|
3307
3307
|
), X = ce(
|
|
3308
|
-
(
|
|
3309
|
-
if (
|
|
3308
|
+
(C) => {
|
|
3309
|
+
if (C.conditional && !C.conditional(g))
|
|
3310
3310
|
return null;
|
|
3311
|
-
const
|
|
3312
|
-
if (
|
|
3313
|
-
const E =
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
"grid-cols-1": !
|
|
3317
|
-
"grid-cols-2":
|
|
3318
|
-
"grid-cols-3":
|
|
3319
|
-
"grid-cols-4":
|
|
3311
|
+
const d = C.items.filter((N) => !(N.hidden || N.conditional && !N.conditional(g)));
|
|
3312
|
+
if (d.length === 0) return null;
|
|
3313
|
+
const E = m(
|
|
3314
|
+
C.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
|
|
3315
|
+
C.layout !== "flex" && {
|
|
3316
|
+
"grid-cols-1": !C.columns || C.columns === 1,
|
|
3317
|
+
"grid-cols-2": C.columns === 2,
|
|
3318
|
+
"grid-cols-3": C.columns === 3,
|
|
3319
|
+
"grid-cols-4": C.columns === 4
|
|
3320
3320
|
},
|
|
3321
|
-
|
|
3321
|
+
C.className
|
|
3322
3322
|
);
|
|
3323
3323
|
return /* @__PURE__ */ i(
|
|
3324
3324
|
"div",
|
|
@@ -3326,68 +3326,68 @@ const Qr = ({
|
|
|
3326
3326
|
className: "flex flex-col gap-4 px-5 py-4 not-first:border-t not-first:border-border-subtle sm:flex-row sm:gap-5",
|
|
3327
3327
|
children: [
|
|
3328
3328
|
/* @__PURE__ */ i("div", { className: "w-full shrink-0 sm:w-form-label", children: [
|
|
3329
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children:
|
|
3330
|
-
|
|
3329
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: C.title }),
|
|
3330
|
+
C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
|
|
3331
3331
|
] }),
|
|
3332
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children:
|
|
3332
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: d.map((N) => (M[N.name] && D[N.name], /* @__PURE__ */ i(
|
|
3333
3333
|
"div",
|
|
3334
3334
|
{
|
|
3335
|
-
className:
|
|
3335
|
+
className: m(
|
|
3336
3336
|
"flex min-w-0 flex-col gap-1.5",
|
|
3337
|
-
|
|
3337
|
+
N.type === "checkbox" && "justify-center"
|
|
3338
3338
|
),
|
|
3339
3339
|
style: {
|
|
3340
|
-
width: typeof
|
|
3341
|
-
gridColumn: typeof
|
|
3340
|
+
width: typeof N.width == "string" ? N.width : void 0,
|
|
3341
|
+
gridColumn: typeof N.width == "number" ? `span ${N.width} / span ${N.width}` : void 0
|
|
3342
3342
|
},
|
|
3343
3343
|
children: [
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3344
|
+
N.type !== "custom" && N.type !== "checkbox" && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3345
|
+
N.label,
|
|
3346
|
+
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3347
3347
|
] }),
|
|
3348
|
-
H(
|
|
3348
|
+
H(N)
|
|
3349
3349
|
]
|
|
3350
3350
|
},
|
|
3351
|
-
|
|
3351
|
+
N.name
|
|
3352
3352
|
))) }) })
|
|
3353
3353
|
]
|
|
3354
3354
|
},
|
|
3355
|
-
|
|
3355
|
+
C.id
|
|
3356
3356
|
);
|
|
3357
3357
|
},
|
|
3358
|
-
[
|
|
3359
|
-
), Z =
|
|
3358
|
+
[g, M, D, H]
|
|
3359
|
+
), Z = m(
|
|
3360
3360
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3361
3361
|
{
|
|
3362
|
-
"max-w-md":
|
|
3363
|
-
"max-w-2xl":
|
|
3364
|
-
"max-w-4xl":
|
|
3365
|
-
"max-w-full":
|
|
3362
|
+
"max-w-md": u === "sm",
|
|
3363
|
+
"max-w-2xl": u === "md",
|
|
3364
|
+
"max-w-4xl": u === "lg",
|
|
3365
|
+
"max-w-full": u === "full"
|
|
3366
3366
|
},
|
|
3367
|
-
|
|
3368
|
-
),
|
|
3369
|
-
return /* @__PURE__ */ i("form", { ref:
|
|
3367
|
+
p
|
|
3368
|
+
), ee = u === "full" ? "md" : u;
|
|
3369
|
+
return /* @__PURE__ */ i("form", { ref: k, onSubmit: W, className: Z, children: [
|
|
3370
3370
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(X) }),
|
|
3371
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children:
|
|
3371
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: y && /* @__PURE__ */ i(fe, { children: [
|
|
3372
3372
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
3373
3373
|
s && /* @__PURE__ */ e(
|
|
3374
|
-
|
|
3374
|
+
re,
|
|
3375
3375
|
{
|
|
3376
3376
|
type: "button",
|
|
3377
|
-
variant:
|
|
3378
|
-
size:
|
|
3379
|
-
disabled:
|
|
3377
|
+
variant: b.variant ?? "ghost",
|
|
3378
|
+
size: b.size || ee,
|
|
3379
|
+
disabled: b.disabled || f,
|
|
3380
3380
|
onClick: s,
|
|
3381
|
-
className:
|
|
3382
|
-
children:
|
|
3381
|
+
className: b.className,
|
|
3382
|
+
children: b.label
|
|
3383
3383
|
}
|
|
3384
3384
|
),
|
|
3385
3385
|
/* @__PURE__ */ e(
|
|
3386
|
-
|
|
3386
|
+
re,
|
|
3387
3387
|
{
|
|
3388
3388
|
type: "submit",
|
|
3389
3389
|
variant: h.variant,
|
|
3390
|
-
size: h.size ||
|
|
3390
|
+
size: h.size || ee,
|
|
3391
3391
|
disabled: h.disabled || f,
|
|
3392
3392
|
loading: f,
|
|
3393
3393
|
className: h.className,
|
|
@@ -3406,19 +3406,19 @@ function en({
|
|
|
3406
3406
|
tone: l = "default",
|
|
3407
3407
|
loading: c = !1,
|
|
3408
3408
|
onConfirm: h,
|
|
3409
|
-
onCancel:
|
|
3409
|
+
onCancel: b
|
|
3410
3410
|
}) {
|
|
3411
3411
|
return /* @__PURE__ */ e(
|
|
3412
3412
|
Fe,
|
|
3413
3413
|
{
|
|
3414
3414
|
open: t,
|
|
3415
|
-
onClose:
|
|
3415
|
+
onClose: b,
|
|
3416
3416
|
title: r,
|
|
3417
3417
|
size: "sm",
|
|
3418
3418
|
footer: /* @__PURE__ */ i("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3419
|
-
/* @__PURE__ */ e(
|
|
3419
|
+
/* @__PURE__ */ e(re, { variant: "ghost", onClick: b, disabled: c, children: a }),
|
|
3420
3420
|
/* @__PURE__ */ e(
|
|
3421
|
-
|
|
3421
|
+
re,
|
|
3422
3422
|
{
|
|
3423
3423
|
variant: l === "danger" ? "destructive" : "primary",
|
|
3424
3424
|
onClick: h,
|
|
@@ -3464,12 +3464,12 @@ function tn({
|
|
|
3464
3464
|
onDismiss: l,
|
|
3465
3465
|
className: c,
|
|
3466
3466
|
children: h,
|
|
3467
|
-
...
|
|
3467
|
+
...b
|
|
3468
3468
|
}) {
|
|
3469
3469
|
return /* @__PURE__ */ i(
|
|
3470
3470
|
"span",
|
|
3471
3471
|
{
|
|
3472
|
-
className:
|
|
3472
|
+
className: m(
|
|
3473
3473
|
// Base styles
|
|
3474
3474
|
"inline-flex items-center font-medium rounded-full",
|
|
3475
3475
|
// Variant styles
|
|
@@ -3478,18 +3478,18 @@ function tn({
|
|
|
3478
3478
|
dr[r],
|
|
3479
3479
|
c
|
|
3480
3480
|
),
|
|
3481
|
-
...
|
|
3481
|
+
...b,
|
|
3482
3482
|
children: [
|
|
3483
3483
|
n && /* @__PURE__ */ e(
|
|
3484
3484
|
"span",
|
|
3485
3485
|
{
|
|
3486
|
-
className:
|
|
3486
|
+
className: m(
|
|
3487
3487
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3488
3488
|
ur[t]
|
|
3489
3489
|
)
|
|
3490
3490
|
}
|
|
3491
3491
|
),
|
|
3492
|
-
s && /* @__PURE__ */ e("span", { className:
|
|
3492
|
+
s && /* @__PURE__ */ e("span", { className: m("flex-shrink-0", h && "mr-1"), children: s }),
|
|
3493
3493
|
h,
|
|
3494
3494
|
a && l && /* @__PURE__ */ e(
|
|
3495
3495
|
"button",
|
|
@@ -3521,14 +3521,14 @@ function rn({
|
|
|
3521
3521
|
return /* @__PURE__ */ i(
|
|
3522
3522
|
"div",
|
|
3523
3523
|
{
|
|
3524
|
-
className:
|
|
3524
|
+
className: m(
|
|
3525
3525
|
"flex flex-col items-center gap-2.5 text-center",
|
|
3526
3526
|
l && "rounded-lg border border-border bg-surface px-11 py-9 shadow-overlay",
|
|
3527
3527
|
c
|
|
3528
3528
|
),
|
|
3529
3529
|
...h,
|
|
3530
3530
|
children: [
|
|
3531
|
-
t != null && /* @__PURE__ */ e("span", { className:
|
|
3531
|
+
t != null && /* @__PURE__ */ e("span", { className: m("flex size-disc items-center justify-center rounded-full text-2xl", mr[r]), children: t }),
|
|
3532
3532
|
/* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
|
|
3533
3533
|
s && /* @__PURE__ */ e("div", { className: "max-w-sm text-sm leading-relaxed text-text-muted", children: s }),
|
|
3534
3534
|
a && /* @__PURE__ */ e("div", { className: "flex gap-2 pt-1.5", children: a })
|
|
@@ -3540,7 +3540,7 @@ function nn({ children: t, className: r, ...n }) {
|
|
|
3540
3540
|
return /* @__PURE__ */ e(
|
|
3541
3541
|
"kbd",
|
|
3542
3542
|
{
|
|
3543
|
-
className:
|
|
3543
|
+
className: m(
|
|
3544
3544
|
"inline-flex items-center rounded border border-border px-1.5 py-px text-xs font-medium leading-none text-text-muted",
|
|
3545
3545
|
r
|
|
3546
3546
|
),
|
|
@@ -3565,12 +3565,12 @@ function sn({ value: t, variant: r = "accent", size: n = "md", className: s, ...
|
|
|
3565
3565
|
"aria-valuenow": Math.round(l),
|
|
3566
3566
|
"aria-valuemin": 0,
|
|
3567
3567
|
"aria-valuemax": 100,
|
|
3568
|
-
className:
|
|
3568
|
+
className: m("w-full overflow-hidden rounded-full bg-surface-hover", fr[n], s),
|
|
3569
3569
|
...a,
|
|
3570
3570
|
children: /* @__PURE__ */ e(
|
|
3571
3571
|
"div",
|
|
3572
3572
|
{
|
|
3573
|
-
className:
|
|
3573
|
+
className: m("h-full rounded-full transition-[width] duration-300 ease-out", hr[r]),
|
|
3574
3574
|
style: { width: `${l}%` }
|
|
3575
3575
|
}
|
|
3576
3576
|
)
|
|
@@ -3606,7 +3606,7 @@ function an({
|
|
|
3606
3606
|
return /* @__PURE__ */ i(
|
|
3607
3607
|
"div",
|
|
3608
3608
|
{
|
|
3609
|
-
className:
|
|
3609
|
+
className: m(
|
|
3610
3610
|
"inline-flex items-center",
|
|
3611
3611
|
s ? "flex-col space-y-2" : "",
|
|
3612
3612
|
a
|
|
@@ -3616,7 +3616,7 @@ function an({
|
|
|
3616
3616
|
/* @__PURE__ */ i(
|
|
3617
3617
|
"svg",
|
|
3618
3618
|
{
|
|
3619
|
-
className:
|
|
3619
|
+
className: m(
|
|
3620
3620
|
"animate-spin",
|
|
3621
3621
|
xr[t],
|
|
3622
3622
|
br[r]
|
|
@@ -3651,7 +3651,7 @@ function an({
|
|
|
3651
3651
|
s && /* @__PURE__ */ e(
|
|
3652
3652
|
"span",
|
|
3653
3653
|
{
|
|
3654
|
-
className:
|
|
3654
|
+
className: m(
|
|
3655
3655
|
"text-text-muted",
|
|
3656
3656
|
gr[t]
|
|
3657
3657
|
),
|
|
@@ -3690,7 +3690,7 @@ function ln({
|
|
|
3690
3690
|
role: s ? "img" : void 0,
|
|
3691
3691
|
"aria-label": s,
|
|
3692
3692
|
"aria-hidden": s ? void 0 : !0,
|
|
3693
|
-
className:
|
|
3693
|
+
className: m(
|
|
3694
3694
|
"inline-block size-dot shrink-0",
|
|
3695
3695
|
r === "round" ? "rounded-full" : "rounded-sm",
|
|
3696
3696
|
pr[t],
|
|
@@ -3708,39 +3708,39 @@ function on({
|
|
|
3708
3708
|
className: a
|
|
3709
3709
|
}) {
|
|
3710
3710
|
const l = t.indexOf(r), c = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
3711
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className:
|
|
3711
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: m("flex items-center gap-1.5", a), children: t.map((h, b) => /* @__PURE__ */ e(
|
|
3712
3712
|
"span",
|
|
3713
3713
|
{
|
|
3714
|
-
className:
|
|
3714
|
+
className: m(
|
|
3715
3715
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3716
|
+
b === l ? "w-5 bg-accent" : "w-3.5",
|
|
3717
|
+
b < l && "bg-border-strong",
|
|
3718
|
+
b > l && "bg-border"
|
|
3719
3719
|
)
|
|
3720
3720
|
},
|
|
3721
3721
|
h
|
|
3722
|
-
)) }) : /* @__PURE__ */ e("div", { ...c, className:
|
|
3722
|
+
)) }) : /* @__PURE__ */ e("div", { ...c, className: m("flex items-center gap-2", a), children: t.map((h, b) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
3723
3723
|
/* @__PURE__ */ e(
|
|
3724
3724
|
"span",
|
|
3725
3725
|
{
|
|
3726
|
-
"aria-current":
|
|
3727
|
-
className:
|
|
3726
|
+
"aria-current": b === l ? "step" : void 0,
|
|
3727
|
+
className: m(
|
|
3728
3728
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3729
|
+
b === l && "bg-accent text-accent-fg",
|
|
3730
|
+
b < l && "bg-accent-soft text-accent",
|
|
3731
|
+
b > l && "bg-surface-hover text-text-muted"
|
|
3732
3732
|
),
|
|
3733
|
-
children:
|
|
3733
|
+
children: b + 1
|
|
3734
3734
|
}
|
|
3735
3735
|
),
|
|
3736
|
-
|
|
3736
|
+
b < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3737
3737
|
] }, h)) });
|
|
3738
3738
|
}
|
|
3739
3739
|
function cn({ title: t, icon: r = /* @__PURE__ */ e(lt, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...l }) {
|
|
3740
3740
|
return /* @__PURE__ */ i(
|
|
3741
3741
|
"div",
|
|
3742
3742
|
{
|
|
3743
|
-
className:
|
|
3743
|
+
className: m(
|
|
3744
3744
|
"flex flex-col gap-2 rounded-xl border p-4",
|
|
3745
3745
|
"border-assistant-border bg-assistant-soft",
|
|
3746
3746
|
a
|
|
@@ -3769,7 +3769,7 @@ function yr(t) {
|
|
|
3769
3769
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
3770
3770
|
}
|
|
3771
3771
|
const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
3772
|
-
const [l, c] = le.useState(!1), h =
|
|
3772
|
+
const [l, c] = le.useState(!1), h = m(
|
|
3773
3773
|
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover-border-emphasis text-text",
|
|
3774
3774
|
vr[n],
|
|
3775
3775
|
s
|
|
@@ -3780,14 +3780,14 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3780
3780
|
src: r,
|
|
3781
3781
|
alt: t ?? "",
|
|
3782
3782
|
title: a ?? t,
|
|
3783
|
-
className:
|
|
3783
|
+
className: m(h, "object-cover"),
|
|
3784
3784
|
onError: () => c(!0)
|
|
3785
3785
|
}
|
|
3786
3786
|
) : /* @__PURE__ */ e("span", { className: h, title: a ?? t, "aria-label": t, children: yr(t) });
|
|
3787
3787
|
}, Le = "ring-surface", wr = "ring-surface-accent", dn = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
|
|
3788
3788
|
if (t.length === 0) return null;
|
|
3789
3789
|
const a = t.slice(0, r), l = t.length - a.length;
|
|
3790
|
-
return /* @__PURE__ */ i("span", { className:
|
|
3790
|
+
return /* @__PURE__ */ i("span", { className: m("inline-flex items-center", s), children: [
|
|
3791
3791
|
a.map((c, h) => /* @__PURE__ */ e(
|
|
3792
3792
|
Nr,
|
|
3793
3793
|
{
|
|
@@ -3795,7 +3795,7 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3795
3795
|
src: c.src,
|
|
3796
3796
|
size: n,
|
|
3797
3797
|
title: c.name ? c.seen === !1 ? `${c.name} — nog niet gelezen` : c.name : void 0,
|
|
3798
|
-
className:
|
|
3798
|
+
className: m(
|
|
3799
3799
|
h > 0 && "-ml-2",
|
|
3800
3800
|
c.owner ? wr : Le,
|
|
3801
3801
|
c.seen === !1 && "opacity-40"
|
|
@@ -3806,7 +3806,7 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3806
3806
|
l > 0 && /* @__PURE__ */ i(
|
|
3807
3807
|
"span",
|
|
3808
3808
|
{
|
|
3809
|
-
className:
|
|
3809
|
+
className: m(
|
|
3810
3810
|
"inline-flex items-center justify-center rounded-full shrink-0 -ml-2 font-semibold bg-surface-hover text-text-muted",
|
|
3811
3811
|
n === "xs" ? "w-5 h-5 text-xs" : n === "md" ? "w-7 h-7 text-xs" : n === "lg" ? "w-9 h-9 text-xs" : "w-6 h-6 text-xs",
|
|
3812
3812
|
Le
|
|
@@ -3835,7 +3835,7 @@ function un({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
3835
3835
|
"span",
|
|
3836
3836
|
{
|
|
3837
3837
|
title: a,
|
|
3838
|
-
className:
|
|
3838
|
+
className: m(
|
|
3839
3839
|
"inline-flex shrink-0 items-center justify-center font-bold",
|
|
3840
3840
|
kr[n],
|
|
3841
3841
|
l.fg,
|
|
@@ -3855,22 +3855,22 @@ const mn = ({
|
|
|
3855
3855
|
showLoading: l = !0,
|
|
3856
3856
|
showError: c = !0,
|
|
3857
3857
|
fallback: h,
|
|
3858
|
-
loadingContent:
|
|
3859
|
-
errorContent:
|
|
3858
|
+
loadingContent: b,
|
|
3859
|
+
errorContent: y,
|
|
3860
3860
|
className: x,
|
|
3861
|
-
onLoad:
|
|
3861
|
+
onLoad: u,
|
|
3862
3862
|
onError: f,
|
|
3863
|
-
...
|
|
3863
|
+
...p
|
|
3864
3864
|
}) => {
|
|
3865
|
-
const [
|
|
3866
|
-
|
|
3865
|
+
const [k, v] = R(!0), [g, $] = R(!1), [D, _] = R(t), M = (Z) => {
|
|
3866
|
+
v(!1), $(!1), u?.(Z);
|
|
3867
3867
|
}, q = (Z) => {
|
|
3868
|
-
if (
|
|
3869
|
-
_(h),
|
|
3868
|
+
if (v(!1), $(!0), h && D !== h) {
|
|
3869
|
+
_(h), $(!1), v(!0);
|
|
3870
3870
|
return;
|
|
3871
3871
|
}
|
|
3872
3872
|
f?.(Z);
|
|
3873
|
-
}, V =
|
|
3873
|
+
}, V = m(
|
|
3874
3874
|
"relative overflow-hidden bg-surface-hover",
|
|
3875
3875
|
// Size variants
|
|
3876
3876
|
{
|
|
@@ -3898,13 +3898,13 @@ const mn = ({
|
|
|
3898
3898
|
"rounded-full": a === "full"
|
|
3899
3899
|
},
|
|
3900
3900
|
x
|
|
3901
|
-
),
|
|
3901
|
+
), j = m(
|
|
3902
3902
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3903
3903
|
{
|
|
3904
|
-
"opacity-0":
|
|
3905
|
-
"opacity-100": !
|
|
3904
|
+
"opacity-0": k || g,
|
|
3905
|
+
"opacity-100": !k && !g
|
|
3906
3906
|
}
|
|
3907
|
-
), W =
|
|
3907
|
+
), W = m(
|
|
3908
3908
|
"absolute inset-0 flex items-center justify-center",
|
|
3909
3909
|
"text-text-muted"
|
|
3910
3910
|
), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), X = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
@@ -3915,16 +3915,16 @@ const mn = ({
|
|
|
3915
3915
|
/* @__PURE__ */ e(
|
|
3916
3916
|
"img",
|
|
3917
3917
|
{
|
|
3918
|
-
...
|
|
3919
|
-
src:
|
|
3918
|
+
...p,
|
|
3919
|
+
src: D,
|
|
3920
3920
|
alt: r,
|
|
3921
|
-
className:
|
|
3921
|
+
className: j,
|
|
3922
3922
|
onLoad: M,
|
|
3923
3923
|
onError: q
|
|
3924
3924
|
}
|
|
3925
3925
|
),
|
|
3926
|
-
|
|
3927
|
-
|
|
3926
|
+
k && l && /* @__PURE__ */ e("div", { className: W, children: b || H }),
|
|
3927
|
+
g && c && /* @__PURE__ */ e("div", { className: W, children: y || X })
|
|
3928
3928
|
] });
|
|
3929
3929
|
};
|
|
3930
3930
|
function fn({
|
|
@@ -3936,33 +3936,33 @@ function fn({
|
|
|
3936
3936
|
trailing: l,
|
|
3937
3937
|
onSelect: c,
|
|
3938
3938
|
onActiveIndexChange: h,
|
|
3939
|
-
isActive:
|
|
3940
|
-
unread:
|
|
3939
|
+
isActive: b,
|
|
3940
|
+
unread: y,
|
|
3941
3941
|
dimmed: x,
|
|
3942
|
-
groupBy:
|
|
3942
|
+
groupBy: u,
|
|
3943
3943
|
groups: f,
|
|
3944
|
-
renderGroupHeader:
|
|
3945
|
-
stickyGroupHeaders:
|
|
3946
|
-
collapsibleGroups:
|
|
3947
|
-
hideGroupCount:
|
|
3948
|
-
selectable:
|
|
3949
|
-
selectedItems:
|
|
3944
|
+
renderGroupHeader: p,
|
|
3945
|
+
stickyGroupHeaders: k = !1,
|
|
3946
|
+
collapsibleGroups: v = !1,
|
|
3947
|
+
hideGroupCount: g = !1,
|
|
3948
|
+
selectable: $ = !1,
|
|
3949
|
+
selectedItems: D = [],
|
|
3950
3950
|
onSelectionChange: _,
|
|
3951
3951
|
bulkActions: M,
|
|
3952
3952
|
header: q,
|
|
3953
3953
|
stickyHeader: V = !1,
|
|
3954
|
-
bordered:
|
|
3954
|
+
bordered: j = !1,
|
|
3955
3955
|
emptyContent: W,
|
|
3956
3956
|
loading: H = !1,
|
|
3957
3957
|
loadingRows: X = 4,
|
|
3958
3958
|
className: Z,
|
|
3959
|
-
"aria-label":
|
|
3959
|
+
"aria-label": ee
|
|
3960
3960
|
}) {
|
|
3961
|
-
const [
|
|
3961
|
+
const [C, d] = le.useState(
|
|
3962
3962
|
() => Object.fromEntries(
|
|
3963
3963
|
(f ?? []).filter((T) => T.defaultCollapsed).map((T) => [T.id, !0])
|
|
3964
3964
|
)
|
|
3965
|
-
), E = le.useRef(null),
|
|
3965
|
+
), E = le.useRef(null), N = (T) => {
|
|
3966
3966
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(T.key)) return;
|
|
3967
3967
|
const P = Array.from(
|
|
3968
3968
|
E.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
@@ -3971,20 +3971,20 @@ function fn({
|
|
|
3971
3971
|
T.preventDefault();
|
|
3972
3972
|
const K = P.indexOf(document.activeElement), o = T.key === "Home" ? 0 : T.key === "End" ? P.length - 1 : T.key === "ArrowDown" ? (K + 1) % P.length : (K - 1 + P.length) % P.length;
|
|
3973
3973
|
P[o]?.focus();
|
|
3974
|
-
},
|
|
3974
|
+
}, L = (T, U) => r ? r(T, U) : U, w = (T) => D.includes(T), Q = (T, U) => {
|
|
3975
3975
|
_ && _(
|
|
3976
|
-
U ? [
|
|
3976
|
+
U ? [...D, T] : D.filter((P) => P !== T)
|
|
3977
3977
|
);
|
|
3978
|
-
},
|
|
3978
|
+
}, te = (T) => _?.(T ? [...t] : []), ne = m(
|
|
3979
3979
|
"flex flex-col",
|
|
3980
|
-
|
|
3980
|
+
j && "overflow-hidden rounded-lg border border-border-subtle",
|
|
3981
3981
|
Z
|
|
3982
3982
|
);
|
|
3983
3983
|
if (H)
|
|
3984
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3984
|
+
return /* @__PURE__ */ e("div", { className: ne, children: Array.from({ length: X }).map((T, U) => /* @__PURE__ */ i(
|
|
3985
3985
|
"div",
|
|
3986
3986
|
{
|
|
3987
|
-
className:
|
|
3987
|
+
className: m(
|
|
3988
3988
|
"flex animate-pulse items-center gap-3 px-4 py-2",
|
|
3989
3989
|
n === "divided" && U > 0 && "border-t border-border-subtle"
|
|
3990
3990
|
),
|
|
@@ -3998,9 +3998,9 @@ function fn({
|
|
|
3998
3998
|
`skeleton-${U}`
|
|
3999
3999
|
)) });
|
|
4000
4000
|
if (t.length === 0 && W)
|
|
4001
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4002
|
-
const G = t.length > 0 &&
|
|
4003
|
-
const K =
|
|
4001
|
+
return /* @__PURE__ */ e("div", { className: ne, children: W });
|
|
4002
|
+
const G = t.length > 0 && D.length === t.length, S = D.length > 0 && !G, A = (T, U, P) => {
|
|
4003
|
+
const K = b?.(T, U) ?? !1, o = y?.(T, U) ?? !1, z = x?.(T, U) ?? !1, B = $ && w(T);
|
|
4004
4004
|
return /* @__PURE__ */ i(
|
|
4005
4005
|
"li",
|
|
4006
4006
|
{
|
|
@@ -4015,7 +4015,7 @@ function fn({
|
|
|
4015
4015
|
F.key !== "Enter" && F.key !== " " || (F.preventDefault(), c(T, U));
|
|
4016
4016
|
}
|
|
4017
4017
|
} : {},
|
|
4018
|
-
className:
|
|
4018
|
+
className: m(
|
|
4019
4019
|
"flex items-center gap-3 px-4 py-2 text-base",
|
|
4020
4020
|
"transition-colors duration-fast ease-out",
|
|
4021
4021
|
n === "divided" && !P && "border-t border-border-subtle",
|
|
@@ -4025,11 +4025,11 @@ function fn({
|
|
|
4025
4025
|
z && "opacity-55"
|
|
4026
4026
|
),
|
|
4027
4027
|
children: [
|
|
4028
|
-
|
|
4028
|
+
$ && /* @__PURE__ */ e("span", { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4029
4029
|
xe,
|
|
4030
4030
|
{
|
|
4031
|
-
checked:
|
|
4032
|
-
onChange: (F) =>
|
|
4031
|
+
checked: w(T),
|
|
4032
|
+
onChange: (F) => Q(T, F.target.checked),
|
|
4033
4033
|
"aria-label": "Rij selecteren"
|
|
4034
4034
|
}
|
|
4035
4035
|
) }),
|
|
@@ -4045,14 +4045,14 @@ function fn({
|
|
|
4045
4045
|
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(T, U) })
|
|
4046
4046
|
]
|
|
4047
4047
|
},
|
|
4048
|
-
|
|
4048
|
+
L(T, U)
|
|
4049
4049
|
);
|
|
4050
|
-
},
|
|
4051
|
-
if (!
|
|
4050
|
+
}, I = (() => {
|
|
4051
|
+
if (!u)
|
|
4052
4052
|
return t.map((K, o) => A(K, o, o === 0));
|
|
4053
4053
|
const T = /* @__PURE__ */ new Map();
|
|
4054
4054
|
t.forEach((K, o) => {
|
|
4055
|
-
const z =
|
|
4055
|
+
const z = u(K, o);
|
|
4056
4056
|
T.has(z) || T.set(z, []), T.get(z).push({ item: K, index: o });
|
|
4057
4057
|
});
|
|
4058
4058
|
const U = f ?? [];
|
|
@@ -4060,59 +4060,59 @@ function fn({
|
|
|
4060
4060
|
...U.filter((K) => T.has(K.id)),
|
|
4061
4061
|
...[...T.keys()].filter((K) => !U.some((o) => o.id === K)).map((K) => ({ id: K }))
|
|
4062
4062
|
].flatMap((K, o) => {
|
|
4063
|
-
const z = T.get(K.id) ?? [], B =
|
|
4063
|
+
const z = T.get(K.id) ?? [], B = v && C[K.id], F = K.title ?? K.id, O = K.count ?? z.length, se = /* @__PURE__ */ e(
|
|
4064
4064
|
"li",
|
|
4065
4065
|
{
|
|
4066
|
-
onClick:
|
|
4067
|
-
className:
|
|
4066
|
+
onClick: v ? () => d((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
|
|
4067
|
+
className: m(
|
|
4068
4068
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4069
4069
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4070
4070
|
"border-border-subtle",
|
|
4071
4071
|
o > 0 && "border-t",
|
|
4072
4072
|
"border-b",
|
|
4073
|
-
|
|
4074
|
-
|
|
4073
|
+
k && "sticky z-10",
|
|
4074
|
+
v && "cursor-pointer select-none hover:text-text"
|
|
4075
4075
|
),
|
|
4076
|
-
"aria-expanded":
|
|
4077
|
-
style:
|
|
4078
|
-
children:
|
|
4079
|
-
|
|
4076
|
+
"aria-expanded": v ? !B : void 0,
|
|
4077
|
+
style: k ? { top: V ? 28 : 0 } : void 0,
|
|
4078
|
+
children: p ? p(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
|
|
4079
|
+
v && /* @__PURE__ */ e(
|
|
4080
4080
|
ye,
|
|
4081
4081
|
{
|
|
4082
4082
|
"aria-hidden": !0,
|
|
4083
|
-
className:
|
|
4083
|
+
className: m(
|
|
4084
4084
|
"size-icon-sm shrink-0 transition-transform duration-fast ease-out",
|
|
4085
4085
|
!B && "rotate-90"
|
|
4086
4086
|
)
|
|
4087
4087
|
}
|
|
4088
4088
|
),
|
|
4089
4089
|
/* @__PURE__ */ e("span", { children: F }),
|
|
4090
|
-
!
|
|
4090
|
+
!g && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
|
|
4091
4091
|
] })
|
|
4092
4092
|
},
|
|
4093
4093
|
`group-${K.id}`
|
|
4094
4094
|
);
|
|
4095
|
-
return B ? [
|
|
4096
|
-
|
|
4095
|
+
return B ? [se] : [
|
|
4096
|
+
se,
|
|
4097
4097
|
...z.map(
|
|
4098
4098
|
({ item: ie, index: He }, qe) => A(ie, He, qe === 0)
|
|
4099
4099
|
)
|
|
4100
4100
|
];
|
|
4101
4101
|
});
|
|
4102
4102
|
})();
|
|
4103
|
-
return /* @__PURE__ */ i("div", { ref: E, className:
|
|
4104
|
-
|
|
4103
|
+
return /* @__PURE__ */ i("div", { ref: E, className: ne, onKeyDown: c ? N : void 0, children: [
|
|
4104
|
+
$ && D.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4105
4105
|
/* @__PURE__ */ e(
|
|
4106
4106
|
xe,
|
|
4107
4107
|
{
|
|
4108
4108
|
checked: G,
|
|
4109
4109
|
indeterminate: S,
|
|
4110
|
-
onChange: (T) =>
|
|
4110
|
+
onChange: (T) => te(T.target.checked),
|
|
4111
4111
|
"aria-label": "Alles selecteren"
|
|
4112
4112
|
}
|
|
4113
4113
|
),
|
|
4114
4114
|
/* @__PURE__ */ i("span", { className: "text-xs text-text-subtle", children: [
|
|
4115
|
-
|
|
4115
|
+
D.length,
|
|
4116
4116
|
" geselecteerd"
|
|
4117
4117
|
] }),
|
|
4118
4118
|
M && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: M })
|
|
@@ -4120,7 +4120,7 @@ function fn({
|
|
|
4120
4120
|
q && /* @__PURE__ */ e(
|
|
4121
4121
|
"div",
|
|
4122
4122
|
{
|
|
4123
|
-
className:
|
|
4123
|
+
className: m(
|
|
4124
4124
|
"flex items-center gap-3 border-b border-border-subtle px-4 py-1.5",
|
|
4125
4125
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4126
4126
|
V && "sticky top-0 z-20"
|
|
@@ -4128,7 +4128,7 @@ function fn({
|
|
|
4128
4128
|
children: q
|
|
4129
4129
|
}
|
|
4130
4130
|
),
|
|
4131
|
-
/* @__PURE__ */ e("ul", { "aria-label":
|
|
4131
|
+
/* @__PURE__ */ e("ul", { "aria-label": ee, className: "flex flex-col", children: I })
|
|
4132
4132
|
] });
|
|
4133
4133
|
}
|
|
4134
4134
|
function hn({
|
|
@@ -4141,7 +4141,7 @@ function hn({
|
|
|
4141
4141
|
return /* @__PURE__ */ e(
|
|
4142
4142
|
"div",
|
|
4143
4143
|
{
|
|
4144
|
-
className:
|
|
4144
|
+
className: m(
|
|
4145
4145
|
// A bubble never spans the whole column; it narrows further from md,
|
|
4146
4146
|
// where the thread itself is wide enough for the difference to matter.
|
|
4147
4147
|
"min-w-0 max-w-bubble border md:max-w-bubble-md",
|
|
@@ -4168,8 +4168,8 @@ const Cr = {
|
|
|
4168
4168
|
success: "border-border"
|
|
4169
4169
|
};
|
|
4170
4170
|
function xn({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4171
|
-
return /* @__PURE__ */ i("div", { className:
|
|
4172
|
-
/* @__PURE__ */ e("div", { className:
|
|
4171
|
+
return /* @__PURE__ */ i("div", { className: m("rounded-xl border bg-surface px-4 py-3.5", Sr[n], s), ...a, children: [
|
|
4172
|
+
/* @__PURE__ */ e("div", { className: m("text-2xl font-semibold", Cr[n]), children: t }),
|
|
4173
4173
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
4174
4174
|
] });
|
|
4175
4175
|
}
|
|
@@ -4182,28 +4182,28 @@ const bn = ({
|
|
|
4182
4182
|
children: l,
|
|
4183
4183
|
className: c,
|
|
4184
4184
|
backLabel: h = "Back",
|
|
4185
|
-
backClassName:
|
|
4186
|
-
onBack:
|
|
4185
|
+
backClassName: b,
|
|
4186
|
+
onBack: y,
|
|
4187
4187
|
editable: x = !1,
|
|
4188
|
-
onTitleChange:
|
|
4188
|
+
onTitleChange: u
|
|
4189
4189
|
}) => {
|
|
4190
|
-
const [f,
|
|
4190
|
+
const [f, p] = R(!1), [k, v] = R(r), g = ae(null);
|
|
4191
4191
|
Y(() => {
|
|
4192
|
-
|
|
4192
|
+
v(r);
|
|
4193
4193
|
}, [r]), Y(() => {
|
|
4194
|
-
f &&
|
|
4194
|
+
f && g.current && (g.current.focus(), g.current.select());
|
|
4195
4195
|
}, [f]);
|
|
4196
|
-
const
|
|
4197
|
-
x &&
|
|
4198
|
-
},
|
|
4199
|
-
|
|
4196
|
+
const $ = () => {
|
|
4197
|
+
x && p(!0);
|
|
4198
|
+
}, D = () => {
|
|
4199
|
+
p(!1), k.trim() !== "" && k !== r && u ? u(k.trim()) : v(r);
|
|
4200
4200
|
}, _ = (M) => {
|
|
4201
|
-
M.key === "Enter" ?
|
|
4201
|
+
M.key === "Enter" ? g.current?.blur() : M.key === "Escape" && (v(r), p(!1));
|
|
4202
4202
|
};
|
|
4203
4203
|
return /* @__PURE__ */ i(
|
|
4204
4204
|
"div",
|
|
4205
4205
|
{
|
|
4206
|
-
className:
|
|
4206
|
+
className: m(
|
|
4207
4207
|
"p-5 pb-3",
|
|
4208
4208
|
// App-bar treatment: own background, full-bleed, closed with a rule.
|
|
4209
4209
|
t && "bg-surface border-b border-border",
|
|
@@ -4212,16 +4212,16 @@ const bn = ({
|
|
|
4212
4212
|
children: [
|
|
4213
4213
|
/* @__PURE__ */ i("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
4214
4214
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-2 text-text", children: [
|
|
4215
|
-
|
|
4215
|
+
y && /* @__PURE__ */ e(re, { variant: "secondary", onClick: y, leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "sm" }), iconOnly: !0 }),
|
|
4216
4216
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4217
4217
|
f ? /* @__PURE__ */ e(
|
|
4218
4218
|
"input",
|
|
4219
4219
|
{
|
|
4220
|
-
ref:
|
|
4220
|
+
ref: g,
|
|
4221
4221
|
type: "text",
|
|
4222
|
-
value:
|
|
4223
|
-
onChange: (M) =>
|
|
4224
|
-
onBlur:
|
|
4222
|
+
value: k,
|
|
4223
|
+
onChange: (M) => v(M.target.value),
|
|
4224
|
+
onBlur: D,
|
|
4225
4225
|
onKeyDown: _,
|
|
4226
4226
|
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"
|
|
4227
4227
|
}
|
|
@@ -4229,8 +4229,8 @@ const bn = ({
|
|
|
4229
4229
|
/* @__PURE__ */ e(
|
|
4230
4230
|
"h2",
|
|
4231
4231
|
{
|
|
4232
|
-
onClick:
|
|
4233
|
-
className:
|
|
4232
|
+
onClick: $,
|
|
4233
|
+
className: m(
|
|
4234
4234
|
"text-2xl font-semibold truncate",
|
|
4235
4235
|
x && "cursor-pointer"
|
|
4236
4236
|
),
|
|
@@ -4243,7 +4243,7 @@ const bn = ({
|
|
|
4243
4243
|
ct,
|
|
4244
4244
|
{
|
|
4245
4245
|
size: 15,
|
|
4246
|
-
onClick:
|
|
4246
|
+
onClick: $,
|
|
4247
4247
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4248
4248
|
}
|
|
4249
4249
|
)
|
|
@@ -4264,7 +4264,7 @@ const bn = ({
|
|
|
4264
4264
|
},
|
|
4265
4265
|
M.id
|
|
4266
4266
|
) : /* @__PURE__ */ e(
|
|
4267
|
-
|
|
4267
|
+
re,
|
|
4268
4268
|
{
|
|
4269
4269
|
variant: M.variant ?? "secondary",
|
|
4270
4270
|
onClick: (q) => {
|
|
@@ -4288,10 +4288,10 @@ const bn = ({
|
|
|
4288
4288
|
backLabel: n = "Back",
|
|
4289
4289
|
className: s,
|
|
4290
4290
|
children: a
|
|
4291
|
-
}) => /* @__PURE__ */ i("div", { className:
|
|
4292
|
-
r && /* @__PURE__ */ e(
|
|
4291
|
+
}) => /* @__PURE__ */ i("div", { className: m("flex items-center gap-2 mb-3", s), children: [
|
|
4292
|
+
r && /* @__PURE__ */ e(re, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(Ee, { size: 14 }), children: n }),
|
|
4293
4293
|
a && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: a }),
|
|
4294
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className:
|
|
4294
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: m("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
|
|
4295
4295
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4296
4296
|
Pe,
|
|
4297
4297
|
{
|
|
@@ -4304,7 +4304,7 @@ const bn = ({
|
|
|
4304
4304
|
},
|
|
4305
4305
|
l.id
|
|
4306
4306
|
) : /* @__PURE__ */ e(
|
|
4307
|
-
|
|
4307
|
+
re,
|
|
4308
4308
|
{
|
|
4309
4309
|
variant: l.variant ?? "secondary",
|
|
4310
4310
|
size: "sm",
|
|
@@ -4321,7 +4321,7 @@ const bn = ({
|
|
|
4321
4321
|
] });
|
|
4322
4322
|
function pn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
4323
4323
|
const a = /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-border-subtle", "aria-hidden": !0 });
|
|
4324
|
-
return !t && !r ? /* @__PURE__ */ e("div", { className:
|
|
4324
|
+
return !t && !r ? /* @__PURE__ */ e("div", { className: m("flex items-center py-2", s), children: a }) : /* @__PURE__ */ i("div", { className: m("flex items-center gap-3 py-2", s), children: [
|
|
4325
4325
|
n === "center" && a,
|
|
4326
4326
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-xs font-medium text-text-muted", children: t }),
|
|
4327
4327
|
a,
|
|
@@ -4339,7 +4339,7 @@ function vn({
|
|
|
4339
4339
|
return /* @__PURE__ */ i(
|
|
4340
4340
|
"div",
|
|
4341
4341
|
{
|
|
4342
|
-
className:
|
|
4342
|
+
className: m(
|
|
4343
4343
|
"flex items-center justify-between gap-4 py-2",
|
|
4344
4344
|
s && "rounded-lg border border-border px-3",
|
|
4345
4345
|
a && "opacity-50",
|
|
@@ -4363,7 +4363,7 @@ function yn({
|
|
|
4363
4363
|
children: a,
|
|
4364
4364
|
className: l
|
|
4365
4365
|
}) {
|
|
4366
|
-
return /* @__PURE__ */ i("section", { className:
|
|
4366
|
+
return /* @__PURE__ */ i("section", { className: m("flex flex-col gap-2", l), children: [
|
|
4367
4367
|
/* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
4368
4368
|
t && /* @__PURE__ */ e(J, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
|
|
4369
4369
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -4372,7 +4372,7 @@ function yn({
|
|
|
4372
4372
|
] }),
|
|
4373
4373
|
s && /* @__PURE__ */ e("div", { className: "shrink-0", children: s })
|
|
4374
4374
|
] }),
|
|
4375
|
-
/* @__PURE__ */ e("div", { className:
|
|
4375
|
+
/* @__PURE__ */ e("div", { className: m("flex flex-col", t && "pl-6"), children: a })
|
|
4376
4376
|
] });
|
|
4377
4377
|
}
|
|
4378
4378
|
function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
@@ -4381,7 +4381,7 @@ function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
4381
4381
|
{
|
|
4382
4382
|
type: "button",
|
|
4383
4383
|
onClick: n,
|
|
4384
|
-
className:
|
|
4384
|
+
className: m(
|
|
4385
4385
|
"inline-flex max-w-full items-center gap-1.5 rounded-full bg-surface-sunk px-2.5 py-1 text-xs text-text-muted transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text",
|
|
4386
4386
|
s
|
|
4387
4387
|
),
|
|
@@ -4416,16 +4416,16 @@ const wn = ({
|
|
|
4416
4416
|
} catch {
|
|
4417
4417
|
return String(x);
|
|
4418
4418
|
}
|
|
4419
|
-
}, l = (x) => x ? "Ja" : "Nee", c = (x,
|
|
4420
|
-
if (!
|
|
4421
|
-
const f =
|
|
4419
|
+
}, l = (x) => x ? "Ja" : "Nee", c = (x, u) => {
|
|
4420
|
+
if (!u) return String(x || "-");
|
|
4421
|
+
const f = u.find((p) => p.value === x);
|
|
4422
4422
|
return f ? f.label : String(x || "-");
|
|
4423
4423
|
}, h = ce(
|
|
4424
4424
|
(x) => {
|
|
4425
|
-
const
|
|
4425
|
+
const u = zr(r, x.name);
|
|
4426
4426
|
if (x.type === "array") {
|
|
4427
|
-
const
|
|
4428
|
-
return !
|
|
4427
|
+
const p = u;
|
|
4428
|
+
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
4429
4429
|
oe,
|
|
4430
4430
|
{
|
|
4431
4431
|
variant: "body",
|
|
@@ -4433,7 +4433,7 @@ const wn = ({
|
|
|
4433
4433
|
className: "text-text-muted",
|
|
4434
4434
|
children: "Geen items"
|
|
4435
4435
|
}
|
|
4436
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
4436
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((k, v) => /* @__PURE__ */ i(
|
|
4437
4437
|
"div",
|
|
4438
4438
|
{
|
|
4439
4439
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4448,51 +4448,51 @@ const wn = ({
|
|
|
4448
4448
|
children: [
|
|
4449
4449
|
x.label,
|
|
4450
4450
|
" ",
|
|
4451
|
-
|
|
4451
|
+
v + 1
|
|
4452
4452
|
]
|
|
4453
4453
|
}
|
|
4454
4454
|
) }),
|
|
4455
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: x.arrayFields?.map((
|
|
4456
|
-
const
|
|
4457
|
-
let
|
|
4458
|
-
switch (
|
|
4455
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: x.arrayFields?.map((g) => {
|
|
4456
|
+
const $ = k?.[g.name];
|
|
4457
|
+
let D = "-";
|
|
4458
|
+
switch (g.type) {
|
|
4459
4459
|
case "text":
|
|
4460
4460
|
case "email":
|
|
4461
4461
|
case "number":
|
|
4462
4462
|
case "tel":
|
|
4463
4463
|
case "url":
|
|
4464
4464
|
case "textarea":
|
|
4465
|
-
|
|
4465
|
+
D = $ || "-";
|
|
4466
4466
|
break;
|
|
4467
4467
|
case "select":
|
|
4468
4468
|
case "radio":
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4469
|
+
D = c(
|
|
4470
|
+
$,
|
|
4471
|
+
g.options
|
|
4472
4472
|
);
|
|
4473
4473
|
break;
|
|
4474
4474
|
case "checkbox":
|
|
4475
|
-
|
|
4475
|
+
D = l($);
|
|
4476
4476
|
break;
|
|
4477
4477
|
case "date":
|
|
4478
|
-
|
|
4478
|
+
D = a($);
|
|
4479
4479
|
break;
|
|
4480
4480
|
case "custom":
|
|
4481
|
-
|
|
4482
|
-
value:
|
|
4481
|
+
D = g.customComponent?.({
|
|
4482
|
+
value: $
|
|
4483
4483
|
});
|
|
4484
4484
|
break;
|
|
4485
4485
|
default:
|
|
4486
|
-
|
|
4486
|
+
D = String($ || "-");
|
|
4487
4487
|
}
|
|
4488
|
-
return
|
|
4488
|
+
return g.format && (D = g.format($, k)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
4489
4489
|
/* @__PURE__ */ e(
|
|
4490
4490
|
oe,
|
|
4491
4491
|
{
|
|
4492
4492
|
variant: "label",
|
|
4493
4493
|
size: "xs",
|
|
4494
4494
|
className: "text-text-muted",
|
|
4495
|
-
children:
|
|
4495
|
+
children: g.label
|
|
4496
4496
|
}
|
|
4497
4497
|
),
|
|
4498
4498
|
/* @__PURE__ */ e(
|
|
@@ -4501,27 +4501,27 @@ const wn = ({
|
|
|
4501
4501
|
variant: "body",
|
|
4502
4502
|
size: "sm",
|
|
4503
4503
|
className: "text-text",
|
|
4504
|
-
children:
|
|
4504
|
+
children: D
|
|
4505
4505
|
}
|
|
4506
4506
|
)
|
|
4507
|
-
] },
|
|
4507
|
+
] }, g.name);
|
|
4508
4508
|
}) })
|
|
4509
4509
|
]
|
|
4510
4510
|
},
|
|
4511
|
-
|
|
4511
|
+
v
|
|
4512
4512
|
)) });
|
|
4513
4513
|
}
|
|
4514
4514
|
if (x.type === "custom" && x.customComponent)
|
|
4515
|
-
return x.customComponent({ value:
|
|
4515
|
+
return x.customComponent({ value: u });
|
|
4516
4516
|
if (x.format) {
|
|
4517
|
-
const
|
|
4517
|
+
const p = x.format(u, r);
|
|
4518
4518
|
return /* @__PURE__ */ e(
|
|
4519
4519
|
oe,
|
|
4520
4520
|
{
|
|
4521
4521
|
variant: "body",
|
|
4522
4522
|
size: "sm",
|
|
4523
4523
|
className: "text-text",
|
|
4524
|
-
children:
|
|
4524
|
+
children: p
|
|
4525
4525
|
}
|
|
4526
4526
|
);
|
|
4527
4527
|
}
|
|
@@ -4533,23 +4533,23 @@ const wn = ({
|
|
|
4533
4533
|
case "number":
|
|
4534
4534
|
case "tel":
|
|
4535
4535
|
case "url":
|
|
4536
|
-
f =
|
|
4536
|
+
f = u ? String(u) : "-";
|
|
4537
4537
|
break;
|
|
4538
4538
|
case "textarea":
|
|
4539
|
-
f =
|
|
4539
|
+
f = u ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(u || "-") }) : "-";
|
|
4540
4540
|
break;
|
|
4541
4541
|
case "select":
|
|
4542
4542
|
case "radio":
|
|
4543
|
-
f = c(
|
|
4543
|
+
f = c(u, x.options);
|
|
4544
4544
|
break;
|
|
4545
4545
|
case "checkbox":
|
|
4546
|
-
f = l(
|
|
4546
|
+
f = l(u);
|
|
4547
4547
|
break;
|
|
4548
4548
|
case "date":
|
|
4549
|
-
f = a(
|
|
4549
|
+
f = a(u);
|
|
4550
4550
|
break;
|
|
4551
4551
|
default:
|
|
4552
|
-
f =
|
|
4552
|
+
f = u ? String(u) : "-";
|
|
4553
4553
|
}
|
|
4554
4554
|
return /* @__PURE__ */ e(
|
|
4555
4555
|
oe,
|
|
@@ -4562,13 +4562,13 @@ const wn = ({
|
|
|
4562
4562
|
);
|
|
4563
4563
|
},
|
|
4564
4564
|
[r]
|
|
4565
|
-
),
|
|
4565
|
+
), b = ce(
|
|
4566
4566
|
(x) => {
|
|
4567
4567
|
if (x.conditional && !x.conditional(r))
|
|
4568
4568
|
return null;
|
|
4569
|
-
const
|
|
4570
|
-
if (
|
|
4571
|
-
const f =
|
|
4569
|
+
const u = x.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
|
|
4570
|
+
if (u.length === 0) return null;
|
|
4571
|
+
const f = m(
|
|
4572
4572
|
"space-y-4",
|
|
4573
4573
|
{
|
|
4574
4574
|
"grid gap-4": x.layout === "grid",
|
|
@@ -4608,28 +4608,28 @@ const wn = ({
|
|
|
4608
4608
|
}
|
|
4609
4609
|
)
|
|
4610
4610
|
] }),
|
|
4611
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: f, children:
|
|
4611
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: f, children: u.map((p) => /* @__PURE__ */ i(
|
|
4612
4612
|
"div",
|
|
4613
4613
|
{
|
|
4614
4614
|
className: "space-y-1",
|
|
4615
4615
|
style: {
|
|
4616
|
-
width: typeof
|
|
4617
|
-
gridColumn: typeof
|
|
4616
|
+
width: typeof p.width == "string" ? p.width : void 0,
|
|
4617
|
+
gridColumn: typeof p.width == "number" ? `span ${p.width} / span ${p.width}` : void 0
|
|
4618
4618
|
},
|
|
4619
4619
|
children: [
|
|
4620
|
-
|
|
4620
|
+
p.type !== "custom" && /* @__PURE__ */ e(
|
|
4621
4621
|
oe,
|
|
4622
4622
|
{
|
|
4623
4623
|
variant: "label",
|
|
4624
4624
|
size: "sm",
|
|
4625
4625
|
className: "font-medium text-text-muted",
|
|
4626
|
-
children:
|
|
4626
|
+
children: p.label
|
|
4627
4627
|
}
|
|
4628
4628
|
),
|
|
4629
|
-
h(
|
|
4629
|
+
h(p)
|
|
4630
4630
|
]
|
|
4631
4631
|
},
|
|
4632
|
-
|
|
4632
|
+
p.name
|
|
4633
4633
|
)) }) })
|
|
4634
4634
|
]
|
|
4635
4635
|
},
|
|
@@ -4637,7 +4637,7 @@ const wn = ({
|
|
|
4637
4637
|
);
|
|
4638
4638
|
},
|
|
4639
4639
|
[r, h]
|
|
4640
|
-
),
|
|
4640
|
+
), y = m(
|
|
4641
4641
|
"space-y-6",
|
|
4642
4642
|
{
|
|
4643
4643
|
"max-w-md": n === "sm",
|
|
@@ -4647,14 +4647,14 @@ const wn = ({
|
|
|
4647
4647
|
},
|
|
4648
4648
|
s
|
|
4649
4649
|
);
|
|
4650
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4650
|
+
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(b) }) });
|
|
4651
4651
|
}, Re = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
|
|
4652
4652
|
const a = !!(t.children && t.children.length > 0), l = r ? r(t.path) : !1;
|
|
4653
4653
|
return a ? /* @__PURE__ */ i("li", { children: [
|
|
4654
4654
|
/* @__PURE__ */ i(
|
|
4655
4655
|
"div",
|
|
4656
4656
|
{
|
|
4657
|
-
className:
|
|
4657
|
+
className: m(
|
|
4658
4658
|
"flex items-center gap-2 px-2 pt-4 pb-1 text-xs font-semibold uppercase tracking-label text-text-subtle"
|
|
4659
4659
|
),
|
|
4660
4660
|
children: [
|
|
@@ -4682,7 +4682,7 @@ const wn = ({
|
|
|
4682
4682
|
onKeyDown: (c) => {
|
|
4683
4683
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), t.path && n?.(t.path));
|
|
4684
4684
|
},
|
|
4685
|
-
className:
|
|
4685
|
+
className: m(
|
|
4686
4686
|
"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4687
4687
|
"transition-colors duration-fast ease-out",
|
|
4688
4688
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -4694,7 +4694,7 @@ const wn = ({
|
|
|
4694
4694
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e(
|
|
4695
4695
|
"span",
|
|
4696
4696
|
{
|
|
4697
|
-
className:
|
|
4697
|
+
className: m(
|
|
4698
4698
|
"shrink-0 text-xs tabular-nums",
|
|
4699
4699
|
l ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle"
|
|
4700
4700
|
),
|
|
@@ -4717,7 +4717,7 @@ const wn = ({
|
|
|
4717
4717
|
r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c, h) => /* @__PURE__ */ e(
|
|
4718
4718
|
"span",
|
|
4719
4719
|
{
|
|
4720
|
-
className:
|
|
4720
|
+
className: m(
|
|
4721
4721
|
"flex h-control-sm w-7 cursor-pointer items-center justify-center rounded-md text-text-strong",
|
|
4722
4722
|
"transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text-strong",
|
|
4723
4723
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
@@ -4777,9 +4777,9 @@ const wn = ({
|
|
|
4777
4777
|
truncate: l = !1,
|
|
4778
4778
|
className: c,
|
|
4779
4779
|
children: h,
|
|
4780
|
-
...
|
|
4780
|
+
...b
|
|
4781
4781
|
}) => {
|
|
4782
|
-
const
|
|
4782
|
+
const y = `h${t}`, x = m(
|
|
4783
4783
|
"font-sans text-pretty",
|
|
4784
4784
|
Er[r || Tr(t)],
|
|
4785
4785
|
Mr[n],
|
|
@@ -4788,7 +4788,7 @@ const wn = ({
|
|
|
4788
4788
|
l && "truncate",
|
|
4789
4789
|
c
|
|
4790
4790
|
);
|
|
4791
|
-
return /* @__PURE__ */ e(
|
|
4791
|
+
return /* @__PURE__ */ e(y, { className: x, ...b, children: h });
|
|
4792
4792
|
};
|
|
4793
4793
|
function Tr(t) {
|
|
4794
4794
|
return {
|
|
@@ -4808,39 +4808,39 @@ const Sn = ({
|
|
|
4808
4808
|
initialCommandPath: a,
|
|
4809
4809
|
initialActiveIndex: l
|
|
4810
4810
|
}) => {
|
|
4811
|
-
const [c, h] = R(""), [
|
|
4812
|
-
(
|
|
4811
|
+
const [c, h] = R(""), [b, y] = R(a || []), [x, u] = R(l || 0), f = ae(null), p = ae(null), v = (b.length ? t.find((g) => g.id === b[0])?.subCommands || [] : t).filter(
|
|
4812
|
+
(g) => g.label.toLowerCase().includes(c.toLowerCase())
|
|
4813
4813
|
);
|
|
4814
4814
|
return Y(() => {
|
|
4815
|
-
r || (h(""),
|
|
4815
|
+
r || (h(""), y(a || []), u(l || 0));
|
|
4816
4816
|
}, [r]), Y(() => {
|
|
4817
|
-
const
|
|
4817
|
+
const g = ($) => {
|
|
4818
4818
|
if (r) {
|
|
4819
|
-
if (
|
|
4819
|
+
if ($.key === "Escape")
|
|
4820
4820
|
n();
|
|
4821
|
-
else if (
|
|
4822
|
-
|
|
4823
|
-
(
|
|
4821
|
+
else if ($.key === "ArrowUp")
|
|
4822
|
+
u(
|
|
4823
|
+
(D) => D > 0 ? D - 1 : v.length - 1
|
|
4824
4824
|
);
|
|
4825
|
-
else if (
|
|
4826
|
-
|
|
4827
|
-
(
|
|
4825
|
+
else if ($.key === "ArrowDown")
|
|
4826
|
+
u(
|
|
4827
|
+
(D) => D < v.length - 1 ? D + 1 : 0
|
|
4828
4828
|
);
|
|
4829
|
-
else if (
|
|
4830
|
-
const
|
|
4831
|
-
|
|
4829
|
+
else if ($.key === "Enter") {
|
|
4830
|
+
const D = v[x];
|
|
4831
|
+
D && (D.subCommands ? (y([...b, D.id]), u(0)) : D.action && (D.action(), n()));
|
|
4832
4832
|
}
|
|
4833
4833
|
}
|
|
4834
4834
|
};
|
|
4835
|
-
return document.addEventListener("keydown",
|
|
4836
|
-
}, [r, n,
|
|
4837
|
-
const
|
|
4838
|
-
f.current && !f.current.contains(
|
|
4835
|
+
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
4836
|
+
}, [r, n, v, x, b]), Y(() => {
|
|
4837
|
+
const g = ($) => {
|
|
4838
|
+
f.current && !f.current.contains($.target) && n();
|
|
4839
4839
|
};
|
|
4840
|
-
return r && document.addEventListener("mousedown",
|
|
4840
|
+
return r && document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
4841
4841
|
}, [r, n]), Y(() => {
|
|
4842
4842
|
if (!r) return;
|
|
4843
|
-
|
|
4843
|
+
p.current?.querySelector(`[data-index="${x}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4844
4844
|
}, [x, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
|
|
4845
4845
|
"div",
|
|
4846
4846
|
{
|
|
@@ -4856,7 +4856,7 @@ const Sn = ({
|
|
|
4856
4856
|
autoFocus: !0,
|
|
4857
4857
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
4858
4858
|
value: c,
|
|
4859
|
-
onChange: (
|
|
4859
|
+
onChange: (g) => h(g.target.value),
|
|
4860
4860
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
4861
4861
|
}
|
|
4862
4862
|
)
|
|
@@ -4864,26 +4864,26 @@ const Sn = ({
|
|
|
4864
4864
|
/* @__PURE__ */ i(
|
|
4865
4865
|
"div",
|
|
4866
4866
|
{
|
|
4867
|
-
ref:
|
|
4867
|
+
ref: p,
|
|
4868
4868
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4869
4869
|
children: [
|
|
4870
|
-
|
|
4871
|
-
|
|
4870
|
+
v.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4871
|
+
v.map((g, $) => /* @__PURE__ */ i(
|
|
4872
4872
|
"div",
|
|
4873
4873
|
{
|
|
4874
|
-
"data-index":
|
|
4875
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
4874
|
+
"data-index": $,
|
|
4875
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${$ === x ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4876
4876
|
onClick: () => {
|
|
4877
|
-
|
|
4877
|
+
g.subCommands ? (y([...b, g.id]), u(0)) : g.action && (g.action(), n());
|
|
4878
4878
|
},
|
|
4879
|
-
onMouseEnter: () =>
|
|
4879
|
+
onMouseEnter: () => u($),
|
|
4880
4880
|
children: [
|
|
4881
|
-
|
|
4882
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4883
|
-
|
|
4881
|
+
g.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: g.icon }),
|
|
4882
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: g.label }),
|
|
4883
|
+
g.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ye, { className: "w-4 h-4" }) })
|
|
4884
4884
|
]
|
|
4885
4885
|
},
|
|
4886
|
-
|
|
4886
|
+
g.id
|
|
4887
4887
|
))
|
|
4888
4888
|
]
|
|
4889
4889
|
}
|
|
@@ -4976,13 +4976,13 @@ const Sn = ({
|
|
|
4976
4976
|
border: l,
|
|
4977
4977
|
borderColor: c,
|
|
4978
4978
|
className: h,
|
|
4979
|
-
children:
|
|
4980
|
-
...
|
|
4979
|
+
children: b,
|
|
4980
|
+
...y
|
|
4981
4981
|
}, x) => /* @__PURE__ */ e(
|
|
4982
4982
|
"div",
|
|
4983
4983
|
{
|
|
4984
4984
|
ref: x,
|
|
4985
|
-
className:
|
|
4985
|
+
className: m(
|
|
4986
4986
|
t && Ar[t],
|
|
4987
4987
|
r && Lr[r],
|
|
4988
4988
|
n && Ir[n],
|
|
@@ -4992,8 +4992,8 @@ const Sn = ({
|
|
|
4992
4992
|
c && Br[c],
|
|
4993
4993
|
h
|
|
4994
4994
|
),
|
|
4995
|
-
...
|
|
4996
|
-
children:
|
|
4995
|
+
...y,
|
|
4996
|
+
children: b
|
|
4997
4997
|
}
|
|
4998
4998
|
)
|
|
4999
4999
|
);
|
|
@@ -5021,44 +5021,44 @@ function En({
|
|
|
5021
5021
|
componentProps: a,
|
|
5022
5022
|
className: l
|
|
5023
5023
|
}) {
|
|
5024
|
-
const c =
|
|
5025
|
-
return
|
|
5024
|
+
const c = ae(null), [h, b] = R(!0), [y, x] = R(null), u = ae(null);
|
|
5025
|
+
return ae(null), Y(() => {
|
|
5026
5026
|
let f = !0;
|
|
5027
5027
|
return (async () => {
|
|
5028
|
-
|
|
5028
|
+
b(!0);
|
|
5029
5029
|
try {
|
|
5030
|
-
const
|
|
5030
|
+
const k = await r();
|
|
5031
5031
|
if (!f) return;
|
|
5032
|
-
const
|
|
5033
|
-
x(n === "react" ? () =>
|
|
5034
|
-
} catch (
|
|
5035
|
-
console.error(`[FederatedResource] Load failed: ${t}`,
|
|
5032
|
+
const v = k.component || k.default || k;
|
|
5033
|
+
x(n === "react" ? () => v : () => k);
|
|
5034
|
+
} catch (k) {
|
|
5035
|
+
console.error(`[FederatedResource] Load failed: ${t}`, k);
|
|
5036
5036
|
} finally {
|
|
5037
|
-
f &&
|
|
5037
|
+
f && b(!1);
|
|
5038
5038
|
}
|
|
5039
5039
|
})(), () => {
|
|
5040
5040
|
f = !1;
|
|
5041
5041
|
};
|
|
5042
5042
|
}, [t, r]), Y(() => {
|
|
5043
|
-
if (h || !
|
|
5043
|
+
if (h || !y || n === "react") return;
|
|
5044
5044
|
const f = c.current;
|
|
5045
5045
|
if (f) {
|
|
5046
5046
|
if (n === "svelte") {
|
|
5047
|
-
const
|
|
5048
|
-
return
|
|
5047
|
+
const p = y.default || y, k = new p({ target: f, props: a || {} });
|
|
5048
|
+
return u.current = k, () => k.$destroy();
|
|
5049
5049
|
}
|
|
5050
|
-
if (
|
|
5051
|
-
const
|
|
5050
|
+
if (y.mount) {
|
|
5051
|
+
const p = y.mount({ container: f, props: a || {} });
|
|
5052
5052
|
return () => {
|
|
5053
|
-
typeof
|
|
5053
|
+
typeof p == "function" ? p() : y.unmount?.(f);
|
|
5054
5054
|
};
|
|
5055
5055
|
}
|
|
5056
5056
|
}
|
|
5057
|
-
}, [
|
|
5058
|
-
n === "svelte" &&
|
|
5057
|
+
}, [y, n, h]), Y(() => {
|
|
5058
|
+
n === "svelte" && u.current && u.current.$set?.(a);
|
|
5059
5059
|
}, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
|
|
5060
5060
|
h && s,
|
|
5061
|
-
n === "react" &&
|
|
5061
|
+
n === "react" && y && /* @__PURE__ */ e(y, { ...a })
|
|
5062
5062
|
] });
|
|
5063
5063
|
}
|
|
5064
5064
|
class Mn extends mt {
|
|
@@ -5095,7 +5095,7 @@ export {
|
|
|
5095
5095
|
dn as AvatarStack,
|
|
5096
5096
|
tn as Badge,
|
|
5097
5097
|
Ve as Box,
|
|
5098
|
-
|
|
5098
|
+
re as Button,
|
|
5099
5099
|
Gr as ButtonGroup,
|
|
5100
5100
|
zn as Card,
|
|
5101
5101
|
un as ChannelBadge,
|
|
@@ -5148,7 +5148,7 @@ export {
|
|
|
5148
5148
|
he as TextField,
|
|
5149
5149
|
_r as VideoSurface,
|
|
5150
5150
|
wn as View,
|
|
5151
|
-
|
|
5151
|
+
m as cn,
|
|
5152
5152
|
Ur as createSizes,
|
|
5153
5153
|
qr as createVariants
|
|
5154
5154
|
};
|