@opencxh/ui-kit 3.83.1 → 3.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +806 -745
- package/dist/index.js.map +1 -1
- package/dist/src/forms/Form.d.ts +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/input/FolderSelect.d.ts +27 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { clsx as je } from "clsx";
|
|
2
2
|
import { jsxs as d, jsx as e, Fragment as $e } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as _e, User as
|
|
3
|
+
import { VideoOff as _e, User as Pe, MicOff as Be, Mic as Oe, ChevronDown as We, FileText as xe, HardDrive as ke, X as Fe, ArrowLeft as we, Search as Te, FolderPlus as Ve, Upload as Re, Folder as Ce, Pencil as He, ChevronDownIcon as qe, ChevronRight as Ue } from "lucide-react";
|
|
4
4
|
import se, { useRef as J, useEffect as U, forwardRef as ce, useState as P, useCallback as ae, useMemo as de, createContext as Ge, Component as Ke } from "react";
|
|
5
5
|
function p(...t) {
|
|
6
6
|
return je(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function er(t) {
|
|
9
9
|
return (a, r) => t[a]?.[r] || "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function tr(t) {
|
|
12
12
|
return (a) => t[a] || "";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function rr({ tiles: t, pinned: a, className: r }) {
|
|
15
15
|
if (a)
|
|
16
16
|
return /* @__PURE__ */ d("div", { className: p("flex flex-col md:flex-row gap-2 h-full", r), children: [
|
|
17
17
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children: a }),
|
|
18
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((
|
|
18
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((s, o) => /* @__PURE__ */ e("div", { className: "min-w-[160px] md:min-w-0", children: s }, o)) })
|
|
19
19
|
] });
|
|
20
20
|
const n = 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: p("grid gap-2 h-full", n, r), children: t.map((
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: p("grid gap-2 h-full", n, r), children: t.map((s, o) => /* @__PURE__ */ e("div", { children: s }, o)) });
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function nr({
|
|
24
24
|
name: t,
|
|
25
25
|
avatarUrl: a,
|
|
26
26
|
muted: r,
|
|
27
27
|
speaking: n,
|
|
28
|
-
hasVideo:
|
|
28
|
+
hasVideo: s,
|
|
29
29
|
videoSlot: o,
|
|
30
30
|
className: u
|
|
31
31
|
}) {
|
|
@@ -38,27 +38,27 @@ function rr({
|
|
|
38
38
|
u
|
|
39
39
|
),
|
|
40
40
|
children: [
|
|
41
|
-
|
|
41
|
+
s && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-gray-700 flex items-center justify-center", children: s ? /* @__PURE__ */ e(_e, { className: "w-8 h-8" }) : /* @__PURE__ */ e(Pe, { className: "w-8 h-8" }) }) }),
|
|
42
42
|
/* @__PURE__ */ d("div", { className: "absolute bottom-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded bg-black/50 text-white text-xs", children: [
|
|
43
|
-
r ? /* @__PURE__ */ e(
|
|
43
|
+
r ? /* @__PURE__ */ e(Be, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Oe, { className: "w-3 h-3" }),
|
|
44
44
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: t })
|
|
45
45
|
] })
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
50
|
+
function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
51
|
+
const s = J(null);
|
|
52
52
|
return U(() => {
|
|
53
|
-
if (!a || !
|
|
54
|
-
const o = t(
|
|
53
|
+
if (!a || !s.current) return;
|
|
54
|
+
const o = t(s.current);
|
|
55
55
|
return () => {
|
|
56
|
-
typeof o == "function" && o(),
|
|
56
|
+
typeof o == "function" && o(), s.current && (s.current.innerHTML = "");
|
|
57
57
|
};
|
|
58
58
|
}, [t, a]), /* @__PURE__ */ e(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
ref:
|
|
61
|
+
ref: s,
|
|
62
62
|
className: p(
|
|
63
63
|
"w-full h-full bg-gray-900 overflow-hidden",
|
|
64
64
|
r && "[&>*]:scale-x-[-1]",
|
|
@@ -93,19 +93,19 @@ const Je = {
|
|
|
93
93
|
size: a = "md",
|
|
94
94
|
fullWidth: r = !1,
|
|
95
95
|
loading: n = !1,
|
|
96
|
-
leftIcon:
|
|
96
|
+
leftIcon: s,
|
|
97
97
|
rightIcon: o,
|
|
98
98
|
iconOnly: u = !1,
|
|
99
99
|
className: b,
|
|
100
100
|
children: x,
|
|
101
101
|
disabled: g,
|
|
102
102
|
...f
|
|
103
|
-
},
|
|
103
|
+
}, l) => {
|
|
104
104
|
const m = g || n;
|
|
105
105
|
return /* @__PURE__ */ d(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
108
|
-
ref:
|
|
108
|
+
ref: l,
|
|
109
109
|
type: "button",
|
|
110
110
|
className: p(
|
|
111
111
|
// Base styles — radius/focus/colors come from the token-driven `.btn o__*` CSS
|
|
@@ -156,22 +156,22 @@ const Je = {
|
|
|
156
156
|
]
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
!n &&
|
|
159
|
+
!n && s && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "mr-2"), children: s }),
|
|
160
160
|
!u && x,
|
|
161
161
|
!n && o && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "ml-2"), children: o }),
|
|
162
|
-
u && !n && !
|
|
162
|
+
u && !n && !s && !o && x
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
te.displayName = "Button";
|
|
169
|
-
const
|
|
169
|
+
const lr = ({
|
|
170
170
|
children: t,
|
|
171
171
|
size: a = "md",
|
|
172
172
|
orientation: r = "horizontal",
|
|
173
173
|
attached: n = !0,
|
|
174
|
-
className:
|
|
174
|
+
className: s
|
|
175
175
|
}) => {
|
|
176
176
|
const o = p(
|
|
177
177
|
"inline-flex",
|
|
@@ -193,15 +193,15 @@ const ar = ({
|
|
|
193
193
|
"gap-2": !n && (a === "sm" || a === "md"),
|
|
194
194
|
"gap-3": !n && (a === "lg" || a === "xl")
|
|
195
195
|
},
|
|
196
|
-
|
|
196
|
+
s
|
|
197
197
|
);
|
|
198
198
|
return /* @__PURE__ */ e("div", { className: o, role: "group", children: t });
|
|
199
|
-
},
|
|
199
|
+
}, sr = ({
|
|
200
200
|
variant: t = "default",
|
|
201
201
|
size: a = "md",
|
|
202
202
|
color: r = "primary",
|
|
203
203
|
disabled: n = !1,
|
|
204
|
-
external:
|
|
204
|
+
external: s = !1,
|
|
205
205
|
className: o,
|
|
206
206
|
children: u,
|
|
207
207
|
href: b,
|
|
@@ -209,7 +209,7 @@ const ar = ({
|
|
|
209
209
|
rel: g,
|
|
210
210
|
...f
|
|
211
211
|
}) => {
|
|
212
|
-
const
|
|
212
|
+
const l = s || b && (b.startsWith("http") || b.startsWith("mailto:")), m = p(
|
|
213
213
|
// Base styles
|
|
214
214
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
215
215
|
// Size variants
|
|
@@ -266,12 +266,12 @@ const ar = ({
|
|
|
266
266
|
), h = {
|
|
267
267
|
...f,
|
|
268
268
|
href: n ? void 0 : b,
|
|
269
|
-
target:
|
|
270
|
-
rel:
|
|
269
|
+
target: l ? "_blank" : x,
|
|
270
|
+
rel: l ? "noopener noreferrer" : g
|
|
271
271
|
};
|
|
272
272
|
return /* @__PURE__ */ d("a", { className: m, ...h, children: [
|
|
273
273
|
u,
|
|
274
|
-
|
|
274
|
+
l && /* @__PURE__ */ e(
|
|
275
275
|
"svg",
|
|
276
276
|
{
|
|
277
277
|
className: "w-3 h-3 ml-1",
|
|
@@ -299,23 +299,23 @@ const ar = ({
|
|
|
299
299
|
sm: "px-3 py-1.5 text-sm",
|
|
300
300
|
md: "px-4 py-2 text-sm"
|
|
301
301
|
};
|
|
302
|
-
function
|
|
302
|
+
function ze({
|
|
303
303
|
label: t,
|
|
304
304
|
onClick: a,
|
|
305
305
|
variant: r = "primary",
|
|
306
306
|
size: n = "md",
|
|
307
|
-
icon:
|
|
307
|
+
icon: s,
|
|
308
308
|
options: o,
|
|
309
309
|
disabled: u = !1
|
|
310
310
|
}) {
|
|
311
311
|
const [b, x] = P(!1), g = J(null), f = ae(() => {
|
|
312
|
-
x((
|
|
312
|
+
x((l) => !l);
|
|
313
313
|
}, []);
|
|
314
314
|
return U(() => {
|
|
315
|
-
const
|
|
315
|
+
const l = (m) => {
|
|
316
316
|
g.current && !g.current.contains(m.target) && x(!1);
|
|
317
317
|
};
|
|
318
|
-
return document.addEventListener("mousedown",
|
|
318
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
319
319
|
}, []), /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex items-center gap-px", children: [
|
|
320
320
|
/* @__PURE__ */ d(
|
|
321
321
|
"button",
|
|
@@ -332,7 +332,7 @@ function Te({
|
|
|
332
332
|
"!rounded-r-none"
|
|
333
333
|
),
|
|
334
334
|
children: [
|
|
335
|
-
|
|
335
|
+
s && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: s }),
|
|
336
336
|
t
|
|
337
337
|
]
|
|
338
338
|
}
|
|
@@ -351,23 +351,23 @@ function Te({
|
|
|
351
351
|
n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
|
|
352
352
|
"!rounded-l-none"
|
|
353
353
|
),
|
|
354
|
-
children: /* @__PURE__ */ e(
|
|
354
|
+
children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
|
|
355
355
|
}
|
|
356
356
|
),
|
|
357
|
-
b && o.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: o.map((
|
|
357
|
+
b && o.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: o.map((l) => /* @__PURE__ */ e(
|
|
358
358
|
"button",
|
|
359
359
|
{
|
|
360
360
|
type: "button",
|
|
361
361
|
onClick: () => {
|
|
362
|
-
|
|
362
|
+
l.onClick(), x(!1);
|
|
363
363
|
},
|
|
364
364
|
className: p(
|
|
365
365
|
"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
|
|
366
|
-
|
|
366
|
+
l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
|
|
367
367
|
),
|
|
368
|
-
children:
|
|
368
|
+
children: l.label
|
|
369
369
|
},
|
|
370
|
-
|
|
370
|
+
l.id
|
|
371
371
|
)) })
|
|
372
372
|
] });
|
|
373
373
|
}
|
|
@@ -381,29 +381,29 @@ const Qe = {
|
|
|
381
381
|
md: "text-sm",
|
|
382
382
|
lg: "text-base",
|
|
383
383
|
full: "text-base"
|
|
384
|
-
},
|
|
384
|
+
}, ye = ce(
|
|
385
385
|
({
|
|
386
386
|
label: t,
|
|
387
387
|
helperText: a,
|
|
388
388
|
error: r,
|
|
389
389
|
size: n = "md",
|
|
390
|
-
indeterminate:
|
|
390
|
+
indeterminate: s = !1,
|
|
391
391
|
containerClassName: o,
|
|
392
392
|
labelClassName: u,
|
|
393
393
|
className: b,
|
|
394
394
|
id: x,
|
|
395
395
|
...g
|
|
396
396
|
}, f) => {
|
|
397
|
-
const
|
|
397
|
+
const l = x || `checkbox-${Math.random().toString(36).substr(2, 9)}`, m = !!r;
|
|
398
398
|
return se.useEffect(() => {
|
|
399
|
-
f && typeof f == "object" && f.current && (f.current.indeterminate =
|
|
400
|
-
}, [
|
|
399
|
+
f && typeof f == "object" && f.current && (f.current.indeterminate = s);
|
|
400
|
+
}, [s, f]), /* @__PURE__ */ d("div", { className: p("flex flex-col", o), children: [
|
|
401
401
|
/* @__PURE__ */ d("div", { className: "flex items-start", children: [
|
|
402
402
|
/* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
|
|
403
403
|
"input",
|
|
404
404
|
{
|
|
405
405
|
ref: f,
|
|
406
|
-
id:
|
|
406
|
+
id: l,
|
|
407
407
|
type: "checkbox",
|
|
408
408
|
className: p(
|
|
409
409
|
// Base styles
|
|
@@ -426,7 +426,7 @@ const Qe = {
|
|
|
426
426
|
/* @__PURE__ */ e(
|
|
427
427
|
"label",
|
|
428
428
|
{
|
|
429
|
-
htmlFor:
|
|
429
|
+
htmlFor: l,
|
|
430
430
|
className: p(
|
|
431
431
|
"font-medium cursor-pointer",
|
|
432
432
|
m ? "text-error" : "text-default",
|
|
@@ -443,56 +443,56 @@ const Qe = {
|
|
|
443
443
|
] });
|
|
444
444
|
}
|
|
445
445
|
);
|
|
446
|
-
|
|
447
|
-
const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }),
|
|
446
|
+
ye.displayName = "Checkbox";
|
|
447
|
+
const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ve = ce(({
|
|
448
448
|
value: t,
|
|
449
449
|
onChange: a,
|
|
450
450
|
placeholder: r = "Select date",
|
|
451
451
|
disabled: n = !1,
|
|
452
|
-
required:
|
|
452
|
+
required: s = !1,
|
|
453
453
|
size: o = "md",
|
|
454
454
|
className: u,
|
|
455
455
|
minDate: b,
|
|
456
456
|
maxDate: x,
|
|
457
457
|
format: g = "MM/dd/yyyy"
|
|
458
458
|
}, f) => {
|
|
459
|
-
const [
|
|
459
|
+
const [l, m] = P(!1), [h, w] = P(() => t || /* @__PURE__ */ new Date()), k = J(null);
|
|
460
460
|
U(() => {
|
|
461
|
-
const
|
|
462
|
-
k.current && !k.current.contains(
|
|
461
|
+
const z = (W) => {
|
|
462
|
+
k.current && !k.current.contains(W.target) && m(!1);
|
|
463
463
|
};
|
|
464
|
-
return
|
|
465
|
-
document.removeEventListener("mousedown",
|
|
464
|
+
return l && document.addEventListener("mousedown", z), () => {
|
|
465
|
+
document.removeEventListener("mousedown", z);
|
|
466
466
|
};
|
|
467
|
-
}, [
|
|
468
|
-
const
|
|
469
|
-
if (!
|
|
470
|
-
const
|
|
467
|
+
}, [l]);
|
|
468
|
+
const v = (z) => {
|
|
469
|
+
if (!z) return "";
|
|
470
|
+
const W = z.getDate().toString().padStart(2, "0"), V = (z.getMonth() + 1).toString().padStart(2, "0"), i = z.getFullYear();
|
|
471
471
|
switch (g) {
|
|
472
472
|
case "dd/MM/yyyy":
|
|
473
|
-
return `${
|
|
473
|
+
return `${W}/${V}/${i}`;
|
|
474
474
|
case "yyyy-MM-dd":
|
|
475
|
-
return `${i}-${
|
|
475
|
+
return `${i}-${V}-${W}`;
|
|
476
476
|
case "MM/dd/yyyy":
|
|
477
477
|
default:
|
|
478
|
-
return `${
|
|
478
|
+
return `${V}/${W}/${i}`;
|
|
479
479
|
}
|
|
480
480
|
}, j = () => {
|
|
481
|
-
const
|
|
482
|
-
i.setDate(i.getDate() -
|
|
483
|
-
const
|
|
481
|
+
const z = h.getFullYear(), W = h.getMonth(), V = new Date(z, W, 1), i = new Date(V);
|
|
482
|
+
i.setDate(i.getDate() - V.getDay());
|
|
483
|
+
const y = [], E = new Date(i);
|
|
484
484
|
for (let S = 0; S < 42; S++)
|
|
485
|
-
|
|
486
|
-
return
|
|
487
|
-
}, N = (
|
|
488
|
-
|
|
485
|
+
y.push(new Date(E)), E.setDate(E.getDate() + 1);
|
|
486
|
+
return y;
|
|
487
|
+
}, N = (z) => {
|
|
488
|
+
z.getMonth() === h.getMonth() && (b && z < b || x && z > x || (a?.(z), m(!1)));
|
|
489
489
|
}, q = () => {
|
|
490
490
|
w(new Date(h.getFullYear(), h.getMonth() - 1, 1));
|
|
491
491
|
}, B = () => {
|
|
492
492
|
w(new Date(h.getFullYear(), h.getMonth() + 1, 1));
|
|
493
493
|
}, G = () => {
|
|
494
494
|
a?.(null), m(!1);
|
|
495
|
-
},
|
|
495
|
+
}, F = p(
|
|
496
496
|
"w-full border border-neutral rounded-md transition-colors duration-200",
|
|
497
497
|
"bg-module text-default",
|
|
498
498
|
"placeholder:text-default dark:placeholder:text-muted",
|
|
@@ -526,27 +526,27 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
526
526
|
{
|
|
527
527
|
ref: f,
|
|
528
528
|
type: "text",
|
|
529
|
-
value:
|
|
529
|
+
value: v(t ?? null),
|
|
530
530
|
placeholder: r,
|
|
531
531
|
disabled: n,
|
|
532
|
-
required:
|
|
532
|
+
required: s,
|
|
533
533
|
readOnly: !0,
|
|
534
|
-
onClick: () => !n && m(!
|
|
535
|
-
className: p(
|
|
534
|
+
onClick: () => !n && m(!l),
|
|
535
|
+
className: p(F, "pr-10 cursor-pointer")
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
538
|
/* @__PURE__ */ e(
|
|
539
539
|
"button",
|
|
540
540
|
{
|
|
541
541
|
type: "button",
|
|
542
|
-
onClick: () => !n && m(!
|
|
542
|
+
onClick: () => !n && m(!l),
|
|
543
543
|
disabled: n,
|
|
544
544
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted hover:text-muted",
|
|
545
545
|
children: /* @__PURE__ */ e(tt, {})
|
|
546
546
|
}
|
|
547
547
|
)
|
|
548
548
|
] }),
|
|
549
|
-
|
|
549
|
+
l && /* @__PURE__ */ d("div", { className: "absolute z-50 mt-1 bg-module border border-neutral rounded-md shadow-lg p-4 min-w-[280px]", children: [
|
|
550
550
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4", children: [
|
|
551
551
|
/* @__PURE__ */ e(
|
|
552
552
|
"button",
|
|
@@ -570,26 +570,26 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
570
570
|
}
|
|
571
571
|
)
|
|
572
572
|
] }),
|
|
573
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((
|
|
574
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: I.map((
|
|
575
|
-
const
|
|
573
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted text-center py-1", children: z }, z)) }),
|
|
574
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: I.map((z, W) => {
|
|
575
|
+
const V = z.getMonth() === h.getMonth(), i = t && z.toDateString() === t.toDateString(), y = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), E = !V || b && z < b || x && z > x;
|
|
576
576
|
return /* @__PURE__ */ e(
|
|
577
577
|
"button",
|
|
578
578
|
{
|
|
579
|
-
onClick: () => !
|
|
580
|
-
disabled:
|
|
579
|
+
onClick: () => !E && N(z),
|
|
580
|
+
disabled: E,
|
|
581
581
|
className: p(
|
|
582
582
|
"w-8 h-8 text-sm rounded transition-colors duration-200",
|
|
583
583
|
{
|
|
584
|
-
"text-default hover:bg-neutral-container":
|
|
584
|
+
"text-default hover:bg-neutral-container": V && !i && !E,
|
|
585
585
|
"bg-primary text-white": i,
|
|
586
|
-
"bg-neutral-container text-default":
|
|
587
|
-
"text-muted cursor-not-allowed":
|
|
586
|
+
"bg-neutral-container text-default": y && !i,
|
|
587
|
+
"text-muted cursor-not-allowed": E
|
|
588
588
|
}
|
|
589
589
|
),
|
|
590
|
-
children:
|
|
590
|
+
children: z.getDate()
|
|
591
591
|
},
|
|
592
|
-
|
|
592
|
+
W
|
|
593
593
|
);
|
|
594
594
|
}) }),
|
|
595
595
|
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral", children: [
|
|
@@ -653,7 +653,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
653
653
|
md: "px-3 py-2 text-sm",
|
|
654
654
|
lg: "px-3 py-2 text-sm",
|
|
655
655
|
full: "px-3 py-2 text-sm"
|
|
656
|
-
},
|
|
656
|
+
}, be = {
|
|
657
657
|
sm: "h-4 w-4",
|
|
658
658
|
md: "h-5 w-5",
|
|
659
659
|
lg: "h-6 w-6",
|
|
@@ -664,75 +664,75 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
664
664
|
helperText: a,
|
|
665
665
|
error: r,
|
|
666
666
|
size: n = "md",
|
|
667
|
-
fullWidth:
|
|
667
|
+
fullWidth: s = !1,
|
|
668
668
|
startIcon: o = /* @__PURE__ */ e(at, {}),
|
|
669
669
|
loading: u = !1,
|
|
670
670
|
containerClassName: b,
|
|
671
671
|
labelClassName: x,
|
|
672
672
|
className: g,
|
|
673
673
|
id: f,
|
|
674
|
-
options:
|
|
674
|
+
options: l,
|
|
675
675
|
onRemoteSearch: m,
|
|
676
676
|
onSelect: h,
|
|
677
677
|
debounceTime: w = 500,
|
|
678
678
|
showAllOnOpen: k = !1,
|
|
679
|
-
value:
|
|
679
|
+
value: v,
|
|
680
680
|
onChange: j,
|
|
681
681
|
...N
|
|
682
682
|
}, q) => {
|
|
683
|
-
const B = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, G = !!r,
|
|
683
|
+
const B = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, G = !!r, F = J(null), I = J(null), [H, z] = P(v || ""), [W, V] = P(!1), [i, y] = P(!1), [E, S] = P(!1);
|
|
684
684
|
U(() => {
|
|
685
|
-
|
|
686
|
-
}, [
|
|
687
|
-
const
|
|
688
|
-
if (k && !
|
|
689
|
-
const
|
|
690
|
-
return
|
|
691
|
-
(D) => String(D.label).toLowerCase().includes(
|
|
685
|
+
v !== void 0 && z(v);
|
|
686
|
+
}, [v]);
|
|
687
|
+
const M = de(() => {
|
|
688
|
+
if (k && !E || !H) return l;
|
|
689
|
+
const T = String(H).toLowerCase();
|
|
690
|
+
return l.filter(
|
|
691
|
+
(D) => String(D.label).toLowerCase().includes(T)
|
|
692
692
|
);
|
|
693
|
-
}, [H,
|
|
693
|
+
}, [H, l, k, E]);
|
|
694
694
|
U(() => {
|
|
695
695
|
if (!m || !H) {
|
|
696
|
-
|
|
696
|
+
y(!1);
|
|
697
697
|
return;
|
|
698
698
|
}
|
|
699
|
-
const
|
|
700
|
-
|
|
699
|
+
const T = setTimeout(async () => {
|
|
700
|
+
y(!0);
|
|
701
701
|
try {
|
|
702
702
|
await m(String(H));
|
|
703
703
|
} catch (D) {
|
|
704
704
|
console.error("Remote search failed:", D);
|
|
705
705
|
} finally {
|
|
706
|
-
|
|
706
|
+
y(!1);
|
|
707
707
|
}
|
|
708
708
|
}, w);
|
|
709
709
|
return () => {
|
|
710
|
-
clearTimeout(
|
|
710
|
+
clearTimeout(T), y(!1);
|
|
711
711
|
};
|
|
712
712
|
}, [H, w, m]), U(() => {
|
|
713
|
-
const
|
|
714
|
-
|
|
713
|
+
const T = (D) => {
|
|
714
|
+
F.current && !F.current.contains(D.target) && V(!1);
|
|
715
715
|
};
|
|
716
|
-
return document.addEventListener("mousedown",
|
|
716
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
717
717
|
}, []);
|
|
718
|
-
const
|
|
719
|
-
const D =
|
|
720
|
-
|
|
721
|
-
}, Q = (
|
|
722
|
-
T
|
|
718
|
+
const L = (T) => {
|
|
719
|
+
const D = T.target.value;
|
|
720
|
+
z(D), V(!0), S(!0), j && j(T);
|
|
721
|
+
}, Q = (T) => {
|
|
722
|
+
z(T.label), V(!1), S(!1), h && h(T.value);
|
|
723
723
|
}, re = () => {
|
|
724
|
-
(
|
|
725
|
-
}, X = u || i, $ =
|
|
724
|
+
(l.length > 0 || m) && (V(!0), S(!1));
|
|
725
|
+
}, X = u || i, $ = W && (M.length > 0 || X), A = de(() => q || I, [q]);
|
|
726
726
|
return /* @__PURE__ */ d(
|
|
727
727
|
"div",
|
|
728
728
|
{
|
|
729
729
|
className: ie(
|
|
730
730
|
"flex flex-col",
|
|
731
|
-
|
|
731
|
+
s ? "w-full" : "",
|
|
732
732
|
b || "",
|
|
733
733
|
"relative"
|
|
734
734
|
),
|
|
735
|
-
ref:
|
|
735
|
+
ref: F,
|
|
736
736
|
children: [
|
|
737
737
|
t && /* @__PURE__ */ e(
|
|
738
738
|
"label",
|
|
@@ -747,14 +747,14 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
747
747
|
}
|
|
748
748
|
),
|
|
749
749
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
750
|
-
o && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ie("text-muted",
|
|
750
|
+
o && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ie("text-muted", be[n]), children: o }) }),
|
|
751
751
|
/* @__PURE__ */ e(
|
|
752
752
|
"input",
|
|
753
753
|
{
|
|
754
754
|
ref: A,
|
|
755
755
|
id: B,
|
|
756
756
|
value: H,
|
|
757
|
-
onChange:
|
|
757
|
+
onChange: L,
|
|
758
758
|
onFocus: re,
|
|
759
759
|
className: ie(
|
|
760
760
|
// Base styles
|
|
@@ -779,7 +779,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
779
779
|
/* @__PURE__ */ d(
|
|
780
780
|
"svg",
|
|
781
781
|
{
|
|
782
|
-
className: ie("animate-spin text-link",
|
|
782
|
+
className: ie("animate-spin text-link", be[n]),
|
|
783
783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
784
784
|
fill: "none",
|
|
785
785
|
viewBox: "0 0 24 24",
|
|
@@ -813,11 +813,11 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
813
813
|
{
|
|
814
814
|
className: ie(
|
|
815
815
|
"text-muted cursor-pointer transition-transform",
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
be[n],
|
|
817
|
+
W ? "rotate-180" : "rotate-0"
|
|
818
818
|
),
|
|
819
819
|
onClick: () => {
|
|
820
|
-
|
|
820
|
+
V((T) => (T || S(!1), !T));
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
)
|
|
@@ -828,16 +828,16 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
828
828
|
{
|
|
829
829
|
className: "absolute z-10 mt-1 w-full bg-module border border-neutral rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
830
830
|
role: "listbox",
|
|
831
|
-
children:
|
|
831
|
+
children: M.length > 0 ? M.map((T) => /* @__PURE__ */ e(
|
|
832
832
|
"li",
|
|
833
833
|
{
|
|
834
834
|
className: "px-4 py-2 cursor-pointer text-default hover:bg-accent-container hover:text-accent transition-colors",
|
|
835
|
-
onClick: () => Q(
|
|
835
|
+
onClick: () => Q(T),
|
|
836
836
|
role: "option",
|
|
837
|
-
"aria-selected": H ===
|
|
838
|
-
children:
|
|
837
|
+
"aria-selected": H === T.label,
|
|
838
|
+
children: T.label
|
|
839
839
|
},
|
|
840
|
-
|
|
840
|
+
T.value
|
|
841
841
|
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-muted", children: X || u ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
842
842
|
}
|
|
843
843
|
),
|
|
@@ -866,87 +866,87 @@ const ct = {
|
|
|
866
866
|
md: "px-3 py-2 text-sm",
|
|
867
867
|
lg: "px-3 py-2 text-sm",
|
|
868
868
|
full: "px-3 py-2 text-sm"
|
|
869
|
-
}, me = (t) => t.trim().toLowerCase(),
|
|
869
|
+
}, me = (t) => t.trim().toLowerCase(), fe = ce(
|
|
870
870
|
({
|
|
871
871
|
label: t,
|
|
872
872
|
helperText: a,
|
|
873
873
|
error: r,
|
|
874
874
|
size: n = "md",
|
|
875
|
-
fullWidth:
|
|
875
|
+
fullWidth: s = !1,
|
|
876
876
|
options: o,
|
|
877
877
|
placeholder: u,
|
|
878
878
|
containerClassName: b,
|
|
879
879
|
labelClassName: x,
|
|
880
880
|
className: g,
|
|
881
881
|
id: f,
|
|
882
|
-
searchable:
|
|
882
|
+
searchable: l,
|
|
883
883
|
multiple: m,
|
|
884
884
|
value: h,
|
|
885
885
|
onChange: w,
|
|
886
886
|
allowCreate: k,
|
|
887
|
-
onCreateOption:
|
|
887
|
+
onCreateOption: v,
|
|
888
888
|
...j
|
|
889
889
|
}, N) => {
|
|
890
|
-
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, B = !!r, [G,
|
|
891
|
-
se.useImperativeHandle(N, () =>
|
|
890
|
+
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, B = !!r, [G, F] = se.useState(!1), [I, H] = se.useState(""), z = se.useRef(null), [W, V] = se.useState(o);
|
|
891
|
+
se.useImperativeHandle(N, () => z.current), se.useEffect(() => {
|
|
892
892
|
const $ = (A) => {
|
|
893
|
-
|
|
893
|
+
z.current && !z.current.contains(A.target) && F(!1);
|
|
894
894
|
};
|
|
895
895
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
896
896
|
}, []);
|
|
897
897
|
const i = se.useCallback(
|
|
898
898
|
($, A) => $.some(
|
|
899
|
-
(
|
|
899
|
+
(T) => me(T.value) === me(A) || me(T.label) === me(A)
|
|
900
900
|
),
|
|
901
901
|
[]
|
|
902
|
-
),
|
|
902
|
+
), y = se.useCallback(
|
|
903
903
|
($, A) => {
|
|
904
|
-
const
|
|
904
|
+
const T = [...$], D = (ee) => {
|
|
905
905
|
const ne = (ee ?? "").trim();
|
|
906
|
-
ne && (i(
|
|
906
|
+
ne && (i(T, ne) || T.push({ value: ne, label: ne }));
|
|
907
907
|
};
|
|
908
|
-
return Array.isArray(A) ? A.forEach(D) : D(A),
|
|
908
|
+
return Array.isArray(A) ? A.forEach(D) : D(A), T;
|
|
909
909
|
},
|
|
910
910
|
[i]
|
|
911
911
|
);
|
|
912
912
|
se.useEffect(() => {
|
|
913
|
-
|
|
913
|
+
V(($) => {
|
|
914
914
|
const A = [...o];
|
|
915
|
-
return $.forEach((
|
|
916
|
-
!i(A,
|
|
917
|
-
}),
|
|
915
|
+
return $.forEach((T) => {
|
|
916
|
+
!i(A, T.value) && !i(A, T.label) && A.push(T);
|
|
917
|
+
}), y(A, h);
|
|
918
918
|
});
|
|
919
|
-
}, [o, h,
|
|
920
|
-
const
|
|
919
|
+
}, [o, h, y, i]);
|
|
920
|
+
const E = ($) => {
|
|
921
921
|
if (m) {
|
|
922
|
-
const A = Array.isArray(h) ? h : [],
|
|
923
|
-
w?.(
|
|
922
|
+
const A = Array.isArray(h) ? h : [], T = A.includes($) ? A.filter((D) => D !== $) : [...A, $];
|
|
923
|
+
w?.(T);
|
|
924
924
|
} else
|
|
925
|
-
w?.($),
|
|
926
|
-
}, S = m ? null :
|
|
925
|
+
w?.($), F(!1), H("");
|
|
926
|
+
}, S = m ? null : W.find(($) => $.value === h), M = m ? W.filter(
|
|
927
927
|
($) => Array.isArray(h) && h.includes($.value)
|
|
928
|
-
) : [],
|
|
928
|
+
) : [], L = l && I ? W.filter(
|
|
929
929
|
($) => $.label.toLowerCase().includes(I.toLowerCase())
|
|
930
|
-
) :
|
|
930
|
+
) : W, Q = !!k && !!l && !!I.trim() && !i(W, I), re = ($) => {
|
|
931
931
|
const A = $.trim();
|
|
932
932
|
if (!A) return;
|
|
933
|
-
const
|
|
933
|
+
const T = v?.(A) ?? {
|
|
934
934
|
value: A,
|
|
935
935
|
label: A
|
|
936
936
|
};
|
|
937
|
-
if (i(
|
|
938
|
-
|
|
937
|
+
if (i(W, T.value) || i(W, T.label)) {
|
|
938
|
+
E(T.value), H(""), m || F(!1);
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
|
-
|
|
942
|
-
}, X = () => m ?
|
|
941
|
+
V((D) => [...D, T]), E(T.value), H(""), m || F(!1);
|
|
942
|
+
}, X = () => m ? M.length > 0 ? M.map(($) => $.label).join(", ") : u || "Select options" : S?.label || u || "Select an option";
|
|
943
943
|
return /* @__PURE__ */ d(
|
|
944
944
|
"div",
|
|
945
945
|
{
|
|
946
|
-
ref:
|
|
946
|
+
ref: z,
|
|
947
947
|
className: p(
|
|
948
948
|
"relative flex flex-col",
|
|
949
|
-
|
|
949
|
+
s && "w-full",
|
|
950
950
|
b
|
|
951
951
|
),
|
|
952
952
|
...j,
|
|
@@ -955,7 +955,7 @@ const ct = {
|
|
|
955
955
|
"label",
|
|
956
956
|
{
|
|
957
957
|
htmlFor: q,
|
|
958
|
-
onClick: () =>
|
|
958
|
+
onClick: () => F(!G),
|
|
959
959
|
className: p(
|
|
960
960
|
"block text-sm font-medium mb-1",
|
|
961
961
|
B ? "text-error" : "text-default",
|
|
@@ -970,7 +970,7 @@ const ct = {
|
|
|
970
970
|
{
|
|
971
971
|
type: "button",
|
|
972
972
|
id: q,
|
|
973
|
-
onClick: () =>
|
|
973
|
+
onClick: () => F(!G),
|
|
974
974
|
className: p(
|
|
975
975
|
"block w-full rounded-lg border transition-colors duration-200 text-left",
|
|
976
976
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
@@ -984,7 +984,7 @@ const ct = {
|
|
|
984
984
|
}
|
|
985
985
|
),
|
|
986
986
|
G && /* @__PURE__ */ d("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
|
|
987
|
-
|
|
987
|
+
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
988
988
|
"input",
|
|
989
989
|
{
|
|
990
990
|
type: "text",
|
|
@@ -1021,17 +1021,17 @@ const ct = {
|
|
|
1021
1021
|
{
|
|
1022
1022
|
className: "px-4 py-2 text-sm text-muted cursor-pointer hover:bg-neutral-container",
|
|
1023
1023
|
onClick: () => {
|
|
1024
|
-
w?.(""),
|
|
1024
|
+
w?.(""), F(!1);
|
|
1025
1025
|
},
|
|
1026
1026
|
children: u
|
|
1027
1027
|
}
|
|
1028
1028
|
),
|
|
1029
|
-
|
|
1029
|
+
L.map(($) => {
|
|
1030
1030
|
const A = m ? Array.isArray(h) && h.includes($.value) : h === $.value;
|
|
1031
1031
|
return /* @__PURE__ */ e(
|
|
1032
1032
|
"li",
|
|
1033
1033
|
{
|
|
1034
|
-
onClick: () => !$.disabled &&
|
|
1034
|
+
onClick: () => !$.disabled && E($.value),
|
|
1035
1035
|
className: p(
|
|
1036
1036
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1037
1037
|
"text-default",
|
|
@@ -1072,7 +1072,7 @@ const ct = {
|
|
|
1072
1072
|
);
|
|
1073
1073
|
}
|
|
1074
1074
|
);
|
|
1075
|
-
|
|
1075
|
+
fe.displayName = "Select";
|
|
1076
1076
|
const it = {
|
|
1077
1077
|
sm: "px-3 py-1.5 text-sm",
|
|
1078
1078
|
md: "px-3 py-2 text-sm",
|
|
@@ -1084,17 +1084,17 @@ const it = {
|
|
|
1084
1084
|
helperText: a,
|
|
1085
1085
|
error: r,
|
|
1086
1086
|
size: n = "md",
|
|
1087
|
-
fullWidth:
|
|
1087
|
+
fullWidth: s = !1,
|
|
1088
1088
|
loading: o = !1,
|
|
1089
1089
|
containerClassName: u,
|
|
1090
1090
|
labelClassName: b,
|
|
1091
1091
|
className: x,
|
|
1092
1092
|
id: g,
|
|
1093
1093
|
rows: f = 4,
|
|
1094
|
-
...
|
|
1094
|
+
...l
|
|
1095
1095
|
}, m) => {
|
|
1096
1096
|
const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
|
|
1097
|
-
return /* @__PURE__ */ d("div", { className: p("flex flex-col",
|
|
1097
|
+
return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", u), children: [
|
|
1098
1098
|
t && /* @__PURE__ */ e(
|
|
1099
1099
|
"label",
|
|
1100
1100
|
{
|
|
@@ -1125,7 +1125,7 @@ const it = {
|
|
|
1125
1125
|
w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
1126
1126
|
x
|
|
1127
1127
|
),
|
|
1128
|
-
...
|
|
1128
|
+
...l
|
|
1129
1129
|
}
|
|
1130
1130
|
),
|
|
1131
1131
|
o && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ d(
|
|
@@ -1177,7 +1177,7 @@ const dt = {
|
|
|
1177
1177
|
md: "px-3 py-2 text-sm",
|
|
1178
1178
|
lg: "px-3 py-2 text-sm",
|
|
1179
1179
|
full: "px-3 py-2 text-sm"
|
|
1180
|
-
},
|
|
1180
|
+
}, ge = {
|
|
1181
1181
|
sm: "h-4 w-4",
|
|
1182
1182
|
md: "h-5 w-5",
|
|
1183
1183
|
lg: "h-6 w-6",
|
|
@@ -1188,18 +1188,18 @@ const dt = {
|
|
|
1188
1188
|
helperText: a,
|
|
1189
1189
|
error: r,
|
|
1190
1190
|
size: n = "md",
|
|
1191
|
-
fullWidth:
|
|
1191
|
+
fullWidth: s = !1,
|
|
1192
1192
|
startIcon: o,
|
|
1193
1193
|
endIcon: u,
|
|
1194
1194
|
loading: b = !1,
|
|
1195
1195
|
containerClassName: x,
|
|
1196
1196
|
labelClassName: g,
|
|
1197
1197
|
className: f,
|
|
1198
|
-
id:
|
|
1198
|
+
id: l,
|
|
1199
1199
|
...m
|
|
1200
1200
|
}, h) => {
|
|
1201
|
-
const w =
|
|
1202
|
-
return /* @__PURE__ */ d("div", { className: p("flex flex-col",
|
|
1201
|
+
const w = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, k = !!r;
|
|
1202
|
+
return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", x), children: [
|
|
1203
1203
|
t && /* @__PURE__ */ e(
|
|
1204
1204
|
"label",
|
|
1205
1205
|
{
|
|
@@ -1214,7 +1214,7 @@ const dt = {
|
|
|
1214
1214
|
),
|
|
1215
1215
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1216
1216
|
o && // Todo fix inset not showing correctly on different sizes
|
|
1217
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: p("text-muted",
|
|
1217
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: p("text-muted", ge[n]), children: o }) }),
|
|
1218
1218
|
/* @__PURE__ */ e(
|
|
1219
1219
|
"input",
|
|
1220
1220
|
{
|
|
@@ -1240,7 +1240,7 @@ const dt = {
|
|
|
1240
1240
|
(u || b) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: b ? /* @__PURE__ */ d(
|
|
1241
1241
|
"svg",
|
|
1242
1242
|
{
|
|
1243
|
-
className: p("animate-spin text-muted",
|
|
1243
|
+
className: p("animate-spin text-muted", ge[n]),
|
|
1244
1244
|
fill: "none",
|
|
1245
1245
|
viewBox: "0 0 24 24",
|
|
1246
1246
|
children: [
|
|
@@ -1265,7 +1265,7 @@ const dt = {
|
|
|
1265
1265
|
)
|
|
1266
1266
|
]
|
|
1267
1267
|
}
|
|
1268
|
-
) : u && /* @__PURE__ */ e("span", { className: p("text-muted",
|
|
1268
|
+
) : u && /* @__PURE__ */ e("span", { className: p("text-muted", ge[n]), children: u }) })
|
|
1269
1269
|
] }),
|
|
1270
1270
|
(r || a) && /* @__PURE__ */ e(
|
|
1271
1271
|
"p",
|
|
@@ -1286,7 +1286,7 @@ const oe = ({
|
|
|
1286
1286
|
size: a = "md",
|
|
1287
1287
|
color: r = "current",
|
|
1288
1288
|
clickable: n = !1,
|
|
1289
|
-
onClick:
|
|
1289
|
+
onClick: s,
|
|
1290
1290
|
className: o,
|
|
1291
1291
|
"aria-label": u,
|
|
1292
1292
|
...b
|
|
@@ -1314,12 +1314,12 @@ const oe = ({
|
|
|
1314
1314
|
), f = {
|
|
1315
1315
|
size: x,
|
|
1316
1316
|
className: g,
|
|
1317
|
-
onClick: n ?
|
|
1317
|
+
onClick: n ? s : void 0,
|
|
1318
1318
|
"aria-label": u,
|
|
1319
1319
|
role: n ? "button" : void 0,
|
|
1320
1320
|
tabIndex: n ? 0 : void 0,
|
|
1321
|
-
onKeyDown: n ? (
|
|
1322
|
-
(
|
|
1321
|
+
onKeyDown: n ? (l) => {
|
|
1322
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s?.());
|
|
1323
1323
|
} : void 0,
|
|
1324
1324
|
...b
|
|
1325
1325
|
};
|
|
@@ -1349,14 +1349,14 @@ function mt({
|
|
|
1349
1349
|
] })
|
|
1350
1350
|
] }),
|
|
1351
1351
|
a && /* @__PURE__ */ d("div", { className: "rounded-lg overflow-hidden", children: [
|
|
1352
|
-
/* @__PURE__ */ e("div", { className: `grid grid-cols-${r} gap-2 bg-neutral-container p-3`, children: Array.from({ length: r }).map((
|
|
1352
|
+
/* @__PURE__ */ e("div", { className: `grid grid-cols-${r} gap-2 bg-neutral-container p-3`, children: Array.from({ length: r }).map((s, o) => /* @__PURE__ */ e(
|
|
1353
1353
|
"div",
|
|
1354
1354
|
{
|
|
1355
1355
|
className: "h-4 bg-neutral-border-emphasis rounded w-2/3"
|
|
1356
1356
|
},
|
|
1357
1357
|
`header-${o}`
|
|
1358
1358
|
)) }),
|
|
1359
|
-
Array.from({ length: n }).map((
|
|
1359
|
+
Array.from({ length: n }).map((s, o) => /* @__PURE__ */ e(
|
|
1360
1360
|
"div",
|
|
1361
1361
|
{
|
|
1362
1362
|
className: `grid grid-cols-${r} gap-2 p-3 border-t border-neutral`,
|
|
@@ -1378,68 +1378,68 @@ const ft = ({
|
|
|
1378
1378
|
options: a,
|
|
1379
1379
|
value: r,
|
|
1380
1380
|
onSelect: n,
|
|
1381
|
-
placement:
|
|
1381
|
+
placement: s = "bottom-start",
|
|
1382
1382
|
disabled: o = !1,
|
|
1383
1383
|
className: u,
|
|
1384
1384
|
showCheck: b = !0,
|
|
1385
1385
|
header: x
|
|
1386
1386
|
}) => {
|
|
1387
|
-
const [g, f] = P(!1), [
|
|
1387
|
+
const [g, f] = P(!1), [l, m] = P(null), [h, w] = P({ top: 0, left: 0 }), [k, v] = P({}), j = J(null), N = J(null), q = J(null), B = J(null);
|
|
1388
1388
|
U(() => {
|
|
1389
|
-
const i = (
|
|
1390
|
-
j.current && (!j.current.contains(
|
|
1389
|
+
const i = (y) => {
|
|
1390
|
+
j.current && (!j.current.contains(y.target) || q.current && !q.current.contains(y.target)) && (f(!1), m(null), B.current && (clearTimeout(B.current), B.current = null));
|
|
1391
1391
|
};
|
|
1392
1392
|
return g && document.addEventListener("mousedown", i), () => {
|
|
1393
1393
|
document.removeEventListener("mousedown", i);
|
|
1394
1394
|
};
|
|
1395
1395
|
}, [g]), U(() => {
|
|
1396
|
-
const i = (
|
|
1397
|
-
|
|
1396
|
+
const i = (y) => {
|
|
1397
|
+
y.key === "Escape" && (f(!1), m(null), B.current && (clearTimeout(B.current), B.current = null));
|
|
1398
1398
|
};
|
|
1399
1399
|
return g && document.addEventListener("keydown", i), () => {
|
|
1400
1400
|
document.removeEventListener("keydown", i);
|
|
1401
1401
|
};
|
|
1402
1402
|
}, [g]), U(() => {
|
|
1403
|
-
if (
|
|
1403
|
+
if (l && j.current) {
|
|
1404
1404
|
const i = j.current.querySelector(
|
|
1405
|
-
`[data-option-value="${
|
|
1405
|
+
`[data-option-value="${l}"]`
|
|
1406
1406
|
);
|
|
1407
1407
|
if (i) {
|
|
1408
|
-
const
|
|
1408
|
+
const y = i.getBoundingClientRect();
|
|
1409
1409
|
w({
|
|
1410
|
-
top:
|
|
1411
|
-
left:
|
|
1410
|
+
top: y.top,
|
|
1411
|
+
left: y.right + 8
|
|
1412
1412
|
});
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
-
}, [
|
|
1415
|
+
}, [l]), U(() => () => {
|
|
1416
1416
|
B.current && clearTimeout(B.current);
|
|
1417
1417
|
}, []);
|
|
1418
1418
|
const G = (i) => {
|
|
1419
1419
|
if (i.stopPropagation(), !o) {
|
|
1420
1420
|
if (!g) {
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1421
|
+
const y = N.current?.getBoundingClientRect();
|
|
1422
|
+
if (y) {
|
|
1423
1423
|
const S = {};
|
|
1424
|
-
|
|
1424
|
+
s.startsWith("bottom") ? S.top = y.bottom + 6 : S.bottom = window.innerHeight - y.top + 6, s.endsWith("start") ? S.left = y.left : S.right = window.innerWidth - y.right, v(S);
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
f(!g), m(null), B.current && (clearTimeout(B.current), B.current = null);
|
|
1428
1428
|
}
|
|
1429
|
-
},
|
|
1430
|
-
i.stopPropagation(), !
|
|
1429
|
+
}, F = (i, y, E) => {
|
|
1430
|
+
i.stopPropagation(), !y.disabled && !y.divider && (!y.children || y.children.length === 0) && (n?.(y.value, E), f(!1), m(null));
|
|
1431
1431
|
}, I = (i) => {
|
|
1432
1432
|
B.current && (clearTimeout(B.current), B.current = null), i.children && i.children.length > 0 ? m(i.value) : m(null);
|
|
1433
1433
|
}, H = (i) => {
|
|
1434
1434
|
i.children && i.children.length > 0 ? B.current = setTimeout(() => {
|
|
1435
1435
|
m(null);
|
|
1436
1436
|
}, 150) : m(null);
|
|
1437
|
-
},
|
|
1438
|
-
i.stopPropagation(), !
|
|
1439
|
-
},
|
|
1437
|
+
}, z = (i, y, E) => {
|
|
1438
|
+
i.stopPropagation(), !y.disabled && !y.divider && (n?.(y.value, E), f(!1), m(null));
|
|
1439
|
+
}, W = p(
|
|
1440
1440
|
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1441
1441
|
"max-h-60 overflow-auto"
|
|
1442
|
-
),
|
|
1442
|
+
), V = p(
|
|
1443
1443
|
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1444
1444
|
"max-h-60 overflow-auto"
|
|
1445
1445
|
);
|
|
@@ -1464,24 +1464,24 @@ const ft = ({
|
|
|
1464
1464
|
children: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
g && /* @__PURE__ */ e("div", { className:
|
|
1467
|
+
g && /* @__PURE__ */ e("div", { className: W, style: k, children: /* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
1468
1468
|
x && (typeof x == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: x }) : x),
|
|
1469
|
-
a.map((i,
|
|
1469
|
+
a.map((i, y) => {
|
|
1470
1470
|
if (i.divider)
|
|
1471
1471
|
return /* @__PURE__ */ e(
|
|
1472
1472
|
"div",
|
|
1473
1473
|
{
|
|
1474
1474
|
className: "border-t border-neutral my-2"
|
|
1475
1475
|
},
|
|
1476
|
-
`divider-${
|
|
1476
|
+
`divider-${y}`
|
|
1477
1477
|
);
|
|
1478
|
-
const
|
|
1478
|
+
const E = i.children && i.children.length > 0, S = l === i.value;
|
|
1479
1479
|
return /* @__PURE__ */ d("div", { className: "relative group", children: [
|
|
1480
1480
|
/* @__PURE__ */ d(
|
|
1481
1481
|
"button",
|
|
1482
1482
|
{
|
|
1483
1483
|
"data-option-value": i.value,
|
|
1484
|
-
onClick: (
|
|
1484
|
+
onClick: (M) => F(M, i),
|
|
1485
1485
|
onMouseEnter: () => I(i),
|
|
1486
1486
|
onMouseLeave: () => H(i),
|
|
1487
1487
|
disabled: i.disabled,
|
|
@@ -1489,7 +1489,7 @@ const ft = ({
|
|
|
1489
1489
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1490
1490
|
{
|
|
1491
1491
|
"opacity-50 cursor-not-allowed": i.disabled,
|
|
1492
|
-
"bg-neutral-container": S &&
|
|
1492
|
+
"bg-neutral-container": S && E
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
children: [
|
|
@@ -1502,16 +1502,16 @@ const ft = ({
|
|
|
1502
1502
|
] }),
|
|
1503
1503
|
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
|
|
1504
1504
|
b && r === i.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
|
|
1505
|
-
|
|
1505
|
+
E && /* @__PURE__ */ e("span", { className: "text-muted text-xs", children: "▶" })
|
|
1506
1506
|
] })
|
|
1507
1507
|
]
|
|
1508
1508
|
}
|
|
1509
1509
|
),
|
|
1510
|
-
|
|
1510
|
+
E && S && /* @__PURE__ */ e(
|
|
1511
1511
|
"div",
|
|
1512
1512
|
{
|
|
1513
1513
|
ref: q,
|
|
1514
|
-
className:
|
|
1514
|
+
className: V,
|
|
1515
1515
|
style: {
|
|
1516
1516
|
top: `${h.top}px`,
|
|
1517
1517
|
left: `${h.left}px`
|
|
@@ -1524,45 +1524,45 @@ const ft = ({
|
|
|
1524
1524
|
m(null);
|
|
1525
1525
|
}, 150);
|
|
1526
1526
|
},
|
|
1527
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((
|
|
1528
|
-
if (
|
|
1527
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((M, L) => {
|
|
1528
|
+
if (M.divider)
|
|
1529
1529
|
return /* @__PURE__ */ e(
|
|
1530
1530
|
"div",
|
|
1531
1531
|
{
|
|
1532
1532
|
className: "border-t border-neutral my-2"
|
|
1533
1533
|
},
|
|
1534
|
-
`divider-${
|
|
1534
|
+
`divider-${L}`
|
|
1535
1535
|
);
|
|
1536
1536
|
const Q = typeof r == "object" && r[i.value] && r[i.value].includes(
|
|
1537
|
-
|
|
1538
|
-
) || r ===
|
|
1537
|
+
M.value
|
|
1538
|
+
) || r === M.value;
|
|
1539
1539
|
return /* @__PURE__ */ d(
|
|
1540
1540
|
"button",
|
|
1541
1541
|
{
|
|
1542
|
-
onClick: (re) =>
|
|
1542
|
+
onClick: (re) => z(
|
|
1543
1543
|
re,
|
|
1544
|
-
|
|
1544
|
+
M,
|
|
1545
1545
|
i.value
|
|
1546
1546
|
),
|
|
1547
|
-
disabled:
|
|
1547
|
+
disabled: M.disabled,
|
|
1548
1548
|
className: p(
|
|
1549
1549
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1550
1550
|
{
|
|
1551
|
-
"opacity-50 cursor-not-allowed":
|
|
1551
|
+
"opacity-50 cursor-not-allowed": M.disabled
|
|
1552
1552
|
}
|
|
1553
1553
|
),
|
|
1554
1554
|
children: [
|
|
1555
1555
|
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1556
|
-
|
|
1556
|
+
M.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: M.icon }),
|
|
1557
1557
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1558
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1559
|
-
|
|
1558
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: M.label }),
|
|
1559
|
+
M.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: M.description })
|
|
1560
1560
|
] })
|
|
1561
1561
|
] }),
|
|
1562
1562
|
b && Q && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
|
|
1563
1563
|
]
|
|
1564
1564
|
},
|
|
1565
|
-
|
|
1565
|
+
M.value
|
|
1566
1566
|
);
|
|
1567
1567
|
}) })
|
|
1568
1568
|
}
|
|
@@ -1570,10 +1570,10 @@ const ft = ({
|
|
|
1570
1570
|
] }, i.value);
|
|
1571
1571
|
}),
|
|
1572
1572
|
(() => {
|
|
1573
|
-
const i = a.reduce((
|
|
1574
|
-
if (
|
|
1575
|
-
const S =
|
|
1576
|
-
return
|
|
1573
|
+
const i = a.reduce((y, E) => {
|
|
1574
|
+
if (E.divider) return y;
|
|
1575
|
+
const S = E.children ? E.children.filter((M) => !M.divider).length : 0;
|
|
1576
|
+
return y + 1 + S;
|
|
1577
1577
|
}, 0);
|
|
1578
1578
|
return i > 1 && /* @__PURE__ */ e("div", { className: "border-t border-neutral mt-2 pt-2", children: /* @__PURE__ */ d("div", { className: "text-xs text-muted px-3 py-1", children: [
|
|
1579
1579
|
i,
|
|
@@ -1728,10 +1728,10 @@ const ft = ({
|
|
|
1728
1728
|
}
|
|
1729
1729
|
), Nt = (t) => {
|
|
1730
1730
|
const a = (n) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(n) : t.value === n, r = (n) => {
|
|
1731
|
-
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((
|
|
1731
|
+
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((s) => s !== n)) : t.onChange(n);
|
|
1732
1732
|
};
|
|
1733
1733
|
return t.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[160px]", children: /* @__PURE__ */ e(
|
|
1734
|
-
|
|
1734
|
+
ve,
|
|
1735
1735
|
{
|
|
1736
1736
|
size: "sm",
|
|
1737
1737
|
value: t.value,
|
|
@@ -1743,7 +1743,7 @@ const ft = ({
|
|
|
1743
1743
|
/* @__PURE__ */ d("summary", { className: "flex items-center space-x-2 cursor-pointer rounded-full px-3 py-2 text-sm btn btn o__secondary", children: [
|
|
1744
1744
|
/* @__PURE__ */ e("span", { children: t.label }),
|
|
1745
1745
|
/* @__PURE__ */ e("span", { className: "text-default", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1746
|
-
(n) => t.options?.find((
|
|
1746
|
+
(n) => t.options?.find((s) => s.value === n)?.label
|
|
1747
1747
|
).join(", ") : t.options?.find((n) => n.value === t.value)?.label }),
|
|
1748
1748
|
/* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(De, {}) })
|
|
1749
1749
|
] }),
|
|
@@ -1778,31 +1778,31 @@ const ft = ({
|
|
|
1778
1778
|
columns: a,
|
|
1779
1779
|
loading: r = !1,
|
|
1780
1780
|
searchable: n = !1,
|
|
1781
|
-
searchPlaceholder:
|
|
1781
|
+
searchPlaceholder: s = "Search...",
|
|
1782
1782
|
filters: o = [],
|
|
1783
1783
|
paginated: u = !1,
|
|
1784
1784
|
pageSizeOptions: b = [10, 25, 50, 100],
|
|
1785
1785
|
defaultPageSize: x = 10,
|
|
1786
1786
|
actions: g = [],
|
|
1787
1787
|
onRowClick: f,
|
|
1788
|
-
selectable:
|
|
1788
|
+
selectable: l = !1,
|
|
1789
1789
|
selectedRows: m = [],
|
|
1790
1790
|
onSelectionChange: h,
|
|
1791
|
-
getRowKey: w = (G,
|
|
1791
|
+
getRowKey: w = (G, F) => F,
|
|
1792
1792
|
emptyContent: k,
|
|
1793
|
-
hoverable:
|
|
1793
|
+
hoverable: v = !0,
|
|
1794
1794
|
bordered: j = !1,
|
|
1795
1795
|
striped: N = !1,
|
|
1796
1796
|
className: q,
|
|
1797
1797
|
rowClassName: B
|
|
1798
1798
|
}) => {
|
|
1799
|
-
const [G,
|
|
1799
|
+
const [G, F] = P(""), [I, H] = P({
|
|
1800
1800
|
column: null,
|
|
1801
1801
|
direction: null
|
|
1802
|
-
}), [
|
|
1802
|
+
}), [z, W] = P({
|
|
1803
1803
|
page: 0,
|
|
1804
1804
|
pageSize: x
|
|
1805
|
-
}),
|
|
1805
|
+
}), V = J(null), i = de(() => {
|
|
1806
1806
|
let c = t;
|
|
1807
1807
|
if (n && G.trim()) {
|
|
1808
1808
|
const C = a.filter(
|
|
@@ -1821,7 +1821,7 @@ const ft = ({
|
|
|
1821
1821
|
return String(_ || "") === C.value;
|
|
1822
1822
|
}));
|
|
1823
1823
|
}), c;
|
|
1824
|
-
}, [t, G, a, n, o]),
|
|
1824
|
+
}, [t, G, a, n, o]), y = de(() => {
|
|
1825
1825
|
if (!I.column || !I.direction) return i;
|
|
1826
1826
|
const c = a.find((C) => C.id === I.column);
|
|
1827
1827
|
return c ? [...i].sort((C, O) => {
|
|
@@ -1829,19 +1829,19 @@ const ft = ({
|
|
|
1829
1829
|
let Y = 0;
|
|
1830
1830
|
return R < _ ? Y = -1 : R > _ && (Y = 1), I.direction === "desc" ? -Y : Y;
|
|
1831
1831
|
}) : i;
|
|
1832
|
-
}, [i, I, a]),
|
|
1833
|
-
if (!u) return
|
|
1834
|
-
const c =
|
|
1835
|
-
return
|
|
1836
|
-
}, [
|
|
1832
|
+
}, [i, I, a]), E = de(() => {
|
|
1833
|
+
if (!u) return y;
|
|
1834
|
+
const c = z.page * z.pageSize, C = c + z.pageSize;
|
|
1835
|
+
return y.slice(c, C);
|
|
1836
|
+
}, [y, z, u]), S = ae(
|
|
1837
1837
|
(c) => {
|
|
1838
1838
|
a.find((O) => O.id === c)?.sortable && H((O) => O.column !== c ? { column: c, direction: "asc" } : O.direction === "asc" ? { column: c, direction: "desc" } : { column: null, direction: null });
|
|
1839
1839
|
},
|
|
1840
1840
|
[a]
|
|
1841
|
-
),
|
|
1842
|
-
|
|
1843
|
-
}, []),
|
|
1844
|
-
|
|
1841
|
+
), M = ae((c) => {
|
|
1842
|
+
W((C) => ({ ...C, page: c }));
|
|
1843
|
+
}, []), L = ae((c) => {
|
|
1844
|
+
W({ page: 0, pageSize: c });
|
|
1845
1845
|
}, []), Q = ae(
|
|
1846
1846
|
(c, C) => {
|
|
1847
1847
|
if (!h) return;
|
|
@@ -1853,21 +1853,21 @@ const ft = ({
|
|
|
1853
1853
|
[m, h, w]
|
|
1854
1854
|
), re = ae(
|
|
1855
1855
|
(c) => {
|
|
1856
|
-
h && h(c ? [...
|
|
1856
|
+
h && h(c ? [...E] : []);
|
|
1857
1857
|
},
|
|
1858
|
-
[
|
|
1858
|
+
[E, h]
|
|
1859
1859
|
);
|
|
1860
1860
|
U(() => {
|
|
1861
|
-
|
|
1861
|
+
W((c) => ({ ...c, page: 0 }));
|
|
1862
1862
|
}, [G, I]), U(() => {
|
|
1863
|
-
|
|
1863
|
+
W((c) => ({ ...c, page: 0 }));
|
|
1864
1864
|
}, [o.map((c) => c.value).join(",")]);
|
|
1865
|
-
const X =
|
|
1865
|
+
const X = y.length, $ = Math.ceil(X / z.pageSize), A = z.page * z.pageSize + 1, T = Math.min(A + z.pageSize - 1, X), D = E.length > 0 && E.every((c) => {
|
|
1866
1866
|
const C = w(c, 0);
|
|
1867
1867
|
return m.some(
|
|
1868
1868
|
(O, R) => w(O, R) === C
|
|
1869
1869
|
);
|
|
1870
|
-
}), ee =
|
|
1870
|
+
}), ee = E.some((c) => {
|
|
1871
1871
|
const C = w(c, 0);
|
|
1872
1872
|
return m.some(
|
|
1873
1873
|
(O, R) => w(O, R) === C
|
|
@@ -1877,8 +1877,8 @@ const ft = ({
|
|
|
1877
1877
|
q
|
|
1878
1878
|
), K = p("bg-[var(--base-module)]"), le = p(
|
|
1879
1879
|
"text-[var(--text-default)] p-3 border-b border-[var(--neutral-border)]"
|
|
1880
|
-
),
|
|
1881
|
-
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]":
|
|
1880
|
+
), he = p("h-12", {
|
|
1881
|
+
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": v,
|
|
1882
1882
|
"cursor-pointer": f
|
|
1883
1883
|
});
|
|
1884
1884
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
@@ -1887,9 +1887,9 @@ const ft = ({
|
|
|
1887
1887
|
/* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
|
|
1888
1888
|
ue,
|
|
1889
1889
|
{
|
|
1890
|
-
placeholder:
|
|
1890
|
+
placeholder: s,
|
|
1891
1891
|
value: G,
|
|
1892
|
-
onChange: (c) =>
|
|
1892
|
+
onChange: (c) => F(c.target.value),
|
|
1893
1893
|
startIcon: /* @__PURE__ */ e(ht, {}),
|
|
1894
1894
|
className: "max-w-sm"
|
|
1895
1895
|
}
|
|
@@ -1904,9 +1904,9 @@ const ft = ({
|
|
|
1904
1904
|
tableColumns: a.length
|
|
1905
1905
|
}
|
|
1906
1906
|
) }),
|
|
1907
|
-
/* @__PURE__ */ d("table", { ref:
|
|
1907
|
+
/* @__PURE__ */ d("table", { ref: V, className: p(ne, "min-w-full"), children: [
|
|
1908
1908
|
/* @__PURE__ */ e("thead", { className: K, children: /* @__PURE__ */ d("tr", { children: [
|
|
1909
|
-
|
|
1909
|
+
l && /* @__PURE__ */ e("th", { className: p(le, "w-12"), children: /* @__PURE__ */ e(
|
|
1910
1910
|
"input",
|
|
1911
1911
|
{
|
|
1912
1912
|
type: "checkbox",
|
|
@@ -1967,17 +1967,17 @@ const ft = ({
|
|
|
1967
1967
|
)),
|
|
1968
1968
|
g.length > 0 && /* @__PURE__ */ e("th", { className: p(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1969
1969
|
] }) }),
|
|
1970
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
1970
|
+
/* @__PURE__ */ e("tbody", { children: E.length === 0 || r ? !r && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1971
1971
|
"td",
|
|
1972
1972
|
{
|
|
1973
|
-
colSpan: a.length + (
|
|
1973
|
+
colSpan: a.length + (l ? 1 : 0) + (g.length > 0 ? 1 : 0),
|
|
1974
1974
|
className: p(
|
|
1975
1975
|
le,
|
|
1976
1976
|
"text-center py-8 text-muted"
|
|
1977
1977
|
),
|
|
1978
1978
|
children: k || "No data available"
|
|
1979
1979
|
}
|
|
1980
|
-
) }) :
|
|
1980
|
+
) }) : E.map((c, C) => {
|
|
1981
1981
|
const O = w(c, C), R = m.some(
|
|
1982
1982
|
(_, Y) => w(_, Y) === O
|
|
1983
1983
|
);
|
|
@@ -1985,7 +1985,7 @@ const ft = ({
|
|
|
1985
1985
|
"tr",
|
|
1986
1986
|
{
|
|
1987
1987
|
className: p(
|
|
1988
|
-
|
|
1988
|
+
he,
|
|
1989
1989
|
{ "bg-accent-container": R },
|
|
1990
1990
|
B?.(c, C)
|
|
1991
1991
|
),
|
|
@@ -1993,7 +1993,7 @@ const ft = ({
|
|
|
1993
1993
|
_.stopPropagation(), f?.(c, C);
|
|
1994
1994
|
},
|
|
1995
1995
|
children: [
|
|
1996
|
-
|
|
1996
|
+
l && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
1997
1997
|
"input",
|
|
1998
1998
|
{
|
|
1999
1999
|
type: "checkbox",
|
|
@@ -2036,7 +2036,7 @@ const ft = ({
|
|
|
2036
2036
|
})),
|
|
2037
2037
|
onSelect: (_) => {
|
|
2038
2038
|
const Y = g.find(
|
|
2039
|
-
(
|
|
2039
|
+
(pe) => pe.id === _
|
|
2040
2040
|
);
|
|
2041
2041
|
Y && Y.onClick(c, C);
|
|
2042
2042
|
},
|
|
@@ -2056,7 +2056,7 @@ const ft = ({
|
|
|
2056
2056
|
"Showing ",
|
|
2057
2057
|
A,
|
|
2058
2058
|
" to ",
|
|
2059
|
-
|
|
2059
|
+
T,
|
|
2060
2060
|
" of ",
|
|
2061
2061
|
X,
|
|
2062
2062
|
" results"
|
|
@@ -2066,8 +2066,8 @@ const ft = ({
|
|
|
2066
2066
|
/* @__PURE__ */ e(
|
|
2067
2067
|
"select",
|
|
2068
2068
|
{
|
|
2069
|
-
value:
|
|
2070
|
-
onChange: (c) =>
|
|
2069
|
+
value: z.pageSize,
|
|
2070
|
+
onChange: (c) => L(Number(c.target.value)),
|
|
2071
2071
|
className: "border border-[var(--neutral-border)] text-[var(--text-default)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] w-16",
|
|
2072
2072
|
children: b.map((c) => /* @__PURE__ */ e("option", { value: c, children: c }, c))
|
|
2073
2073
|
}
|
|
@@ -2080,8 +2080,8 @@ const ft = ({
|
|
|
2080
2080
|
{
|
|
2081
2081
|
size: "sm",
|
|
2082
2082
|
variant: "ghost",
|
|
2083
|
-
onClick: () =>
|
|
2084
|
-
disabled:
|
|
2083
|
+
onClick: () => M(0),
|
|
2084
|
+
disabled: z.page === 0,
|
|
2085
2085
|
iconOnly: !0,
|
|
2086
2086
|
children: /* @__PURE__ */ e(yt, {})
|
|
2087
2087
|
}
|
|
@@ -2091,15 +2091,15 @@ const ft = ({
|
|
|
2091
2091
|
{
|
|
2092
2092
|
size: "sm",
|
|
2093
2093
|
variant: "ghost",
|
|
2094
|
-
onClick: () =>
|
|
2095
|
-
disabled:
|
|
2094
|
+
onClick: () => M(z.page - 1),
|
|
2095
|
+
disabled: z.page === 0,
|
|
2096
2096
|
iconOnly: !0,
|
|
2097
2097
|
children: /* @__PURE__ */ e(bt, {})
|
|
2098
2098
|
}
|
|
2099
2099
|
),
|
|
2100
2100
|
/* @__PURE__ */ d("span", { className: "px-3 py-1 text-sm text-muted", children: [
|
|
2101
2101
|
"Page ",
|
|
2102
|
-
|
|
2102
|
+
z.page + 1,
|
|
2103
2103
|
" of ",
|
|
2104
2104
|
$
|
|
2105
2105
|
] }),
|
|
@@ -2108,8 +2108,8 @@ const ft = ({
|
|
|
2108
2108
|
{
|
|
2109
2109
|
size: "sm",
|
|
2110
2110
|
variant: "ghost",
|
|
2111
|
-
onClick: () =>
|
|
2112
|
-
disabled:
|
|
2111
|
+
onClick: () => M(z.page + 1),
|
|
2112
|
+
disabled: z.page >= $ - 1,
|
|
2113
2113
|
iconOnly: !0,
|
|
2114
2114
|
children: /* @__PURE__ */ e(gt, {})
|
|
2115
2115
|
}
|
|
@@ -2119,8 +2119,8 @@ const ft = ({
|
|
|
2119
2119
|
{
|
|
2120
2120
|
size: "sm",
|
|
2121
2121
|
variant: "ghost",
|
|
2122
|
-
onClick: () =>
|
|
2123
|
-
disabled:
|
|
2122
|
+
onClick: () => M($ - 1),
|
|
2123
|
+
disabled: z.page >= $ - 1,
|
|
2124
2124
|
iconOnly: !0,
|
|
2125
2125
|
children: /* @__PURE__ */ e(vt, {})
|
|
2126
2126
|
}
|
|
@@ -2128,13 +2128,13 @@ const ft = ({
|
|
|
2128
2128
|
] })
|
|
2129
2129
|
] })
|
|
2130
2130
|
] });
|
|
2131
|
-
}, wt = Ge(null),
|
|
2131
|
+
}, wt = Ge(null), or = ({
|
|
2132
2132
|
items: t,
|
|
2133
2133
|
activeTab: a,
|
|
2134
2134
|
onTabChange: r,
|
|
2135
2135
|
className: n
|
|
2136
2136
|
}) => {
|
|
2137
|
-
const [
|
|
2137
|
+
const [s, o] = P(t[0]?.id || ""), u = a || s, b = (x) => {
|
|
2138
2138
|
r ? r(x) : o(x);
|
|
2139
2139
|
};
|
|
2140
2140
|
return /* @__PURE__ */ e("div", { className: p("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((x) => /* @__PURE__ */ e(
|
|
@@ -2165,7 +2165,7 @@ const ft = ({
|
|
|
2165
2165
|
defaultTab: a,
|
|
2166
2166
|
activeTab: r,
|
|
2167
2167
|
onTabChange: n,
|
|
2168
|
-
variant:
|
|
2168
|
+
variant: s = "default",
|
|
2169
2169
|
size: o = "md",
|
|
2170
2170
|
className: u
|
|
2171
2171
|
}) => {
|
|
@@ -2173,44 +2173,44 @@ const ft = ({
|
|
|
2173
2173
|
a || r || t[0]?.id || ""
|
|
2174
2174
|
), g = r || b, f = (k) => {
|
|
2175
2175
|
n ? n(k) : x(k);
|
|
2176
|
-
},
|
|
2176
|
+
}, l = {
|
|
2177
2177
|
activeTab: g,
|
|
2178
2178
|
setActiveTab: f
|
|
2179
2179
|
}, m = t.find((k) => k.id === g), h = p(
|
|
2180
2180
|
"flex",
|
|
2181
2181
|
{
|
|
2182
|
-
"border-b border-neutral-200 dark:border-neutral-700 px-2":
|
|
2183
|
-
"bg-neutral-100 dark:bg-neutral-800 p-1 rounded-lg":
|
|
2184
|
-
"space-x-1":
|
|
2185
|
-
"space-x-8":
|
|
2182
|
+
"border-b border-neutral-200 dark:border-neutral-700 px-2": s === "default" || s === "underline",
|
|
2183
|
+
"bg-neutral-100 dark:bg-neutral-800 p-1 rounded-lg": s === "pills",
|
|
2184
|
+
"space-x-1": s === "pills",
|
|
2185
|
+
"space-x-8": s === "default" || s === "underline"
|
|
2186
2186
|
},
|
|
2187
2187
|
u
|
|
2188
|
-
), w = (k,
|
|
2188
|
+
), w = (k, v) => {
|
|
2189
2189
|
const j = "transition-colors duration-200 font-medium", N = {
|
|
2190
2190
|
"text-xs px-2 py-1": o === "sm",
|
|
2191
2191
|
"text-sm px-3 py-2": o === "md",
|
|
2192
2192
|
"text-base px-4 py-3": o === "lg"
|
|
2193
2193
|
}, q = {
|
|
2194
2194
|
// Default variant
|
|
2195
|
-
"border-b-2 -mb-px":
|
|
2195
|
+
"border-b-2 -mb-px": s === "default",
|
|
2196
2196
|
// Pills variant
|
|
2197
|
-
"rounded-md":
|
|
2197
|
+
"rounded-md": s === "pills",
|
|
2198
2198
|
// Underline variant
|
|
2199
|
-
"border-b-2 pb-2":
|
|
2199
|
+
"border-b-2 pb-2": s === "underline"
|
|
2200
2200
|
}, B = {
|
|
2201
2201
|
"opacity-50 cursor-not-allowed": k.disabled,
|
|
2202
2202
|
"cursor-pointer": !k.disabled
|
|
2203
|
-
}, G =
|
|
2204
|
-
"border-primary text-primary":
|
|
2205
|
-
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm":
|
|
2206
|
-
} : {},
|
|
2207
|
-
"border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100":
|
|
2208
|
-
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100":
|
|
2209
|
-
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100":
|
|
2203
|
+
}, G = v ? {
|
|
2204
|
+
"border-primary text-primary": s === "default" || s === "underline",
|
|
2205
|
+
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
|
|
2206
|
+
} : {}, F = !v && !k.disabled ? {
|
|
2207
|
+
"border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "default",
|
|
2208
|
+
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
|
|
2209
|
+
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
|
|
2210
2210
|
} : {};
|
|
2211
|
-
return p(j, N, q, B, G,
|
|
2211
|
+
return p(j, N, q, B, G, F);
|
|
2212
2212
|
};
|
|
2213
|
-
return /* @__PURE__ */ e(wt.Provider, { value:
|
|
2213
|
+
return /* @__PURE__ */ e(wt.Provider, { value: l, children: /* @__PURE__ */ d("div", { children: [
|
|
2214
2214
|
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((k) => /* @__PURE__ */ e(
|
|
2215
2215
|
"button",
|
|
2216
2216
|
{
|
|
@@ -2251,7 +2251,7 @@ function St({
|
|
|
2251
2251
|
onClose: a,
|
|
2252
2252
|
title: r,
|
|
2253
2253
|
size: n = "md",
|
|
2254
|
-
closeOnBackdropClick:
|
|
2254
|
+
closeOnBackdropClick: s = !0,
|
|
2255
2255
|
closeOnEscape: o = !0,
|
|
2256
2256
|
className: u,
|
|
2257
2257
|
backdropClassName: b,
|
|
@@ -2259,18 +2259,18 @@ function St({
|
|
|
2259
2259
|
footer: g,
|
|
2260
2260
|
showCloseButton: f = !0
|
|
2261
2261
|
}) {
|
|
2262
|
-
const
|
|
2262
|
+
const l = J(null), m = J(null);
|
|
2263
2263
|
U(() => {
|
|
2264
2264
|
if (!t || !o) return;
|
|
2265
2265
|
const w = (k) => {
|
|
2266
2266
|
k.key === "Escape" && a();
|
|
2267
2267
|
};
|
|
2268
2268
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
2269
|
-
}, [t, o, a]), U(() => (t ? (m.current = document.activeElement,
|
|
2269
|
+
}, [t, o, a]), U(() => (t ? (m.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (m.current && m.current.focus(), document.body.style.overflow = ""), () => {
|
|
2270
2270
|
document.body.style.overflow = "";
|
|
2271
2271
|
}), [t]);
|
|
2272
2272
|
const h = (w) => {
|
|
2273
|
-
|
|
2273
|
+
s && w.target === w.currentTarget && a();
|
|
2274
2274
|
};
|
|
2275
2275
|
return t ? /* @__PURE__ */ e(
|
|
2276
2276
|
"div",
|
|
@@ -2285,7 +2285,7 @@ function St({
|
|
|
2285
2285
|
children: /* @__PURE__ */ d(
|
|
2286
2286
|
"div",
|
|
2287
2287
|
{
|
|
2288
|
-
ref:
|
|
2288
|
+
ref: l,
|
|
2289
2289
|
className: p(
|
|
2290
2290
|
"relative w-full bg-module rounded-modal shadow-modal rounded-md",
|
|
2291
2291
|
// 'animate-scale-in',
|
|
@@ -2330,14 +2330,14 @@ const Z = ({
|
|
|
2330
2330
|
size: a = "md",
|
|
2331
2331
|
weight: r = "normal",
|
|
2332
2332
|
color: n = "current",
|
|
2333
|
-
align:
|
|
2333
|
+
align: s = "left",
|
|
2334
2334
|
truncate: o = !1,
|
|
2335
2335
|
italic: u = !1,
|
|
2336
2336
|
underline: b = !1,
|
|
2337
2337
|
lineHeight: x = "normal",
|
|
2338
2338
|
as: g,
|
|
2339
2339
|
className: f,
|
|
2340
|
-
children:
|
|
2340
|
+
children: l,
|
|
2341
2341
|
...m
|
|
2342
2342
|
}) => {
|
|
2343
2343
|
const h = g || Lt(t), w = p(
|
|
@@ -2384,10 +2384,10 @@ const Z = ({
|
|
|
2384
2384
|
},
|
|
2385
2385
|
// Alignment
|
|
2386
2386
|
{
|
|
2387
|
-
"text-left":
|
|
2388
|
-
"text-center":
|
|
2389
|
-
"text-right":
|
|
2390
|
-
"text-justify":
|
|
2387
|
+
"text-left": s === "left",
|
|
2388
|
+
"text-center": s === "center",
|
|
2389
|
+
"text-right": s === "right",
|
|
2390
|
+
"text-justify": s === "justify"
|
|
2391
2391
|
},
|
|
2392
2392
|
// Line height (override variant line heights)
|
|
2393
2393
|
t === "body" && {
|
|
@@ -2403,7 +2403,7 @@ const Z = ({
|
|
|
2403
2403
|
},
|
|
2404
2404
|
f
|
|
2405
2405
|
);
|
|
2406
|
-
return /* @__PURE__ */ e(h, { className: w, ...m, children:
|
|
2406
|
+
return /* @__PURE__ */ e(h, { className: w, ...m, children: l });
|
|
2407
2407
|
};
|
|
2408
2408
|
function Lt(t) {
|
|
2409
2409
|
return {
|
|
@@ -2418,24 +2418,24 @@ const Et = ({
|
|
|
2418
2418
|
onChange: a,
|
|
2419
2419
|
label: r,
|
|
2420
2420
|
placeholder: n = "Select or upload a file",
|
|
2421
|
-
error:
|
|
2421
|
+
error: s,
|
|
2422
2422
|
disabled: o,
|
|
2423
2423
|
accept: u,
|
|
2424
2424
|
onListFiles: b,
|
|
2425
2425
|
onListMounts: x,
|
|
2426
2426
|
onUploadFile: g,
|
|
2427
2427
|
onDownloadFile: f,
|
|
2428
|
-
onRegisterFile:
|
|
2428
|
+
onRegisterFile: l
|
|
2429
2429
|
}) => {
|
|
2430
|
-
const [m, h] = P(!1), [w, k] = P([]), [
|
|
2430
|
+
const [m, h] = P(!1), [w, k] = P([]), [v, j] = P(null), [N, q] = P("/"), [B, G] = P([]), [F, I] = P(!1), [H, z] = P(""), [W, V] = P(
|
|
2431
2431
|
typeof t == "object" ? t : null
|
|
2432
|
-
), [i,
|
|
2432
|
+
), [i, y] = P(!1), [E, S] = P(""), M = J(null);
|
|
2433
2433
|
U(() => {
|
|
2434
|
-
m &&
|
|
2434
|
+
m && L();
|
|
2435
2435
|
}, [m]), U(() => {
|
|
2436
|
-
m &&
|
|
2437
|
-
}, [m,
|
|
2438
|
-
const
|
|
2436
|
+
m && v && Q();
|
|
2437
|
+
}, [m, v, N, H]);
|
|
2438
|
+
const L = async () => {
|
|
2439
2439
|
I(!0);
|
|
2440
2440
|
try {
|
|
2441
2441
|
const c = await x?.();
|
|
@@ -2446,10 +2446,10 @@ const Et = ({
|
|
|
2446
2446
|
I(!1);
|
|
2447
2447
|
}
|
|
2448
2448
|
}, Q = async () => {
|
|
2449
|
-
if (
|
|
2449
|
+
if (v) {
|
|
2450
2450
|
I(!0);
|
|
2451
2451
|
try {
|
|
2452
|
-
const c = await b?.({ mountId:
|
|
2452
|
+
const c = await b?.({ mountId: v.id, name: H, path: N });
|
|
2453
2453
|
c?.data && G(c.data);
|
|
2454
2454
|
} catch (c) {
|
|
2455
2455
|
console.error("Failed to load files", c);
|
|
@@ -2473,7 +2473,7 @@ const Et = ({
|
|
|
2473
2473
|
providerKey: C.name,
|
|
2474
2474
|
ownerId: "me"
|
|
2475
2475
|
};
|
|
2476
|
-
|
|
2476
|
+
V(_), a(_, R), h(!1);
|
|
2477
2477
|
} catch (O) {
|
|
2478
2478
|
console.error("Local file selection failed", O);
|
|
2479
2479
|
} finally {
|
|
@@ -2482,19 +2482,19 @@ const Et = ({
|
|
|
2482
2482
|
}
|
|
2483
2483
|
}, X = async (c) => {
|
|
2484
2484
|
const C = c.target.files?.[0];
|
|
2485
|
-
if (!(!C || !
|
|
2485
|
+
if (!(!C || !v)) {
|
|
2486
2486
|
I(!0);
|
|
2487
2487
|
try {
|
|
2488
2488
|
const O = await C.arrayBuffer(), R = await g?.({
|
|
2489
2489
|
file: new Uint8Array(O),
|
|
2490
2490
|
filename: C.name,
|
|
2491
2491
|
mimeType: C.type || "application/octet-stream",
|
|
2492
|
-
mountId:
|
|
2492
|
+
mountId: v.id,
|
|
2493
2493
|
path: N
|
|
2494
2494
|
});
|
|
2495
2495
|
if (R?.data) {
|
|
2496
2496
|
const _ = R.data;
|
|
2497
|
-
|
|
2497
|
+
V(_), a(_, new Uint8Array(O)), h(!1);
|
|
2498
2498
|
}
|
|
2499
2499
|
} catch (O) {
|
|
2500
2500
|
console.error("Upload failed", O);
|
|
@@ -2503,20 +2503,20 @@ const Et = ({
|
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
2505
|
}, $ = async () => {
|
|
2506
|
-
if (!(!
|
|
2506
|
+
if (!(!E || !v)) {
|
|
2507
2507
|
I(!0);
|
|
2508
2508
|
try {
|
|
2509
|
-
const c = `${N}${
|
|
2510
|
-
|
|
2511
|
-
name:
|
|
2509
|
+
const c = `${N}${E}/`;
|
|
2510
|
+
l && (await l({
|
|
2511
|
+
name: E,
|
|
2512
2512
|
type: "folder",
|
|
2513
2513
|
path: N,
|
|
2514
2514
|
mimeType: "application/x-directory",
|
|
2515
2515
|
size: 0,
|
|
2516
|
-
mountId:
|
|
2516
|
+
mountId: v.id,
|
|
2517
2517
|
providerKey: c,
|
|
2518
2518
|
ownerId: "me"
|
|
2519
|
-
}), await Q()),
|
|
2519
|
+
}), await Q()), y(!1), S("");
|
|
2520
2520
|
} catch (c) {
|
|
2521
2521
|
console.error("Failed to create folder", c);
|
|
2522
2522
|
} finally {
|
|
@@ -2527,14 +2527,14 @@ const Et = ({
|
|
|
2527
2527
|
I(!0);
|
|
2528
2528
|
try {
|
|
2529
2529
|
const C = await f?.(c.id);
|
|
2530
|
-
|
|
2530
|
+
V(c), a(c, C), h(!1);
|
|
2531
2531
|
} catch (C) {
|
|
2532
2532
|
console.error("Failed to download file", C);
|
|
2533
2533
|
} finally {
|
|
2534
2534
|
I(!1);
|
|
2535
2535
|
}
|
|
2536
|
-
},
|
|
2537
|
-
c.stopPropagation(),
|
|
2536
|
+
}, T = (c) => {
|
|
2537
|
+
c.stopPropagation(), V(null), a(null);
|
|
2538
2538
|
}, D = de(() => {
|
|
2539
2539
|
const c = /* @__PURE__ */ new Set(), C = [];
|
|
2540
2540
|
return B.forEach((O) => {
|
|
@@ -2542,7 +2542,7 @@ const Et = ({
|
|
|
2542
2542
|
O.path === N && c.add(O.name);
|
|
2543
2543
|
return;
|
|
2544
2544
|
}
|
|
2545
|
-
const R = O.providerKey || O.name, Y = (N ? R.substring(N.length) : R).split("/").filter((
|
|
2545
|
+
const R = O.providerKey || O.name, Y = (N ? R.substring(N.length) : R).split("/").filter((pe) => pe !== "");
|
|
2546
2546
|
Y.length > 1 ? c.add(Y[0]) : Y.length === 1 && C.push(O);
|
|
2547
2547
|
}), {
|
|
2548
2548
|
folders: Array.from(c).sort(),
|
|
@@ -2574,7 +2574,7 @@ const Et = ({
|
|
|
2574
2574
|
/* @__PURE__ */ e(
|
|
2575
2575
|
oe,
|
|
2576
2576
|
{
|
|
2577
|
-
icon: C.type === "folder" ? Ce :
|
|
2577
|
+
icon: C.type === "folder" ? Ce : xe,
|
|
2578
2578
|
size: "sm",
|
|
2579
2579
|
color: C.type === "folder" ? "warning" : "secondary"
|
|
2580
2580
|
}
|
|
@@ -2605,12 +2605,12 @@ const Et = ({
|
|
|
2605
2605
|
onClick: (O) => {
|
|
2606
2606
|
O.stopPropagation(), C.type === "folder" ? ee(C.name) : A(C);
|
|
2607
2607
|
},
|
|
2608
|
-
loading:
|
|
2608
|
+
loading: F && C.type === "file" && W?.id === C.id,
|
|
2609
2609
|
children: C.type === "folder" ? "Open" : "Select"
|
|
2610
2610
|
}
|
|
2611
2611
|
)
|
|
2612
2612
|
}
|
|
2613
|
-
],
|
|
2613
|
+
], he = [
|
|
2614
2614
|
{
|
|
2615
2615
|
id: "name",
|
|
2616
2616
|
header: "Mount Name",
|
|
@@ -2637,32 +2637,32 @@ const Et = ({
|
|
|
2637
2637
|
className: p(
|
|
2638
2638
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2639
2639
|
"hover:border-primary-400 bg-module",
|
|
2640
|
-
|
|
2640
|
+
s ? "border-error" : "border-neutral",
|
|
2641
2641
|
o && "opacity-50 cursor-not-allowed bg-module-subtle"
|
|
2642
2642
|
),
|
|
2643
2643
|
children: [
|
|
2644
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon:
|
|
2645
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2646
|
-
|
|
2644
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: W ? xe : ke, color: W ? "primary" : "secondary" }) }),
|
|
2645
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: W ? /* @__PURE__ */ e("span", { className: "text-sm text-default font-medium", children: W.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: n }) }),
|
|
2646
|
+
W && !o && /* @__PURE__ */ e(
|
|
2647
2647
|
"button",
|
|
2648
2648
|
{
|
|
2649
|
-
onClick:
|
|
2649
|
+
onClick: T,
|
|
2650
2650
|
className: "p-1 hover:bg-neutral-container rounded",
|
|
2651
|
-
children: /* @__PURE__ */ e(oe, { icon:
|
|
2651
|
+
children: /* @__PURE__ */ e(oe, { icon: Fe, size: "xs" })
|
|
2652
2652
|
}
|
|
2653
2653
|
)
|
|
2654
2654
|
]
|
|
2655
2655
|
}
|
|
2656
2656
|
),
|
|
2657
|
-
|
|
2657
|
+
s && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: s }),
|
|
2658
2658
|
/* @__PURE__ */ e(
|
|
2659
2659
|
St,
|
|
2660
2660
|
{
|
|
2661
2661
|
open: m,
|
|
2662
2662
|
onClose: () => {
|
|
2663
|
-
h(!1), j(null), q("/"),
|
|
2663
|
+
h(!1), j(null), q("/"), y(!1);
|
|
2664
2664
|
},
|
|
2665
|
-
title:
|
|
2665
|
+
title: v ? `Explorer: ${v.name}` : "Select Storage Mount",
|
|
2666
2666
|
size: "lg",
|
|
2667
2667
|
children: /* @__PURE__ */ e(
|
|
2668
2668
|
kt,
|
|
@@ -2672,7 +2672,7 @@ const Et = ({
|
|
|
2672
2672
|
{
|
|
2673
2673
|
id: "remote",
|
|
2674
2674
|
label: "Platform Storage",
|
|
2675
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2675
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: v ? /* @__PURE__ */ d($e, { children: [
|
|
2676
2676
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2677
2677
|
/* @__PURE__ */ e(
|
|
2678
2678
|
te,
|
|
@@ -2692,8 +2692,8 @@ const Et = ({
|
|
|
2692
2692
|
{
|
|
2693
2693
|
placeholder: "Search...",
|
|
2694
2694
|
value: H,
|
|
2695
|
-
onChange: (c) =>
|
|
2696
|
-
startIcon: /* @__PURE__ */ e(
|
|
2695
|
+
onChange: (c) => z(c.target.value),
|
|
2696
|
+
startIcon: /* @__PURE__ */ e(Te, { size: 14 }),
|
|
2697
2697
|
fullWidth: !0,
|
|
2698
2698
|
size: "sm"
|
|
2699
2699
|
}
|
|
@@ -2704,8 +2704,8 @@ const Et = ({
|
|
|
2704
2704
|
{
|
|
2705
2705
|
variant: "outline",
|
|
2706
2706
|
size: "sm",
|
|
2707
|
-
onClick: () =>
|
|
2708
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2707
|
+
onClick: () => y(!0),
|
|
2708
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Ve, size: "xs" }),
|
|
2709
2709
|
children: "New Folder"
|
|
2710
2710
|
}
|
|
2711
2711
|
),
|
|
@@ -2714,9 +2714,9 @@ const Et = ({
|
|
|
2714
2714
|
{
|
|
2715
2715
|
variant: "primary",
|
|
2716
2716
|
size: "sm",
|
|
2717
|
-
onClick: () =>
|
|
2717
|
+
onClick: () => M.current?.click(),
|
|
2718
2718
|
leftIcon: /* @__PURE__ */ e(oe, { icon: Re, size: "xs" }),
|
|
2719
|
-
loading:
|
|
2719
|
+
loading: F,
|
|
2720
2720
|
children: "Upload"
|
|
2721
2721
|
}
|
|
2722
2722
|
),
|
|
@@ -2725,7 +2725,7 @@ const Et = ({
|
|
|
2725
2725
|
{
|
|
2726
2726
|
type: "file",
|
|
2727
2727
|
className: "hidden",
|
|
2728
|
-
ref:
|
|
2728
|
+
ref: M,
|
|
2729
2729
|
onChange: X,
|
|
2730
2730
|
accept: u
|
|
2731
2731
|
}
|
|
@@ -2739,20 +2739,20 @@ const Et = ({
|
|
|
2739
2739
|
{
|
|
2740
2740
|
size: "sm",
|
|
2741
2741
|
placeholder: "Folder name",
|
|
2742
|
-
value:
|
|
2742
|
+
value: E,
|
|
2743
2743
|
onChange: (c) => S(c.target.value),
|
|
2744
2744
|
autoFocus: !0
|
|
2745
2745
|
}
|
|
2746
2746
|
),
|
|
2747
|
-
/* @__PURE__ */ e(te, { size: "sm", onClick: $, loading:
|
|
2748
|
-
/* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () =>
|
|
2747
|
+
/* @__PURE__ */ e(te, { size: "sm", onClick: $, loading: F, children: "Create" }),
|
|
2748
|
+
/* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () => y(!1), children: "Cancel" })
|
|
2749
2749
|
] }),
|
|
2750
2750
|
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2751
2751
|
Le,
|
|
2752
2752
|
{
|
|
2753
2753
|
data: K,
|
|
2754
2754
|
columns: le,
|
|
2755
|
-
loading:
|
|
2755
|
+
loading: F,
|
|
2756
2756
|
emptyContent: "This folder is empty",
|
|
2757
2757
|
onRowClick: (c) => c.type === "folder" ? ee(c.name) : A(c)
|
|
2758
2758
|
}
|
|
@@ -2761,8 +2761,8 @@ const Et = ({
|
|
|
2761
2761
|
Le,
|
|
2762
2762
|
{
|
|
2763
2763
|
data: w,
|
|
2764
|
-
columns:
|
|
2765
|
-
loading:
|
|
2764
|
+
columns: he,
|
|
2765
|
+
loading: F,
|
|
2766
2766
|
emptyContent: "No storage mounts configured",
|
|
2767
2767
|
onRowClick: (c) => j(c)
|
|
2768
2768
|
}
|
|
@@ -2772,7 +2772,7 @@ const Et = ({
|
|
|
2772
2772
|
id: "local",
|
|
2773
2773
|
label: "Local File",
|
|
2774
2774
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral rounded-xl bg-module-subtle/50", children: [
|
|
2775
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon:
|
|
2775
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
|
|
2776
2776
|
/* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2777
2777
|
/* @__PURE__ */ d(Z, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2778
2778
|
"This file will be used directly in the form and will ",
|
|
@@ -2782,9 +2782,9 @@ const Et = ({
|
|
|
2782
2782
|
/* @__PURE__ */ d("label", { className: "cursor-pointer", children: [
|
|
2783
2783
|
/* @__PURE__ */ d("div", { className: p(
|
|
2784
2784
|
"inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 px-6 py-3 text-base bg-primary text-white hover:bg-primary-600",
|
|
2785
|
-
|
|
2785
|
+
F && "opacity-50 cursor-wait"
|
|
2786
2786
|
), children: [
|
|
2787
|
-
|
|
2787
|
+
F && /* @__PURE__ */ d("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2788
2788
|
/* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2789
2789
|
/* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
2790
2790
|
] }),
|
|
@@ -2797,7 +2797,7 @@ const Et = ({
|
|
|
2797
2797
|
className: "hidden",
|
|
2798
2798
|
onChange: re,
|
|
2799
2799
|
accept: u,
|
|
2800
|
-
disabled:
|
|
2800
|
+
disabled: F
|
|
2801
2801
|
}
|
|
2802
2802
|
)
|
|
2803
2803
|
] })
|
|
@@ -2810,129 +2810,174 @@ const Et = ({
|
|
|
2810
2810
|
)
|
|
2811
2811
|
] });
|
|
2812
2812
|
};
|
|
2813
|
+
function Mt({
|
|
2814
|
+
value: t,
|
|
2815
|
+
onChange: a,
|
|
2816
|
+
onListFolders: r,
|
|
2817
|
+
disabled: n,
|
|
2818
|
+
size: s = "md",
|
|
2819
|
+
placeholder: o,
|
|
2820
|
+
templatePlaceholder: u,
|
|
2821
|
+
showTemplate: b = !0
|
|
2822
|
+
}) {
|
|
2823
|
+
const [x, g] = P([]);
|
|
2824
|
+
U(() => {
|
|
2825
|
+
let l = !0;
|
|
2826
|
+
return Promise.resolve(r?.()).then((m) => {
|
|
2827
|
+
l && m && g(m.data ?? []);
|
|
2828
|
+
}).catch(() => {
|
|
2829
|
+
}), () => {
|
|
2830
|
+
l = !1;
|
|
2831
|
+
};
|
|
2832
|
+
}, []);
|
|
2833
|
+
const f = t ?? {};
|
|
2834
|
+
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-2", children: [
|
|
2835
|
+
/* @__PURE__ */ e(
|
|
2836
|
+
fe,
|
|
2837
|
+
{
|
|
2838
|
+
size: s,
|
|
2839
|
+
fullWidth: !0,
|
|
2840
|
+
value: f.folderId ?? "",
|
|
2841
|
+
options: x.map((l) => ({ value: l.id, label: l.name })),
|
|
2842
|
+
placeholder: o ?? "Select a folder",
|
|
2843
|
+
onChange: (l) => a?.({ ...f, folderId: l })
|
|
2844
|
+
}
|
|
2845
|
+
),
|
|
2846
|
+
b && /* @__PURE__ */ e(
|
|
2847
|
+
ue,
|
|
2848
|
+
{
|
|
2849
|
+
size: s,
|
|
2850
|
+
disabled: n ?? !1,
|
|
2851
|
+
value: f.pathTemplate ?? "",
|
|
2852
|
+
placeholder: u ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
2853
|
+
onChange: (l) => a?.({ ...f, pathTemplate: l.target.value })
|
|
2854
|
+
}
|
|
2855
|
+
)
|
|
2856
|
+
] });
|
|
2857
|
+
}
|
|
2813
2858
|
function Ee(t, a) {
|
|
2814
2859
|
return a.split(".").reduce(
|
|
2815
2860
|
(r, n) => r && typeof r == "object" && n in r ? r[n] : void 0,
|
|
2816
2861
|
t
|
|
2817
2862
|
);
|
|
2818
2863
|
}
|
|
2819
|
-
function
|
|
2820
|
-
const n = a.split("."),
|
|
2821
|
-
let o =
|
|
2864
|
+
function $t(t, a, r) {
|
|
2865
|
+
const n = a.split("."), s = Array.isArray(t) ? [...t] : { ...t };
|
|
2866
|
+
let o = s;
|
|
2822
2867
|
for (let u = 0; u < n.length - 1; u++) {
|
|
2823
2868
|
const b = n[u], x = o[b];
|
|
2824
2869
|
o[b] = x && typeof x == "object" ? Array.isArray(x) ? [...x] : { ...x } : {}, o = o[b];
|
|
2825
2870
|
}
|
|
2826
|
-
return o[n[n.length - 1]] = r,
|
|
2871
|
+
return o[n[n.length - 1]] = r, s;
|
|
2827
2872
|
}
|
|
2828
|
-
function
|
|
2873
|
+
function Tt(t, a) {
|
|
2829
2874
|
const r = a.split("."), n = Array.isArray(t) ? [...t] : { ...t };
|
|
2830
|
-
let
|
|
2875
|
+
let s = n;
|
|
2831
2876
|
for (let o = 0; o < r.length - 1; o++) {
|
|
2832
2877
|
const u = r[o];
|
|
2833
|
-
if (!
|
|
2834
|
-
|
|
2878
|
+
if (!s[u] || typeof s[u] != "object") return n;
|
|
2879
|
+
s[u] = Array.isArray(s[u]) ? [...s[u]] : { ...s[u] }, s = s[u];
|
|
2835
2880
|
}
|
|
2836
|
-
return delete
|
|
2881
|
+
return delete s[r[r.length - 1]], n;
|
|
2837
2882
|
}
|
|
2838
|
-
const
|
|
2883
|
+
const cr = ({
|
|
2839
2884
|
groups: t,
|
|
2840
2885
|
data: a,
|
|
2841
2886
|
onSubmit: r,
|
|
2842
2887
|
onCancel: n,
|
|
2843
|
-
onChange:
|
|
2888
|
+
onChange: s,
|
|
2844
2889
|
transform: o,
|
|
2845
2890
|
validate: u,
|
|
2846
2891
|
submitButton: b = { label: "Submit", variant: "primary" },
|
|
2847
2892
|
cancelButton: x = { label: "Cancel", variant: "outline" },
|
|
2848
2893
|
showButtons: g = !0,
|
|
2849
2894
|
layout: f = "vertical",
|
|
2850
|
-
size:
|
|
2895
|
+
size: l = "md",
|
|
2851
2896
|
loading: m = !1,
|
|
2852
2897
|
className: h,
|
|
2853
2898
|
ref: w,
|
|
2854
2899
|
sdk: k
|
|
2855
2900
|
}) => {
|
|
2856
|
-
const [
|
|
2901
|
+
const [v, j] = P(a || {}), [N, q] = P({}), [B, G] = P({});
|
|
2857
2902
|
U(() => {
|
|
2858
2903
|
a && j({ ...a });
|
|
2859
2904
|
}, [a]);
|
|
2860
|
-
const
|
|
2861
|
-
(i,
|
|
2862
|
-
const S = t.flatMap((
|
|
2905
|
+
const F = ae(
|
|
2906
|
+
(i, y, E) => {
|
|
2907
|
+
const S = t.flatMap((M) => M.items).find((M) => M.name === i);
|
|
2863
2908
|
if (!S) return null;
|
|
2864
|
-
if (S.required && (
|
|
2909
|
+
if (S.required && (y == null || y === ""))
|
|
2865
2910
|
return `${S.label} is required`;
|
|
2866
2911
|
if (S.type === "array") {
|
|
2867
|
-
if (S.required && (!
|
|
2912
|
+
if (S.required && (!y || y.length === 0))
|
|
2868
2913
|
return `${S.label} cannot be empty.`;
|
|
2869
|
-
if (
|
|
2914
|
+
if (y && !Array.isArray(y))
|
|
2870
2915
|
return `${S.label} must be an array.`;
|
|
2871
|
-
if (Array.isArray(
|
|
2872
|
-
const
|
|
2873
|
-
let
|
|
2874
|
-
if (
|
|
2916
|
+
if (Array.isArray(y) && S.arrayFields) {
|
|
2917
|
+
const M = [];
|
|
2918
|
+
let L = !1;
|
|
2919
|
+
if (y.forEach((Q, re) => {
|
|
2875
2920
|
const X = {};
|
|
2876
2921
|
for (const $ of S.arrayFields) {
|
|
2877
2922
|
const A = Q?.[$.name];
|
|
2878
2923
|
if ($.required && (A == null || A === ""))
|
|
2879
|
-
X[$.name] = `${$.label} is required`,
|
|
2924
|
+
X[$.name] = `${$.label} is required`, L = !0;
|
|
2880
2925
|
else if ($.validator) {
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2926
|
+
const T = $.validator(A, Q);
|
|
2927
|
+
T && (X[$.name] = T, L = !0);
|
|
2883
2928
|
}
|
|
2884
2929
|
}
|
|
2885
|
-
|
|
2886
|
-
}),
|
|
2887
|
-
return JSON.stringify(
|
|
2930
|
+
M[re] = X;
|
|
2931
|
+
}), L)
|
|
2932
|
+
return JSON.stringify(M);
|
|
2888
2933
|
}
|
|
2889
2934
|
}
|
|
2890
|
-
return S.validator ? S.validator(
|
|
2935
|
+
return S.validator ? S.validator(y, E) : null;
|
|
2891
2936
|
},
|
|
2892
2937
|
[t]
|
|
2893
2938
|
), I = ae(
|
|
2894
|
-
(i,
|
|
2895
|
-
let
|
|
2896
|
-
|
|
2939
|
+
(i, y) => {
|
|
2940
|
+
let E = $t(
|
|
2941
|
+
v,
|
|
2897
2942
|
i,
|
|
2898
|
-
|
|
2943
|
+
y
|
|
2899
2944
|
);
|
|
2900
|
-
t.flatMap((
|
|
2901
|
-
const
|
|
2902
|
-
q((
|
|
2903
|
-
...
|
|
2904
|
-
[i]:
|
|
2905
|
-
})),
|
|
2945
|
+
t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (y == null || y === "") && (E = Tt(E, i)), j(E), G((L) => ({ ...L, [i]: !0 }));
|
|
2946
|
+
const M = F(i, y, E);
|
|
2947
|
+
q((L) => ({
|
|
2948
|
+
...L,
|
|
2949
|
+
[i]: M || ""
|
|
2950
|
+
})), s?.(E, i);
|
|
2906
2951
|
},
|
|
2907
|
-
[
|
|
2952
|
+
[v, t, F, s]
|
|
2908
2953
|
), H = ae(
|
|
2909
2954
|
async (i) => {
|
|
2910
2955
|
if (console.log("handleSubmit"), i.preventDefault(), m) return;
|
|
2911
|
-
const
|
|
2912
|
-
for (const
|
|
2913
|
-
if (
|
|
2956
|
+
const y = {}, E = t.flatMap((M) => M.items);
|
|
2957
|
+
for (const M of E) {
|
|
2958
|
+
if (M.hidden || M.conditional && !M.conditional(v))
|
|
2914
2959
|
continue;
|
|
2915
|
-
const
|
|
2916
|
-
|
|
2917
|
-
Ee(
|
|
2918
|
-
|
|
2960
|
+
const L = F(
|
|
2961
|
+
M.name,
|
|
2962
|
+
Ee(v, M.name),
|
|
2963
|
+
v
|
|
2919
2964
|
);
|
|
2920
|
-
|
|
2965
|
+
L && (y[M.name] = L);
|
|
2921
2966
|
}
|
|
2922
2967
|
if (u) {
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2968
|
+
const M = u(v);
|
|
2969
|
+
M && Object.assign(y, M);
|
|
2925
2970
|
}
|
|
2926
|
-
if (q(
|
|
2971
|
+
if (q(y), console.log("newErrors", y), Object.keys(y).some((M) => y[M]))
|
|
2927
2972
|
return;
|
|
2928
|
-
const S = o ? o(
|
|
2929
|
-
await r?.(
|
|
2973
|
+
const S = o ? o(v) : v;
|
|
2974
|
+
await r?.(v, S);
|
|
2930
2975
|
},
|
|
2931
|
-
[
|
|
2932
|
-
),
|
|
2976
|
+
[v, t, F, u, o, r, m]
|
|
2977
|
+
), z = ae(
|
|
2933
2978
|
(i) => {
|
|
2934
|
-
const
|
|
2935
|
-
value:
|
|
2979
|
+
const y = Ee(v, i.name), E = B[i.name] ? N[i.name] : void 0, S = i.disabled || m, M = {
|
|
2980
|
+
value: y || "",
|
|
2936
2981
|
disabled: S,
|
|
2937
2982
|
required: i.required,
|
|
2938
2983
|
placeholder: i.placeholder,
|
|
@@ -2948,142 +2993,157 @@ const or = ({
|
|
|
2948
2993
|
return /* @__PURE__ */ e(
|
|
2949
2994
|
ue,
|
|
2950
2995
|
{
|
|
2951
|
-
...
|
|
2952
|
-
onChange: (
|
|
2996
|
+
...M,
|
|
2997
|
+
onChange: (L) => I(i.name, L.target.value),
|
|
2953
2998
|
type: i.textType || i.type,
|
|
2954
2999
|
autoComplete: i.autocomplete,
|
|
2955
|
-
error:
|
|
2956
|
-
size:
|
|
3000
|
+
error: E,
|
|
3001
|
+
size: l
|
|
2957
3002
|
}
|
|
2958
3003
|
);
|
|
2959
3004
|
case "textarea":
|
|
2960
3005
|
return /* @__PURE__ */ e(
|
|
2961
3006
|
Ne,
|
|
2962
3007
|
{
|
|
2963
|
-
...
|
|
2964
|
-
onChange: (
|
|
3008
|
+
...M,
|
|
3009
|
+
onChange: (L) => I(i.name, L.target.value),
|
|
2965
3010
|
rows: 4,
|
|
2966
|
-
error:
|
|
2967
|
-
size:
|
|
3011
|
+
error: E,
|
|
3012
|
+
size: l
|
|
2968
3013
|
}
|
|
2969
3014
|
);
|
|
2970
3015
|
case "select":
|
|
2971
3016
|
return /* @__PURE__ */ e(
|
|
2972
|
-
|
|
3017
|
+
fe,
|
|
2973
3018
|
{
|
|
2974
|
-
...
|
|
2975
|
-
onChange: (
|
|
2976
|
-
options: (i.options || []).map((
|
|
2977
|
-
...
|
|
2978
|
-
value: String(
|
|
3019
|
+
...M,
|
|
3020
|
+
onChange: (L) => I(i.name, L),
|
|
3021
|
+
options: (i.options || []).map((L) => ({
|
|
3022
|
+
...L,
|
|
3023
|
+
value: String(L.value)
|
|
2979
3024
|
})),
|
|
2980
3025
|
searchable: i.searchable,
|
|
2981
3026
|
multiple: i.multiple,
|
|
2982
3027
|
allowCreate: i.allowCreate,
|
|
2983
|
-
error:
|
|
2984
|
-
size:
|
|
3028
|
+
error: E,
|
|
3029
|
+
size: l
|
|
2985
3030
|
}
|
|
2986
3031
|
);
|
|
2987
3032
|
case "checkbox":
|
|
2988
3033
|
return /* @__PURE__ */ e(
|
|
2989
|
-
|
|
3034
|
+
ye,
|
|
2990
3035
|
{
|
|
2991
|
-
...
|
|
2992
|
-
checked: !!
|
|
2993
|
-
onChange: (
|
|
2994
|
-
size:
|
|
3036
|
+
...M,
|
|
3037
|
+
checked: !!y,
|
|
3038
|
+
onChange: (L) => I(i.name, L.target.checked),
|
|
3039
|
+
size: l
|
|
2995
3040
|
}
|
|
2996
3041
|
);
|
|
2997
3042
|
case "radio":
|
|
2998
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children: i.options?.map((
|
|
3043
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: i.options?.map((L) => /* @__PURE__ */ d("label", { className: "flex items-center gap-2", children: [
|
|
2999
3044
|
/* @__PURE__ */ e(
|
|
3000
3045
|
"input",
|
|
3001
3046
|
{
|
|
3002
3047
|
type: "radio",
|
|
3003
3048
|
name: i.name,
|
|
3004
|
-
value:
|
|
3005
|
-
checked:
|
|
3006
|
-
onChange: () => I(i.name,
|
|
3007
|
-
disabled: S ||
|
|
3049
|
+
value: L.value,
|
|
3050
|
+
checked: y === L.value,
|
|
3051
|
+
onChange: () => I(i.name, L.value),
|
|
3052
|
+
disabled: S || L.disabled,
|
|
3008
3053
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
3009
3054
|
}
|
|
3010
3055
|
),
|
|
3011
|
-
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children:
|
|
3012
|
-
] },
|
|
3056
|
+
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: L.label })
|
|
3057
|
+
] }, L.value)) });
|
|
3013
3058
|
case "date":
|
|
3014
3059
|
return /* @__PURE__ */ e(
|
|
3015
|
-
|
|
3060
|
+
ve,
|
|
3016
3061
|
{
|
|
3017
|
-
...
|
|
3018
|
-
value:
|
|
3019
|
-
onChange: (
|
|
3020
|
-
size:
|
|
3062
|
+
...M,
|
|
3063
|
+
value: y ? new Date(y) : null,
|
|
3064
|
+
onChange: (L) => I(i.name, L),
|
|
3065
|
+
size: l
|
|
3021
3066
|
}
|
|
3022
3067
|
);
|
|
3023
3068
|
case "file":
|
|
3024
3069
|
return /* @__PURE__ */ e(
|
|
3025
3070
|
Et,
|
|
3026
3071
|
{
|
|
3027
|
-
...
|
|
3028
|
-
value:
|
|
3029
|
-
onChange: (
|
|
3030
|
-
error:
|
|
3031
|
-
onListFiles: (
|
|
3072
|
+
...M,
|
|
3073
|
+
value: y,
|
|
3074
|
+
onChange: (L) => I(i.name, L),
|
|
3075
|
+
error: E,
|
|
3076
|
+
onListFiles: (L) => k?.http.invoke({
|
|
3032
3077
|
method: "POST",
|
|
3033
3078
|
action: "storage.file.list",
|
|
3034
|
-
body:
|
|
3079
|
+
body: L
|
|
3035
3080
|
}),
|
|
3036
3081
|
onListMounts: () => k?.http.invoke({
|
|
3037
3082
|
method: "GET",
|
|
3038
3083
|
action: "storage.mount"
|
|
3039
3084
|
}),
|
|
3040
|
-
onUploadFile: (
|
|
3085
|
+
onUploadFile: (L) => k?.http.invoke({
|
|
3041
3086
|
method: "POST",
|
|
3042
3087
|
action: "storage.file.upload",
|
|
3043
|
-
body:
|
|
3088
|
+
body: L
|
|
3044
3089
|
}),
|
|
3045
|
-
onDownloadFile: (
|
|
3090
|
+
onDownloadFile: (L) => k?.http.invoke({
|
|
3046
3091
|
method: "GET",
|
|
3047
|
-
action: `storage.file.${
|
|
3092
|
+
action: `storage.file.${L}.download`
|
|
3048
3093
|
}),
|
|
3049
|
-
onRegisterFile: (
|
|
3094
|
+
onRegisterFile: (L) => k?.http.invoke({
|
|
3050
3095
|
method: "POST",
|
|
3051
3096
|
action: "storage.file.folder",
|
|
3052
|
-
body:
|
|
3097
|
+
body: L
|
|
3053
3098
|
})
|
|
3054
3099
|
}
|
|
3055
3100
|
);
|
|
3101
|
+
case "folder":
|
|
3102
|
+
return /* @__PURE__ */ e(
|
|
3103
|
+
Mt,
|
|
3104
|
+
{
|
|
3105
|
+
value: y || {},
|
|
3106
|
+
onChange: (L) => I(i.name, L),
|
|
3107
|
+
onListFolders: () => k?.http.invoke({
|
|
3108
|
+
method: "GET",
|
|
3109
|
+
action: "storage.mount"
|
|
3110
|
+
}),
|
|
3111
|
+
disabled: S,
|
|
3112
|
+
size: l,
|
|
3113
|
+
placeholder: i.placeholder
|
|
3114
|
+
}
|
|
3115
|
+
);
|
|
3056
3116
|
case "custom":
|
|
3057
3117
|
return i.customComponent?.({
|
|
3058
|
-
value:
|
|
3059
|
-
onChange: (
|
|
3060
|
-
error:
|
|
3118
|
+
value: y,
|
|
3119
|
+
onChange: (L) => I(i.name, L),
|
|
3120
|
+
error: E,
|
|
3061
3121
|
disabled: S
|
|
3062
3122
|
});
|
|
3063
3123
|
case "array": {
|
|
3064
|
-
const
|
|
3124
|
+
const L = y || [];
|
|
3065
3125
|
let Q = [];
|
|
3066
|
-
if (typeof
|
|
3126
|
+
if (typeof E == "string" && E.startsWith("["))
|
|
3067
3127
|
try {
|
|
3068
|
-
Q = JSON.parse(
|
|
3128
|
+
Q = JSON.parse(E);
|
|
3069
3129
|
} catch {
|
|
3070
3130
|
}
|
|
3071
3131
|
const re = () => {
|
|
3072
|
-
I(i.name, [...
|
|
3132
|
+
I(i.name, [...L, {}]);
|
|
3073
3133
|
}, X = (A) => {
|
|
3074
3134
|
I(
|
|
3075
3135
|
i.name,
|
|
3076
|
-
|
|
3136
|
+
L.filter((T, D) => D !== A)
|
|
3077
3137
|
);
|
|
3078
|
-
}, $ = (A,
|
|
3079
|
-
const ee = [...
|
|
3138
|
+
}, $ = (A, T, D) => {
|
|
3139
|
+
const ee = [...L];
|
|
3080
3140
|
ee[A] = {
|
|
3081
3141
|
...ee[A],
|
|
3082
|
-
[
|
|
3142
|
+
[T]: D
|
|
3083
3143
|
}, I(i.name, ee);
|
|
3084
3144
|
};
|
|
3085
3145
|
return /* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
3086
|
-
|
|
3146
|
+
L.map((A, T) => /* @__PURE__ */ d(
|
|
3087
3147
|
"div",
|
|
3088
3148
|
{
|
|
3089
3149
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
@@ -3094,13 +3154,13 @@ const or = ({
|
|
|
3094
3154
|
type: "button",
|
|
3095
3155
|
variant: "ghost",
|
|
3096
3156
|
size: "sm",
|
|
3097
|
-
onClick: () => X(
|
|
3157
|
+
onClick: () => X(T),
|
|
3098
3158
|
disabled: S,
|
|
3099
3159
|
children: "Remove"
|
|
3100
3160
|
}
|
|
3101
3161
|
) }),
|
|
3102
3162
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((D) => {
|
|
3103
|
-
const ee = Q?.[
|
|
3163
|
+
const ee = Q?.[T]?.[D.name];
|
|
3104
3164
|
return /* @__PURE__ */ d(
|
|
3105
3165
|
"div",
|
|
3106
3166
|
{
|
|
@@ -3138,14 +3198,14 @@ const or = ({
|
|
|
3138
3198
|
{
|
|
3139
3199
|
...ne,
|
|
3140
3200
|
onChange: (K) => $(
|
|
3141
|
-
|
|
3201
|
+
T,
|
|
3142
3202
|
D.name,
|
|
3143
3203
|
K.target.value
|
|
3144
3204
|
),
|
|
3145
3205
|
type: D.textType || D.type,
|
|
3146
3206
|
autoComplete: D.autocomplete,
|
|
3147
3207
|
error: ee,
|
|
3148
|
-
size:
|
|
3208
|
+
size: l
|
|
3149
3209
|
}
|
|
3150
3210
|
);
|
|
3151
3211
|
case "textarea":
|
|
@@ -3154,22 +3214,22 @@ const or = ({
|
|
|
3154
3214
|
{
|
|
3155
3215
|
...ne,
|
|
3156
3216
|
onChange: (K) => $(
|
|
3157
|
-
|
|
3217
|
+
T,
|
|
3158
3218
|
D.name,
|
|
3159
3219
|
K.target.value
|
|
3160
3220
|
),
|
|
3161
3221
|
rows: 4,
|
|
3162
3222
|
error: ee,
|
|
3163
|
-
size:
|
|
3223
|
+
size: l
|
|
3164
3224
|
}
|
|
3165
3225
|
);
|
|
3166
3226
|
case "select":
|
|
3167
3227
|
return /* @__PURE__ */ e(
|
|
3168
|
-
|
|
3228
|
+
fe,
|
|
3169
3229
|
{
|
|
3170
3230
|
...ne,
|
|
3171
3231
|
onChange: (K) => $(
|
|
3172
|
-
|
|
3232
|
+
T,
|
|
3173
3233
|
D.name,
|
|
3174
3234
|
K
|
|
3175
3235
|
),
|
|
@@ -3183,21 +3243,21 @@ const or = ({
|
|
|
3183
3243
|
multiple: D.multiple,
|
|
3184
3244
|
allowCreate: D.allowCreate,
|
|
3185
3245
|
error: ee,
|
|
3186
|
-
size:
|
|
3246
|
+
size: l
|
|
3187
3247
|
}
|
|
3188
3248
|
);
|
|
3189
3249
|
case "checkbox":
|
|
3190
3250
|
return /* @__PURE__ */ e(
|
|
3191
|
-
|
|
3251
|
+
ye,
|
|
3192
3252
|
{
|
|
3193
3253
|
...ne,
|
|
3194
3254
|
checked: !!A?.[D.name],
|
|
3195
3255
|
onChange: (K) => $(
|
|
3196
|
-
|
|
3256
|
+
T,
|
|
3197
3257
|
D.name,
|
|
3198
3258
|
K.target.checked
|
|
3199
3259
|
),
|
|
3200
|
-
size:
|
|
3260
|
+
size: l
|
|
3201
3261
|
}
|
|
3202
3262
|
);
|
|
3203
3263
|
case "radio":
|
|
@@ -3210,11 +3270,11 @@ const or = ({
|
|
|
3210
3270
|
"input",
|
|
3211
3271
|
{
|
|
3212
3272
|
type: "radio",
|
|
3213
|
-
name: `${i.name}.${
|
|
3273
|
+
name: `${i.name}.${T}.${D.name}`,
|
|
3214
3274
|
value: K.value,
|
|
3215
3275
|
checked: A?.[D.name] === K.value,
|
|
3216
3276
|
onChange: () => $(
|
|
3217
|
-
|
|
3277
|
+
T,
|
|
3218
3278
|
D.name,
|
|
3219
3279
|
K.value
|
|
3220
3280
|
),
|
|
@@ -3230,16 +3290,16 @@ const or = ({
|
|
|
3230
3290
|
case "date": {
|
|
3231
3291
|
const K = A?.[D.name];
|
|
3232
3292
|
return /* @__PURE__ */ e(
|
|
3233
|
-
|
|
3293
|
+
ve,
|
|
3234
3294
|
{
|
|
3235
3295
|
...ne,
|
|
3236
3296
|
value: K ? new Date(K) : null,
|
|
3237
3297
|
onChange: (le) => $(
|
|
3238
|
-
|
|
3298
|
+
T,
|
|
3239
3299
|
D.name,
|
|
3240
3300
|
le
|
|
3241
3301
|
),
|
|
3242
|
-
size:
|
|
3302
|
+
size: l
|
|
3243
3303
|
}
|
|
3244
3304
|
);
|
|
3245
3305
|
}
|
|
@@ -3247,7 +3307,7 @@ const or = ({
|
|
|
3247
3307
|
return D.customComponent?.({
|
|
3248
3308
|
value: A?.[D.name],
|
|
3249
3309
|
onChange: (K) => $(
|
|
3250
|
-
|
|
3310
|
+
T,
|
|
3251
3311
|
D.name,
|
|
3252
3312
|
K
|
|
3253
3313
|
),
|
|
@@ -3279,7 +3339,7 @@ const or = ({
|
|
|
3279
3339
|
}) })
|
|
3280
3340
|
]
|
|
3281
3341
|
},
|
|
3282
|
-
|
|
3342
|
+
T
|
|
3283
3343
|
)),
|
|
3284
3344
|
/* @__PURE__ */ d(
|
|
3285
3345
|
te,
|
|
@@ -3301,14 +3361,14 @@ const or = ({
|
|
|
3301
3361
|
return null;
|
|
3302
3362
|
}
|
|
3303
3363
|
},
|
|
3304
|
-
[
|
|
3305
|
-
),
|
|
3364
|
+
[v, B, N, m, l, I]
|
|
3365
|
+
), W = ae(
|
|
3306
3366
|
(i) => {
|
|
3307
|
-
if (i.conditional && !i.conditional(
|
|
3367
|
+
if (i.conditional && !i.conditional(v))
|
|
3308
3368
|
return null;
|
|
3309
|
-
const
|
|
3310
|
-
if (
|
|
3311
|
-
const
|
|
3369
|
+
const y = i.items.filter((S) => !(S.hidden || S.conditional && !S.conditional(v)));
|
|
3370
|
+
if (y.length === 0) return null;
|
|
3371
|
+
const E = p(
|
|
3312
3372
|
"space-y-2",
|
|
3313
3373
|
{
|
|
3314
3374
|
"grid gap-2": i.layout === "grid",
|
|
@@ -3348,7 +3408,7 @@ const or = ({
|
|
|
3348
3408
|
}
|
|
3349
3409
|
)
|
|
3350
3410
|
] }),
|
|
3351
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
3411
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: E, children: y.map((S) => (B[S.name] && N[S.name], /* @__PURE__ */ d(
|
|
3352
3412
|
"div",
|
|
3353
3413
|
{
|
|
3354
3414
|
className: p(
|
|
@@ -3369,7 +3429,7 @@ const or = ({
|
|
|
3369
3429
|
]
|
|
3370
3430
|
}
|
|
3371
3431
|
) }),
|
|
3372
|
-
|
|
3432
|
+
z(S)
|
|
3373
3433
|
]
|
|
3374
3434
|
},
|
|
3375
3435
|
S.name
|
|
@@ -3379,26 +3439,26 @@ const or = ({
|
|
|
3379
3439
|
i.id
|
|
3380
3440
|
);
|
|
3381
3441
|
},
|
|
3382
|
-
[
|
|
3383
|
-
),
|
|
3442
|
+
[v, B, N, z]
|
|
3443
|
+
), V = p(
|
|
3384
3444
|
"space-y-6",
|
|
3385
3445
|
{
|
|
3386
|
-
"max-w-md":
|
|
3387
|
-
"max-w-2xl":
|
|
3388
|
-
"max-w-4xl":
|
|
3389
|
-
"max-w-full":
|
|
3446
|
+
"max-w-md": l === "sm",
|
|
3447
|
+
"max-w-2xl": l === "md",
|
|
3448
|
+
"max-w-4xl": l === "lg",
|
|
3449
|
+
"max-w-full": l === "full"
|
|
3390
3450
|
},
|
|
3391
3451
|
h
|
|
3392
3452
|
);
|
|
3393
|
-
return /* @__PURE__ */ d("form", { ref: w, onSubmit: H, className:
|
|
3394
|
-
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
3453
|
+
return /* @__PURE__ */ d("form", { ref: w, onSubmit: H, className: V, children: [
|
|
3454
|
+
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(W) }),
|
|
3395
3455
|
g && /* @__PURE__ */ d("div", { className: p("flex gap-3 justify-end pt-8"), children: [
|
|
3396
3456
|
n && /* @__PURE__ */ e(
|
|
3397
3457
|
te,
|
|
3398
3458
|
{
|
|
3399
3459
|
type: "button",
|
|
3400
3460
|
variant: x.variant,
|
|
3401
|
-
size: x.size ||
|
|
3461
|
+
size: x.size || l,
|
|
3402
3462
|
disabled: x.disabled || m,
|
|
3403
3463
|
onClick: n,
|
|
3404
3464
|
className: x.className,
|
|
@@ -3410,7 +3470,7 @@ const or = ({
|
|
|
3410
3470
|
{
|
|
3411
3471
|
type: "submit",
|
|
3412
3472
|
variant: b.variant,
|
|
3413
|
-
size: b.size ||
|
|
3473
|
+
size: b.size || l,
|
|
3414
3474
|
disabled: b.disabled || m,
|
|
3415
3475
|
loading: m,
|
|
3416
3476
|
className: b.className,
|
|
@@ -3419,12 +3479,12 @@ const or = ({
|
|
|
3419
3479
|
)
|
|
3420
3480
|
] })
|
|
3421
3481
|
] });
|
|
3422
|
-
},
|
|
3482
|
+
}, ir = ({
|
|
3423
3483
|
trigger: t,
|
|
3424
3484
|
children: a,
|
|
3425
3485
|
placement: r = "bottom-start",
|
|
3426
3486
|
className: n,
|
|
3427
|
-
disabled:
|
|
3487
|
+
disabled: s = !1
|
|
3428
3488
|
}) => {
|
|
3429
3489
|
const [o, u] = P(!1), [b, x] = P({}), g = J(null), f = J(null);
|
|
3430
3490
|
U(() => {
|
|
@@ -3438,13 +3498,13 @@ const or = ({
|
|
|
3438
3498
|
document.removeEventListener("mousedown", h), document.removeEventListener("keydown", w);
|
|
3439
3499
|
};
|
|
3440
3500
|
}, [o]);
|
|
3441
|
-
const
|
|
3442
|
-
if (h.stopPropagation(), !
|
|
3501
|
+
const l = (h) => {
|
|
3502
|
+
if (h.stopPropagation(), !s) {
|
|
3443
3503
|
if (!o) {
|
|
3444
3504
|
const w = f.current?.getBoundingClientRect();
|
|
3445
3505
|
if (w) {
|
|
3446
|
-
const
|
|
3447
|
-
r.startsWith("bottom") ?
|
|
3506
|
+
const v = {};
|
|
3507
|
+
r.startsWith("bottom") ? v.top = w.bottom + 6 : v.bottom = window.innerHeight - w.top + 6, r.endsWith("start") ? v.left = w.left : v.right = window.innerWidth - w.right, x(v);
|
|
3448
3508
|
}
|
|
3449
3509
|
}
|
|
3450
3510
|
u((w) => !w);
|
|
@@ -3456,9 +3516,9 @@ const or = ({
|
|
|
3456
3516
|
{
|
|
3457
3517
|
ref: f,
|
|
3458
3518
|
type: "button",
|
|
3459
|
-
onClick:
|
|
3460
|
-
disabled:
|
|
3461
|
-
className: p("inline-flex items-center",
|
|
3519
|
+
onClick: l,
|
|
3520
|
+
disabled: s,
|
|
3521
|
+
className: p("inline-flex items-center", s && "opacity-50 cursor-not-allowed"),
|
|
3462
3522
|
children: t
|
|
3463
3523
|
}
|
|
3464
3524
|
),
|
|
@@ -3482,11 +3542,11 @@ const or = ({
|
|
|
3482
3542
|
warning: "bg-notice-container text-on-notice",
|
|
3483
3543
|
error: "bg-error-container text-error",
|
|
3484
3544
|
info: "bg-beta-container text-link"
|
|
3485
|
-
},
|
|
3545
|
+
}, Dt = {
|
|
3486
3546
|
sm: "px-2 py-0.5 text-xs",
|
|
3487
3547
|
md: "px-2.5 py-1 text-sm",
|
|
3488
3548
|
lg: "px-3 py-1.5 text-base"
|
|
3489
|
-
},
|
|
3549
|
+
}, It = {
|
|
3490
3550
|
default: "bg-neutral-fill",
|
|
3491
3551
|
primary: "bg-accent-fill",
|
|
3492
3552
|
secondary: "bg-neutral-fill",
|
|
@@ -3495,12 +3555,12 @@ const or = ({
|
|
|
3495
3555
|
error: "bg-error-fill",
|
|
3496
3556
|
info: "bg-beta-fill"
|
|
3497
3557
|
};
|
|
3498
|
-
function
|
|
3558
|
+
function dr({
|
|
3499
3559
|
variant: t = "default",
|
|
3500
3560
|
size: a = "md",
|
|
3501
3561
|
dot: r = !1,
|
|
3502
3562
|
icon: n,
|
|
3503
|
-
dismissible:
|
|
3563
|
+
dismissible: s = !1,
|
|
3504
3564
|
onDismiss: o,
|
|
3505
3565
|
className: u,
|
|
3506
3566
|
children: b,
|
|
@@ -3515,7 +3575,7 @@ function ir({
|
|
|
3515
3575
|
// Variant styles
|
|
3516
3576
|
zt[t],
|
|
3517
3577
|
// Size styles
|
|
3518
|
-
|
|
3578
|
+
Dt[a],
|
|
3519
3579
|
u
|
|
3520
3580
|
),
|
|
3521
3581
|
...x,
|
|
@@ -3525,13 +3585,13 @@ function ir({
|
|
|
3525
3585
|
{
|
|
3526
3586
|
className: p(
|
|
3527
3587
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3528
|
-
|
|
3588
|
+
It[t]
|
|
3529
3589
|
)
|
|
3530
3590
|
}
|
|
3531
3591
|
),
|
|
3532
3592
|
n && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", b && "mr-1"), children: n }),
|
|
3533
3593
|
b,
|
|
3534
|
-
|
|
3594
|
+
s && o && /* @__PURE__ */ e(
|
|
3535
3595
|
"button",
|
|
3536
3596
|
{
|
|
3537
3597
|
onClick: o,
|
|
@@ -3551,30 +3611,30 @@ function ir({
|
|
|
3551
3611
|
}
|
|
3552
3612
|
);
|
|
3553
3613
|
}
|
|
3554
|
-
const
|
|
3614
|
+
const At = {
|
|
3555
3615
|
xs: "h-3 w-3",
|
|
3556
3616
|
sm: "h-4 w-4",
|
|
3557
3617
|
md: "h-6 w-6",
|
|
3558
3618
|
lg: "h-8 w-8",
|
|
3559
3619
|
xl: "h-12 w-12"
|
|
3560
|
-
},
|
|
3620
|
+
}, jt = {
|
|
3561
3621
|
primary: "text-primary",
|
|
3562
3622
|
secondary: "text-secondary-600",
|
|
3563
3623
|
white: "text-white",
|
|
3564
3624
|
current: "text-current"
|
|
3565
|
-
},
|
|
3625
|
+
}, _t = {
|
|
3566
3626
|
xs: "text-xs",
|
|
3567
3627
|
sm: "text-sm",
|
|
3568
3628
|
md: "text-sm",
|
|
3569
3629
|
lg: "text-base",
|
|
3570
3630
|
xl: "text-lg"
|
|
3571
3631
|
};
|
|
3572
|
-
function
|
|
3632
|
+
function ur({
|
|
3573
3633
|
size: t = "md",
|
|
3574
3634
|
variant: a = "primary",
|
|
3575
3635
|
label: r = "Loading...",
|
|
3576
3636
|
showLabel: n = !1,
|
|
3577
|
-
className:
|
|
3637
|
+
className: s,
|
|
3578
3638
|
...o
|
|
3579
3639
|
}) {
|
|
3580
3640
|
return /* @__PURE__ */ d(
|
|
@@ -3583,7 +3643,7 @@ function dr({
|
|
|
3583
3643
|
className: p(
|
|
3584
3644
|
"inline-flex items-center",
|
|
3585
3645
|
n ? "flex-col space-y-2" : "",
|
|
3586
|
-
|
|
3646
|
+
s
|
|
3587
3647
|
),
|
|
3588
3648
|
...o,
|
|
3589
3649
|
children: [
|
|
@@ -3592,8 +3652,8 @@ function dr({
|
|
|
3592
3652
|
{
|
|
3593
3653
|
className: p(
|
|
3594
3654
|
"animate-spin",
|
|
3595
|
-
|
|
3596
|
-
|
|
3655
|
+
At[t],
|
|
3656
|
+
jt[a]
|
|
3597
3657
|
),
|
|
3598
3658
|
fill: "none",
|
|
3599
3659
|
viewBox: "0 0 24 24",
|
|
@@ -3627,7 +3687,7 @@ function dr({
|
|
|
3627
3687
|
{
|
|
3628
3688
|
className: p(
|
|
3629
3689
|
"text-secondary-600 dark:text-secondary-400",
|
|
3630
|
-
|
|
3690
|
+
_t[t]
|
|
3631
3691
|
),
|
|
3632
3692
|
children: r
|
|
3633
3693
|
}
|
|
@@ -3637,7 +3697,7 @@ function dr({
|
|
|
3637
3697
|
}
|
|
3638
3698
|
);
|
|
3639
3699
|
}
|
|
3640
|
-
const
|
|
3700
|
+
const Pt = {
|
|
3641
3701
|
xs: "w-5 h-5 text-[10px]",
|
|
3642
3702
|
sm: "w-6 h-6 text-xs",
|
|
3643
3703
|
md: "w-7 h-7 text-[13px]",
|
|
@@ -3648,10 +3708,10 @@ function Bt(t) {
|
|
|
3648
3708
|
const a = t.trim().split(/[\s@.]+/).filter(Boolean);
|
|
3649
3709
|
return a.length >= 2 ? (a[0][0] + a[1][0]).toUpperCase() : t.slice(0, 2).toUpperCase();
|
|
3650
3710
|
}
|
|
3651
|
-
const
|
|
3711
|
+
const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
3652
3712
|
const [o, u] = se.useState(!1), b = p(
|
|
3653
3713
|
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-neutral-border-emphasis text-default",
|
|
3654
|
-
|
|
3714
|
+
Pt[r],
|
|
3655
3715
|
n
|
|
3656
3716
|
);
|
|
3657
3717
|
return a && !o ? /* @__PURE__ */ e(
|
|
@@ -3659,17 +3719,17 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3659
3719
|
{
|
|
3660
3720
|
src: a,
|
|
3661
3721
|
alt: t ?? "",
|
|
3662
|
-
title:
|
|
3722
|
+
title: s ?? t,
|
|
3663
3723
|
className: p(b, "object-cover"),
|
|
3664
3724
|
onError: () => u(!0)
|
|
3665
3725
|
}
|
|
3666
|
-
) : /* @__PURE__ */ e("span", { className: b, title:
|
|
3667
|
-
}, Me = "shadow-[0_0_0_2px_var(--base-module)]",
|
|
3726
|
+
) : /* @__PURE__ */ e("span", { className: b, title: s ?? t, "aria-label": t, children: Bt(t) });
|
|
3727
|
+
}, Me = "shadow-[0_0_0_2px_var(--base-module)]", Wt = "shadow-[0_0_0_2px_var(--base-module),0_0_0_3.5px_var(--accent-border)]", mr = ({ people: t, max: a = 4, size: r = "sm", className: n }) => {
|
|
3668
3728
|
if (t.length === 0) return null;
|
|
3669
|
-
const
|
|
3729
|
+
const s = t.slice(0, a), o = t.length - s.length;
|
|
3670
3730
|
return /* @__PURE__ */ d("span", { className: p("inline-flex items-center", n), children: [
|
|
3671
|
-
|
|
3672
|
-
|
|
3731
|
+
s.map((u, b) => /* @__PURE__ */ e(
|
|
3732
|
+
Ot,
|
|
3673
3733
|
{
|
|
3674
3734
|
name: u.name,
|
|
3675
3735
|
src: u.src,
|
|
@@ -3677,7 +3737,7 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3677
3737
|
title: u.name ? u.seen === !1 ? `${u.name} — nog niet gelezen` : u.name : void 0,
|
|
3678
3738
|
className: p(
|
|
3679
3739
|
b > 0 && "-ml-2",
|
|
3680
|
-
u.owner ?
|
|
3740
|
+
u.owner ? Wt : Me,
|
|
3681
3741
|
u.seen === !1 && "opacity-40"
|
|
3682
3742
|
)
|
|
3683
3743
|
},
|
|
@@ -3698,31 +3758,31 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3698
3758
|
}
|
|
3699
3759
|
)
|
|
3700
3760
|
] });
|
|
3701
|
-
},
|
|
3761
|
+
}, fr = ({
|
|
3702
3762
|
src: t,
|
|
3703
3763
|
alt: a,
|
|
3704
3764
|
size: r = "md",
|
|
3705
3765
|
aspectRatio: n = "auto",
|
|
3706
|
-
radius:
|
|
3766
|
+
radius: s = "md",
|
|
3707
3767
|
showLoading: o = !0,
|
|
3708
3768
|
showError: u = !0,
|
|
3709
3769
|
fallback: b,
|
|
3710
3770
|
loadingContent: x,
|
|
3711
3771
|
errorContent: g,
|
|
3712
3772
|
className: f,
|
|
3713
|
-
onLoad:
|
|
3773
|
+
onLoad: l,
|
|
3714
3774
|
onError: m,
|
|
3715
3775
|
...h
|
|
3716
3776
|
}) => {
|
|
3717
|
-
const [w, k] = P(!0), [
|
|
3718
|
-
k(!1), j(!1),
|
|
3719
|
-
}, G = (
|
|
3777
|
+
const [w, k] = P(!0), [v, j] = P(!1), [N, q] = P(t), B = (V) => {
|
|
3778
|
+
k(!1), j(!1), l?.(V);
|
|
3779
|
+
}, G = (V) => {
|
|
3720
3780
|
if (k(!1), j(!0), b && N !== b) {
|
|
3721
3781
|
q(b), j(!1), k(!0);
|
|
3722
3782
|
return;
|
|
3723
3783
|
}
|
|
3724
|
-
m?.(
|
|
3725
|
-
},
|
|
3784
|
+
m?.(V);
|
|
3785
|
+
}, F = p(
|
|
3726
3786
|
"relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
|
|
3727
3787
|
// Size variants
|
|
3728
3788
|
{
|
|
@@ -3742,24 +3802,24 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3742
3802
|
},
|
|
3743
3803
|
// Border radius variants
|
|
3744
3804
|
{
|
|
3745
|
-
"rounded-none":
|
|
3746
|
-
"rounded-sm":
|
|
3747
|
-
"rounded-md":
|
|
3748
|
-
"rounded-lg":
|
|
3749
|
-
"rounded-xl":
|
|
3750
|
-
"rounded-full":
|
|
3805
|
+
"rounded-none": s === "none",
|
|
3806
|
+
"rounded-sm": s === "sm",
|
|
3807
|
+
"rounded-md": s === "md",
|
|
3808
|
+
"rounded-lg": s === "lg",
|
|
3809
|
+
"rounded-xl": s === "xl",
|
|
3810
|
+
"rounded-full": s === "full"
|
|
3751
3811
|
},
|
|
3752
3812
|
f
|
|
3753
3813
|
), I = p(
|
|
3754
3814
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3755
3815
|
{
|
|
3756
|
-
"opacity-0": w ||
|
|
3757
|
-
"opacity-100": !w && !
|
|
3816
|
+
"opacity-0": w || v,
|
|
3817
|
+
"opacity-100": !w && !v
|
|
3758
3818
|
}
|
|
3759
3819
|
), H = p(
|
|
3760
3820
|
"absolute inset-0 flex items-center justify-center",
|
|
3761
3821
|
"text-neutral-400 dark:text-neutral-500"
|
|
3762
|
-
),
|
|
3822
|
+
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), W = /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
3763
3823
|
/* @__PURE__ */ e(
|
|
3764
3824
|
"svg",
|
|
3765
3825
|
{
|
|
@@ -3780,7 +3840,7 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3780
3840
|
),
|
|
3781
3841
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3782
3842
|
] });
|
|
3783
|
-
return /* @__PURE__ */ d("div", { className:
|
|
3843
|
+
return /* @__PURE__ */ d("div", { className: F, children: [
|
|
3784
3844
|
/* @__PURE__ */ e(
|
|
3785
3845
|
"img",
|
|
3786
3846
|
{
|
|
@@ -3792,40 +3852,40 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3792
3852
|
onError: G
|
|
3793
3853
|
}
|
|
3794
3854
|
),
|
|
3795
|
-
w && o && /* @__PURE__ */ e("div", { className: H, children: x ||
|
|
3796
|
-
|
|
3855
|
+
w && o && /* @__PURE__ */ e("div", { className: H, children: x || z }),
|
|
3856
|
+
v && u && /* @__PURE__ */ e("div", { className: H, children: g || W })
|
|
3797
3857
|
] });
|
|
3798
|
-
},
|
|
3858
|
+
}, hr = ({
|
|
3799
3859
|
title: t,
|
|
3800
3860
|
subtitle: a,
|
|
3801
3861
|
actions: r = [],
|
|
3802
3862
|
children: n,
|
|
3803
|
-
className:
|
|
3863
|
+
className: s,
|
|
3804
3864
|
backLabel: o = "Back",
|
|
3805
3865
|
backClassName: u,
|
|
3806
3866
|
onBack: b,
|
|
3807
3867
|
editable: x = !1,
|
|
3808
3868
|
onTitleChange: g
|
|
3809
3869
|
}) => {
|
|
3810
|
-
const [f,
|
|
3870
|
+
const [f, l] = P(!1), [m, h] = P(t), w = J(null);
|
|
3811
3871
|
U(() => {
|
|
3812
3872
|
h(t);
|
|
3813
3873
|
}, [t]), U(() => {
|
|
3814
3874
|
f && w.current && (w.current.focus(), w.current.select());
|
|
3815
3875
|
}, [f]);
|
|
3816
3876
|
const k = () => {
|
|
3817
|
-
x &&
|
|
3818
|
-
},
|
|
3819
|
-
|
|
3877
|
+
x && l(!0);
|
|
3878
|
+
}, v = () => {
|
|
3879
|
+
l(!1), m.trim() !== "" && m !== t && g ? g(m.trim()) : h(t);
|
|
3820
3880
|
}, j = (N) => {
|
|
3821
|
-
N.key === "Enter" ? w.current?.blur() : N.key === "Escape" && (h(t),
|
|
3881
|
+
N.key === "Enter" ? w.current?.blur() : N.key === "Escape" && (h(t), l(!1));
|
|
3822
3882
|
};
|
|
3823
3883
|
return /* @__PURE__ */ d(
|
|
3824
3884
|
"div",
|
|
3825
3885
|
{
|
|
3826
3886
|
className: p(
|
|
3827
3887
|
"p-5 pb-3 border-b border-neutral",
|
|
3828
|
-
|
|
3888
|
+
s
|
|
3829
3889
|
),
|
|
3830
3890
|
children: [
|
|
3831
3891
|
/* @__PURE__ */ d("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
@@ -3849,7 +3909,7 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3849
3909
|
type: "text",
|
|
3850
3910
|
value: m,
|
|
3851
3911
|
onChange: (N) => h(N.target.value),
|
|
3852
|
-
onBlur:
|
|
3912
|
+
onBlur: v,
|
|
3853
3913
|
onKeyDown: j,
|
|
3854
3914
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-neutral rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
|
|
3855
3915
|
}
|
|
@@ -3878,7 +3938,7 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3878
3938
|
] }) }),
|
|
3879
3939
|
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: r.map(
|
|
3880
3940
|
(N) => N.splitOptions && N.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3881
|
-
|
|
3941
|
+
ze,
|
|
3882
3942
|
{
|
|
3883
3943
|
label: N.label,
|
|
3884
3944
|
onClick: N.onClick,
|
|
@@ -3915,12 +3975,12 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3915
3975
|
]
|
|
3916
3976
|
}
|
|
3917
3977
|
);
|
|
3918
|
-
},
|
|
3978
|
+
}, pr = ({
|
|
3919
3979
|
actions: t = [],
|
|
3920
3980
|
onBack: a,
|
|
3921
3981
|
backLabel: r = "Back",
|
|
3922
3982
|
className: n,
|
|
3923
|
-
children:
|
|
3983
|
+
children: s
|
|
3924
3984
|
}) => /* @__PURE__ */ d("div", { className: p("flex items-center gap-2 mb-3", n), children: [
|
|
3925
3985
|
a && /* @__PURE__ */ d(
|
|
3926
3986
|
"button",
|
|
@@ -3934,10 +3994,10 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3934
3994
|
]
|
|
3935
3995
|
}
|
|
3936
3996
|
),
|
|
3937
|
-
|
|
3938
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className: p("flex flex-wrap gap-2", !
|
|
3997
|
+
s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: s }),
|
|
3998
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: p("flex flex-wrap gap-2", !s && "ml-auto"), children: t.map(
|
|
3939
3999
|
(o) => o.splitOptions && o.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3940
|
-
|
|
4000
|
+
ze,
|
|
3941
4001
|
{
|
|
3942
4002
|
label: o.label,
|
|
3943
4003
|
onClick: o.onClick,
|
|
@@ -3970,19 +4030,19 @@ const Pt = ({ name: t, src: a, size: r = "sm", className: n, title: l }) => {
|
|
|
3970
4030
|
)
|
|
3971
4031
|
) })
|
|
3972
4032
|
] });
|
|
3973
|
-
function
|
|
4033
|
+
function Ft(t, a) {
|
|
3974
4034
|
return a.split(".").reduce(
|
|
3975
4035
|
(r, n) => r && typeof r == "object" && n in r ? r[n] : void 0,
|
|
3976
4036
|
t
|
|
3977
4037
|
);
|
|
3978
4038
|
}
|
|
3979
|
-
const
|
|
4039
|
+
const xr = ({
|
|
3980
4040
|
groups: t,
|
|
3981
4041
|
data: a,
|
|
3982
4042
|
size: r = "md",
|
|
3983
4043
|
className: n
|
|
3984
4044
|
}) => {
|
|
3985
|
-
const
|
|
4045
|
+
const s = (f) => {
|
|
3986
4046
|
if (!f) return "-";
|
|
3987
4047
|
try {
|
|
3988
4048
|
return new Date(f).toLocaleDateString("nl-NL", {
|
|
@@ -3993,15 +4053,15 @@ const pr = ({
|
|
|
3993
4053
|
} catch {
|
|
3994
4054
|
return String(f);
|
|
3995
4055
|
}
|
|
3996
|
-
}, o = (f) => f ? "Ja" : "Nee", u = (f,
|
|
3997
|
-
if (!
|
|
3998
|
-
const m =
|
|
4056
|
+
}, o = (f) => f ? "Ja" : "Nee", u = (f, l) => {
|
|
4057
|
+
if (!l) return String(f || "-");
|
|
4058
|
+
const m = l.find((h) => h.value === f);
|
|
3999
4059
|
return m ? m.label : String(f || "-");
|
|
4000
4060
|
}, b = ae(
|
|
4001
4061
|
(f) => {
|
|
4002
|
-
const
|
|
4062
|
+
const l = Ft(a, f.name);
|
|
4003
4063
|
if (f.type === "array") {
|
|
4004
|
-
const h =
|
|
4064
|
+
const h = l;
|
|
4005
4065
|
return !h || h.length === 0 ? /* @__PURE__ */ e(
|
|
4006
4066
|
Z,
|
|
4007
4067
|
{
|
|
@@ -4029,10 +4089,10 @@ const pr = ({
|
|
|
4029
4089
|
]
|
|
4030
4090
|
}
|
|
4031
4091
|
) }),
|
|
4032
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((
|
|
4033
|
-
const j = w?.[
|
|
4092
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((v) => {
|
|
4093
|
+
const j = w?.[v.name];
|
|
4034
4094
|
let N = "-";
|
|
4035
|
-
switch (
|
|
4095
|
+
switch (v.type) {
|
|
4036
4096
|
case "text":
|
|
4037
4097
|
case "email":
|
|
4038
4098
|
case "number":
|
|
@@ -4045,31 +4105,31 @@ const pr = ({
|
|
|
4045
4105
|
case "radio":
|
|
4046
4106
|
N = u(
|
|
4047
4107
|
j,
|
|
4048
|
-
|
|
4108
|
+
v.options
|
|
4049
4109
|
);
|
|
4050
4110
|
break;
|
|
4051
4111
|
case "checkbox":
|
|
4052
4112
|
N = o(j);
|
|
4053
4113
|
break;
|
|
4054
4114
|
case "date":
|
|
4055
|
-
N =
|
|
4115
|
+
N = s(j);
|
|
4056
4116
|
break;
|
|
4057
4117
|
case "custom":
|
|
4058
|
-
N =
|
|
4118
|
+
N = v.customComponent?.({
|
|
4059
4119
|
value: j
|
|
4060
4120
|
});
|
|
4061
4121
|
break;
|
|
4062
4122
|
default:
|
|
4063
4123
|
N = String(j || "-");
|
|
4064
4124
|
}
|
|
4065
|
-
return
|
|
4125
|
+
return v.format && (N = v.format(j, w)), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
4066
4126
|
/* @__PURE__ */ e(
|
|
4067
4127
|
Z,
|
|
4068
4128
|
{
|
|
4069
4129
|
variant: "label",
|
|
4070
4130
|
size: "xs",
|
|
4071
4131
|
className: "text-neutral-600 dark:text-neutral-400",
|
|
4072
|
-
children:
|
|
4132
|
+
children: v.label
|
|
4073
4133
|
}
|
|
4074
4134
|
),
|
|
4075
4135
|
/* @__PURE__ */ e(
|
|
@@ -4081,7 +4141,7 @@ const pr = ({
|
|
|
4081
4141
|
children: N
|
|
4082
4142
|
}
|
|
4083
4143
|
)
|
|
4084
|
-
] },
|
|
4144
|
+
] }, v.name);
|
|
4085
4145
|
}) })
|
|
4086
4146
|
]
|
|
4087
4147
|
},
|
|
@@ -4089,9 +4149,9 @@ const pr = ({
|
|
|
4089
4149
|
)) });
|
|
4090
4150
|
}
|
|
4091
4151
|
if (f.type === "custom" && f.customComponent)
|
|
4092
|
-
return f.customComponent({ value:
|
|
4152
|
+
return f.customComponent({ value: l });
|
|
4093
4153
|
if (f.format) {
|
|
4094
|
-
const h = f.format(
|
|
4154
|
+
const h = f.format(l, a);
|
|
4095
4155
|
return /* @__PURE__ */ e(
|
|
4096
4156
|
Z,
|
|
4097
4157
|
{
|
|
@@ -4110,23 +4170,23 @@ const pr = ({
|
|
|
4110
4170
|
case "number":
|
|
4111
4171
|
case "tel":
|
|
4112
4172
|
case "url":
|
|
4113
|
-
m =
|
|
4173
|
+
m = l ? String(l) : "-";
|
|
4114
4174
|
break;
|
|
4115
4175
|
case "textarea":
|
|
4116
|
-
m =
|
|
4176
|
+
m = l ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(l || "-") }) : "-";
|
|
4117
4177
|
break;
|
|
4118
4178
|
case "select":
|
|
4119
4179
|
case "radio":
|
|
4120
|
-
m = u(
|
|
4180
|
+
m = u(l, f.options);
|
|
4121
4181
|
break;
|
|
4122
4182
|
case "checkbox":
|
|
4123
|
-
m = o(
|
|
4183
|
+
m = o(l);
|
|
4124
4184
|
break;
|
|
4125
4185
|
case "date":
|
|
4126
|
-
m = l
|
|
4186
|
+
m = s(l);
|
|
4127
4187
|
break;
|
|
4128
4188
|
default:
|
|
4129
|
-
m =
|
|
4189
|
+
m = l ? String(l) : "-";
|
|
4130
4190
|
}
|
|
4131
4191
|
return /* @__PURE__ */ e(
|
|
4132
4192
|
Z,
|
|
@@ -4143,8 +4203,8 @@ const pr = ({
|
|
|
4143
4203
|
(f) => {
|
|
4144
4204
|
if (f.conditional && !f.conditional(a))
|
|
4145
4205
|
return null;
|
|
4146
|
-
const
|
|
4147
|
-
if (
|
|
4206
|
+
const l = f.items.filter((h) => !(h.hidden || h.conditional && !h.conditional(a)));
|
|
4207
|
+
if (l.length === 0) return null;
|
|
4148
4208
|
const m = p(
|
|
4149
4209
|
"space-y-4",
|
|
4150
4210
|
{
|
|
@@ -4185,7 +4245,7 @@ const pr = ({
|
|
|
4185
4245
|
}
|
|
4186
4246
|
)
|
|
4187
4247
|
] }),
|
|
4188
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: m, children:
|
|
4248
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: m, children: l.map((h) => /* @__PURE__ */ d(
|
|
4189
4249
|
"div",
|
|
4190
4250
|
{
|
|
4191
4251
|
className: p(
|
|
@@ -4226,8 +4286,8 @@ const pr = ({
|
|
|
4226
4286
|
);
|
|
4227
4287
|
return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(x) }) });
|
|
4228
4288
|
}, Ie = ({ item: t, isSelectedHandler: a, onClick: r, depth: n = 0 }) => {
|
|
4229
|
-
const [
|
|
4230
|
-
u && o(!
|
|
4289
|
+
const [s, o] = P(t.defaultCollapsed ?? !1), u = t.children && t.children.length > 0, b = u && n === 0, x = () => {
|
|
4290
|
+
u && o(!s);
|
|
4231
4291
|
}, g = a ? a(t.path) : !1;
|
|
4232
4292
|
return /* @__PURE__ */ d("li", { children: [
|
|
4233
4293
|
/* @__PURE__ */ d(
|
|
@@ -4248,11 +4308,11 @@ const pr = ({
|
|
|
4248
4308
|
t.icon && /* @__PURE__ */ e("span", { className: "mr-2 shrink-0", children: t.icon }),
|
|
4249
4309
|
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 truncate", children: t.label }),
|
|
4250
4310
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
|
|
4251
|
-
u && /* @__PURE__ */ e("span", { className: `${
|
|
4311
|
+
u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e(qe, { className: "w-4 h-4 text-muted" }) })
|
|
4252
4312
|
]
|
|
4253
4313
|
}
|
|
4254
4314
|
),
|
|
4255
|
-
u && !
|
|
4315
|
+
u && !s && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((f, l) => /* @__PURE__ */ e(
|
|
4256
4316
|
Ie,
|
|
4257
4317
|
{
|
|
4258
4318
|
item: f,
|
|
@@ -4260,15 +4320,15 @@ const pr = ({
|
|
|
4260
4320
|
onClick: r,
|
|
4261
4321
|
depth: n + 1
|
|
4262
4322
|
},
|
|
4263
|
-
|
|
4323
|
+
l
|
|
4264
4324
|
)) })
|
|
4265
4325
|
] });
|
|
4266
|
-
},
|
|
4326
|
+
}, br = ({
|
|
4267
4327
|
title: t,
|
|
4268
4328
|
actionIcons: a,
|
|
4269
4329
|
items: r,
|
|
4270
4330
|
isSelectedHandler: n,
|
|
4271
|
-
onClick:
|
|
4331
|
+
onClick: s,
|
|
4272
4332
|
preMenuItemsComponent: o
|
|
4273
4333
|
}) => /* @__PURE__ */ d("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4274
4334
|
/* @__PURE__ */ d("div", { className: "sidebar-menu-header", children: [
|
|
@@ -4282,23 +4342,23 @@ const pr = ({
|
|
|
4282
4342
|
{
|
|
4283
4343
|
item: u,
|
|
4284
4344
|
isSelectedHandler: n,
|
|
4285
|
-
onClick:
|
|
4345
|
+
onClick: s
|
|
4286
4346
|
},
|
|
4287
4347
|
b
|
|
4288
4348
|
)
|
|
4289
4349
|
) })
|
|
4290
|
-
] }),
|
|
4350
|
+
] }), gr = ({
|
|
4291
4351
|
level: t = 1,
|
|
4292
4352
|
size: a,
|
|
4293
4353
|
weight: r = "bold",
|
|
4294
4354
|
color: n = "current",
|
|
4295
|
-
align:
|
|
4355
|
+
align: s = "left",
|
|
4296
4356
|
truncate: o = !1,
|
|
4297
4357
|
className: u,
|
|
4298
4358
|
children: b,
|
|
4299
4359
|
...x
|
|
4300
4360
|
}) => {
|
|
4301
|
-
const g = a ||
|
|
4361
|
+
const g = a || Vt(t), f = p(
|
|
4302
4362
|
"font-primary",
|
|
4303
4363
|
// Size variants
|
|
4304
4364
|
{
|
|
@@ -4333,19 +4393,19 @@ const pr = ({
|
|
|
4333
4393
|
},
|
|
4334
4394
|
// Alignment
|
|
4335
4395
|
{
|
|
4336
|
-
"text-left":
|
|
4337
|
-
"text-center":
|
|
4338
|
-
"text-right":
|
|
4396
|
+
"text-left": s === "left",
|
|
4397
|
+
"text-center": s === "center",
|
|
4398
|
+
"text-right": s === "right"
|
|
4339
4399
|
},
|
|
4340
4400
|
// Truncation
|
|
4341
4401
|
{
|
|
4342
4402
|
truncate: o
|
|
4343
4403
|
},
|
|
4344
4404
|
u
|
|
4345
|
-
),
|
|
4346
|
-
return /* @__PURE__ */ e(
|
|
4405
|
+
), l = `h${t}`;
|
|
4406
|
+
return /* @__PURE__ */ e(l, { className: f, ...x, children: b });
|
|
4347
4407
|
};
|
|
4348
|
-
function
|
|
4408
|
+
function Vt(t) {
|
|
4349
4409
|
return {
|
|
4350
4410
|
1: "4xl",
|
|
4351
4411
|
2: "3xl",
|
|
@@ -4355,12 +4415,12 @@ function Wt(t) {
|
|
|
4355
4415
|
6: "md"
|
|
4356
4416
|
}[t] || "md";
|
|
4357
4417
|
}
|
|
4358
|
-
const
|
|
4418
|
+
const yr = ({
|
|
4359
4419
|
items: t,
|
|
4360
4420
|
type: a = "unordered",
|
|
4361
4421
|
variant: r = "default",
|
|
4362
4422
|
size: n = "md",
|
|
4363
|
-
interactive:
|
|
4423
|
+
interactive: s = !1,
|
|
4364
4424
|
className: o,
|
|
4365
4425
|
itemClassName: u
|
|
4366
4426
|
}) => {
|
|
@@ -4385,7 +4445,7 @@ const gr = ({
|
|
|
4385
4445
|
"text-lg": n === "lg"
|
|
4386
4446
|
},
|
|
4387
4447
|
o
|
|
4388
|
-
), x = (
|
|
4448
|
+
), x = (l, m) => p(
|
|
4389
4449
|
// Base item styles
|
|
4390
4450
|
"transition-colors duration-200",
|
|
4391
4451
|
// Size-based padding
|
|
@@ -4395,92 +4455,92 @@ const gr = ({
|
|
|
4395
4455
|
"py-3 px-4": n === "lg" && (r === "bordered" || r === "divided")
|
|
4396
4456
|
},
|
|
4397
4457
|
// Interactive styles
|
|
4398
|
-
|
|
4458
|
+
s && !l.disabled && {
|
|
4399
4459
|
"cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800": !0,
|
|
4400
4460
|
"focus:outline-none focus:bg-neutral-100 dark:focus:bg-neutral-700": !0
|
|
4401
4461
|
},
|
|
4402
4462
|
// Disabled styles
|
|
4403
|
-
|
|
4463
|
+
l.disabled && {
|
|
4404
4464
|
"opacity-50 cursor-not-allowed": !0
|
|
4405
4465
|
},
|
|
4406
4466
|
u
|
|
4407
|
-
), g = (
|
|
4408
|
-
|
|
4409
|
-
}, f = (
|
|
4410
|
-
|
|
4467
|
+
), g = (l) => {
|
|
4468
|
+
s && !l.disabled && l.onClick && l.onClick();
|
|
4469
|
+
}, f = (l, m) => {
|
|
4470
|
+
s && !m.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), m.onClick?.());
|
|
4411
4471
|
};
|
|
4412
|
-
return a === "ordered" ? /* @__PURE__ */ e("ol", { className: b, children: t.map((
|
|
4472
|
+
return a === "ordered" ? /* @__PURE__ */ e("ol", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4413
4473
|
"li",
|
|
4414
4474
|
{
|
|
4415
|
-
className: x(
|
|
4416
|
-
onClick: () => g(
|
|
4417
|
-
onKeyDown: (h) => f(h,
|
|
4418
|
-
tabIndex:
|
|
4419
|
-
role:
|
|
4420
|
-
children:
|
|
4475
|
+
className: x(l),
|
|
4476
|
+
onClick: () => g(l),
|
|
4477
|
+
onKeyDown: (h) => f(h, l),
|
|
4478
|
+
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4479
|
+
role: s ? "button" : void 0,
|
|
4480
|
+
children: l.content
|
|
4421
4481
|
},
|
|
4422
|
-
|
|
4423
|
-
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: b, children: t.map((
|
|
4482
|
+
l.id || m
|
|
4483
|
+
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4424
4484
|
"div",
|
|
4425
4485
|
{
|
|
4426
|
-
className: x(
|
|
4427
|
-
onClick: () => g(
|
|
4428
|
-
onKeyDown: (h) => f(h,
|
|
4429
|
-
tabIndex:
|
|
4430
|
-
role:
|
|
4431
|
-
children:
|
|
4486
|
+
className: x(l),
|
|
4487
|
+
onClick: () => g(l),
|
|
4488
|
+
onKeyDown: (h) => f(h, l),
|
|
4489
|
+
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4490
|
+
role: s ? "button" : void 0,
|
|
4491
|
+
children: l.content
|
|
4432
4492
|
},
|
|
4433
|
-
|
|
4434
|
-
)) }) : /* @__PURE__ */ e("ul", { className: b, children: t.map((
|
|
4493
|
+
l.id || m
|
|
4494
|
+
)) }) : /* @__PURE__ */ e("ul", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4435
4495
|
"li",
|
|
4436
4496
|
{
|
|
4437
|
-
className: x(
|
|
4438
|
-
onClick: () => g(
|
|
4439
|
-
onKeyDown: (h) => f(h,
|
|
4440
|
-
tabIndex:
|
|
4441
|
-
role:
|
|
4442
|
-
children:
|
|
4497
|
+
className: x(l),
|
|
4498
|
+
onClick: () => g(l),
|
|
4499
|
+
onKeyDown: (h) => f(h, l),
|
|
4500
|
+
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4501
|
+
role: s ? "button" : void 0,
|
|
4502
|
+
children: l.content
|
|
4443
4503
|
},
|
|
4444
|
-
|
|
4504
|
+
l.id || m
|
|
4445
4505
|
)) });
|
|
4446
|
-
},
|
|
4506
|
+
}, vr = ({
|
|
4447
4507
|
commands: t,
|
|
4448
4508
|
isOpen: a,
|
|
4449
4509
|
onClose: r,
|
|
4450
4510
|
labels: n,
|
|
4451
|
-
initialCommandPath:
|
|
4511
|
+
initialCommandPath: s,
|
|
4452
4512
|
initialActiveIndex: o
|
|
4453
4513
|
}) => {
|
|
4454
|
-
const [u, b] = P(""), [x, g] = P(
|
|
4455
|
-
(
|
|
4514
|
+
const [u, b] = P(""), [x, g] = P(s || []), [f, l] = P(o || 0), m = J(null), h = J(null), k = (x.length ? t.find((v) => v.id === x[0])?.subCommands || [] : t).filter(
|
|
4515
|
+
(v) => v.label.toLowerCase().includes(u.toLowerCase())
|
|
4456
4516
|
);
|
|
4457
4517
|
return U(() => {
|
|
4458
|
-
a || (b(""), g(
|
|
4518
|
+
a || (b(""), g(s || []), l(o || 0));
|
|
4459
4519
|
}, [a]), U(() => {
|
|
4460
|
-
const
|
|
4520
|
+
const v = (j) => {
|
|
4461
4521
|
if (a) {
|
|
4462
4522
|
if (j.key === "Escape")
|
|
4463
4523
|
r();
|
|
4464
4524
|
else if (j.key === "ArrowUp")
|
|
4465
|
-
|
|
4525
|
+
l(
|
|
4466
4526
|
(N) => N > 0 ? N - 1 : k.length - 1
|
|
4467
4527
|
);
|
|
4468
4528
|
else if (j.key === "ArrowDown")
|
|
4469
|
-
|
|
4529
|
+
l(
|
|
4470
4530
|
(N) => N < k.length - 1 ? N + 1 : 0
|
|
4471
4531
|
);
|
|
4472
4532
|
else if (j.key === "Enter") {
|
|
4473
4533
|
const N = k[f];
|
|
4474
|
-
N && (N.subCommands ? (g([...x, N.id]),
|
|
4534
|
+
N && (N.subCommands ? (g([...x, N.id]), l(0)) : N.action && (N.action(), r()));
|
|
4475
4535
|
}
|
|
4476
4536
|
}
|
|
4477
4537
|
};
|
|
4478
|
-
return document.addEventListener("keydown",
|
|
4538
|
+
return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
|
|
4479
4539
|
}, [a, r, k, f, x]), U(() => {
|
|
4480
|
-
const
|
|
4540
|
+
const v = (j) => {
|
|
4481
4541
|
m.current && !m.current.contains(j.target) && r();
|
|
4482
4542
|
};
|
|
4483
|
-
return a && document.addEventListener("mousedown",
|
|
4543
|
+
return a && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
4484
4544
|
}, [a, r]), U(() => {
|
|
4485
4545
|
if (!a) return;
|
|
4486
4546
|
h.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
|
|
@@ -4491,7 +4551,7 @@ const gr = ({
|
|
|
4491
4551
|
ref: m,
|
|
4492
4552
|
children: [
|
|
4493
4553
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4494
|
-
/* @__PURE__ */ e(
|
|
4554
|
+
/* @__PURE__ */ e(Te, { className: "w-4 h-4 text-muted shrink-0" }),
|
|
4495
4555
|
/* @__PURE__ */ e(
|
|
4496
4556
|
"input",
|
|
4497
4557
|
{
|
|
@@ -4499,7 +4559,7 @@ const gr = ({
|
|
|
4499
4559
|
autoFocus: !0,
|
|
4500
4560
|
placeholder: n?.searchPlaceholder || "Search commands...",
|
|
4501
4561
|
value: u,
|
|
4502
|
-
onChange: (
|
|
4562
|
+
onChange: (v) => b(v.target.value),
|
|
4503
4563
|
className: "w-full py-2 text-default border-0 focus:outline-none focus:ring-0 focus:border-0 focus:shadow-none bg-transparent"
|
|
4504
4564
|
}
|
|
4505
4565
|
)
|
|
@@ -4511,22 +4571,22 @@ const gr = ({
|
|
|
4511
4571
|
className: "mt-2 pt-2 text-sm border-t border-neutral max-h-[50vh] overflow-y-auto",
|
|
4512
4572
|
children: [
|
|
4513
4573
|
k.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
|
|
4514
|
-
k.map((
|
|
4574
|
+
k.map((v, j) => /* @__PURE__ */ d(
|
|
4515
4575
|
"div",
|
|
4516
4576
|
{
|
|
4517
4577
|
"data-index": j,
|
|
4518
4578
|
className: `flex items-center p-2 cursor-pointer rounded-md text-default ${j === f ? "bg-neutral-container" : ""}`,
|
|
4519
4579
|
onClick: () => {
|
|
4520
|
-
|
|
4580
|
+
v.subCommands ? (g([...x, v.id]), l(0)) : v.action && (v.action(), r());
|
|
4521
4581
|
},
|
|
4522
|
-
onMouseEnter: () =>
|
|
4582
|
+
onMouseEnter: () => l(j),
|
|
4523
4583
|
children: [
|
|
4524
|
-
|
|
4525
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4526
|
-
|
|
4584
|
+
v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
|
|
4585
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
|
|
4586
|
+
v.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(Ue, { className: "w-4 h-4" }) })
|
|
4527
4587
|
]
|
|
4528
4588
|
},
|
|
4529
|
-
|
|
4589
|
+
v.id
|
|
4530
4590
|
))
|
|
4531
4591
|
]
|
|
4532
4592
|
}
|
|
@@ -4548,7 +4608,7 @@ const gr = ({
|
|
|
4548
4608
|
]
|
|
4549
4609
|
}
|
|
4550
4610
|
) }) : null;
|
|
4551
|
-
},
|
|
4611
|
+
}, Rt = {
|
|
4552
4612
|
none: "p-0",
|
|
4553
4613
|
xs: "p-1",
|
|
4554
4614
|
sm: "p-2",
|
|
@@ -4556,7 +4616,7 @@ const gr = ({
|
|
|
4556
4616
|
lg: "p-6",
|
|
4557
4617
|
xl: "p-8",
|
|
4558
4618
|
"2xl": "p-12"
|
|
4559
|
-
},
|
|
4619
|
+
}, Ht = {
|
|
4560
4620
|
none: "m-0",
|
|
4561
4621
|
xs: "m-1",
|
|
4562
4622
|
sm: "m-2",
|
|
@@ -4564,7 +4624,7 @@ const gr = ({
|
|
|
4564
4624
|
lg: "m-6",
|
|
4565
4625
|
xl: "m-8",
|
|
4566
4626
|
"2xl": "m-12"
|
|
4567
|
-
},
|
|
4627
|
+
}, qt = {
|
|
4568
4628
|
none: "",
|
|
4569
4629
|
primary: "bg-primary",
|
|
4570
4630
|
secondary: "bg-secondary",
|
|
@@ -4580,26 +4640,26 @@ const gr = ({
|
|
|
4580
4640
|
backdrop: "bg-backdrop",
|
|
4581
4641
|
editor: "bg-editor",
|
|
4582
4642
|
input: "bg-input"
|
|
4583
|
-
},
|
|
4643
|
+
}, Ut = {
|
|
4584
4644
|
none: "rounded-none",
|
|
4585
4645
|
sm: "rounded-sm",
|
|
4586
4646
|
md: "rounded-md",
|
|
4587
4647
|
lg: "rounded-lg",
|
|
4588
4648
|
xl: "rounded-xl",
|
|
4589
4649
|
full: "rounded-full"
|
|
4590
|
-
},
|
|
4650
|
+
}, Gt = {
|
|
4591
4651
|
none: "shadow-none",
|
|
4592
4652
|
sm: "shadow-sm shadow-lvl-0",
|
|
4593
4653
|
md: "shadow-md shadow-lvl-0",
|
|
4594
4654
|
lg: "shadow-lg shadow-lvl-0",
|
|
4595
4655
|
xl: "shadow-xl shadow-lvl-0",
|
|
4596
4656
|
"2xl": "shadow-2xl shadow-lvl-0"
|
|
4597
|
-
},
|
|
4657
|
+
}, Kt = {
|
|
4598
4658
|
none: "border-0",
|
|
4599
4659
|
sm: "border",
|
|
4600
4660
|
md: "border-2",
|
|
4601
4661
|
lg: "border-4"
|
|
4602
|
-
},
|
|
4662
|
+
}, Jt = {
|
|
4603
4663
|
primary: "border-primary",
|
|
4604
4664
|
secondary: "border-secondary",
|
|
4605
4665
|
accent: "border-accent",
|
|
@@ -4615,7 +4675,7 @@ const gr = ({
|
|
|
4615
4675
|
margin: a,
|
|
4616
4676
|
background: r,
|
|
4617
4677
|
radius: n,
|
|
4618
|
-
shadow:
|
|
4678
|
+
shadow: s,
|
|
4619
4679
|
border: o,
|
|
4620
4680
|
borderColor: u,
|
|
4621
4681
|
className: b,
|
|
@@ -4626,13 +4686,13 @@ const gr = ({
|
|
|
4626
4686
|
{
|
|
4627
4687
|
ref: f,
|
|
4628
4688
|
className: p(
|
|
4629
|
-
t &&
|
|
4630
|
-
a &&
|
|
4631
|
-
r &&
|
|
4632
|
-
n &&
|
|
4633
|
-
|
|
4634
|
-
o &&
|
|
4635
|
-
u &&
|
|
4689
|
+
t && Rt[t],
|
|
4690
|
+
a && Ht[a],
|
|
4691
|
+
r && qt[r],
|
|
4692
|
+
n && Ut[n],
|
|
4693
|
+
s && Gt[s],
|
|
4694
|
+
o && Kt[o],
|
|
4695
|
+
u && Jt[u],
|
|
4636
4696
|
b
|
|
4637
4697
|
),
|
|
4638
4698
|
...g,
|
|
@@ -4641,19 +4701,19 @@ const gr = ({
|
|
|
4641
4701
|
)
|
|
4642
4702
|
);
|
|
4643
4703
|
Ae.displayName = "Box";
|
|
4644
|
-
const
|
|
4704
|
+
const Nr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(Ae, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
|
|
4645
4705
|
a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
|
|
4646
4706
|
t
|
|
4647
4707
|
] });
|
|
4648
|
-
function
|
|
4708
|
+
function wr({
|
|
4649
4709
|
identifier: t,
|
|
4650
4710
|
resourceLoader: a,
|
|
4651
4711
|
framework: r = "react",
|
|
4652
4712
|
fallback: n,
|
|
4653
|
-
componentProps:
|
|
4713
|
+
componentProps: s,
|
|
4654
4714
|
className: o
|
|
4655
4715
|
}) {
|
|
4656
|
-
const u = J(null), [b, x] = P(!0), [g, f] = P(null),
|
|
4716
|
+
const u = J(null), [b, x] = P(!0), [g, f] = P(null), l = J(null);
|
|
4657
4717
|
return J(null), U(() => {
|
|
4658
4718
|
let m = !0;
|
|
4659
4719
|
return (async () => {
|
|
@@ -4676,24 +4736,24 @@ function Nr({
|
|
|
4676
4736
|
const m = u.current;
|
|
4677
4737
|
if (m) {
|
|
4678
4738
|
if (r === "svelte") {
|
|
4679
|
-
const h = g.default || g, w = new h({ target: m, props:
|
|
4680
|
-
return
|
|
4739
|
+
const h = g.default || g, w = new h({ target: m, props: s || {} });
|
|
4740
|
+
return l.current = w, () => w.$destroy();
|
|
4681
4741
|
}
|
|
4682
4742
|
if (g.mount) {
|
|
4683
|
-
const h = g.mount({ container: m, props:
|
|
4743
|
+
const h = g.mount({ container: m, props: s || {} });
|
|
4684
4744
|
return () => {
|
|
4685
4745
|
typeof h == "function" ? h() : g.unmount?.(m);
|
|
4686
4746
|
};
|
|
4687
4747
|
}
|
|
4688
4748
|
}
|
|
4689
4749
|
}, [g, r, b]), U(() => {
|
|
4690
|
-
r === "svelte" &&
|
|
4691
|
-
}, [
|
|
4750
|
+
r === "svelte" && l.current && l.current.$set?.(s);
|
|
4751
|
+
}, [s, r]), /* @__PURE__ */ d("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
4692
4752
|
b && n,
|
|
4693
|
-
r === "react" && g && /* @__PURE__ */ e(g, { ...
|
|
4753
|
+
r === "react" && g && /* @__PURE__ */ e(g, { ...s })
|
|
4694
4754
|
] });
|
|
4695
4755
|
}
|
|
4696
|
-
class
|
|
4756
|
+
class kr extends Ke {
|
|
4697
4757
|
constructor() {
|
|
4698
4758
|
super(...arguments), this.state = {
|
|
4699
4759
|
hasError: !1,
|
|
@@ -4722,48 +4782,49 @@ class wr extends Ke {
|
|
|
4722
4782
|
}
|
|
4723
4783
|
}
|
|
4724
4784
|
export {
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4785
|
+
Ot as Avatar,
|
|
4786
|
+
mr as AvatarStack,
|
|
4787
|
+
dr as Badge,
|
|
4728
4788
|
Ae as Box,
|
|
4729
4789
|
te as Button,
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4790
|
+
lr as ButtonGroup,
|
|
4791
|
+
Nr as Card,
|
|
4792
|
+
ye as Checkbox,
|
|
4793
|
+
vr as CommandPalette,
|
|
4734
4794
|
mt as ContentLoading,
|
|
4735
|
-
|
|
4795
|
+
ve as DatePicker,
|
|
4736
4796
|
ft as Dropdown,
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4797
|
+
kr as ErrorBoundary,
|
|
4798
|
+
wr as FederatedResource,
|
|
4799
|
+
Mt as FolderSelect,
|
|
4800
|
+
cr as Form,
|
|
4801
|
+
gr as Heading,
|
|
4741
4802
|
oe as Icon,
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4803
|
+
fr as Image,
|
|
4804
|
+
sr as Link,
|
|
4805
|
+
yr as List,
|
|
4806
|
+
rr as MeetingGrid,
|
|
4746
4807
|
St as Modal,
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4808
|
+
hr as PageHeader,
|
|
4809
|
+
pr as PageToolbar,
|
|
4810
|
+
nr as ParticipantTile,
|
|
4811
|
+
ir as Popover,
|
|
4751
4812
|
ot as SearchableTextField,
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4813
|
+
fe as Select,
|
|
4814
|
+
br as SidebarMenu,
|
|
4815
|
+
ur as Spinner,
|
|
4816
|
+
ze as SplitButton,
|
|
4756
4817
|
Et as StorageInput,
|
|
4757
|
-
|
|
4818
|
+
or as TabBar,
|
|
4758
4819
|
Le as Table,
|
|
4759
4820
|
kt as Tabs,
|
|
4760
4821
|
Z as Text,
|
|
4761
4822
|
Ne as TextArea,
|
|
4762
4823
|
ue as TextField,
|
|
4763
|
-
|
|
4764
|
-
|
|
4824
|
+
ar as VideoSurface,
|
|
4825
|
+
xr as View,
|
|
4765
4826
|
p as cn,
|
|
4766
|
-
|
|
4767
|
-
|
|
4827
|
+
tr as createSizes,
|
|
4828
|
+
er as createVariants
|
|
4768
4829
|
};
|
|
4769
4830
|
//# sourceMappingURL=index.js.map
|