@opencxh/ui-kit 3.13.0 → 3.18.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 +697 -639
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/meeting/MeetingGrid.d.ts +12 -0
- package/dist/src/meeting/ParticipantTile.d.ts +16 -0
- package/dist/src/meeting/VideoSurface.d.ts +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,86 @@
|
|
|
1
1
|
import { clsx as Te } from "clsx";
|
|
2
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { jsxs as c, jsx as e, Fragment as Me } from "react/jsx-runtime";
|
|
3
|
+
import { VideoOff as Ae, User as Ie, MicOff as je, Mic as Be, ChevronDown as Pe, FileText as pe, HardDrive as Ne, X as Oe, ArrowLeft as Ee, Search as _e, FolderPlus as Ve, Upload as Fe, Folder as we, ChevronDownIcon as We, ChevronRight as Re } from "lucide-react";
|
|
4
|
+
import se, { useRef as X, useEffect as K, forwardRef as ce, useState as V, useCallback as ae, useMemo as ie, createContext as He, Component as qe } from "react";
|
|
5
5
|
function x(...r) {
|
|
6
6
|
return Te(r);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return (
|
|
8
|
+
function Gr(r) {
|
|
9
|
+
return (n, t) => r[n]?.[t] || "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return (
|
|
11
|
+
function Kr(r) {
|
|
12
|
+
return (n) => r[n] || "";
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function Jr({ tiles: r, pinned: n, className: t }) {
|
|
15
|
+
if (n)
|
|
16
|
+
return /* @__PURE__ */ c("div", { className: x("flex flex-col md:flex-row gap-2 h-full", t), children: [
|
|
17
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children: n }),
|
|
18
|
+
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: r.map((o, i) => /* @__PURE__ */ e("div", { className: "min-w-[160px] md:min-w-0", children: o }, i)) })
|
|
19
|
+
] });
|
|
20
|
+
const a = r.length <= 1 ? "grid-cols-1" : r.length <= 4 ? "grid-cols-2" : r.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: x("grid gap-2 h-full", a, t), children: r.map((o, i) => /* @__PURE__ */ e("div", { children: o }, i)) });
|
|
22
|
+
}
|
|
23
|
+
function Yr({
|
|
24
|
+
name: r,
|
|
25
|
+
avatarUrl: n,
|
|
26
|
+
muted: t,
|
|
27
|
+
speaking: a,
|
|
28
|
+
hasVideo: o,
|
|
29
|
+
videoSlot: i,
|
|
30
|
+
className: h
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ c(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: x(
|
|
36
|
+
"relative rounded-lg overflow-hidden bg-gray-800 aspect-video flex items-center justify-center",
|
|
37
|
+
a && "ring-2 ring-emerald-400",
|
|
38
|
+
h
|
|
39
|
+
),
|
|
40
|
+
children: [
|
|
41
|
+
o && i ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: i }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: n ? /* @__PURE__ */ e("img", { src: n, alt: r, 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: o ? /* @__PURE__ */ e(Ae, { className: "w-8 h-8" }) : /* @__PURE__ */ e(Ie, { className: "w-8 h-8" }) }) }),
|
|
42
|
+
/* @__PURE__ */ c("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
|
+
t ? /* @__PURE__ */ e(je, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Be, { className: "w-3 h-3" }),
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: r })
|
|
45
|
+
] })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function Zr({ attach: r, active: n = !0, mirrored: t = !1, className: a }) {
|
|
51
|
+
const o = X(null);
|
|
52
|
+
return K(() => {
|
|
53
|
+
if (!n || !o.current) return;
|
|
54
|
+
const i = r(o.current);
|
|
55
|
+
return () => {
|
|
56
|
+
typeof i == "function" && i(), o.current && (o.current.innerHTML = "");
|
|
57
|
+
};
|
|
58
|
+
}, [r, n]), /* @__PURE__ */ e(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref: o,
|
|
62
|
+
className: x(
|
|
63
|
+
"w-full h-full bg-gray-900 overflow-hidden",
|
|
64
|
+
t && "[&>*]:scale-x-[-1]",
|
|
65
|
+
a
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const Ue = {
|
|
15
71
|
primary: "btn o__primary",
|
|
16
72
|
secondary: "btn o__secondary",
|
|
17
73
|
outline: "btn o__secondary",
|
|
18
74
|
ghost: "btn text-gray-700",
|
|
19
75
|
destructive: "btn o__destructive"
|
|
20
|
-
},
|
|
76
|
+
}, Ge = {
|
|
21
77
|
xs: "px-2 py-1 text-xs",
|
|
22
78
|
sm: "px-3 py-1.5 text-sm",
|
|
23
79
|
md: "px-4 py-2 text-sm",
|
|
24
80
|
lg: "px-6 py-3 text-base",
|
|
25
81
|
xl: "px-8 py-4 text-lg",
|
|
26
82
|
full: "px-4 py-3 text-base"
|
|
27
|
-
},
|
|
83
|
+
}, Ke = {
|
|
28
84
|
xs: "p-1",
|
|
29
85
|
sm: "p-1.5",
|
|
30
86
|
md: "p-2",
|
|
@@ -34,7 +90,7 @@ const We = {
|
|
|
34
90
|
}, ee = ce(
|
|
35
91
|
({
|
|
36
92
|
variant: r = "primary",
|
|
37
|
-
size:
|
|
93
|
+
size: n = "md",
|
|
38
94
|
fullWidth: t = !1,
|
|
39
95
|
loading: a = !1,
|
|
40
96
|
leftIcon: o,
|
|
@@ -44,12 +100,12 @@ const We = {
|
|
|
44
100
|
children: f,
|
|
45
101
|
disabled: b,
|
|
46
102
|
...m
|
|
47
|
-
},
|
|
103
|
+
}, l) => {
|
|
48
104
|
const d = b || a;
|
|
49
105
|
return /* @__PURE__ */ c(
|
|
50
106
|
"button",
|
|
51
107
|
{
|
|
52
|
-
ref:
|
|
108
|
+
ref: l,
|
|
53
109
|
type: "button",
|
|
54
110
|
className: x(
|
|
55
111
|
// Base styles
|
|
@@ -57,9 +113,9 @@ const We = {
|
|
|
57
113
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
58
114
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
59
115
|
// Variant styles
|
|
60
|
-
|
|
116
|
+
Ue[r],
|
|
61
117
|
// Size styles
|
|
62
|
-
h ?
|
|
118
|
+
h ? Ke[n] : Ge[n],
|
|
63
119
|
// Full width
|
|
64
120
|
t && "w-full",
|
|
65
121
|
// Loading state
|
|
@@ -111,9 +167,9 @@ const We = {
|
|
|
111
167
|
}
|
|
112
168
|
);
|
|
113
169
|
ee.displayName = "Button";
|
|
114
|
-
const
|
|
170
|
+
const Xr = ({
|
|
115
171
|
children: r,
|
|
116
|
-
size:
|
|
172
|
+
size: n = "md",
|
|
117
173
|
orientation: t = "horizontal",
|
|
118
174
|
attached: a = !0,
|
|
119
175
|
className: o
|
|
@@ -134,16 +190,16 @@ const Hr = ({
|
|
|
134
190
|
"[&>*:not(:first-child)]:-ml-px": a && t === "horizontal",
|
|
135
191
|
"[&>*:not(:first-child)]:-mt-px": a && t === "vertical",
|
|
136
192
|
// Spacing for non-attached buttons
|
|
137
|
-
"gap-1": !a &&
|
|
138
|
-
"gap-2": !a && (
|
|
139
|
-
"gap-3": !a && (
|
|
193
|
+
"gap-1": !a && n === "xs",
|
|
194
|
+
"gap-2": !a && (n === "sm" || n === "md"),
|
|
195
|
+
"gap-3": !a && (n === "lg" || n === "xl")
|
|
140
196
|
},
|
|
141
197
|
o
|
|
142
198
|
);
|
|
143
199
|
return /* @__PURE__ */ e("div", { className: i, role: "group", children: r });
|
|
144
|
-
},
|
|
200
|
+
}, Qr = ({
|
|
145
201
|
variant: r = "default",
|
|
146
|
-
size:
|
|
202
|
+
size: n = "md",
|
|
147
203
|
color: t = "primary",
|
|
148
204
|
disabled: a = !1,
|
|
149
205
|
external: o = !1,
|
|
@@ -154,16 +210,16 @@ const Hr = ({
|
|
|
154
210
|
rel: b,
|
|
155
211
|
...m
|
|
156
212
|
}) => {
|
|
157
|
-
const
|
|
213
|
+
const l = o || g && (g.startsWith("http") || g.startsWith("mailto:")), d = x(
|
|
158
214
|
// Base styles
|
|
159
215
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
160
216
|
// Size variants
|
|
161
217
|
{
|
|
162
|
-
"text-xs":
|
|
163
|
-
"text-sm":
|
|
164
|
-
"text-base":
|
|
165
|
-
"text-lg":
|
|
166
|
-
"text-xl":
|
|
218
|
+
"text-xs": n === "xs",
|
|
219
|
+
"text-sm": n === "sm",
|
|
220
|
+
"text-base": n === "md",
|
|
221
|
+
"text-lg": n === "lg",
|
|
222
|
+
"text-xl": n === "xl"
|
|
167
223
|
},
|
|
168
224
|
// Color variants
|
|
169
225
|
{
|
|
@@ -211,12 +267,12 @@ const Hr = ({
|
|
|
211
267
|
), p = {
|
|
212
268
|
...m,
|
|
213
269
|
href: a ? void 0 : g,
|
|
214
|
-
target:
|
|
215
|
-
rel:
|
|
270
|
+
target: l ? "_blank" : f,
|
|
271
|
+
rel: l ? "noopener noreferrer" : b
|
|
216
272
|
};
|
|
217
273
|
return /* @__PURE__ */ c("a", { className: d, ...p, children: [
|
|
218
274
|
h,
|
|
219
|
-
|
|
275
|
+
l && /* @__PURE__ */ e(
|
|
220
276
|
"svg",
|
|
221
277
|
{
|
|
222
278
|
className: "w-3 h-3 ml-1",
|
|
@@ -240,41 +296,41 @@ const Hr = ({
|
|
|
240
296
|
primary: "btn o__primary",
|
|
241
297
|
secondary: "btn o__secondary",
|
|
242
298
|
outline: "btn o__secondary"
|
|
243
|
-
},
|
|
299
|
+
}, Je = {
|
|
244
300
|
sm: "px-3 py-1.5 text-sm",
|
|
245
301
|
md: "px-4 py-2 text-sm"
|
|
246
302
|
};
|
|
247
|
-
function
|
|
303
|
+
function Ye({
|
|
248
304
|
label: r,
|
|
249
|
-
onClick:
|
|
305
|
+
onClick: n,
|
|
250
306
|
variant: t = "primary",
|
|
251
307
|
size: a = "md",
|
|
252
308
|
icon: o,
|
|
253
309
|
options: i,
|
|
254
310
|
disabled: h = !1
|
|
255
311
|
}) {
|
|
256
|
-
const [g, f] = V(!1), b =
|
|
257
|
-
f((
|
|
312
|
+
const [g, f] = V(!1), b = X(null), m = ae(() => {
|
|
313
|
+
f((l) => !l);
|
|
258
314
|
}, []);
|
|
259
|
-
return
|
|
260
|
-
const
|
|
315
|
+
return K(() => {
|
|
316
|
+
const l = (d) => {
|
|
261
317
|
b.current && !b.current.contains(d.target) && f(!1);
|
|
262
318
|
};
|
|
263
|
-
return document.addEventListener("mousedown",
|
|
264
|
-
}, []), /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex", children: [
|
|
319
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
320
|
+
}, []), /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex items-center gap-px", children: [
|
|
265
321
|
/* @__PURE__ */ c(
|
|
266
322
|
"button",
|
|
267
323
|
{
|
|
268
324
|
type: "button",
|
|
269
|
-
onClick:
|
|
325
|
+
onClick: n,
|
|
270
326
|
disabled: h,
|
|
271
327
|
className: x(
|
|
272
|
-
"inline-flex items-center justify-center font-medium
|
|
328
|
+
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
273
329
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
274
330
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
275
331
|
Ce[t],
|
|
276
|
-
|
|
277
|
-
"rounded-r-none
|
|
332
|
+
Je[a],
|
|
333
|
+
"!rounded-r-none"
|
|
278
334
|
),
|
|
279
335
|
children: [
|
|
280
336
|
o && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: o }),
|
|
@@ -289,40 +345,39 @@ function Ue({
|
|
|
289
345
|
onClick: m,
|
|
290
346
|
disabled: h,
|
|
291
347
|
className: x(
|
|
292
|
-
"inline-flex items-center justify-center font-medium
|
|
348
|
+
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
293
349
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
294
350
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
295
|
-
"border-l border-l-white/20",
|
|
296
351
|
Ce[t],
|
|
297
352
|
a === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
|
|
298
|
-
"rounded-l-none"
|
|
353
|
+
"!rounded-l-none"
|
|
299
354
|
),
|
|
300
|
-
children: /* @__PURE__ */ e(
|
|
355
|
+
children: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" })
|
|
301
356
|
}
|
|
302
357
|
),
|
|
303
|
-
g && i.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: i.map((
|
|
358
|
+
g && i.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: i.map((l) => /* @__PURE__ */ e(
|
|
304
359
|
"button",
|
|
305
360
|
{
|
|
306
361
|
type: "button",
|
|
307
362
|
onClick: () => {
|
|
308
|
-
|
|
363
|
+
l.onClick(), f(!1);
|
|
309
364
|
},
|
|
310
365
|
className: x(
|
|
311
366
|
"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
|
|
312
|
-
|
|
367
|
+
l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
|
|
313
368
|
),
|
|
314
|
-
children:
|
|
369
|
+
children: l.label
|
|
315
370
|
},
|
|
316
|
-
|
|
371
|
+
l.id
|
|
317
372
|
)) })
|
|
318
373
|
] });
|
|
319
374
|
}
|
|
320
|
-
const
|
|
375
|
+
const Ze = {
|
|
321
376
|
sm: "h-4 w-4",
|
|
322
377
|
md: "h-5 w-5",
|
|
323
378
|
lg: "h-6 w-6",
|
|
324
379
|
full: "h-6 w-6"
|
|
325
|
-
},
|
|
380
|
+
}, Xe = {
|
|
326
381
|
sm: "text-sm",
|
|
327
382
|
md: "text-sm",
|
|
328
383
|
lg: "text-base",
|
|
@@ -330,7 +385,7 @@ const Ke = {
|
|
|
330
385
|
}, be = ce(
|
|
331
386
|
({
|
|
332
387
|
label: r,
|
|
333
|
-
helperText:
|
|
388
|
+
helperText: n,
|
|
334
389
|
error: t,
|
|
335
390
|
size: a = "md",
|
|
336
391
|
indeterminate: o = !1,
|
|
@@ -340,7 +395,7 @@ const Ke = {
|
|
|
340
395
|
id: f,
|
|
341
396
|
...b
|
|
342
397
|
}, m) => {
|
|
343
|
-
const
|
|
398
|
+
const l = f || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
|
|
344
399
|
return se.useEffect(() => {
|
|
345
400
|
m && typeof m == "object" && m.current && (m.current.indeterminate = o);
|
|
346
401
|
}, [o, m]), /* @__PURE__ */ c("div", { className: x("flex flex-col", i), children: [
|
|
@@ -349,7 +404,7 @@ const Ke = {
|
|
|
349
404
|
"input",
|
|
350
405
|
{
|
|
351
406
|
ref: m,
|
|
352
|
-
id:
|
|
407
|
+
id: l,
|
|
353
408
|
type: "checkbox",
|
|
354
409
|
className: x(
|
|
355
410
|
// Base styles
|
|
@@ -357,7 +412,7 @@ const Ke = {
|
|
|
357
412
|
"focus:ring-2 focus:ring-offset-2 focus:outline-none",
|
|
358
413
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
359
414
|
// Size styles
|
|
360
|
-
|
|
415
|
+
Ze[a],
|
|
361
416
|
// State styles
|
|
362
417
|
d ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-primary focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800",
|
|
363
418
|
g
|
|
@@ -369,17 +424,17 @@ const Ke = {
|
|
|
369
424
|
/* @__PURE__ */ e(
|
|
370
425
|
"label",
|
|
371
426
|
{
|
|
372
|
-
htmlFor:
|
|
427
|
+
htmlFor: l,
|
|
373
428
|
className: x(
|
|
374
429
|
"font-medium cursor-pointer",
|
|
375
430
|
d ? "text-error" : "text-secondary-900 dark:text-secondary-100",
|
|
376
|
-
|
|
431
|
+
Xe[a],
|
|
377
432
|
h
|
|
378
433
|
),
|
|
379
434
|
children: r
|
|
380
435
|
}
|
|
381
436
|
),
|
|
382
|
-
|
|
437
|
+
n && !t && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-secondary-500 dark:text-secondary-400", children: n })
|
|
383
438
|
] })
|
|
384
439
|
] }),
|
|
385
440
|
t && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-error", children: t })
|
|
@@ -387,9 +442,9 @@ const Ke = {
|
|
|
387
442
|
}
|
|
388
443
|
);
|
|
389
444
|
be.displayName = "Checkbox";
|
|
390
|
-
const
|
|
445
|
+
const Qe = () => /* @__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" }) }), er = () => /* @__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" }) }), rr = () => /* @__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" }) }), ye = ce(({
|
|
391
446
|
value: r,
|
|
392
|
-
onChange:
|
|
447
|
+
onChange: n,
|
|
393
448
|
placeholder: t = "Select date",
|
|
394
449
|
disabled: a = !1,
|
|
395
450
|
required: o = !1,
|
|
@@ -399,15 +454,15 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
399
454
|
maxDate: f,
|
|
400
455
|
format: b = "MM/dd/yyyy"
|
|
401
456
|
}, m) => {
|
|
402
|
-
const [
|
|
403
|
-
|
|
457
|
+
const [l, d] = V(!1), [p, N] = V(() => r || /* @__PURE__ */ new Date()), v = X(null);
|
|
458
|
+
K(() => {
|
|
404
459
|
const z = (y) => {
|
|
405
460
|
v.current && !v.current.contains(y.target) && d(!1);
|
|
406
461
|
};
|
|
407
|
-
return
|
|
462
|
+
return l && document.addEventListener("mousedown", z), () => {
|
|
408
463
|
document.removeEventListener("mousedown", z);
|
|
409
464
|
};
|
|
410
|
-
}, [
|
|
465
|
+
}, [l]);
|
|
411
466
|
const S = (z) => {
|
|
412
467
|
if (!z) return "";
|
|
413
468
|
const y = z.getDate().toString().padStart(2, "0"), T = (z.getMonth() + 1).toString().padStart(2, "0"), u = z.getFullYear();
|
|
@@ -428,13 +483,13 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
428
483
|
$.push(new Date(L)), L.setDate(L.getDate() + 1);
|
|
429
484
|
return $;
|
|
430
485
|
}, k = (z) => {
|
|
431
|
-
z.getMonth() === p.getMonth() && (g && z < g || f && z > f || (
|
|
432
|
-
},
|
|
486
|
+
z.getMonth() === p.getMonth() && (g && z < g || f && z > f || (n?.(z), d(!1)));
|
|
487
|
+
}, H = () => {
|
|
433
488
|
N(new Date(p.getFullYear(), p.getMonth() - 1, 1));
|
|
434
|
-
},
|
|
489
|
+
}, G = () => {
|
|
435
490
|
N(new Date(p.getFullYear(), p.getMonth() + 1, 1));
|
|
436
|
-
},
|
|
437
|
-
|
|
491
|
+
}, q = () => {
|
|
492
|
+
n?.(null), d(!1);
|
|
438
493
|
}, F = x(
|
|
439
494
|
"w-full border border-neutral-100 dark:border-neutral-600 rounded-md transition-colors duration-200",
|
|
440
495
|
"bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-300",
|
|
@@ -448,7 +503,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
448
503
|
"px-4 py-3 text-base": i === "full"
|
|
449
504
|
},
|
|
450
505
|
h
|
|
451
|
-
),
|
|
506
|
+
), E = B(), J = [
|
|
452
507
|
"January",
|
|
453
508
|
"February",
|
|
454
509
|
"March",
|
|
@@ -474,7 +529,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
474
529
|
disabled: a,
|
|
475
530
|
required: o,
|
|
476
531
|
readOnly: !0,
|
|
477
|
-
onClick: () => !a && d(!
|
|
532
|
+
onClick: () => !a && d(!l),
|
|
478
533
|
className: x(F, "pr-10 cursor-pointer")
|
|
479
534
|
}
|
|
480
535
|
),
|
|
@@ -482,21 +537,21 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
482
537
|
"button",
|
|
483
538
|
{
|
|
484
539
|
type: "button",
|
|
485
|
-
onClick: () => !a && d(!
|
|
540
|
+
onClick: () => !a && d(!l),
|
|
486
541
|
disabled: a,
|
|
487
542
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300",
|
|
488
|
-
children: /* @__PURE__ */ e(
|
|
543
|
+
children: /* @__PURE__ */ e(Qe, {})
|
|
489
544
|
}
|
|
490
545
|
)
|
|
491
546
|
] }),
|
|
492
|
-
|
|
547
|
+
l && /* @__PURE__ */ c("div", { className: "absolute z-50 mt-1 bg-white dark:bg-neutral-800 border border-neutral-100 dark:border-neutral-600 rounded-md shadow-lg p-4 min-w-[280px]", children: [
|
|
493
548
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
494
549
|
/* @__PURE__ */ e(
|
|
495
550
|
"button",
|
|
496
551
|
{
|
|
497
|
-
onClick:
|
|
552
|
+
onClick: H,
|
|
498
553
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
499
|
-
children: /* @__PURE__ */ e(
|
|
554
|
+
children: /* @__PURE__ */ e(er, {})
|
|
500
555
|
}
|
|
501
556
|
),
|
|
502
557
|
/* @__PURE__ */ c("h3", { className: "text-sm font-medium text-neutral-900 dark:text-neutral-100", children: [
|
|
@@ -507,14 +562,14 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
507
562
|
/* @__PURE__ */ e(
|
|
508
563
|
"button",
|
|
509
564
|
{
|
|
510
|
-
onClick:
|
|
565
|
+
onClick: G,
|
|
511
566
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
512
|
-
children: /* @__PURE__ */ e(
|
|
567
|
+
children: /* @__PURE__ */ e(rr, {})
|
|
513
568
|
}
|
|
514
569
|
)
|
|
515
570
|
] }),
|
|
516
571
|
/* @__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-neutral-500 dark:text-neutral-400 text-center py-1", children: z }, z)) }),
|
|
517
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children:
|
|
572
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, y) => {
|
|
518
573
|
const T = z.getMonth() === p.getMonth(), u = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !T || g && z < g || f && z > f;
|
|
519
574
|
return /* @__PURE__ */ e(
|
|
520
575
|
"button",
|
|
@@ -539,7 +594,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
539
594
|
/* @__PURE__ */ e(
|
|
540
595
|
"button",
|
|
541
596
|
{
|
|
542
|
-
onClick:
|
|
597
|
+
onClick: q,
|
|
543
598
|
className: "text-sm text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
|
|
544
599
|
children: "Clear"
|
|
545
600
|
}
|
|
@@ -555,7 +610,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
555
610
|
] })
|
|
556
611
|
] })
|
|
557
612
|
] });
|
|
558
|
-
}), de = (...r) => r.filter(Boolean).join(" "),
|
|
613
|
+
}), de = (...r) => r.filter(Boolean).join(" "), tr = (r) => /* @__PURE__ */ e(
|
|
559
614
|
"svg",
|
|
560
615
|
{
|
|
561
616
|
...r,
|
|
@@ -573,7 +628,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
573
628
|
}
|
|
574
629
|
)
|
|
575
630
|
}
|
|
576
|
-
),
|
|
631
|
+
), ar = (r) => /* @__PURE__ */ e(
|
|
577
632
|
"svg",
|
|
578
633
|
{
|
|
579
634
|
...r,
|
|
@@ -591,7 +646,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
591
646
|
}
|
|
592
647
|
)
|
|
593
648
|
}
|
|
594
|
-
),
|
|
649
|
+
), nr = {
|
|
595
650
|
sm: "px-3 py-1.5 text-sm",
|
|
596
651
|
md: "px-3 py-2 text-sm",
|
|
597
652
|
lg: "px-3 py-2 text-sm",
|
|
@@ -601,20 +656,20 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
601
656
|
md: "h-5 w-5",
|
|
602
657
|
lg: "h-6 w-6",
|
|
603
658
|
full: "h-6 w-6"
|
|
604
|
-
},
|
|
659
|
+
}, lr = ce(
|
|
605
660
|
({
|
|
606
661
|
label: r,
|
|
607
|
-
helperText:
|
|
662
|
+
helperText: n,
|
|
608
663
|
error: t,
|
|
609
664
|
size: a = "md",
|
|
610
665
|
fullWidth: o = !1,
|
|
611
|
-
startIcon: i = /* @__PURE__ */ e(
|
|
666
|
+
startIcon: i = /* @__PURE__ */ e(tr, {}),
|
|
612
667
|
loading: h = !1,
|
|
613
668
|
containerClassName: g,
|
|
614
669
|
labelClassName: f,
|
|
615
670
|
className: b,
|
|
616
671
|
id: m,
|
|
617
|
-
options:
|
|
672
|
+
options: l,
|
|
618
673
|
onRemoteSearch: d,
|
|
619
674
|
onSelect: p,
|
|
620
675
|
debounceTime: N = 500,
|
|
@@ -622,26 +677,26 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
622
677
|
onChange: S,
|
|
623
678
|
...B
|
|
624
679
|
}, k) => {
|
|
625
|
-
const
|
|
626
|
-
|
|
680
|
+
const H = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, G = !!t, q = X(null), F = X(null), [E, J] = V(v || ""), [z, y] = V(!1), [T, u] = V(!1);
|
|
681
|
+
K(() => {
|
|
627
682
|
v !== void 0 && J(v);
|
|
628
683
|
}, [v]);
|
|
629
684
|
const $ = ie(() => {
|
|
630
|
-
if (!
|
|
631
|
-
const W = String(
|
|
632
|
-
return
|
|
685
|
+
if (!E) return l;
|
|
686
|
+
const W = String(E).toLowerCase();
|
|
687
|
+
return l.filter(
|
|
633
688
|
(C) => String(C.label).toLowerCase().includes(W)
|
|
634
689
|
);
|
|
635
|
-
}, [
|
|
636
|
-
|
|
637
|
-
if (!d || !
|
|
690
|
+
}, [E, l]);
|
|
691
|
+
K(() => {
|
|
692
|
+
if (!d || !E) {
|
|
638
693
|
u(!1);
|
|
639
694
|
return;
|
|
640
695
|
}
|
|
641
696
|
const W = setTimeout(async () => {
|
|
642
697
|
u(!0);
|
|
643
698
|
try {
|
|
644
|
-
await d(String(
|
|
699
|
+
await d(String(E));
|
|
645
700
|
} catch (C) {
|
|
646
701
|
console.error("Remote search failed:", C);
|
|
647
702
|
} finally {
|
|
@@ -651,9 +706,9 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
651
706
|
return () => {
|
|
652
707
|
clearTimeout(W), u(!1);
|
|
653
708
|
};
|
|
654
|
-
}, [
|
|
709
|
+
}, [E, N, d]), K(() => {
|
|
655
710
|
const W = (C) => {
|
|
656
|
-
|
|
711
|
+
q.current && !q.current.contains(C.target) && y(!1);
|
|
657
712
|
};
|
|
658
713
|
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
659
714
|
}, []);
|
|
@@ -663,8 +718,8 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
663
718
|
}, D = (W) => {
|
|
664
719
|
J(W.label), y(!1), p && p(W.value);
|
|
665
720
|
}, P = () => {
|
|
666
|
-
(
|
|
667
|
-
},
|
|
721
|
+
(l.length > 0 || d) && y(!0);
|
|
722
|
+
}, M = h || T, re = z && ($.length > 0 || M), ne = ie(() => k || F, [k]);
|
|
668
723
|
return /* @__PURE__ */ c(
|
|
669
724
|
"div",
|
|
670
725
|
{
|
|
@@ -674,15 +729,15 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
674
729
|
g || "",
|
|
675
730
|
"relative"
|
|
676
731
|
),
|
|
677
|
-
ref:
|
|
732
|
+
ref: q,
|
|
678
733
|
children: [
|
|
679
734
|
r && /* @__PURE__ */ e(
|
|
680
735
|
"label",
|
|
681
736
|
{
|
|
682
|
-
htmlFor:
|
|
737
|
+
htmlFor: H,
|
|
683
738
|
className: de(
|
|
684
739
|
"block text-sm font-medium mb-1",
|
|
685
|
-
|
|
740
|
+
G ? "text-red-500" : "text-gray-700 dark:text-gray-300",
|
|
686
741
|
f || ""
|
|
687
742
|
),
|
|
688
743
|
children: r
|
|
@@ -694,8 +749,8 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
694
749
|
"input",
|
|
695
750
|
{
|
|
696
751
|
ref: ne,
|
|
697
|
-
id:
|
|
698
|
-
value:
|
|
752
|
+
id: H,
|
|
753
|
+
value: E,
|
|
699
754
|
onChange: L,
|
|
700
755
|
onFocus: P,
|
|
701
756
|
className: de(
|
|
@@ -704,19 +759,19 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
704
759
|
"placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none",
|
|
705
760
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
706
761
|
// Size styles
|
|
707
|
-
|
|
762
|
+
nr[a],
|
|
708
763
|
// Icon padding
|
|
709
764
|
i ? "pl-10" : "",
|
|
710
765
|
"pr-10",
|
|
711
766
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
712
767
|
// State styles
|
|
713
|
-
|
|
768
|
+
G ? "border-red-500 text-red-500 focus:border-red-500 focus:ring-red-500" : "border-gray-300 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",
|
|
714
769
|
b || ""
|
|
715
770
|
),
|
|
716
771
|
...B
|
|
717
772
|
}
|
|
718
773
|
),
|
|
719
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children:
|
|
774
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || h ? (
|
|
720
775
|
// Loading Spinner
|
|
721
776
|
/* @__PURE__ */ c(
|
|
722
777
|
"svg",
|
|
@@ -751,7 +806,7 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
751
806
|
) : (
|
|
752
807
|
// Dropdown Chevron
|
|
753
808
|
/* @__PURE__ */ e(
|
|
754
|
-
|
|
809
|
+
ar,
|
|
755
810
|
{
|
|
756
811
|
className: de(
|
|
757
812
|
"text-gray-400 cursor-pointer transition-transform",
|
|
@@ -774,34 +829,34 @@ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
774
829
|
className: "px-4 py-2 cursor-pointer text-gray-900 dark:text-gray-100 hover:bg-blue-500 hover:text-white transition-colors",
|
|
775
830
|
onClick: () => D(W),
|
|
776
831
|
role: "option",
|
|
777
|
-
"aria-selected":
|
|
832
|
+
"aria-selected": E === W.label,
|
|
778
833
|
children: W.label
|
|
779
834
|
},
|
|
780
835
|
W.value
|
|
781
|
-
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children:
|
|
836
|
+
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children: M || h ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
782
837
|
}
|
|
783
838
|
),
|
|
784
|
-
(t ||
|
|
839
|
+
(t || n) && /* @__PURE__ */ e(
|
|
785
840
|
"p",
|
|
786
841
|
{
|
|
787
842
|
className: de(
|
|
788
843
|
"mt-1 text-xs",
|
|
789
|
-
|
|
844
|
+
G ? "text-red-500" : "text-gray-500"
|
|
790
845
|
),
|
|
791
|
-
children: t ||
|
|
846
|
+
children: t || n
|
|
792
847
|
}
|
|
793
848
|
),
|
|
794
849
|
d && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-green-600 dark:text-green-400", children: [
|
|
795
850
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
796
|
-
String(
|
|
851
|
+
String(E)
|
|
797
852
|
] })
|
|
798
853
|
]
|
|
799
854
|
}
|
|
800
855
|
);
|
|
801
856
|
}
|
|
802
857
|
);
|
|
803
|
-
|
|
804
|
-
const
|
|
858
|
+
lr.displayName = "SearchableTextField";
|
|
859
|
+
const sr = {
|
|
805
860
|
sm: "px-3 py-1.5 text-sm",
|
|
806
861
|
md: "px-3 py-2 text-sm",
|
|
807
862
|
lg: "px-3 py-2 text-sm",
|
|
@@ -809,7 +864,7 @@ const tr = {
|
|
|
809
864
|
}, me = (r) => r.trim().toLowerCase(), ve = ce(
|
|
810
865
|
({
|
|
811
866
|
label: r,
|
|
812
|
-
helperText:
|
|
867
|
+
helperText: n,
|
|
813
868
|
error: t,
|
|
814
869
|
size: a = "md",
|
|
815
870
|
fullWidth: o = !1,
|
|
@@ -819,7 +874,7 @@ const tr = {
|
|
|
819
874
|
labelClassName: f,
|
|
820
875
|
className: b,
|
|
821
876
|
id: m,
|
|
822
|
-
searchable:
|
|
877
|
+
searchable: l,
|
|
823
878
|
multiple: d,
|
|
824
879
|
value: p,
|
|
825
880
|
onChange: N,
|
|
@@ -827,7 +882,7 @@ const tr = {
|
|
|
827
882
|
onCreateOption: S,
|
|
828
883
|
...B
|
|
829
884
|
}, k) => {
|
|
830
|
-
const
|
|
885
|
+
const H = m || `select-${Math.random().toString(36).substr(2, 9)}`, G = !!t, [q, F] = se.useState(!1), [E, J] = se.useState(""), z = se.useRef(null), [y, T] = se.useState(i);
|
|
831
886
|
se.useImperativeHandle(k, () => z.current), se.useEffect(() => {
|
|
832
887
|
const C = (I) => {
|
|
833
888
|
z.current && !z.current.contains(I.target) && F(!1);
|
|
@@ -836,49 +891,49 @@ const tr = {
|
|
|
836
891
|
}, []);
|
|
837
892
|
const u = se.useCallback(
|
|
838
893
|
(C, I) => C.some(
|
|
839
|
-
(
|
|
894
|
+
(_) => me(_.value) === me(I) || me(_.label) === me(I)
|
|
840
895
|
),
|
|
841
896
|
[]
|
|
842
897
|
), $ = se.useCallback(
|
|
843
898
|
(C, I) => {
|
|
844
|
-
const
|
|
845
|
-
const te = (
|
|
846
|
-
te && (u(
|
|
899
|
+
const _ = [...C], A = (Q) => {
|
|
900
|
+
const te = (Q ?? "").trim();
|
|
901
|
+
te && (u(_, te) || _.push({ value: te, label: te }));
|
|
847
902
|
};
|
|
848
|
-
return Array.isArray(I) ? I.forEach(A) : A(I),
|
|
903
|
+
return Array.isArray(I) ? I.forEach(A) : A(I), _;
|
|
849
904
|
},
|
|
850
905
|
[u]
|
|
851
906
|
);
|
|
852
907
|
se.useEffect(() => {
|
|
853
908
|
T((C) => {
|
|
854
909
|
const I = [...i];
|
|
855
|
-
return C.forEach((
|
|
856
|
-
!u(I,
|
|
910
|
+
return C.forEach((_) => {
|
|
911
|
+
!u(I, _.value) && !u(I, _.label) && I.push(_);
|
|
857
912
|
}), $(I, p);
|
|
858
913
|
});
|
|
859
914
|
}, [i, p, $, u]);
|
|
860
915
|
const L = (C) => {
|
|
861
916
|
if (d) {
|
|
862
|
-
const I = Array.isArray(p) ? p : [],
|
|
863
|
-
N?.(
|
|
917
|
+
const I = Array.isArray(p) ? p : [], _ = I.includes(C) ? I.filter((A) => A !== C) : [...I, C];
|
|
918
|
+
N?.(_);
|
|
864
919
|
} else
|
|
865
920
|
N?.(C), F(!1), J("");
|
|
866
921
|
}, D = d ? null : y.find((C) => C.value === p), P = d ? y.filter(
|
|
867
922
|
(C) => Array.isArray(p) && p.includes(C.value)
|
|
868
|
-
) : [],
|
|
869
|
-
(C) => C.label.toLowerCase().includes(
|
|
870
|
-
) : y, re = !!v && !!
|
|
923
|
+
) : [], M = l && E ? y.filter(
|
|
924
|
+
(C) => C.label.toLowerCase().includes(E.toLowerCase())
|
|
925
|
+
) : y, re = !!v && !!l && !!E.trim() && !u(y, E), ne = (C) => {
|
|
871
926
|
const I = C.trim();
|
|
872
927
|
if (!I) return;
|
|
873
|
-
const
|
|
928
|
+
const _ = S?.(I) ?? {
|
|
874
929
|
value: I,
|
|
875
930
|
label: I
|
|
876
931
|
};
|
|
877
|
-
if (u(y,
|
|
878
|
-
L(
|
|
932
|
+
if (u(y, _.value) || u(y, _.label)) {
|
|
933
|
+
L(_.value), J(""), d || F(!1);
|
|
879
934
|
return;
|
|
880
935
|
}
|
|
881
|
-
T((A) => [...A,
|
|
936
|
+
T((A) => [...A, _]), L(_.value), J(""), d || F(!1);
|
|
882
937
|
}, W = () => d ? P.length > 0 ? P.map((C) => C.label).join(", ") : h || "Select options" : D?.label || h || "Select an option";
|
|
883
938
|
return /* @__PURE__ */ c(
|
|
884
939
|
"div",
|
|
@@ -894,11 +949,11 @@ const tr = {
|
|
|
894
949
|
r && /* @__PURE__ */ e(
|
|
895
950
|
"label",
|
|
896
951
|
{
|
|
897
|
-
htmlFor:
|
|
898
|
-
onClick: () => F(!
|
|
952
|
+
htmlFor: H,
|
|
953
|
+
onClick: () => F(!q),
|
|
899
954
|
className: x(
|
|
900
955
|
"block text-sm font-medium mb-1",
|
|
901
|
-
|
|
956
|
+
G ? "text-error" : "text-secondary-700 dark:text-secondary-300",
|
|
902
957
|
f
|
|
903
958
|
),
|
|
904
959
|
children: r
|
|
@@ -909,30 +964,30 @@ const tr = {
|
|
|
909
964
|
"button",
|
|
910
965
|
{
|
|
911
966
|
type: "button",
|
|
912
|
-
id:
|
|
913
|
-
onClick: () => F(!
|
|
967
|
+
id: H,
|
|
968
|
+
onClick: () => F(!q),
|
|
914
969
|
className: x(
|
|
915
970
|
"block w-full rounded-lg border transition-colors duration-200 text-left",
|
|
916
971
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
917
972
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
918
973
|
"bg-white dark:bg-secondary-800",
|
|
919
|
-
|
|
920
|
-
|
|
974
|
+
sr[a],
|
|
975
|
+
G ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-secondary-900 dark:border-neutral-700 dark:bg-secondary-800 dark:text-secondary-100",
|
|
921
976
|
b
|
|
922
977
|
),
|
|
923
978
|
children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
|
|
924
979
|
}
|
|
925
980
|
),
|
|
926
|
-
|
|
927
|
-
|
|
981
|
+
q && /* @__PURE__ */ c("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-white dark:bg-secondary-800 shadow-lg border border-neutral dark:border-neutral-700", children: [
|
|
982
|
+
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
928
983
|
"input",
|
|
929
984
|
{
|
|
930
985
|
type: "text",
|
|
931
986
|
placeholder: "Search...",
|
|
932
|
-
value:
|
|
987
|
+
value: E,
|
|
933
988
|
onChange: (C) => J(C.target.value),
|
|
934
989
|
onKeyDown: (C) => {
|
|
935
|
-
C.key === "Enter" && re && (C.preventDefault(), ne(
|
|
990
|
+
C.key === "Enter" && re && (C.preventDefault(), ne(E));
|
|
936
991
|
},
|
|
937
992
|
className: x(
|
|
938
993
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -947,10 +1002,10 @@ const tr = {
|
|
|
947
1002
|
"px-4 py-2 text-sm cursor-pointer",
|
|
948
1003
|
"text-primary hover:bg-gray-100 dark:hover:bg-secondary-700"
|
|
949
1004
|
),
|
|
950
|
-
onClick: () => ne(
|
|
1005
|
+
onClick: () => ne(E),
|
|
951
1006
|
children: [
|
|
952
1007
|
"+: “",
|
|
953
|
-
|
|
1008
|
+
E.trim(),
|
|
954
1009
|
"”"
|
|
955
1010
|
]
|
|
956
1011
|
}
|
|
@@ -966,7 +1021,7 @@ const tr = {
|
|
|
966
1021
|
children: h
|
|
967
1022
|
}
|
|
968
1023
|
),
|
|
969
|
-
|
|
1024
|
+
M.map((C) => {
|
|
970
1025
|
const I = d ? Array.isArray(p) && p.includes(C.value) : p === C.value;
|
|
971
1026
|
return /* @__PURE__ */ e(
|
|
972
1027
|
"li",
|
|
@@ -997,14 +1052,14 @@ const tr = {
|
|
|
997
1052
|
] })
|
|
998
1053
|
] })
|
|
999
1054
|
] }),
|
|
1000
|
-
(t ||
|
|
1055
|
+
(t || n) && /* @__PURE__ */ e(
|
|
1001
1056
|
"p",
|
|
1002
1057
|
{
|
|
1003
1058
|
className: x(
|
|
1004
1059
|
"mt-1 text-xs",
|
|
1005
|
-
|
|
1060
|
+
G ? "text-error" : "text-secondary-500"
|
|
1006
1061
|
),
|
|
1007
|
-
children: t ||
|
|
1062
|
+
children: t || n
|
|
1008
1063
|
}
|
|
1009
1064
|
)
|
|
1010
1065
|
]
|
|
@@ -1013,7 +1068,7 @@ const tr = {
|
|
|
1013
1068
|
}
|
|
1014
1069
|
);
|
|
1015
1070
|
ve.displayName = "Select";
|
|
1016
|
-
const
|
|
1071
|
+
const or = {
|
|
1017
1072
|
sm: "px-3 py-1.5 text-sm",
|
|
1018
1073
|
md: "px-3 py-2 text-sm",
|
|
1019
1074
|
lg: "px-4 py-3 text-base",
|
|
@@ -1021,7 +1076,7 @@ const ar = {
|
|
|
1021
1076
|
}, ke = ce(
|
|
1022
1077
|
({
|
|
1023
1078
|
label: r,
|
|
1024
|
-
helperText:
|
|
1079
|
+
helperText: n,
|
|
1025
1080
|
error: t,
|
|
1026
1081
|
size: a = "md",
|
|
1027
1082
|
fullWidth: o = !1,
|
|
@@ -1031,7 +1086,7 @@ const ar = {
|
|
|
1031
1086
|
className: f,
|
|
1032
1087
|
id: b,
|
|
1033
1088
|
rows: m = 4,
|
|
1034
|
-
...
|
|
1089
|
+
...l
|
|
1035
1090
|
}, d) => {
|
|
1036
1091
|
const p = b || `textarea-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
|
|
1037
1092
|
return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", h), children: [
|
|
@@ -1060,12 +1115,12 @@ const ar = {
|
|
|
1060
1115
|
"placeholder-secondary-400 focus:outline-none focus:ring-0",
|
|
1061
1116
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1062
1117
|
// Size styles
|
|
1063
|
-
|
|
1118
|
+
or[a],
|
|
1064
1119
|
// State styles
|
|
1065
1120
|
N ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
|
|
1066
1121
|
f
|
|
1067
1122
|
),
|
|
1068
|
-
...
|
|
1123
|
+
...l
|
|
1069
1124
|
}
|
|
1070
1125
|
),
|
|
1071
1126
|
i && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ c(
|
|
@@ -1098,21 +1153,21 @@ const ar = {
|
|
|
1098
1153
|
}
|
|
1099
1154
|
) })
|
|
1100
1155
|
] }),
|
|
1101
|
-
(t ||
|
|
1156
|
+
(t || n) && /* @__PURE__ */ e(
|
|
1102
1157
|
"p",
|
|
1103
1158
|
{
|
|
1104
1159
|
className: x(
|
|
1105
1160
|
"mt-1 text-xs",
|
|
1106
1161
|
N ? "text-error" : "text-secondary-500"
|
|
1107
1162
|
),
|
|
1108
|
-
children: t ||
|
|
1163
|
+
children: t || n
|
|
1109
1164
|
}
|
|
1110
1165
|
)
|
|
1111
1166
|
] });
|
|
1112
1167
|
}
|
|
1113
1168
|
);
|
|
1114
1169
|
ke.displayName = "TextArea";
|
|
1115
|
-
const
|
|
1170
|
+
const cr = {
|
|
1116
1171
|
sm: "px-3 py-1.5 text-sm",
|
|
1117
1172
|
md: "px-3 py-2 text-sm",
|
|
1118
1173
|
lg: "px-3 py-2 text-sm",
|
|
@@ -1125,7 +1180,7 @@ const nr = {
|
|
|
1125
1180
|
}, ue = ce(
|
|
1126
1181
|
({
|
|
1127
1182
|
label: r,
|
|
1128
|
-
helperText:
|
|
1183
|
+
helperText: n,
|
|
1129
1184
|
error: t,
|
|
1130
1185
|
size: a = "md",
|
|
1131
1186
|
fullWidth: o = !1,
|
|
@@ -1135,10 +1190,10 @@ const nr = {
|
|
|
1135
1190
|
containerClassName: f,
|
|
1136
1191
|
labelClassName: b,
|
|
1137
1192
|
className: m,
|
|
1138
|
-
id:
|
|
1193
|
+
id: l,
|
|
1139
1194
|
...d
|
|
1140
1195
|
}, p) => {
|
|
1141
|
-
const N =
|
|
1196
|
+
const N = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, v = !!t;
|
|
1142
1197
|
return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", f), children: [
|
|
1143
1198
|
r && /* @__PURE__ */ e(
|
|
1144
1199
|
"label",
|
|
@@ -1166,7 +1221,7 @@ const nr = {
|
|
|
1166
1221
|
"placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-offset-0",
|
|
1167
1222
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1168
1223
|
// Size styles
|
|
1169
|
-
|
|
1224
|
+
cr[a],
|
|
1170
1225
|
// Icon padding
|
|
1171
1226
|
i && "pl-10",
|
|
1172
1227
|
h && "pr-10",
|
|
@@ -1207,14 +1262,14 @@ const nr = {
|
|
|
1207
1262
|
}
|
|
1208
1263
|
) : h && /* @__PURE__ */ e("span", { className: x("text-secondary-400", ge[a]), children: h }) })
|
|
1209
1264
|
] }),
|
|
1210
|
-
(t ||
|
|
1265
|
+
(t || n) && /* @__PURE__ */ e(
|
|
1211
1266
|
"p",
|
|
1212
1267
|
{
|
|
1213
1268
|
className: x(
|
|
1214
1269
|
"mt-1 text-xs",
|
|
1215
1270
|
v ? "text-error" : "text-secondary-500"
|
|
1216
1271
|
),
|
|
1217
|
-
children: t ||
|
|
1272
|
+
children: t || n
|
|
1218
1273
|
}
|
|
1219
1274
|
)
|
|
1220
1275
|
] });
|
|
@@ -1223,7 +1278,7 @@ const nr = {
|
|
|
1223
1278
|
ue.displayName = "TextField";
|
|
1224
1279
|
const oe = ({
|
|
1225
1280
|
icon: r,
|
|
1226
|
-
size:
|
|
1281
|
+
size: n = "md",
|
|
1227
1282
|
color: t = "current",
|
|
1228
1283
|
clickable: a = !1,
|
|
1229
1284
|
onClick: o,
|
|
@@ -1231,7 +1286,7 @@ const oe = ({
|
|
|
1231
1286
|
"aria-label": h,
|
|
1232
1287
|
...g
|
|
1233
1288
|
}) => {
|
|
1234
|
-
const f = typeof
|
|
1289
|
+
const f = typeof n == "number" ? n : dr(n), b = x(
|
|
1235
1290
|
"inline-block",
|
|
1236
1291
|
// Color variants
|
|
1237
1292
|
{
|
|
@@ -1258,14 +1313,14 @@ const oe = ({
|
|
|
1258
1313
|
"aria-label": h,
|
|
1259
1314
|
role: a ? "button" : void 0,
|
|
1260
1315
|
tabIndex: a ? 0 : void 0,
|
|
1261
|
-
onKeyDown: a ? (
|
|
1262
|
-
(
|
|
1316
|
+
onKeyDown: a ? (l) => {
|
|
1317
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), o?.());
|
|
1263
1318
|
} : void 0,
|
|
1264
1319
|
...g
|
|
1265
1320
|
};
|
|
1266
1321
|
return /* @__PURE__ */ e(r, { ...m });
|
|
1267
1322
|
};
|
|
1268
|
-
function
|
|
1323
|
+
function dr(r) {
|
|
1269
1324
|
return {
|
|
1270
1325
|
xs: 12,
|
|
1271
1326
|
sm: 16,
|
|
@@ -1274,21 +1329,21 @@ function lr(r) {
|
|
|
1274
1329
|
xl: 32
|
|
1275
1330
|
}[r];
|
|
1276
1331
|
}
|
|
1277
|
-
function
|
|
1332
|
+
function ir({
|
|
1278
1333
|
children: r,
|
|
1279
|
-
showTableSkeleton:
|
|
1334
|
+
showTableSkeleton: n = !1,
|
|
1280
1335
|
tableColumns: t = 6,
|
|
1281
1336
|
tableRows: a = 8
|
|
1282
1337
|
}) {
|
|
1283
1338
|
return r ? /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: r }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ c("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
|
|
1284
|
-
!
|
|
1339
|
+
!n && /* @__PURE__ */ c(Me, { children: [
|
|
1285
1340
|
/* @__PURE__ */ e("div", { className: "h-6 bg-gray-200 dark:bg-gray-700 rounded w-1/4" }),
|
|
1286
1341
|
/* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
1287
1342
|
/* @__PURE__ */ e("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-3/4" }),
|
|
1288
1343
|
/* @__PURE__ */ e("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-1/2" })
|
|
1289
1344
|
] })
|
|
1290
1345
|
] }),
|
|
1291
|
-
|
|
1346
|
+
n && /* @__PURE__ */ c("div", { className: "rounded-lg overflow-hidden", children: [
|
|
1292
1347
|
/* @__PURE__ */ e("div", { className: `grid grid-cols-${t} gap-2 bg-gray-100 dark:bg-gray-800 p-3`, children: Array.from({ length: t }).map((o, i) => /* @__PURE__ */ e(
|
|
1293
1348
|
"div",
|
|
1294
1349
|
{
|
|
@@ -1313,9 +1368,9 @@ function sr({
|
|
|
1313
1368
|
] })
|
|
1314
1369
|
] }) });
|
|
1315
1370
|
}
|
|
1316
|
-
const
|
|
1371
|
+
const ur = ({
|
|
1317
1372
|
trigger: r,
|
|
1318
|
-
options:
|
|
1373
|
+
options: n,
|
|
1319
1374
|
value: t,
|
|
1320
1375
|
onSelect: a,
|
|
1321
1376
|
placement: o = "bottom-start",
|
|
@@ -1324,25 +1379,25 @@ const or = ({
|
|
|
1324
1379
|
showCheck: g = !0,
|
|
1325
1380
|
header: f
|
|
1326
1381
|
}) => {
|
|
1327
|
-
const [b, m] = V(!1), [
|
|
1328
|
-
|
|
1382
|
+
const [b, m] = V(!1), [l, d] = V(null), [p, N] = V({ top: 0, left: 0 }), v = X(null), S = X(null), B = X(null), k = X(null);
|
|
1383
|
+
K(() => {
|
|
1329
1384
|
const y = (T) => {
|
|
1330
1385
|
v.current && (!v.current.contains(T.target) || B.current && !B.current.contains(T.target)) && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
|
|
1331
1386
|
};
|
|
1332
1387
|
return b && document.addEventListener("mousedown", y), () => {
|
|
1333
1388
|
document.removeEventListener("mousedown", y);
|
|
1334
1389
|
};
|
|
1335
|
-
}, [b]),
|
|
1390
|
+
}, [b]), K(() => {
|
|
1336
1391
|
const y = (T) => {
|
|
1337
1392
|
T.key === "Escape" && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
|
|
1338
1393
|
};
|
|
1339
1394
|
return b && document.addEventListener("keydown", y), () => {
|
|
1340
1395
|
document.removeEventListener("keydown", y);
|
|
1341
1396
|
};
|
|
1342
|
-
}, [b]),
|
|
1343
|
-
if (
|
|
1397
|
+
}, [b]), K(() => {
|
|
1398
|
+
if (l && v.current) {
|
|
1344
1399
|
const y = v.current.querySelector(
|
|
1345
|
-
`[data-option-value="${
|
|
1400
|
+
`[data-option-value="${l}"]`
|
|
1346
1401
|
);
|
|
1347
1402
|
if (y) {
|
|
1348
1403
|
const T = y.getBoundingClientRect();
|
|
@@ -1352,20 +1407,20 @@ const or = ({
|
|
|
1352
1407
|
});
|
|
1353
1408
|
}
|
|
1354
1409
|
}
|
|
1355
|
-
}, [
|
|
1410
|
+
}, [l]), K(() => () => {
|
|
1356
1411
|
k.current && clearTimeout(k.current);
|
|
1357
1412
|
}, []);
|
|
1358
|
-
const
|
|
1413
|
+
const H = (y) => {
|
|
1359
1414
|
y.stopPropagation(), i || (m(!b), d(null), k.current && (clearTimeout(k.current), k.current = null));
|
|
1360
|
-
},
|
|
1415
|
+
}, G = (y, T, u) => {
|
|
1361
1416
|
y.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (a?.(T.value, u), m(!1), d(null));
|
|
1362
|
-
},
|
|
1417
|
+
}, q = (y) => {
|
|
1363
1418
|
k.current && (clearTimeout(k.current), k.current = null), y.children && y.children.length > 0 ? d(y.value) : d(null);
|
|
1364
1419
|
}, F = (y) => {
|
|
1365
1420
|
y.children && y.children.length > 0 ? k.current = setTimeout(() => {
|
|
1366
1421
|
d(null);
|
|
1367
1422
|
}, 150) : d(null);
|
|
1368
|
-
},
|
|
1423
|
+
}, E = (y, T, u) => {
|
|
1369
1424
|
y.stopPropagation(), !T.disabled && !T.divider && (a?.(T.value, u), m(!1), d(null));
|
|
1370
1425
|
}, J = x(
|
|
1371
1426
|
"absolute z-50 min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-xs border border-gray-100 dark:border-gray-600",
|
|
@@ -1393,7 +1448,7 @@ const or = ({
|
|
|
1393
1448
|
"button",
|
|
1394
1449
|
{
|
|
1395
1450
|
ref: S,
|
|
1396
|
-
onClick:
|
|
1451
|
+
onClick: H,
|
|
1397
1452
|
disabled: i,
|
|
1398
1453
|
className: x("inline-flex items-center justify-center", {
|
|
1399
1454
|
"opacity-50 cursor-not-allowed": i
|
|
@@ -1403,7 +1458,7 @@ const or = ({
|
|
|
1403
1458
|
),
|
|
1404
1459
|
b && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
1405
1460
|
f && (typeof f == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: f }) : f),
|
|
1406
|
-
|
|
1461
|
+
n.map((y, T) => {
|
|
1407
1462
|
if (y.divider)
|
|
1408
1463
|
return /* @__PURE__ */ e(
|
|
1409
1464
|
"div",
|
|
@@ -1412,14 +1467,14 @@ const or = ({
|
|
|
1412
1467
|
},
|
|
1413
1468
|
`divider-${T}`
|
|
1414
1469
|
);
|
|
1415
|
-
const u = y.children && y.children.length > 0, $ =
|
|
1470
|
+
const u = y.children && y.children.length > 0, $ = l === y.value;
|
|
1416
1471
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1417
1472
|
/* @__PURE__ */ c(
|
|
1418
1473
|
"button",
|
|
1419
1474
|
{
|
|
1420
1475
|
"data-option-value": y.value,
|
|
1421
|
-
onClick: (L) =>
|
|
1422
|
-
onMouseEnter: () =>
|
|
1476
|
+
onClick: (L) => G(L, y),
|
|
1477
|
+
onMouseEnter: () => q(y),
|
|
1423
1478
|
onMouseLeave: () => F(y),
|
|
1424
1479
|
disabled: y.disabled,
|
|
1425
1480
|
className: x(
|
|
@@ -1476,8 +1531,8 @@ const or = ({
|
|
|
1476
1531
|
return /* @__PURE__ */ c(
|
|
1477
1532
|
"button",
|
|
1478
1533
|
{
|
|
1479
|
-
onClick: (
|
|
1480
|
-
|
|
1534
|
+
onClick: (M) => E(
|
|
1535
|
+
M,
|
|
1481
1536
|
L,
|
|
1482
1537
|
y.value
|
|
1483
1538
|
),
|
|
@@ -1507,7 +1562,7 @@ const or = ({
|
|
|
1507
1562
|
] }, y.value);
|
|
1508
1563
|
}),
|
|
1509
1564
|
(() => {
|
|
1510
|
-
const y =
|
|
1565
|
+
const y = n.reduce((T, u) => {
|
|
1511
1566
|
if (u.divider) return T;
|
|
1512
1567
|
const $ = u.children ? u.children.filter((L) => !L.divider).length : 0;
|
|
1513
1568
|
return T + 1 + $;
|
|
@@ -1521,7 +1576,7 @@ const or = ({
|
|
|
1521
1576
|
]
|
|
1522
1577
|
}
|
|
1523
1578
|
);
|
|
1524
|
-
},
|
|
1579
|
+
}, mr = () => /* @__PURE__ */ e(
|
|
1525
1580
|
"svg",
|
|
1526
1581
|
{
|
|
1527
1582
|
className: "h-4 w-4",
|
|
@@ -1538,7 +1593,7 @@ const or = ({
|
|
|
1538
1593
|
}
|
|
1539
1594
|
)
|
|
1540
1595
|
}
|
|
1541
|
-
),
|
|
1596
|
+
), hr = ({ active: r }) => /* @__PURE__ */ e(
|
|
1542
1597
|
"svg",
|
|
1543
1598
|
{
|
|
1544
1599
|
className: x(
|
|
@@ -1558,7 +1613,7 @@ const or = ({
|
|
|
1558
1613
|
}
|
|
1559
1614
|
)
|
|
1560
1615
|
}
|
|
1561
|
-
),
|
|
1616
|
+
), fr = ({ active: r }) => /* @__PURE__ */ e(
|
|
1562
1617
|
"svg",
|
|
1563
1618
|
{
|
|
1564
1619
|
className: x(
|
|
@@ -1578,7 +1633,7 @@ const or = ({
|
|
|
1578
1633
|
}
|
|
1579
1634
|
)
|
|
1580
1635
|
}
|
|
1581
|
-
),
|
|
1636
|
+
), pr = () => /* @__PURE__ */ e(
|
|
1582
1637
|
"svg",
|
|
1583
1638
|
{
|
|
1584
1639
|
className: "h-4 w-4",
|
|
@@ -1595,7 +1650,7 @@ const or = ({
|
|
|
1595
1650
|
}
|
|
1596
1651
|
)
|
|
1597
1652
|
}
|
|
1598
|
-
),
|
|
1653
|
+
), xr = () => /* @__PURE__ */ e(
|
|
1599
1654
|
"svg",
|
|
1600
1655
|
{
|
|
1601
1656
|
className: "h-4 w-4",
|
|
@@ -1612,7 +1667,7 @@ const or = ({
|
|
|
1612
1667
|
}
|
|
1613
1668
|
)
|
|
1614
1669
|
}
|
|
1615
|
-
),
|
|
1670
|
+
), gr = () => /* @__PURE__ */ e(
|
|
1616
1671
|
"svg",
|
|
1617
1672
|
{
|
|
1618
1673
|
className: "h-4 w-4",
|
|
@@ -1629,7 +1684,7 @@ const or = ({
|
|
|
1629
1684
|
}
|
|
1630
1685
|
)
|
|
1631
1686
|
}
|
|
1632
|
-
),
|
|
1687
|
+
), br = () => /* @__PURE__ */ e(
|
|
1633
1688
|
"svg",
|
|
1634
1689
|
{
|
|
1635
1690
|
className: "h-4 w-4",
|
|
@@ -1663,8 +1718,8 @@ const or = ({
|
|
|
1663
1718
|
}
|
|
1664
1719
|
)
|
|
1665
1720
|
}
|
|
1666
|
-
),
|
|
1667
|
-
const
|
|
1721
|
+
), yr = (r) => {
|
|
1722
|
+
const n = (a) => r.multiSelect && Array.isArray(r.value) ? r.value?.includes(a) : r.value === a, t = (a) => {
|
|
1668
1723
|
r.multiSelect && Array.isArray(r.value) ? r.onChange(r.value.filter((o) => o !== a)) : r.onChange(a);
|
|
1669
1724
|
};
|
|
1670
1725
|
return r.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[160px]", children: /* @__PURE__ */ e(
|
|
@@ -1693,7 +1748,7 @@ const or = ({
|
|
|
1693
1748
|
children: /* @__PURE__ */ e(
|
|
1694
1749
|
"span",
|
|
1695
1750
|
{
|
|
1696
|
-
className: x(
|
|
1751
|
+
className: x(n(a.value) && "text-primary-500"),
|
|
1697
1752
|
children: a.label
|
|
1698
1753
|
}
|
|
1699
1754
|
)
|
|
@@ -1712,7 +1767,7 @@ const or = ({
|
|
|
1712
1767
|
] }) }) });
|
|
1713
1768
|
}, Se = ({
|
|
1714
1769
|
data: r,
|
|
1715
|
-
columns:
|
|
1770
|
+
columns: n,
|
|
1716
1771
|
loading: t = !1,
|
|
1717
1772
|
searchable: a = !1,
|
|
1718
1773
|
searchPlaceholder: o = "Search...",
|
|
@@ -1722,69 +1777,69 @@ const or = ({
|
|
|
1722
1777
|
defaultPageSize: f = 10,
|
|
1723
1778
|
actions: b = [],
|
|
1724
1779
|
onRowClick: m,
|
|
1725
|
-
selectable:
|
|
1780
|
+
selectable: l = !1,
|
|
1726
1781
|
selectedRows: d = [],
|
|
1727
1782
|
onSelectionChange: p,
|
|
1728
|
-
getRowKey: N = (
|
|
1783
|
+
getRowKey: N = (q, F) => F,
|
|
1729
1784
|
emptyContent: v,
|
|
1730
1785
|
hoverable: S = !0,
|
|
1731
1786
|
bordered: B = !1,
|
|
1732
1787
|
striped: k = !1,
|
|
1733
|
-
className:
|
|
1734
|
-
rowClassName:
|
|
1788
|
+
className: H,
|
|
1789
|
+
rowClassName: G
|
|
1735
1790
|
}) => {
|
|
1736
|
-
const [
|
|
1791
|
+
const [q, F] = V(""), [E, J] = V({
|
|
1737
1792
|
column: null,
|
|
1738
1793
|
direction: null
|
|
1739
1794
|
}), [z, y] = V({
|
|
1740
1795
|
page: 0,
|
|
1741
1796
|
pageSize: f
|
|
1742
|
-
}), T =
|
|
1797
|
+
}), T = X(null), u = ie(() => {
|
|
1743
1798
|
let s = r;
|
|
1744
|
-
if (a &&
|
|
1745
|
-
const w =
|
|
1799
|
+
if (a && q.trim()) {
|
|
1800
|
+
const w = n.filter(
|
|
1746
1801
|
(R) => R.searchable !== !1
|
|
1747
|
-
),
|
|
1802
|
+
), O = q.toLowerCase();
|
|
1748
1803
|
s = s.filter((R) => w.some((j) => {
|
|
1749
1804
|
const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
|
|
1750
|
-
return String(Y || "").toLowerCase().includes(
|
|
1805
|
+
return String(Y || "").toLowerCase().includes(O);
|
|
1751
1806
|
}));
|
|
1752
1807
|
}
|
|
1753
1808
|
return i.forEach((w) => {
|
|
1754
|
-
w.value && w.value !== "all" && (s = s.filter((
|
|
1755
|
-
const R =
|
|
1809
|
+
w.value && w.value !== "all" && (s = s.filter((O) => {
|
|
1810
|
+
const R = n.find((Y) => Y.id === w.id);
|
|
1756
1811
|
if (!R) return !0;
|
|
1757
|
-
const j = typeof R.accessor == "function" ? R.accessor(
|
|
1812
|
+
const j = typeof R.accessor == "function" ? R.accessor(O) : O[R.accessor];
|
|
1758
1813
|
return String(j || "") === w.value;
|
|
1759
1814
|
}));
|
|
1760
1815
|
}), s;
|
|
1761
|
-
}, [r,
|
|
1762
|
-
if (!
|
|
1763
|
-
const s =
|
|
1764
|
-
return s ? [...u].sort((w,
|
|
1765
|
-
const R = typeof s.accessor == "function" ? s.accessor(w) : w[s.accessor], j = typeof s.accessor == "function" ? s.accessor(
|
|
1816
|
+
}, [r, q, n, a, i]), $ = ie(() => {
|
|
1817
|
+
if (!E.column || !E.direction) return u;
|
|
1818
|
+
const s = n.find((w) => w.id === E.column);
|
|
1819
|
+
return s ? [...u].sort((w, O) => {
|
|
1820
|
+
const R = typeof s.accessor == "function" ? s.accessor(w) : w[s.accessor], j = typeof s.accessor == "function" ? s.accessor(O) : O[s.accessor];
|
|
1766
1821
|
let Y = 0;
|
|
1767
|
-
return R < j ? Y = -1 : R > j && (Y = 1),
|
|
1822
|
+
return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
|
|
1768
1823
|
}) : u;
|
|
1769
|
-
}, [u,
|
|
1824
|
+
}, [u, E, n]), L = ie(() => {
|
|
1770
1825
|
if (!h) return $;
|
|
1771
1826
|
const s = z.page * z.pageSize, w = s + z.pageSize;
|
|
1772
1827
|
return $.slice(s, w);
|
|
1773
1828
|
}, [$, z, h]), D = ae(
|
|
1774
1829
|
(s) => {
|
|
1775
|
-
|
|
1830
|
+
n.find((O) => O.id === s)?.sortable && J((O) => O.column !== s ? { column: s, direction: "asc" } : O.direction === "asc" ? { column: s, direction: "desc" } : { column: null, direction: null });
|
|
1776
1831
|
},
|
|
1777
|
-
[
|
|
1832
|
+
[n]
|
|
1778
1833
|
), P = ae((s) => {
|
|
1779
1834
|
y((w) => ({ ...w, page: s }));
|
|
1780
|
-
}, []),
|
|
1835
|
+
}, []), M = ae((s) => {
|
|
1781
1836
|
y({ page: 0, pageSize: s });
|
|
1782
1837
|
}, []), re = ae(
|
|
1783
1838
|
(s, w) => {
|
|
1784
1839
|
if (!p) return;
|
|
1785
|
-
const
|
|
1840
|
+
const O = N(s, 0);
|
|
1786
1841
|
d.map((R, j) => N(R, j)), p(w ? [...d, s] : d.filter(
|
|
1787
|
-
(R, j) => N(d[j], j) !==
|
|
1842
|
+
(R, j) => N(d[j], j) !== O
|
|
1788
1843
|
));
|
|
1789
1844
|
},
|
|
1790
1845
|
[d, p, N]
|
|
@@ -1794,24 +1849,24 @@ const or = ({
|
|
|
1794
1849
|
},
|
|
1795
1850
|
[L, p]
|
|
1796
1851
|
);
|
|
1797
|
-
|
|
1852
|
+
K(() => {
|
|
1798
1853
|
y((s) => ({ ...s, page: 0 }));
|
|
1799
|
-
}, [
|
|
1854
|
+
}, [q, E]), K(() => {
|
|
1800
1855
|
y((s) => ({ ...s, page: 0 }));
|
|
1801
1856
|
}, [i.map((s) => s.value).join(",")]);
|
|
1802
|
-
const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1,
|
|
1857
|
+
const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, _ = Math.min(I + z.pageSize - 1, W), A = L.length > 0 && L.every((s) => {
|
|
1803
1858
|
const w = N(s, 0);
|
|
1804
1859
|
return d.some(
|
|
1805
|
-
(
|
|
1860
|
+
(O, R) => N(O, R) === w
|
|
1806
1861
|
);
|
|
1807
|
-
}),
|
|
1862
|
+
}), Q = L.some((s) => {
|
|
1808
1863
|
const w = N(s, 0);
|
|
1809
1864
|
return d.some(
|
|
1810
|
-
(
|
|
1865
|
+
(O, R) => N(O, R) === w
|
|
1811
1866
|
);
|
|
1812
1867
|
}), te = x(
|
|
1813
1868
|
"w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
|
|
1814
|
-
|
|
1869
|
+
H
|
|
1815
1870
|
), U = x("bg-[var(--base-module)]"), le = x(
|
|
1816
1871
|
"text-[var(--text-default)] dark:text-[var(--text-on-neutral)] p-3 border-b border-[var(--neutral-border)]"
|
|
1817
1872
|
), he = x("h-12", {
|
|
@@ -1820,42 +1875,42 @@ const or = ({
|
|
|
1820
1875
|
});
|
|
1821
1876
|
return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
1822
1877
|
(a || i.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
1823
|
-
i.map((s) => /* @__PURE__ */ e(
|
|
1878
|
+
i.map((s) => /* @__PURE__ */ e(yr, { ...s }, s.id)),
|
|
1824
1879
|
/* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
|
|
1825
1880
|
ue,
|
|
1826
1881
|
{
|
|
1827
1882
|
placeholder: o,
|
|
1828
|
-
value:
|
|
1883
|
+
value: q,
|
|
1829
1884
|
onChange: (s) => F(s.target.value),
|
|
1830
|
-
startIcon: /* @__PURE__ */ e(
|
|
1885
|
+
startIcon: /* @__PURE__ */ e(mr, {}),
|
|
1831
1886
|
className: "max-w-sm"
|
|
1832
1887
|
}
|
|
1833
1888
|
) })
|
|
1834
1889
|
] }) }),
|
|
1835
1890
|
/* @__PURE__ */ c("div", { className: "relative w-full overflow-x-auto min-h-[400px]", children: [
|
|
1836
1891
|
t && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
|
|
1837
|
-
|
|
1892
|
+
ir,
|
|
1838
1893
|
{
|
|
1839
1894
|
showTableSkeleton: !0,
|
|
1840
1895
|
tableRows: 10,
|
|
1841
|
-
tableColumns:
|
|
1896
|
+
tableColumns: n.length
|
|
1842
1897
|
}
|
|
1843
1898
|
) }),
|
|
1844
1899
|
/* @__PURE__ */ c("table", { ref: T, className: x(te, "min-w-full"), children: [
|
|
1845
1900
|
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ c("tr", { children: [
|
|
1846
|
-
|
|
1901
|
+
l && /* @__PURE__ */ e("th", { className: x(le, "w-12"), children: /* @__PURE__ */ e(
|
|
1847
1902
|
"input",
|
|
1848
1903
|
{
|
|
1849
1904
|
type: "checkbox",
|
|
1850
1905
|
checked: A,
|
|
1851
1906
|
ref: (s) => {
|
|
1852
|
-
s && (s.indeterminate =
|
|
1907
|
+
s && (s.indeterminate = Q && !A);
|
|
1853
1908
|
},
|
|
1854
1909
|
onChange: (s) => ne(s.target.checked),
|
|
1855
1910
|
className: "rounded border-neutral-300 dark:border-neutral-600"
|
|
1856
1911
|
}
|
|
1857
1912
|
) }),
|
|
1858
|
-
!t &&
|
|
1913
|
+
!t && n.map((s) => /* @__PURE__ */ e(
|
|
1859
1914
|
"th",
|
|
1860
1915
|
{
|
|
1861
1916
|
className: x(
|
|
@@ -1880,19 +1935,19 @@ const or = ({
|
|
|
1880
1935
|
{
|
|
1881
1936
|
className: x(
|
|
1882
1937
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1883
|
-
|
|
1938
|
+
E.column === s.id && "opacity-100"
|
|
1884
1939
|
),
|
|
1885
1940
|
children: [
|
|
1886
1941
|
/* @__PURE__ */ e(
|
|
1887
|
-
|
|
1942
|
+
hr,
|
|
1888
1943
|
{
|
|
1889
|
-
active:
|
|
1944
|
+
active: E.column === s.id && E.direction === "asc"
|
|
1890
1945
|
}
|
|
1891
1946
|
),
|
|
1892
1947
|
/* @__PURE__ */ e(
|
|
1893
|
-
|
|
1948
|
+
fr,
|
|
1894
1949
|
{
|
|
1895
|
-
active:
|
|
1950
|
+
active: E.column === s.id && E.direction === "desc"
|
|
1896
1951
|
}
|
|
1897
1952
|
)
|
|
1898
1953
|
]
|
|
@@ -1907,7 +1962,7 @@ const or = ({
|
|
|
1907
1962
|
/* @__PURE__ */ e("tbody", { children: L.length === 0 || t ? !t && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1908
1963
|
"td",
|
|
1909
1964
|
{
|
|
1910
|
-
colSpan:
|
|
1965
|
+
colSpan: n.length + (l ? 1 : 0) + (b.length > 0 ? 1 : 0),
|
|
1911
1966
|
className: x(
|
|
1912
1967
|
le,
|
|
1913
1968
|
"text-center py-8 text-neutral-500 dark:text-neutral-400"
|
|
@@ -1915,8 +1970,8 @@ const or = ({
|
|
|
1915
1970
|
children: v || "No data available"
|
|
1916
1971
|
}
|
|
1917
1972
|
) }) : L.map((s, w) => {
|
|
1918
|
-
const
|
|
1919
|
-
(j, Y) => N(j, Y) ===
|
|
1973
|
+
const O = N(s, w), R = d.some(
|
|
1974
|
+
(j, Y) => N(j, Y) === O
|
|
1920
1975
|
);
|
|
1921
1976
|
return /* @__PURE__ */ c(
|
|
1922
1977
|
"tr",
|
|
@@ -1924,13 +1979,13 @@ const or = ({
|
|
|
1924
1979
|
className: x(
|
|
1925
1980
|
he,
|
|
1926
1981
|
{ "bg-blue-50 dark:bg-blue-900/20": R },
|
|
1927
|
-
|
|
1982
|
+
G?.(s, w)
|
|
1928
1983
|
),
|
|
1929
1984
|
onClick: (j) => {
|
|
1930
1985
|
j.stopPropagation(), m?.(s, w);
|
|
1931
1986
|
},
|
|
1932
1987
|
children: [
|
|
1933
|
-
|
|
1988
|
+
l && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
1934
1989
|
"input",
|
|
1935
1990
|
{
|
|
1936
1991
|
type: "checkbox",
|
|
@@ -1941,7 +1996,7 @@ const or = ({
|
|
|
1941
1996
|
className: "rounded border-neutral-300 dark:border-neutral-600"
|
|
1942
1997
|
}
|
|
1943
1998
|
) }),
|
|
1944
|
-
|
|
1999
|
+
n.map((j) => {
|
|
1945
2000
|
const Y = typeof j.accessor == "function" ? j.accessor(s) : s[j.accessor];
|
|
1946
2001
|
return /* @__PURE__ */ e(
|
|
1947
2002
|
"td",
|
|
@@ -1959,7 +2014,7 @@ const or = ({
|
|
|
1959
2014
|
);
|
|
1960
2015
|
}),
|
|
1961
2016
|
b.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
1962
|
-
|
|
2017
|
+
ur,
|
|
1963
2018
|
{
|
|
1964
2019
|
trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100", children: [
|
|
1965
2020
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
@@ -1982,7 +2037,7 @@ const or = ({
|
|
|
1982
2037
|
) })
|
|
1983
2038
|
]
|
|
1984
2039
|
},
|
|
1985
|
-
|
|
2040
|
+
O
|
|
1986
2041
|
);
|
|
1987
2042
|
}) })
|
|
1988
2043
|
] })
|
|
@@ -1993,7 +2048,7 @@ const or = ({
|
|
|
1993
2048
|
"Showing ",
|
|
1994
2049
|
I,
|
|
1995
2050
|
" to ",
|
|
1996
|
-
|
|
2051
|
+
_,
|
|
1997
2052
|
" of ",
|
|
1998
2053
|
W,
|
|
1999
2054
|
" results"
|
|
@@ -2004,7 +2059,7 @@ const or = ({
|
|
|
2004
2059
|
"select",
|
|
2005
2060
|
{
|
|
2006
2061
|
value: z.pageSize,
|
|
2007
|
-
onChange: (s) =>
|
|
2062
|
+
onChange: (s) => M(Number(s.target.value)),
|
|
2008
2063
|
className: "border border-[var(--neutral-border)] text-[var(--text-default)] dark:text-[var(--text-on-neutral)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] dark:bg-[var(--base-input)] w-16",
|
|
2009
2064
|
children: g.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
|
|
2010
2065
|
}
|
|
@@ -2020,7 +2075,7 @@ const or = ({
|
|
|
2020
2075
|
onClick: () => P(0),
|
|
2021
2076
|
disabled: z.page === 0,
|
|
2022
2077
|
iconOnly: !0,
|
|
2023
|
-
children: /* @__PURE__ */ e(
|
|
2078
|
+
children: /* @__PURE__ */ e(gr, {})
|
|
2024
2079
|
}
|
|
2025
2080
|
),
|
|
2026
2081
|
/* @__PURE__ */ e(
|
|
@@ -2031,7 +2086,7 @@ const or = ({
|
|
|
2031
2086
|
onClick: () => P(z.page - 1),
|
|
2032
2087
|
disabled: z.page === 0,
|
|
2033
2088
|
iconOnly: !0,
|
|
2034
|
-
children: /* @__PURE__ */ e(
|
|
2089
|
+
children: /* @__PURE__ */ e(pr, {})
|
|
2035
2090
|
}
|
|
2036
2091
|
),
|
|
2037
2092
|
/* @__PURE__ */ c("span", { className: "px-3 py-1 text-sm text-gray-500 dark:text-gray-400", children: [
|
|
@@ -2048,7 +2103,7 @@ const or = ({
|
|
|
2048
2103
|
onClick: () => P(z.page + 1),
|
|
2049
2104
|
disabled: z.page >= C - 1,
|
|
2050
2105
|
iconOnly: !0,
|
|
2051
|
-
children: /* @__PURE__ */ e(
|
|
2106
|
+
children: /* @__PURE__ */ e(xr, {})
|
|
2052
2107
|
}
|
|
2053
2108
|
),
|
|
2054
2109
|
/* @__PURE__ */ e(
|
|
@@ -2059,19 +2114,19 @@ const or = ({
|
|
|
2059
2114
|
onClick: () => P(C - 1),
|
|
2060
2115
|
disabled: z.page >= C - 1,
|
|
2061
2116
|
iconOnly: !0,
|
|
2062
|
-
children: /* @__PURE__ */ e(
|
|
2117
|
+
children: /* @__PURE__ */ e(br, {})
|
|
2063
2118
|
}
|
|
2064
2119
|
)
|
|
2065
2120
|
] })
|
|
2066
2121
|
] })
|
|
2067
2122
|
] });
|
|
2068
|
-
},
|
|
2123
|
+
}, vr = He(null), et = ({
|
|
2069
2124
|
items: r,
|
|
2070
|
-
activeTab:
|
|
2125
|
+
activeTab: n,
|
|
2071
2126
|
onTabChange: t,
|
|
2072
2127
|
className: a
|
|
2073
2128
|
}) => {
|
|
2074
|
-
const [o, i] = V(r[0]?.id || ""), h =
|
|
2129
|
+
const [o, i] = V(r[0]?.id || ""), h = n || o, g = (f) => {
|
|
2075
2130
|
t ? t(f) : i(f);
|
|
2076
2131
|
};
|
|
2077
2132
|
return /* @__PURE__ */ e("div", { className: x("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((f) => /* @__PURE__ */ e(
|
|
@@ -2097,9 +2152,9 @@ const or = ({
|
|
|
2097
2152
|
},
|
|
2098
2153
|
f.id
|
|
2099
2154
|
)) }) });
|
|
2100
|
-
},
|
|
2155
|
+
}, kr = ({
|
|
2101
2156
|
items: r,
|
|
2102
|
-
defaultTab:
|
|
2157
|
+
defaultTab: n,
|
|
2103
2158
|
activeTab: t,
|
|
2104
2159
|
onTabChange: a,
|
|
2105
2160
|
variant: o = "default",
|
|
@@ -2107,10 +2162,10 @@ const or = ({
|
|
|
2107
2162
|
className: h
|
|
2108
2163
|
}) => {
|
|
2109
2164
|
const [g, f] = V(
|
|
2110
|
-
|
|
2165
|
+
n || t || r[0]?.id || ""
|
|
2111
2166
|
), b = t || g, m = (v) => {
|
|
2112
2167
|
a ? a(v) : f(v);
|
|
2113
|
-
},
|
|
2168
|
+
}, l = {
|
|
2114
2169
|
activeTab: b,
|
|
2115
2170
|
setActiveTab: m
|
|
2116
2171
|
}, d = r.find((v) => v.id === b), p = x(
|
|
@@ -2127,17 +2182,17 @@ const or = ({
|
|
|
2127
2182
|
"text-xs px-2 py-1": i === "sm",
|
|
2128
2183
|
"text-sm px-3 py-2": i === "md",
|
|
2129
2184
|
"text-base px-4 py-3": i === "lg"
|
|
2130
|
-
},
|
|
2185
|
+
}, H = {
|
|
2131
2186
|
// Default variant
|
|
2132
2187
|
"border-b-2 -mb-px": o === "default",
|
|
2133
2188
|
// Pills variant
|
|
2134
2189
|
"rounded-md": o === "pills",
|
|
2135
2190
|
// Underline variant
|
|
2136
2191
|
"border-b-2 pb-2": o === "underline"
|
|
2137
|
-
},
|
|
2192
|
+
}, G = {
|
|
2138
2193
|
"opacity-50 cursor-not-allowed": v.disabled,
|
|
2139
2194
|
"cursor-pointer": !v.disabled
|
|
2140
|
-
},
|
|
2195
|
+
}, q = S ? {
|
|
2141
2196
|
"border-primary text-primary": o === "default" || o === "underline",
|
|
2142
2197
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": o === "pills"
|
|
2143
2198
|
} : {}, F = !S && !v.disabled ? {
|
|
@@ -2145,9 +2200,9 @@ const or = ({
|
|
|
2145
2200
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "pills",
|
|
2146
2201
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": o === "underline"
|
|
2147
2202
|
} : {};
|
|
2148
|
-
return x(B, k,
|
|
2203
|
+
return x(B, k, H, G, q, F);
|
|
2149
2204
|
};
|
|
2150
|
-
return /* @__PURE__ */ e(
|
|
2205
|
+
return /* @__PURE__ */ e(vr.Provider, { value: l, children: /* @__PURE__ */ c("div", { children: [
|
|
2151
2206
|
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: r.map((v) => /* @__PURE__ */ e(
|
|
2152
2207
|
"button",
|
|
2153
2208
|
{
|
|
@@ -2176,16 +2231,16 @@ const or = ({
|
|
|
2176
2231
|
}
|
|
2177
2232
|
)
|
|
2178
2233
|
] }) });
|
|
2179
|
-
},
|
|
2234
|
+
}, Nr = {
|
|
2180
2235
|
sm: "max-w-md",
|
|
2181
2236
|
md: "max-w-lg",
|
|
2182
2237
|
lg: "max-w-2xl",
|
|
2183
2238
|
xl: "max-w-4xl",
|
|
2184
2239
|
full: "max-w-full mx-4"
|
|
2185
2240
|
};
|
|
2186
|
-
function
|
|
2241
|
+
function wr({
|
|
2187
2242
|
open: r,
|
|
2188
|
-
onClose:
|
|
2243
|
+
onClose: n,
|
|
2189
2244
|
title: t,
|
|
2190
2245
|
size: a = "md",
|
|
2191
2246
|
closeOnBackdropClick: o = !0,
|
|
@@ -2196,18 +2251,18 @@ function yr({
|
|
|
2196
2251
|
footer: b,
|
|
2197
2252
|
showCloseButton: m = !0
|
|
2198
2253
|
}) {
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2254
|
+
const l = X(null), d = X(null);
|
|
2255
|
+
K(() => {
|
|
2201
2256
|
if (!r || !i) return;
|
|
2202
2257
|
const N = (v) => {
|
|
2203
|
-
v.key === "Escape" &&
|
|
2258
|
+
v.key === "Escape" && n();
|
|
2204
2259
|
};
|
|
2205
2260
|
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
2206
|
-
}, [r, i,
|
|
2261
|
+
}, [r, i, n]), K(() => (r ? (d.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
|
|
2207
2262
|
document.body.style.overflow = "";
|
|
2208
2263
|
}), [r]);
|
|
2209
2264
|
const p = (N) => {
|
|
2210
|
-
o && N.target === N.currentTarget &&
|
|
2265
|
+
o && N.target === N.currentTarget && n();
|
|
2211
2266
|
};
|
|
2212
2267
|
return r ? /* @__PURE__ */ e(
|
|
2213
2268
|
"div",
|
|
@@ -2222,12 +2277,12 @@ function yr({
|
|
|
2222
2277
|
children: /* @__PURE__ */ c(
|
|
2223
2278
|
"div",
|
|
2224
2279
|
{
|
|
2225
|
-
ref:
|
|
2280
|
+
ref: l,
|
|
2226
2281
|
className: x(
|
|
2227
2282
|
"relative w-full bg-white dark:bg-secondary-800 rounded-modal shadow-modal rounded-md",
|
|
2228
2283
|
// 'animate-scale-in',
|
|
2229
2284
|
"focus:outline-none",
|
|
2230
|
-
|
|
2285
|
+
Nr[a],
|
|
2231
2286
|
h
|
|
2232
2287
|
),
|
|
2233
2288
|
role: "dialog",
|
|
@@ -2247,7 +2302,7 @@ function yr({
|
|
|
2247
2302
|
m && /* @__PURE__ */ e(
|
|
2248
2303
|
"button",
|
|
2249
2304
|
{
|
|
2250
|
-
onClick:
|
|
2305
|
+
onClick: n,
|
|
2251
2306
|
className: "p-1 text-secondary-400 hover:text-secondary-600 dark:hover:text-secondary-300 transition-colors",
|
|
2252
2307
|
"aria-label": "Close modal",
|
|
2253
2308
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
@@ -2264,7 +2319,7 @@ function yr({
|
|
|
2264
2319
|
}
|
|
2265
2320
|
const Z = ({
|
|
2266
2321
|
variant: r = "body",
|
|
2267
|
-
size:
|
|
2322
|
+
size: n = "md",
|
|
2268
2323
|
weight: t = "normal",
|
|
2269
2324
|
color: a = "current",
|
|
2270
2325
|
align: o = "left",
|
|
@@ -2274,10 +2329,10 @@ const Z = ({
|
|
|
2274
2329
|
lineHeight: f = "normal",
|
|
2275
2330
|
as: b,
|
|
2276
2331
|
className: m,
|
|
2277
|
-
children:
|
|
2332
|
+
children: l,
|
|
2278
2333
|
...d
|
|
2279
2334
|
}) => {
|
|
2280
|
-
const p = b ||
|
|
2335
|
+
const p = b || Cr(r), N = x(
|
|
2281
2336
|
// Base styles
|
|
2282
2337
|
"font-primary",
|
|
2283
2338
|
// Variant styles
|
|
@@ -2289,11 +2344,11 @@ const Z = ({
|
|
|
2289
2344
|
},
|
|
2290
2345
|
// Size variants (override variant sizes)
|
|
2291
2346
|
r !== "code" && {
|
|
2292
|
-
"text-xs":
|
|
2293
|
-
"text-sm":
|
|
2294
|
-
"text-base":
|
|
2295
|
-
"text-lg":
|
|
2296
|
-
"text-xl":
|
|
2347
|
+
"text-xs": n === "xs",
|
|
2348
|
+
"text-sm": n === "sm",
|
|
2349
|
+
"text-base": n === "md",
|
|
2350
|
+
"text-lg": n === "lg",
|
|
2351
|
+
"text-xl": n === "xl"
|
|
2297
2352
|
},
|
|
2298
2353
|
// Weight variants
|
|
2299
2354
|
r !== "label" && {
|
|
@@ -2337,9 +2392,9 @@ const Z = ({
|
|
|
2337
2392
|
},
|
|
2338
2393
|
m
|
|
2339
2394
|
);
|
|
2340
|
-
return /* @__PURE__ */ e(p, { className: N, ...d, children:
|
|
2395
|
+
return /* @__PURE__ */ e(p, { className: N, ...d, children: l });
|
|
2341
2396
|
};
|
|
2342
|
-
function
|
|
2397
|
+
function Cr(r) {
|
|
2343
2398
|
return {
|
|
2344
2399
|
body: "p",
|
|
2345
2400
|
caption: "span",
|
|
@@ -2347,9 +2402,9 @@ function vr(r) {
|
|
|
2347
2402
|
code: "code"
|
|
2348
2403
|
}[r] || "p";
|
|
2349
2404
|
}
|
|
2350
|
-
const
|
|
2405
|
+
const Sr = ({
|
|
2351
2406
|
value: r,
|
|
2352
|
-
onChange:
|
|
2407
|
+
onChange: n,
|
|
2353
2408
|
label: t,
|
|
2354
2409
|
placeholder: a = "Select or upload a file",
|
|
2355
2410
|
error: o,
|
|
@@ -2359,44 +2414,44 @@ const kr = ({
|
|
|
2359
2414
|
onListMounts: f,
|
|
2360
2415
|
onUploadFile: b,
|
|
2361
2416
|
onDownloadFile: m,
|
|
2362
|
-
onRegisterFile:
|
|
2417
|
+
onRegisterFile: l
|
|
2363
2418
|
}) => {
|
|
2364
|
-
const [d, p] = V(!1), [N, v] = V([]), [S, B] = V(null), [k,
|
|
2419
|
+
const [d, p] = V(!1), [N, v] = V([]), [S, B] = V(null), [k, H] = V("/"), [G, q] = V([]), [F, E] = V(!1), [J, z] = V(""), [y, T] = V(
|
|
2365
2420
|
typeof r == "object" ? r : null
|
|
2366
|
-
), [u, $] = V(!1), [L, D] = V(""), P =
|
|
2367
|
-
|
|
2368
|
-
d &&
|
|
2369
|
-
}, [d]),
|
|
2421
|
+
), [u, $] = V(!1), [L, D] = V(""), P = X(null);
|
|
2422
|
+
K(() => {
|
|
2423
|
+
d && M();
|
|
2424
|
+
}, [d]), K(() => {
|
|
2370
2425
|
d && S && re();
|
|
2371
2426
|
}, [d, S, k, J]);
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2427
|
+
const M = async () => {
|
|
2428
|
+
E(!0);
|
|
2374
2429
|
try {
|
|
2375
2430
|
const s = await f?.();
|
|
2376
2431
|
s?.data && v(s.data);
|
|
2377
2432
|
} catch (s) {
|
|
2378
2433
|
console.error("Failed to load mounts", s);
|
|
2379
2434
|
} finally {
|
|
2380
|
-
|
|
2435
|
+
E(!1);
|
|
2381
2436
|
}
|
|
2382
2437
|
}, re = async () => {
|
|
2383
2438
|
if (S) {
|
|
2384
|
-
|
|
2439
|
+
E(!0);
|
|
2385
2440
|
try {
|
|
2386
2441
|
const s = await g?.({ mountId: S.id, name: J, path: k });
|
|
2387
|
-
s?.data &&
|
|
2442
|
+
s?.data && q(s.data);
|
|
2388
2443
|
} catch (s) {
|
|
2389
2444
|
console.error("Failed to load files", s);
|
|
2390
2445
|
} finally {
|
|
2391
|
-
|
|
2446
|
+
E(!1);
|
|
2392
2447
|
}
|
|
2393
2448
|
}
|
|
2394
2449
|
}, ne = async (s) => {
|
|
2395
2450
|
const w = s.target.files?.[0];
|
|
2396
2451
|
if (w) {
|
|
2397
|
-
|
|
2452
|
+
E(!0);
|
|
2398
2453
|
try {
|
|
2399
|
-
const
|
|
2454
|
+
const O = await w.arrayBuffer(), R = new Uint8Array(O), j = {
|
|
2400
2455
|
id: `local-${Date.now()}`,
|
|
2401
2456
|
name: w.name,
|
|
2402
2457
|
type: "file",
|
|
@@ -2407,20 +2462,20 @@ const kr = ({
|
|
|
2407
2462
|
providerKey: w.name,
|
|
2408
2463
|
ownerId: "me"
|
|
2409
2464
|
};
|
|
2410
|
-
T(j),
|
|
2411
|
-
} catch (
|
|
2412
|
-
console.error("Local file selection failed",
|
|
2465
|
+
T(j), n(j, R), p(!1);
|
|
2466
|
+
} catch (O) {
|
|
2467
|
+
console.error("Local file selection failed", O);
|
|
2413
2468
|
} finally {
|
|
2414
|
-
|
|
2469
|
+
E(!1);
|
|
2415
2470
|
}
|
|
2416
2471
|
}
|
|
2417
2472
|
}, W = async (s) => {
|
|
2418
2473
|
const w = s.target.files?.[0];
|
|
2419
2474
|
if (!(!w || !S)) {
|
|
2420
|
-
|
|
2475
|
+
E(!0);
|
|
2421
2476
|
try {
|
|
2422
|
-
const
|
|
2423
|
-
file: new Uint8Array(
|
|
2477
|
+
const O = await w.arrayBuffer(), R = await b?.({
|
|
2478
|
+
file: new Uint8Array(O),
|
|
2424
2479
|
filename: w.name,
|
|
2425
2480
|
mimeType: w.type || "application/octet-stream",
|
|
2426
2481
|
mountId: S.id,
|
|
@@ -2428,20 +2483,20 @@ const kr = ({
|
|
|
2428
2483
|
});
|
|
2429
2484
|
if (R?.data) {
|
|
2430
2485
|
const j = R.data;
|
|
2431
|
-
T(j),
|
|
2486
|
+
T(j), n(j, new Uint8Array(O)), p(!1);
|
|
2432
2487
|
}
|
|
2433
|
-
} catch (
|
|
2434
|
-
console.error("Upload failed",
|
|
2488
|
+
} catch (O) {
|
|
2489
|
+
console.error("Upload failed", O);
|
|
2435
2490
|
} finally {
|
|
2436
|
-
|
|
2491
|
+
E(!1);
|
|
2437
2492
|
}
|
|
2438
2493
|
}
|
|
2439
2494
|
}, C = async () => {
|
|
2440
2495
|
if (!(!L || !S)) {
|
|
2441
|
-
|
|
2496
|
+
E(!0);
|
|
2442
2497
|
try {
|
|
2443
2498
|
const s = `${k}${L}/`;
|
|
2444
|
-
|
|
2499
|
+
l && (await l({
|
|
2445
2500
|
name: L,
|
|
2446
2501
|
type: "folder",
|
|
2447
2502
|
path: k,
|
|
@@ -2454,39 +2509,39 @@ const kr = ({
|
|
|
2454
2509
|
} catch (s) {
|
|
2455
2510
|
console.error("Failed to create folder", s);
|
|
2456
2511
|
} finally {
|
|
2457
|
-
|
|
2512
|
+
E(!1);
|
|
2458
2513
|
}
|
|
2459
2514
|
}
|
|
2460
2515
|
}, I = async (s) => {
|
|
2461
|
-
|
|
2516
|
+
E(!0);
|
|
2462
2517
|
try {
|
|
2463
2518
|
const w = await m?.(s.id);
|
|
2464
|
-
T(s),
|
|
2519
|
+
T(s), n(s, w), p(!1);
|
|
2465
2520
|
} catch (w) {
|
|
2466
2521
|
console.error("Failed to download file", w);
|
|
2467
2522
|
} finally {
|
|
2468
|
-
|
|
2523
|
+
E(!1);
|
|
2469
2524
|
}
|
|
2470
|
-
},
|
|
2471
|
-
s.stopPropagation(), T(null),
|
|
2525
|
+
}, _ = (s) => {
|
|
2526
|
+
s.stopPropagation(), T(null), n(null);
|
|
2472
2527
|
}, A = ie(() => {
|
|
2473
2528
|
const s = /* @__PURE__ */ new Set(), w = [];
|
|
2474
|
-
return
|
|
2475
|
-
if (
|
|
2476
|
-
|
|
2529
|
+
return G.forEach((O) => {
|
|
2530
|
+
if (O.type === "folder") {
|
|
2531
|
+
O.path === k && s.add(O.name);
|
|
2477
2532
|
return;
|
|
2478
2533
|
}
|
|
2479
|
-
const R =
|
|
2480
|
-
Y.length > 1 ? s.add(Y[0]) : Y.length === 1 && w.push(
|
|
2534
|
+
const R = O.providerKey || O.name, Y = (k ? R.substring(k.length) : R).split("/").filter((fe) => fe !== "");
|
|
2535
|
+
Y.length > 1 ? s.add(Y[0]) : Y.length === 1 && w.push(O);
|
|
2481
2536
|
}), {
|
|
2482
2537
|
folders: Array.from(s).sort(),
|
|
2483
|
-
files: w.sort((
|
|
2538
|
+
files: w.sort((O, R) => O.name.localeCompare(R.name))
|
|
2484
2539
|
};
|
|
2485
|
-
}, [
|
|
2486
|
-
|
|
2540
|
+
}, [G, k]), Q = (s) => {
|
|
2541
|
+
H((w) => `${w}${s}/`);
|
|
2487
2542
|
}, te = () => {
|
|
2488
2543
|
const s = k.split("/").filter((w) => w !== "");
|
|
2489
|
-
s.pop(), s.length === 0 ?
|
|
2544
|
+
s.pop(), s.length === 0 ? H("/") : H(`${s.join("/")}/`);
|
|
2490
2545
|
}, U = ie(() => {
|
|
2491
2546
|
const s = A.folders.map((w) => ({
|
|
2492
2547
|
id: `folder-${w}`,
|
|
@@ -2536,8 +2591,8 @@ const kr = ({
|
|
|
2536
2591
|
{
|
|
2537
2592
|
size: "sm",
|
|
2538
2593
|
variant: "outline",
|
|
2539
|
-
onClick: (
|
|
2540
|
-
|
|
2594
|
+
onClick: (O) => {
|
|
2595
|
+
O.stopPropagation(), w.type === "folder" ? Q(w.name) : I(w);
|
|
2541
2596
|
},
|
|
2542
2597
|
loading: F && w.type === "file" && y?.id === w.id,
|
|
2543
2598
|
children: w.type === "folder" ? "Open" : "Select"
|
|
@@ -2580,9 +2635,9 @@ const kr = ({
|
|
|
2580
2635
|
y && !i && /* @__PURE__ */ e(
|
|
2581
2636
|
"button",
|
|
2582
2637
|
{
|
|
2583
|
-
onClick:
|
|
2638
|
+
onClick: _,
|
|
2584
2639
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
2585
|
-
children: /* @__PURE__ */ e(oe, { icon:
|
|
2640
|
+
children: /* @__PURE__ */ e(oe, { icon: Oe, size: "xs" })
|
|
2586
2641
|
}
|
|
2587
2642
|
)
|
|
2588
2643
|
]
|
|
@@ -2590,23 +2645,23 @@ const kr = ({
|
|
|
2590
2645
|
),
|
|
2591
2646
|
o && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: o }),
|
|
2592
2647
|
/* @__PURE__ */ e(
|
|
2593
|
-
|
|
2648
|
+
wr,
|
|
2594
2649
|
{
|
|
2595
2650
|
open: d,
|
|
2596
2651
|
onClose: () => {
|
|
2597
|
-
p(!1), B(null),
|
|
2652
|
+
p(!1), B(null), H("/"), $(!1);
|
|
2598
2653
|
},
|
|
2599
2654
|
title: S ? `Explorer: ${S.name}` : "Select Storage Mount",
|
|
2600
2655
|
size: "lg",
|
|
2601
2656
|
children: /* @__PURE__ */ e(
|
|
2602
|
-
|
|
2657
|
+
kr,
|
|
2603
2658
|
{
|
|
2604
2659
|
variant: "pills",
|
|
2605
2660
|
items: [
|
|
2606
2661
|
{
|
|
2607
2662
|
id: "remote",
|
|
2608
2663
|
label: "Platform Storage",
|
|
2609
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(
|
|
2664
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(Me, { children: [
|
|
2610
2665
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2611
2666
|
/* @__PURE__ */ e(
|
|
2612
2667
|
ee,
|
|
@@ -2616,7 +2671,7 @@ const kr = ({
|
|
|
2616
2671
|
onClick: () => {
|
|
2617
2672
|
k && k !== "/" ? te() : B(null);
|
|
2618
2673
|
},
|
|
2619
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2674
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Ee, size: "xs" }),
|
|
2620
2675
|
children: k ? "Back" : "Back to Mounts"
|
|
2621
2676
|
}
|
|
2622
2677
|
),
|
|
@@ -2627,7 +2682,7 @@ const kr = ({
|
|
|
2627
2682
|
placeholder: "Search...",
|
|
2628
2683
|
value: J,
|
|
2629
2684
|
onChange: (s) => z(s.target.value),
|
|
2630
|
-
startIcon: /* @__PURE__ */ e(
|
|
2685
|
+
startIcon: /* @__PURE__ */ e(_e, { size: 14 }),
|
|
2631
2686
|
fullWidth: !0,
|
|
2632
2687
|
size: "sm"
|
|
2633
2688
|
}
|
|
@@ -2639,7 +2694,7 @@ const kr = ({
|
|
|
2639
2694
|
variant: "outline",
|
|
2640
2695
|
size: "sm",
|
|
2641
2696
|
onClick: () => $(!0),
|
|
2642
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2697
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Ve, size: "xs" }),
|
|
2643
2698
|
children: "New Folder"
|
|
2644
2699
|
}
|
|
2645
2700
|
),
|
|
@@ -2649,7 +2704,7 @@ const kr = ({
|
|
|
2649
2704
|
variant: "primary",
|
|
2650
2705
|
size: "sm",
|
|
2651
2706
|
onClick: () => P.current?.click(),
|
|
2652
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2707
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Fe, size: "xs" }),
|
|
2653
2708
|
loading: F,
|
|
2654
2709
|
children: "Upload"
|
|
2655
2710
|
}
|
|
@@ -2688,7 +2743,7 @@ const kr = ({
|
|
|
2688
2743
|
columns: le,
|
|
2689
2744
|
loading: F,
|
|
2690
2745
|
emptyContent: "This folder is empty",
|
|
2691
|
-
onRowClick: (s) => s.type === "folder" ?
|
|
2746
|
+
onRowClick: (s) => s.type === "folder" ? Q(s.name) : I(s)
|
|
2692
2747
|
}
|
|
2693
2748
|
) })
|
|
2694
2749
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
|
|
@@ -2744,14 +2799,14 @@ const kr = ({
|
|
|
2744
2799
|
)
|
|
2745
2800
|
] });
|
|
2746
2801
|
};
|
|
2747
|
-
function Le(r,
|
|
2748
|
-
return
|
|
2802
|
+
function Le(r, n) {
|
|
2803
|
+
return n.split(".").reduce(
|
|
2749
2804
|
(t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
|
|
2750
2805
|
r
|
|
2751
2806
|
);
|
|
2752
2807
|
}
|
|
2753
|
-
function
|
|
2754
|
-
const a =
|
|
2808
|
+
function Lr(r, n, t) {
|
|
2809
|
+
const a = n.split("."), o = Array.isArray(r) ? [...r] : { ...r };
|
|
2755
2810
|
let i = o;
|
|
2756
2811
|
for (let h = 0; h < a.length - 1; h++) {
|
|
2757
2812
|
const g = a[h], f = i[g];
|
|
@@ -2759,8 +2814,8 @@ function Nr(r, l, t) {
|
|
|
2759
2814
|
}
|
|
2760
2815
|
return i[a[a.length - 1]] = t, o;
|
|
2761
2816
|
}
|
|
2762
|
-
function
|
|
2763
|
-
const t =
|
|
2817
|
+
function Mr(r, n) {
|
|
2818
|
+
const t = n.split("."), a = Array.isArray(r) ? [...r] : { ...r };
|
|
2764
2819
|
let o = a;
|
|
2765
2820
|
for (let i = 0; i < t.length - 1; i++) {
|
|
2766
2821
|
const h = t[i];
|
|
@@ -2769,9 +2824,9 @@ function wr(r, l) {
|
|
|
2769
2824
|
}
|
|
2770
2825
|
return delete o[t[t.length - 1]], a;
|
|
2771
2826
|
}
|
|
2772
|
-
const
|
|
2827
|
+
const rt = ({
|
|
2773
2828
|
groups: r,
|
|
2774
|
-
data:
|
|
2829
|
+
data: n,
|
|
2775
2830
|
onSubmit: t,
|
|
2776
2831
|
onCancel: a,
|
|
2777
2832
|
onChange: o,
|
|
@@ -2781,16 +2836,16 @@ const Gr = ({
|
|
|
2781
2836
|
cancelButton: f = { label: "Cancel", variant: "outline" },
|
|
2782
2837
|
showButtons: b = !0,
|
|
2783
2838
|
layout: m = "vertical",
|
|
2784
|
-
size:
|
|
2839
|
+
size: l = "md",
|
|
2785
2840
|
loading: d = !1,
|
|
2786
2841
|
className: p,
|
|
2787
2842
|
ref: N,
|
|
2788
2843
|
sdk: v
|
|
2789
2844
|
}) => {
|
|
2790
|
-
const [S, B] = V(
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
}, [
|
|
2845
|
+
const [S, B] = V(n || {}), [k, H] = V({}), [G, q] = V({});
|
|
2846
|
+
K(() => {
|
|
2847
|
+
n && B({ ...n });
|
|
2848
|
+
}, [n]);
|
|
2794
2849
|
const F = ae(
|
|
2795
2850
|
(u, $, L) => {
|
|
2796
2851
|
const D = r.flatMap((P) => P.items).find((P) => P.name === u);
|
|
@@ -2804,37 +2859,37 @@ const Gr = ({
|
|
|
2804
2859
|
return `${D.label} must be an array.`;
|
|
2805
2860
|
if (Array.isArray($) && D.arrayFields) {
|
|
2806
2861
|
const P = [];
|
|
2807
|
-
let
|
|
2862
|
+
let M = !1;
|
|
2808
2863
|
if ($.forEach((re, ne) => {
|
|
2809
2864
|
const W = {};
|
|
2810
2865
|
for (const C of D.arrayFields) {
|
|
2811
2866
|
const I = re?.[C.name];
|
|
2812
2867
|
if (C.required && (I == null || I === ""))
|
|
2813
|
-
W[C.name] = `${C.label} is required`,
|
|
2868
|
+
W[C.name] = `${C.label} is required`, M = !0;
|
|
2814
2869
|
else if (C.validator) {
|
|
2815
|
-
const
|
|
2816
|
-
|
|
2870
|
+
const _ = C.validator(I, re);
|
|
2871
|
+
_ && (W[C.name] = _, M = !0);
|
|
2817
2872
|
}
|
|
2818
2873
|
}
|
|
2819
2874
|
P[ne] = W;
|
|
2820
|
-
}),
|
|
2875
|
+
}), M)
|
|
2821
2876
|
return JSON.stringify(P);
|
|
2822
2877
|
}
|
|
2823
2878
|
}
|
|
2824
2879
|
return D.validator ? D.validator($, L) : null;
|
|
2825
2880
|
},
|
|
2826
2881
|
[r]
|
|
2827
|
-
),
|
|
2882
|
+
), E = ae(
|
|
2828
2883
|
(u, $) => {
|
|
2829
|
-
let L =
|
|
2884
|
+
let L = Lr(
|
|
2830
2885
|
S,
|
|
2831
2886
|
u,
|
|
2832
2887
|
$
|
|
2833
2888
|
);
|
|
2834
|
-
r.flatMap((
|
|
2889
|
+
r.flatMap((M) => M.items).find((M) => M.name === u)?.removeIfEmpty && ($ == null || $ === "") && (L = Mr(L, u)), B(L), q((M) => ({ ...M, [u]: !0 }));
|
|
2835
2890
|
const P = F(u, $, L);
|
|
2836
|
-
|
|
2837
|
-
...
|
|
2891
|
+
H((M) => ({
|
|
2892
|
+
...M,
|
|
2838
2893
|
[u]: P || ""
|
|
2839
2894
|
})), o?.(L, u);
|
|
2840
2895
|
},
|
|
@@ -2846,18 +2901,18 @@ const Gr = ({
|
|
|
2846
2901
|
for (const P of L) {
|
|
2847
2902
|
if (P.hidden || P.conditional && !P.conditional(S))
|
|
2848
2903
|
continue;
|
|
2849
|
-
const
|
|
2904
|
+
const M = F(
|
|
2850
2905
|
P.name,
|
|
2851
2906
|
Le(S, P.name),
|
|
2852
2907
|
S
|
|
2853
2908
|
);
|
|
2854
|
-
|
|
2909
|
+
M && ($[P.name] = M);
|
|
2855
2910
|
}
|
|
2856
2911
|
if (h) {
|
|
2857
2912
|
const P = h(S);
|
|
2858
2913
|
P && Object.assign($, P);
|
|
2859
2914
|
}
|
|
2860
|
-
if (
|
|
2915
|
+
if (H($), console.log("newErrors", $), Object.keys($).some((P) => $[P]))
|
|
2861
2916
|
return;
|
|
2862
2917
|
const D = i ? i(S) : S;
|
|
2863
2918
|
await t?.(S, D);
|
|
@@ -2865,7 +2920,7 @@ const Gr = ({
|
|
|
2865
2920
|
[S, r, F, h, i, t, d]
|
|
2866
2921
|
), z = ae(
|
|
2867
2922
|
(u) => {
|
|
2868
|
-
const $ = Le(S, u.name), L =
|
|
2923
|
+
const $ = Le(S, u.name), L = G[u.name] ? k[u.name] : void 0, D = u.disabled || d, P = {
|
|
2869
2924
|
value: $ || "",
|
|
2870
2925
|
disabled: D,
|
|
2871
2926
|
required: u.required,
|
|
@@ -2883,11 +2938,11 @@ const Gr = ({
|
|
|
2883
2938
|
ue,
|
|
2884
2939
|
{
|
|
2885
2940
|
...P,
|
|
2886
|
-
onChange: (
|
|
2941
|
+
onChange: (M) => E(u.name, M.target.value),
|
|
2887
2942
|
type: u.textType || u.type,
|
|
2888
2943
|
autoComplete: u.autocomplete,
|
|
2889
2944
|
error: L,
|
|
2890
|
-
size:
|
|
2945
|
+
size: l
|
|
2891
2946
|
}
|
|
2892
2947
|
);
|
|
2893
2948
|
case "textarea":
|
|
@@ -2895,10 +2950,10 @@ const Gr = ({
|
|
|
2895
2950
|
ke,
|
|
2896
2951
|
{
|
|
2897
2952
|
...P,
|
|
2898
|
-
onChange: (
|
|
2953
|
+
onChange: (M) => E(u.name, M.target.value),
|
|
2899
2954
|
rows: 4,
|
|
2900
2955
|
error: L,
|
|
2901
|
-
size:
|
|
2956
|
+
size: l
|
|
2902
2957
|
}
|
|
2903
2958
|
);
|
|
2904
2959
|
case "select":
|
|
@@ -2906,16 +2961,16 @@ const Gr = ({
|
|
|
2906
2961
|
ve,
|
|
2907
2962
|
{
|
|
2908
2963
|
...P,
|
|
2909
|
-
onChange: (
|
|
2910
|
-
options: (u.options || []).map((
|
|
2911
|
-
...
|
|
2912
|
-
value: String(
|
|
2964
|
+
onChange: (M) => E(u.name, M),
|
|
2965
|
+
options: (u.options || []).map((M) => ({
|
|
2966
|
+
...M,
|
|
2967
|
+
value: String(M.value)
|
|
2913
2968
|
})),
|
|
2914
2969
|
searchable: u.searchable,
|
|
2915
2970
|
multiple: u.multiple,
|
|
2916
2971
|
allowCreate: u.allowCreate,
|
|
2917
2972
|
error: L,
|
|
2918
|
-
size:
|
|
2973
|
+
size: l
|
|
2919
2974
|
}
|
|
2920
2975
|
);
|
|
2921
2976
|
case "checkbox":
|
|
@@ -2924,78 +2979,78 @@ const Gr = ({
|
|
|
2924
2979
|
{
|
|
2925
2980
|
...P,
|
|
2926
2981
|
checked: !!$,
|
|
2927
|
-
onChange: (
|
|
2928
|
-
size:
|
|
2982
|
+
onChange: (M) => E(u.name, M.target.checked),
|
|
2983
|
+
size: l
|
|
2929
2984
|
}
|
|
2930
2985
|
);
|
|
2931
2986
|
case "radio":
|
|
2932
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((
|
|
2987
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((M) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
|
|
2933
2988
|
/* @__PURE__ */ e(
|
|
2934
2989
|
"input",
|
|
2935
2990
|
{
|
|
2936
2991
|
type: "radio",
|
|
2937
2992
|
name: u.name,
|
|
2938
|
-
value:
|
|
2939
|
-
checked: $ ===
|
|
2940
|
-
onChange: () =>
|
|
2941
|
-
disabled: D ||
|
|
2993
|
+
value: M.value,
|
|
2994
|
+
checked: $ === M.value,
|
|
2995
|
+
onChange: () => E(u.name, M.value),
|
|
2996
|
+
disabled: D || M.disabled,
|
|
2942
2997
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
2943
2998
|
}
|
|
2944
2999
|
),
|
|
2945
|
-
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children:
|
|
2946
|
-
] },
|
|
3000
|
+
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: M.label })
|
|
3001
|
+
] }, M.value)) });
|
|
2947
3002
|
case "date":
|
|
2948
3003
|
return /* @__PURE__ */ e(
|
|
2949
3004
|
ye,
|
|
2950
3005
|
{
|
|
2951
3006
|
...P,
|
|
2952
3007
|
value: $ ? new Date($) : null,
|
|
2953
|
-
onChange: (
|
|
2954
|
-
size:
|
|
3008
|
+
onChange: (M) => E(u.name, M),
|
|
3009
|
+
size: l
|
|
2955
3010
|
}
|
|
2956
3011
|
);
|
|
2957
3012
|
case "file":
|
|
2958
3013
|
return /* @__PURE__ */ e(
|
|
2959
|
-
|
|
3014
|
+
Sr,
|
|
2960
3015
|
{
|
|
2961
3016
|
...P,
|
|
2962
3017
|
value: $,
|
|
2963
|
-
onChange: (
|
|
3018
|
+
onChange: (M) => E(u.name, M),
|
|
2964
3019
|
error: L,
|
|
2965
|
-
onListFiles: (
|
|
3020
|
+
onListFiles: (M) => v?.http.invoke({
|
|
2966
3021
|
method: "POST",
|
|
2967
3022
|
action: "storage.file.list",
|
|
2968
|
-
body:
|
|
3023
|
+
body: M
|
|
2969
3024
|
}),
|
|
2970
3025
|
onListMounts: () => v?.http.invoke({
|
|
2971
3026
|
method: "GET",
|
|
2972
3027
|
action: "storage.mount"
|
|
2973
3028
|
}),
|
|
2974
|
-
onUploadFile: (
|
|
3029
|
+
onUploadFile: (M) => v?.http.invoke({
|
|
2975
3030
|
method: "POST",
|
|
2976
3031
|
action: "storage.file.upload",
|
|
2977
|
-
body:
|
|
3032
|
+
body: M
|
|
2978
3033
|
}),
|
|
2979
|
-
onDownloadFile: (
|
|
3034
|
+
onDownloadFile: (M) => v?.http.invoke({
|
|
2980
3035
|
method: "GET",
|
|
2981
|
-
action: `storage.file.${
|
|
3036
|
+
action: `storage.file.${M}.download`
|
|
2982
3037
|
}),
|
|
2983
|
-
onRegisterFile: (
|
|
3038
|
+
onRegisterFile: (M) => v?.http.invoke({
|
|
2984
3039
|
method: "POST",
|
|
2985
3040
|
action: "storage.file.folder",
|
|
2986
|
-
body:
|
|
3041
|
+
body: M
|
|
2987
3042
|
})
|
|
2988
3043
|
}
|
|
2989
3044
|
);
|
|
2990
3045
|
case "custom":
|
|
2991
3046
|
return u.customComponent?.({
|
|
2992
3047
|
value: $,
|
|
2993
|
-
onChange: (
|
|
3048
|
+
onChange: (M) => E(u.name, M),
|
|
2994
3049
|
error: L,
|
|
2995
3050
|
disabled: D
|
|
2996
3051
|
});
|
|
2997
3052
|
case "array": {
|
|
2998
|
-
const
|
|
3053
|
+
const M = $ || [];
|
|
2999
3054
|
let re = [];
|
|
3000
3055
|
if (typeof L == "string" && L.startsWith("["))
|
|
3001
3056
|
try {
|
|
@@ -3003,21 +3058,21 @@ const Gr = ({
|
|
|
3003
3058
|
} catch {
|
|
3004
3059
|
}
|
|
3005
3060
|
const ne = () => {
|
|
3006
|
-
|
|
3061
|
+
E(u.name, [...M, {}]);
|
|
3007
3062
|
}, W = (I) => {
|
|
3008
|
-
|
|
3063
|
+
E(
|
|
3009
3064
|
u.name,
|
|
3010
|
-
|
|
3065
|
+
M.filter((_, A) => A !== I)
|
|
3011
3066
|
);
|
|
3012
|
-
}, C = (I,
|
|
3013
|
-
const
|
|
3014
|
-
|
|
3015
|
-
...
|
|
3016
|
-
[
|
|
3017
|
-
},
|
|
3067
|
+
}, C = (I, _, A) => {
|
|
3068
|
+
const Q = [...M];
|
|
3069
|
+
Q[I] = {
|
|
3070
|
+
...Q[I],
|
|
3071
|
+
[_]: A
|
|
3072
|
+
}, E(u.name, Q);
|
|
3018
3073
|
};
|
|
3019
3074
|
return /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
3020
|
-
|
|
3075
|
+
M.map((I, _) => /* @__PURE__ */ c(
|
|
3021
3076
|
"div",
|
|
3022
3077
|
{
|
|
3023
3078
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
@@ -3028,13 +3083,13 @@ const Gr = ({
|
|
|
3028
3083
|
type: "button",
|
|
3029
3084
|
variant: "ghost",
|
|
3030
3085
|
size: "sm",
|
|
3031
|
-
onClick: () => W(
|
|
3086
|
+
onClick: () => W(_),
|
|
3032
3087
|
disabled: D,
|
|
3033
3088
|
children: "Remove"
|
|
3034
3089
|
}
|
|
3035
3090
|
) }),
|
|
3036
3091
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: u.arrayFields?.map((A) => {
|
|
3037
|
-
const
|
|
3092
|
+
const Q = re?.[_]?.[A.name];
|
|
3038
3093
|
return /* @__PURE__ */ c(
|
|
3039
3094
|
"div",
|
|
3040
3095
|
{
|
|
@@ -3072,14 +3127,14 @@ const Gr = ({
|
|
|
3072
3127
|
{
|
|
3073
3128
|
...te,
|
|
3074
3129
|
onChange: (U) => C(
|
|
3075
|
-
|
|
3130
|
+
_,
|
|
3076
3131
|
A.name,
|
|
3077
3132
|
U.target.value
|
|
3078
3133
|
),
|
|
3079
3134
|
type: A.textType || A.type,
|
|
3080
3135
|
autoComplete: A.autocomplete,
|
|
3081
|
-
error:
|
|
3082
|
-
size:
|
|
3136
|
+
error: Q,
|
|
3137
|
+
size: l
|
|
3083
3138
|
}
|
|
3084
3139
|
);
|
|
3085
3140
|
case "textarea":
|
|
@@ -3088,13 +3143,13 @@ const Gr = ({
|
|
|
3088
3143
|
{
|
|
3089
3144
|
...te,
|
|
3090
3145
|
onChange: (U) => C(
|
|
3091
|
-
|
|
3146
|
+
_,
|
|
3092
3147
|
A.name,
|
|
3093
3148
|
U.target.value
|
|
3094
3149
|
),
|
|
3095
3150
|
rows: 4,
|
|
3096
|
-
error:
|
|
3097
|
-
size:
|
|
3151
|
+
error: Q,
|
|
3152
|
+
size: l
|
|
3098
3153
|
}
|
|
3099
3154
|
);
|
|
3100
3155
|
case "select":
|
|
@@ -3103,7 +3158,7 @@ const Gr = ({
|
|
|
3103
3158
|
{
|
|
3104
3159
|
...te,
|
|
3105
3160
|
onChange: (U) => C(
|
|
3106
|
-
|
|
3161
|
+
_,
|
|
3107
3162
|
A.name,
|
|
3108
3163
|
U
|
|
3109
3164
|
),
|
|
@@ -3116,8 +3171,8 @@ const Gr = ({
|
|
|
3116
3171
|
searchable: A.searchable,
|
|
3117
3172
|
multiple: A.multiple,
|
|
3118
3173
|
allowCreate: A.allowCreate,
|
|
3119
|
-
error:
|
|
3120
|
-
size:
|
|
3174
|
+
error: Q,
|
|
3175
|
+
size: l
|
|
3121
3176
|
}
|
|
3122
3177
|
);
|
|
3123
3178
|
case "checkbox":
|
|
@@ -3127,11 +3182,11 @@ const Gr = ({
|
|
|
3127
3182
|
...te,
|
|
3128
3183
|
checked: !!I?.[A.name],
|
|
3129
3184
|
onChange: (U) => C(
|
|
3130
|
-
|
|
3185
|
+
_,
|
|
3131
3186
|
A.name,
|
|
3132
3187
|
U.target.checked
|
|
3133
3188
|
),
|
|
3134
|
-
size:
|
|
3189
|
+
size: l
|
|
3135
3190
|
}
|
|
3136
3191
|
);
|
|
3137
3192
|
case "radio":
|
|
@@ -3144,11 +3199,11 @@ const Gr = ({
|
|
|
3144
3199
|
"input",
|
|
3145
3200
|
{
|
|
3146
3201
|
type: "radio",
|
|
3147
|
-
name: `${u.name}.${
|
|
3202
|
+
name: `${u.name}.${_}.${A.name}`,
|
|
3148
3203
|
value: U.value,
|
|
3149
3204
|
checked: I?.[A.name] === U.value,
|
|
3150
3205
|
onChange: () => C(
|
|
3151
|
-
|
|
3206
|
+
_,
|
|
3152
3207
|
A.name,
|
|
3153
3208
|
U.value
|
|
3154
3209
|
),
|
|
@@ -3169,11 +3224,11 @@ const Gr = ({
|
|
|
3169
3224
|
...te,
|
|
3170
3225
|
value: U ? new Date(U) : null,
|
|
3171
3226
|
onChange: (le) => C(
|
|
3172
|
-
|
|
3227
|
+
_,
|
|
3173
3228
|
A.name,
|
|
3174
3229
|
le
|
|
3175
3230
|
),
|
|
3176
|
-
size:
|
|
3231
|
+
size: l
|
|
3177
3232
|
}
|
|
3178
3233
|
);
|
|
3179
3234
|
}
|
|
@@ -3181,11 +3236,11 @@ const Gr = ({
|
|
|
3181
3236
|
return A.customComponent?.({
|
|
3182
3237
|
value: I?.[A.name],
|
|
3183
3238
|
onChange: (U) => C(
|
|
3184
|
-
|
|
3239
|
+
_,
|
|
3185
3240
|
A.name,
|
|
3186
3241
|
U
|
|
3187
3242
|
),
|
|
3188
|
-
error:
|
|
3243
|
+
error: Q,
|
|
3189
3244
|
disabled: D
|
|
3190
3245
|
});
|
|
3191
3246
|
// Add other field types here as needed
|
|
@@ -3197,13 +3252,13 @@ const Gr = ({
|
|
|
3197
3252
|
] });
|
|
3198
3253
|
}
|
|
3199
3254
|
})(),
|
|
3200
|
-
|
|
3255
|
+
Q && /* @__PURE__ */ e(
|
|
3201
3256
|
Z,
|
|
3202
3257
|
{
|
|
3203
3258
|
variant: "body",
|
|
3204
3259
|
size: "sm",
|
|
3205
3260
|
className: "text-red-600 dark:text-red-400",
|
|
3206
|
-
children:
|
|
3261
|
+
children: Q
|
|
3207
3262
|
}
|
|
3208
3263
|
)
|
|
3209
3264
|
]
|
|
@@ -3213,7 +3268,7 @@ const Gr = ({
|
|
|
3213
3268
|
}) })
|
|
3214
3269
|
]
|
|
3215
3270
|
},
|
|
3216
|
-
|
|
3271
|
+
_
|
|
3217
3272
|
)),
|
|
3218
3273
|
/* @__PURE__ */ c(
|
|
3219
3274
|
ee,
|
|
@@ -3235,7 +3290,7 @@ const Gr = ({
|
|
|
3235
3290
|
return null;
|
|
3236
3291
|
}
|
|
3237
3292
|
},
|
|
3238
|
-
[S,
|
|
3293
|
+
[S, G, k, d, l, E]
|
|
3239
3294
|
), y = ae(
|
|
3240
3295
|
(u) => {
|
|
3241
3296
|
if (u.conditional && !u.conditional(S))
|
|
@@ -3282,7 +3337,7 @@ const Gr = ({
|
|
|
3282
3337
|
}
|
|
3283
3338
|
)
|
|
3284
3339
|
] }),
|
|
3285
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (
|
|
3340
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (G[D.name] && k[D.name], /* @__PURE__ */ c(
|
|
3286
3341
|
"div",
|
|
3287
3342
|
{
|
|
3288
3343
|
className: x(
|
|
@@ -3313,14 +3368,14 @@ const Gr = ({
|
|
|
3313
3368
|
u.id
|
|
3314
3369
|
);
|
|
3315
3370
|
},
|
|
3316
|
-
[S,
|
|
3371
|
+
[S, G, k, z]
|
|
3317
3372
|
), T = x(
|
|
3318
3373
|
"space-y-6",
|
|
3319
3374
|
{
|
|
3320
|
-
"max-w-md":
|
|
3321
|
-
"max-w-2xl":
|
|
3322
|
-
"max-w-4xl":
|
|
3323
|
-
"max-w-full":
|
|
3375
|
+
"max-w-md": l === "sm",
|
|
3376
|
+
"max-w-2xl": l === "md",
|
|
3377
|
+
"max-w-4xl": l === "lg",
|
|
3378
|
+
"max-w-full": l === "full"
|
|
3324
3379
|
},
|
|
3325
3380
|
p
|
|
3326
3381
|
);
|
|
@@ -3332,7 +3387,7 @@ const Gr = ({
|
|
|
3332
3387
|
{
|
|
3333
3388
|
type: "button",
|
|
3334
3389
|
variant: f.variant,
|
|
3335
|
-
size: f.size ||
|
|
3390
|
+
size: f.size || l,
|
|
3336
3391
|
disabled: f.disabled || d,
|
|
3337
3392
|
onClick: a,
|
|
3338
3393
|
className: f.className,
|
|
@@ -3344,7 +3399,7 @@ const Gr = ({
|
|
|
3344
3399
|
{
|
|
3345
3400
|
type: "submit",
|
|
3346
3401
|
variant: g.variant,
|
|
3347
|
-
size: g.size ||
|
|
3402
|
+
size: g.size || l,
|
|
3348
3403
|
disabled: g.disabled || d,
|
|
3349
3404
|
loading: d,
|
|
3350
3405
|
className: g.className,
|
|
@@ -3353,7 +3408,7 @@ const Gr = ({
|
|
|
3353
3408
|
)
|
|
3354
3409
|
] })
|
|
3355
3410
|
] });
|
|
3356
|
-
},
|
|
3411
|
+
}, Er = {
|
|
3357
3412
|
default: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
|
|
3358
3413
|
primary: "bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-200",
|
|
3359
3414
|
secondary: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
|
|
@@ -3361,11 +3416,11 @@ const Gr = ({
|
|
|
3361
3416
|
warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
|
|
3362
3417
|
error: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",
|
|
3363
3418
|
info: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"
|
|
3364
|
-
},
|
|
3419
|
+
}, $r = {
|
|
3365
3420
|
sm: "px-2 py-0.5 text-xs",
|
|
3366
3421
|
md: "px-2.5 py-1 text-sm",
|
|
3367
3422
|
lg: "px-3 py-1.5 text-base"
|
|
3368
|
-
},
|
|
3423
|
+
}, zr = {
|
|
3369
3424
|
default: "bg-secondary-400",
|
|
3370
3425
|
primary: "bg-primary-500",
|
|
3371
3426
|
secondary: "bg-secondary-400",
|
|
@@ -3374,9 +3429,9 @@ const Gr = ({
|
|
|
3374
3429
|
error: "bg-red-500",
|
|
3375
3430
|
info: "bg-blue-500"
|
|
3376
3431
|
};
|
|
3377
|
-
function
|
|
3432
|
+
function tt({
|
|
3378
3433
|
variant: r = "default",
|
|
3379
|
-
size:
|
|
3434
|
+
size: n = "md",
|
|
3380
3435
|
dot: t = !1,
|
|
3381
3436
|
icon: a,
|
|
3382
3437
|
dismissible: o = !1,
|
|
@@ -3392,9 +3447,9 @@ function Jr({
|
|
|
3392
3447
|
// Base styles
|
|
3393
3448
|
"inline-flex items-center font-medium rounded-full",
|
|
3394
3449
|
// Variant styles
|
|
3395
|
-
|
|
3450
|
+
Er[r],
|
|
3396
3451
|
// Size styles
|
|
3397
|
-
|
|
3452
|
+
$r[n],
|
|
3398
3453
|
h
|
|
3399
3454
|
),
|
|
3400
3455
|
...f,
|
|
@@ -3404,7 +3459,7 @@ function Jr({
|
|
|
3404
3459
|
{
|
|
3405
3460
|
className: x(
|
|
3406
3461
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3407
|
-
|
|
3462
|
+
zr[r]
|
|
3408
3463
|
)
|
|
3409
3464
|
}
|
|
3410
3465
|
),
|
|
@@ -3430,27 +3485,27 @@ function Jr({
|
|
|
3430
3485
|
}
|
|
3431
3486
|
);
|
|
3432
3487
|
}
|
|
3433
|
-
const
|
|
3488
|
+
const Dr = {
|
|
3434
3489
|
xs: "h-3 w-3",
|
|
3435
3490
|
sm: "h-4 w-4",
|
|
3436
3491
|
md: "h-6 w-6",
|
|
3437
3492
|
lg: "h-8 w-8",
|
|
3438
3493
|
xl: "h-12 w-12"
|
|
3439
|
-
},
|
|
3494
|
+
}, Tr = {
|
|
3440
3495
|
primary: "text-primary",
|
|
3441
3496
|
secondary: "text-secondary-600",
|
|
3442
3497
|
white: "text-white",
|
|
3443
3498
|
current: "text-current"
|
|
3444
|
-
},
|
|
3499
|
+
}, Ar = {
|
|
3445
3500
|
xs: "text-xs",
|
|
3446
3501
|
sm: "text-sm",
|
|
3447
3502
|
md: "text-sm",
|
|
3448
3503
|
lg: "text-base",
|
|
3449
3504
|
xl: "text-lg"
|
|
3450
3505
|
};
|
|
3451
|
-
function
|
|
3506
|
+
function at({
|
|
3452
3507
|
size: r = "md",
|
|
3453
|
-
variant:
|
|
3508
|
+
variant: n = "primary",
|
|
3454
3509
|
label: t = "Loading...",
|
|
3455
3510
|
showLabel: a = !1,
|
|
3456
3511
|
className: o,
|
|
@@ -3471,8 +3526,8 @@ function Yr({
|
|
|
3471
3526
|
{
|
|
3472
3527
|
className: x(
|
|
3473
3528
|
"animate-spin",
|
|
3474
|
-
|
|
3475
|
-
|
|
3529
|
+
Dr[r],
|
|
3530
|
+
Tr[n]
|
|
3476
3531
|
),
|
|
3477
3532
|
fill: "none",
|
|
3478
3533
|
viewBox: "0 0 24 24",
|
|
@@ -3506,7 +3561,7 @@ function Yr({
|
|
|
3506
3561
|
{
|
|
3507
3562
|
className: x(
|
|
3508
3563
|
"text-secondary-600 dark:text-secondary-400",
|
|
3509
|
-
|
|
3564
|
+
Ar[r]
|
|
3510
3565
|
),
|
|
3511
3566
|
children: t
|
|
3512
3567
|
}
|
|
@@ -3516,9 +3571,9 @@ function Yr({
|
|
|
3516
3571
|
}
|
|
3517
3572
|
);
|
|
3518
3573
|
}
|
|
3519
|
-
const
|
|
3574
|
+
const nt = ({
|
|
3520
3575
|
src: r,
|
|
3521
|
-
alt:
|
|
3576
|
+
alt: n,
|
|
3522
3577
|
size: t = "md",
|
|
3523
3578
|
aspectRatio: a = "auto",
|
|
3524
3579
|
radius: o = "md",
|
|
@@ -3528,15 +3583,15 @@ const Zr = ({
|
|
|
3528
3583
|
loadingContent: f,
|
|
3529
3584
|
errorContent: b,
|
|
3530
3585
|
className: m,
|
|
3531
|
-
onLoad:
|
|
3586
|
+
onLoad: l,
|
|
3532
3587
|
onError: d,
|
|
3533
3588
|
...p
|
|
3534
3589
|
}) => {
|
|
3535
|
-
const [N, v] = V(!0), [S, B] = V(!1), [k,
|
|
3536
|
-
v(!1), B(!1),
|
|
3537
|
-
},
|
|
3590
|
+
const [N, v] = V(!0), [S, B] = V(!1), [k, H] = V(r), G = (T) => {
|
|
3591
|
+
v(!1), B(!1), l?.(T);
|
|
3592
|
+
}, q = (T) => {
|
|
3538
3593
|
if (v(!1), B(!0), g && k !== g) {
|
|
3539
|
-
|
|
3594
|
+
H(g), B(!1), v(!0);
|
|
3540
3595
|
return;
|
|
3541
3596
|
}
|
|
3542
3597
|
d?.(T);
|
|
@@ -3568,7 +3623,7 @@ const Zr = ({
|
|
|
3568
3623
|
"rounded-full": o === "full"
|
|
3569
3624
|
},
|
|
3570
3625
|
m
|
|
3571
|
-
),
|
|
3626
|
+
), E = x(
|
|
3572
3627
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3573
3628
|
{
|
|
3574
3629
|
"opacity-0": N || S,
|
|
@@ -3604,18 +3659,18 @@ const Zr = ({
|
|
|
3604
3659
|
{
|
|
3605
3660
|
...p,
|
|
3606
3661
|
src: k,
|
|
3607
|
-
alt:
|
|
3608
|
-
className:
|
|
3609
|
-
onLoad:
|
|
3610
|
-
onError:
|
|
3662
|
+
alt: n,
|
|
3663
|
+
className: E,
|
|
3664
|
+
onLoad: G,
|
|
3665
|
+
onError: q
|
|
3611
3666
|
}
|
|
3612
3667
|
),
|
|
3613
3668
|
N && i && /* @__PURE__ */ e("div", { className: J, children: f || z }),
|
|
3614
3669
|
S && h && /* @__PURE__ */ e("div", { className: J, children: b || y })
|
|
3615
3670
|
] });
|
|
3616
|
-
},
|
|
3671
|
+
}, lt = ({
|
|
3617
3672
|
title: r,
|
|
3618
|
-
subtitle:
|
|
3673
|
+
subtitle: n,
|
|
3619
3674
|
actions: t = [],
|
|
3620
3675
|
children: a,
|
|
3621
3676
|
className: o,
|
|
@@ -3625,18 +3680,18 @@ const Zr = ({
|
|
|
3625
3680
|
editable: f = !1,
|
|
3626
3681
|
onTitleChange: b
|
|
3627
3682
|
}) => {
|
|
3628
|
-
const [m,
|
|
3629
|
-
|
|
3683
|
+
const [m, l] = V(!1), [d, p] = V(r), N = X(null);
|
|
3684
|
+
K(() => {
|
|
3630
3685
|
p(r);
|
|
3631
|
-
}, [r]),
|
|
3686
|
+
}, [r]), K(() => {
|
|
3632
3687
|
m && N.current && (N.current.focus(), N.current.select());
|
|
3633
3688
|
}, [m]);
|
|
3634
3689
|
const v = () => {
|
|
3635
|
-
f &&
|
|
3690
|
+
f && l(!0);
|
|
3636
3691
|
}, S = () => {
|
|
3637
|
-
|
|
3692
|
+
l(!1), d.trim() !== "" && d !== r && b ? b(d.trim()) : p(r);
|
|
3638
3693
|
}, B = (k) => {
|
|
3639
|
-
k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (p(r),
|
|
3694
|
+
k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (p(r), l(!1));
|
|
3640
3695
|
};
|
|
3641
3696
|
return /* @__PURE__ */ c(
|
|
3642
3697
|
"div",
|
|
@@ -3657,7 +3712,7 @@ const Zr = ({
|
|
|
3657
3712
|
"flex items-center text-sm dark:hover:text-neutral-300 cursor-pointer transition",
|
|
3658
3713
|
h
|
|
3659
3714
|
),
|
|
3660
|
-
children: /* @__PURE__ */ e(
|
|
3715
|
+
children: /* @__PURE__ */ e(Ee, { size: 16, color: "currentColor" })
|
|
3661
3716
|
}
|
|
3662
3717
|
),
|
|
3663
3718
|
m ? /* @__PURE__ */ e(
|
|
@@ -3686,7 +3741,7 @@ const Zr = ({
|
|
|
3686
3741
|
] }) }),
|
|
3687
3742
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map(
|
|
3688
3743
|
(k) => k.splitOptions && k.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3689
|
-
|
|
3744
|
+
Ye,
|
|
3690
3745
|
{
|
|
3691
3746
|
label: k.label,
|
|
3692
3747
|
onClick: k.onClick,
|
|
@@ -3700,8 +3755,8 @@ const Zr = ({
|
|
|
3700
3755
|
"button",
|
|
3701
3756
|
{
|
|
3702
3757
|
type: "button",
|
|
3703
|
-
onClick: (
|
|
3704
|
-
|
|
3758
|
+
onClick: (H) => {
|
|
3759
|
+
H.stopPropagation(), H.target.blur(), k.onClick();
|
|
3705
3760
|
},
|
|
3706
3761
|
disabled: k.disabled,
|
|
3707
3762
|
className: x("btn", {
|
|
@@ -3724,15 +3779,15 @@ const Zr = ({
|
|
|
3724
3779
|
}
|
|
3725
3780
|
);
|
|
3726
3781
|
};
|
|
3727
|
-
function
|
|
3728
|
-
return
|
|
3782
|
+
function Ir(r, n) {
|
|
3783
|
+
return n.split(".").reduce(
|
|
3729
3784
|
(t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
|
|
3730
3785
|
r
|
|
3731
3786
|
);
|
|
3732
3787
|
}
|
|
3733
|
-
const
|
|
3788
|
+
const st = ({
|
|
3734
3789
|
groups: r,
|
|
3735
|
-
data:
|
|
3790
|
+
data: n,
|
|
3736
3791
|
size: t = "md",
|
|
3737
3792
|
className: a
|
|
3738
3793
|
}) => {
|
|
@@ -3747,15 +3802,15 @@ const Qr = ({
|
|
|
3747
3802
|
} catch {
|
|
3748
3803
|
return String(m);
|
|
3749
3804
|
}
|
|
3750
|
-
}, i = (m) => m ? "Ja" : "Nee", h = (m,
|
|
3751
|
-
if (!
|
|
3752
|
-
const d =
|
|
3805
|
+
}, i = (m) => m ? "Ja" : "Nee", h = (m, l) => {
|
|
3806
|
+
if (!l) return String(m || "-");
|
|
3807
|
+
const d = l.find((p) => p.value === m);
|
|
3753
3808
|
return d ? d.label : String(m || "-");
|
|
3754
3809
|
}, g = ae(
|
|
3755
3810
|
(m) => {
|
|
3756
|
-
const
|
|
3811
|
+
const l = Ir(n, m.name);
|
|
3757
3812
|
if (m.type === "array") {
|
|
3758
|
-
const p =
|
|
3813
|
+
const p = l;
|
|
3759
3814
|
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
3760
3815
|
Z,
|
|
3761
3816
|
{
|
|
@@ -3843,9 +3898,9 @@ const Qr = ({
|
|
|
3843
3898
|
)) });
|
|
3844
3899
|
}
|
|
3845
3900
|
if (m.type === "custom" && m.customComponent)
|
|
3846
|
-
return m.customComponent({ value:
|
|
3901
|
+
return m.customComponent({ value: l });
|
|
3847
3902
|
if (m.format) {
|
|
3848
|
-
const p = m.format(
|
|
3903
|
+
const p = m.format(l, n);
|
|
3849
3904
|
return /* @__PURE__ */ e(
|
|
3850
3905
|
Z,
|
|
3851
3906
|
{
|
|
@@ -3864,23 +3919,23 @@ const Qr = ({
|
|
|
3864
3919
|
case "number":
|
|
3865
3920
|
case "tel":
|
|
3866
3921
|
case "url":
|
|
3867
|
-
d =
|
|
3922
|
+
d = l ? String(l) : "-";
|
|
3868
3923
|
break;
|
|
3869
3924
|
case "textarea":
|
|
3870
|
-
d =
|
|
3925
|
+
d = l ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(l || "-") }) : "-";
|
|
3871
3926
|
break;
|
|
3872
3927
|
case "select":
|
|
3873
3928
|
case "radio":
|
|
3874
|
-
d = h(
|
|
3929
|
+
d = h(l, m.options);
|
|
3875
3930
|
break;
|
|
3876
3931
|
case "checkbox":
|
|
3877
|
-
d = i(
|
|
3932
|
+
d = i(l);
|
|
3878
3933
|
break;
|
|
3879
3934
|
case "date":
|
|
3880
|
-
d = o(
|
|
3935
|
+
d = o(l);
|
|
3881
3936
|
break;
|
|
3882
3937
|
default:
|
|
3883
|
-
d =
|
|
3938
|
+
d = l ? String(l) : "-";
|
|
3884
3939
|
}
|
|
3885
3940
|
return /* @__PURE__ */ e(
|
|
3886
3941
|
Z,
|
|
@@ -3892,13 +3947,13 @@ const Qr = ({
|
|
|
3892
3947
|
}
|
|
3893
3948
|
);
|
|
3894
3949
|
},
|
|
3895
|
-
[
|
|
3950
|
+
[n]
|
|
3896
3951
|
), f = ae(
|
|
3897
3952
|
(m) => {
|
|
3898
|
-
if (m.conditional && !m.conditional(
|
|
3953
|
+
if (m.conditional && !m.conditional(n))
|
|
3899
3954
|
return null;
|
|
3900
|
-
const
|
|
3901
|
-
if (
|
|
3955
|
+
const l = m.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(n)));
|
|
3956
|
+
if (l.length === 0) return null;
|
|
3902
3957
|
const d = x(
|
|
3903
3958
|
"space-y-4",
|
|
3904
3959
|
{
|
|
@@ -3939,7 +3994,7 @@ const Qr = ({
|
|
|
3939
3994
|
}
|
|
3940
3995
|
)
|
|
3941
3996
|
] }),
|
|
3942
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children:
|
|
3997
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: l.map((p) => /* @__PURE__ */ c(
|
|
3943
3998
|
"div",
|
|
3944
3999
|
{
|
|
3945
4000
|
className: x(
|
|
@@ -3967,7 +4022,7 @@ const Qr = ({
|
|
|
3967
4022
|
m.id
|
|
3968
4023
|
);
|
|
3969
4024
|
},
|
|
3970
|
-
[
|
|
4025
|
+
[n, g]
|
|
3971
4026
|
), b = x(
|
|
3972
4027
|
"space-y-6",
|
|
3973
4028
|
{
|
|
@@ -3979,10 +4034,10 @@ const Qr = ({
|
|
|
3979
4034
|
a
|
|
3980
4035
|
);
|
|
3981
4036
|
return /* @__PURE__ */ e("div", { className: b, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(f) }) });
|
|
3982
|
-
}, ze = ({ item: r, isSelectedHandler:
|
|
4037
|
+
}, ze = ({ item: r, isSelectedHandler: n, onClick: t }) => {
|
|
3983
4038
|
const [a, o] = V(!1), i = r.children && r.children.length > 0, h = () => {
|
|
3984
4039
|
i && o(!a);
|
|
3985
|
-
}, g =
|
|
4040
|
+
}, g = n ? n(r.path) : !1;
|
|
3986
4041
|
return /* @__PURE__ */ c("li", { children: [
|
|
3987
4042
|
/* @__PURE__ */ c(
|
|
3988
4043
|
"div",
|
|
@@ -4002,7 +4057,7 @@ const Qr = ({
|
|
|
4002
4057
|
r.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: r.icon }),
|
|
4003
4058
|
/* @__PURE__ */ e("span", { className: "flex-1", children: r.label }),
|
|
4004
4059
|
r.count !== void 0 && r.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: r.count }),
|
|
4005
|
-
i && /* @__PURE__ */ e("span", { className: `${a ? "collapsed" : ""}`, children: /* @__PURE__ */ e(
|
|
4060
|
+
i && /* @__PURE__ */ e("span", { className: `${a ? "collapsed" : ""}`, children: /* @__PURE__ */ e(We, { className: "w-4 h-4 text-gray-300" }) })
|
|
4006
4061
|
]
|
|
4007
4062
|
}
|
|
4008
4063
|
),
|
|
@@ -4010,15 +4065,15 @@ const Qr = ({
|
|
|
4010
4065
|
ze,
|
|
4011
4066
|
{
|
|
4012
4067
|
item: f,
|
|
4013
|
-
isSelectedHandler:
|
|
4068
|
+
isSelectedHandler: n,
|
|
4014
4069
|
onClick: t
|
|
4015
4070
|
},
|
|
4016
4071
|
b
|
|
4017
4072
|
)) })
|
|
4018
4073
|
] });
|
|
4019
|
-
},
|
|
4074
|
+
}, ot = ({
|
|
4020
4075
|
title: r,
|
|
4021
|
-
actionIcons:
|
|
4076
|
+
actionIcons: n,
|
|
4022
4077
|
items: t,
|
|
4023
4078
|
isSelectedHandler: a,
|
|
4024
4079
|
onClick: o,
|
|
@@ -4026,7 +4081,7 @@ const Qr = ({
|
|
|
4026
4081
|
}) => /* @__PURE__ */ c("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4027
4082
|
/* @__PURE__ */ c("div", { className: "sidebar-menu-header", children: [
|
|
4028
4083
|
/* @__PURE__ */ e("span", { className: "text-xl font-semibold text-gray-800 mb-2", children: r }),
|
|
4029
|
-
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children:
|
|
4084
|
+
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: n?.map((h, g) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: h }, g)) })
|
|
4030
4085
|
] }),
|
|
4031
4086
|
i && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: i }),
|
|
4032
4087
|
/* @__PURE__ */ e("ul", { children: t.map(
|
|
@@ -4040,9 +4095,9 @@ const Qr = ({
|
|
|
4040
4095
|
g
|
|
4041
4096
|
)
|
|
4042
4097
|
) })
|
|
4043
|
-
] }),
|
|
4098
|
+
] }), ct = ({
|
|
4044
4099
|
level: r = 1,
|
|
4045
|
-
size:
|
|
4100
|
+
size: n,
|
|
4046
4101
|
weight: t = "bold",
|
|
4047
4102
|
color: a = "current",
|
|
4048
4103
|
align: o = "left",
|
|
@@ -4051,7 +4106,7 @@ const Qr = ({
|
|
|
4051
4106
|
children: g,
|
|
4052
4107
|
...f
|
|
4053
4108
|
}) => {
|
|
4054
|
-
const b =
|
|
4109
|
+
const b = n || jr(r), m = x(
|
|
4055
4110
|
"font-primary",
|
|
4056
4111
|
// Size variants
|
|
4057
4112
|
{
|
|
@@ -4095,10 +4150,10 @@ const Qr = ({
|
|
|
4095
4150
|
truncate: i
|
|
4096
4151
|
},
|
|
4097
4152
|
h
|
|
4098
|
-
),
|
|
4099
|
-
return /* @__PURE__ */ e(
|
|
4153
|
+
), l = `h${r}`;
|
|
4154
|
+
return /* @__PURE__ */ e(l, { className: m, ...f, children: g });
|
|
4100
4155
|
};
|
|
4101
|
-
function
|
|
4156
|
+
function jr(r) {
|
|
4102
4157
|
return {
|
|
4103
4158
|
1: "4xl",
|
|
4104
4159
|
2: "3xl",
|
|
@@ -4108,9 +4163,9 @@ function Dr(r) {
|
|
|
4108
4163
|
6: "md"
|
|
4109
4164
|
}[r] || "md";
|
|
4110
4165
|
}
|
|
4111
|
-
const
|
|
4166
|
+
const dt = ({
|
|
4112
4167
|
items: r,
|
|
4113
|
-
type:
|
|
4168
|
+
type: n = "unordered",
|
|
4114
4169
|
variant: t = "default",
|
|
4115
4170
|
size: a = "md",
|
|
4116
4171
|
interactive: o = !1,
|
|
@@ -4138,7 +4193,7 @@ const tt = ({
|
|
|
4138
4193
|
"text-lg": a === "lg"
|
|
4139
4194
|
},
|
|
4140
4195
|
i
|
|
4141
|
-
), f = (
|
|
4196
|
+
), f = (l, d) => x(
|
|
4142
4197
|
// Base item styles
|
|
4143
4198
|
"transition-colors duration-200",
|
|
4144
4199
|
// Size-based padding
|
|
@@ -4148,93 +4203,93 @@ const tt = ({
|
|
|
4148
4203
|
"py-3 px-4": a === "lg" && (t === "bordered" || t === "divided")
|
|
4149
4204
|
},
|
|
4150
4205
|
// Interactive styles
|
|
4151
|
-
o && !
|
|
4206
|
+
o && !l.disabled && {
|
|
4152
4207
|
"cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800": !0,
|
|
4153
4208
|
"focus:outline-none focus:bg-neutral-100 dark:focus:bg-neutral-700": !0
|
|
4154
4209
|
},
|
|
4155
4210
|
// Disabled styles
|
|
4156
|
-
|
|
4211
|
+
l.disabled && {
|
|
4157
4212
|
"opacity-50 cursor-not-allowed": !0
|
|
4158
4213
|
},
|
|
4159
4214
|
h
|
|
4160
|
-
), b = (
|
|
4161
|
-
o && !
|
|
4162
|
-
}, m = (
|
|
4163
|
-
o && !d.disabled && (
|
|
4215
|
+
), b = (l) => {
|
|
4216
|
+
o && !l.disabled && l.onClick && l.onClick();
|
|
4217
|
+
}, m = (l, d) => {
|
|
4218
|
+
o && !d.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), d.onClick?.());
|
|
4164
4219
|
};
|
|
4165
|
-
return
|
|
4220
|
+
return n === "ordered" ? /* @__PURE__ */ e("ol", { className: g, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4166
4221
|
"li",
|
|
4167
4222
|
{
|
|
4168
|
-
className: f(
|
|
4169
|
-
onClick: () => b(
|
|
4170
|
-
onKeyDown: (p) => m(p,
|
|
4171
|
-
tabIndex: o && !
|
|
4223
|
+
className: f(l),
|
|
4224
|
+
onClick: () => b(l),
|
|
4225
|
+
onKeyDown: (p) => m(p, l),
|
|
4226
|
+
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4172
4227
|
role: o ? "button" : void 0,
|
|
4173
|
-
children:
|
|
4228
|
+
children: l.content
|
|
4174
4229
|
},
|
|
4175
|
-
|
|
4176
|
-
)) }) :
|
|
4230
|
+
l.id || d
|
|
4231
|
+
)) }) : n === "description" ? /* @__PURE__ */ e("dl", { className: g, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4177
4232
|
"div",
|
|
4178
4233
|
{
|
|
4179
|
-
className: f(
|
|
4180
|
-
onClick: () => b(
|
|
4181
|
-
onKeyDown: (p) => m(p,
|
|
4182
|
-
tabIndex: o && !
|
|
4234
|
+
className: f(l),
|
|
4235
|
+
onClick: () => b(l),
|
|
4236
|
+
onKeyDown: (p) => m(p, l),
|
|
4237
|
+
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4183
4238
|
role: o ? "button" : void 0,
|
|
4184
|
-
children:
|
|
4239
|
+
children: l.content
|
|
4185
4240
|
},
|
|
4186
|
-
|
|
4187
|
-
)) }) : /* @__PURE__ */ e("ul", { className: g, children: r.map((
|
|
4241
|
+
l.id || d
|
|
4242
|
+
)) }) : /* @__PURE__ */ e("ul", { className: g, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4188
4243
|
"li",
|
|
4189
4244
|
{
|
|
4190
|
-
className: f(
|
|
4191
|
-
onClick: () => b(
|
|
4192
|
-
onKeyDown: (p) => m(p,
|
|
4193
|
-
tabIndex: o && !
|
|
4245
|
+
className: f(l),
|
|
4246
|
+
onClick: () => b(l),
|
|
4247
|
+
onKeyDown: (p) => m(p, l),
|
|
4248
|
+
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4194
4249
|
role: o ? "button" : void 0,
|
|
4195
|
-
children:
|
|
4250
|
+
children: l.content
|
|
4196
4251
|
},
|
|
4197
|
-
|
|
4252
|
+
l.id || d
|
|
4198
4253
|
)) });
|
|
4199
|
-
},
|
|
4254
|
+
}, it = ({
|
|
4200
4255
|
commands: r,
|
|
4201
|
-
isOpen:
|
|
4256
|
+
isOpen: n,
|
|
4202
4257
|
onClose: t,
|
|
4203
4258
|
labels: a,
|
|
4204
4259
|
initialCommandPath: o,
|
|
4205
4260
|
initialActiveIndex: i
|
|
4206
4261
|
}) => {
|
|
4207
|
-
const [h, g] = V(""), [f, b] = V(o || []), [m,
|
|
4262
|
+
const [h, g] = V(""), [f, b] = V(o || []), [m, l] = V(i || 0), d = X(null), N = (f.length ? r.find((v) => v.id === f[0])?.subCommands || [] : r).filter(
|
|
4208
4263
|
(v) => v.label.toLowerCase().includes(h.toLowerCase())
|
|
4209
4264
|
);
|
|
4210
|
-
return
|
|
4211
|
-
|
|
4212
|
-
}, [
|
|
4265
|
+
return K(() => {
|
|
4266
|
+
n || (g(""), b(o || []), l(i || 0));
|
|
4267
|
+
}, [n]), K(() => {
|
|
4213
4268
|
const v = (S) => {
|
|
4214
|
-
if (
|
|
4269
|
+
if (n) {
|
|
4215
4270
|
if (S.key === "Escape")
|
|
4216
4271
|
t();
|
|
4217
4272
|
else if (S.key === "ArrowUp")
|
|
4218
|
-
|
|
4273
|
+
l(
|
|
4219
4274
|
(B) => B > 0 ? B - 1 : N.length - 1
|
|
4220
4275
|
);
|
|
4221
4276
|
else if (S.key === "ArrowDown")
|
|
4222
|
-
|
|
4277
|
+
l(
|
|
4223
4278
|
(B) => B < N.length - 1 ? B + 1 : 0
|
|
4224
4279
|
);
|
|
4225
4280
|
else if (S.key === "Enter") {
|
|
4226
4281
|
const B = N[m];
|
|
4227
|
-
B && (B.subCommands ? (b([...f, B.id]),
|
|
4282
|
+
B && (B.subCommands ? (b([...f, B.id]), l(0)) : B.action && (B.action(), t()));
|
|
4228
4283
|
}
|
|
4229
4284
|
}
|
|
4230
4285
|
};
|
|
4231
4286
|
return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
|
|
4232
|
-
}, [
|
|
4287
|
+
}, [n, t, N, m, f]), K(() => {
|
|
4233
4288
|
const v = (S) => {
|
|
4234
4289
|
d.current && !d.current.contains(S.target) && t();
|
|
4235
4290
|
};
|
|
4236
|
-
return
|
|
4237
|
-
}, [
|
|
4291
|
+
return n && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
4292
|
+
}, [n, t]), n ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ c(
|
|
4238
4293
|
"div",
|
|
4239
4294
|
{
|
|
4240
4295
|
className: "flex flex-col w-full max-w-lg p-2 mx-auto rounded-lg shadow-lg bg-white",
|
|
@@ -4257,13 +4312,13 @@ const tt = ({
|
|
|
4257
4312
|
{
|
|
4258
4313
|
className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${S === m ? "bg-gray-100" : ""}`,
|
|
4259
4314
|
onClick: () => {
|
|
4260
|
-
v.subCommands ? (b([...f, v.id]),
|
|
4315
|
+
v.subCommands ? (b([...f, v.id]), l(0)) : v.action && (v.action(), t());
|
|
4261
4316
|
},
|
|
4262
|
-
onMouseEnter: () =>
|
|
4317
|
+
onMouseEnter: () => l(S),
|
|
4263
4318
|
children: [
|
|
4264
4319
|
v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
|
|
4265
4320
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
|
|
4266
|
-
v.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(
|
|
4321
|
+
v.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Re, { className: "w-4 h-4" }) })
|
|
4267
4322
|
]
|
|
4268
4323
|
},
|
|
4269
4324
|
v.id
|
|
@@ -4289,7 +4344,7 @@ const tt = ({
|
|
|
4289
4344
|
]
|
|
4290
4345
|
}
|
|
4291
4346
|
) }) : null;
|
|
4292
|
-
},
|
|
4347
|
+
}, Br = {
|
|
4293
4348
|
none: "p-0",
|
|
4294
4349
|
xs: "p-1",
|
|
4295
4350
|
sm: "p-2",
|
|
@@ -4297,7 +4352,7 @@ const tt = ({
|
|
|
4297
4352
|
lg: "p-6",
|
|
4298
4353
|
xl: "p-8",
|
|
4299
4354
|
"2xl": "p-12"
|
|
4300
|
-
},
|
|
4355
|
+
}, Pr = {
|
|
4301
4356
|
none: "m-0",
|
|
4302
4357
|
xs: "m-1",
|
|
4303
4358
|
sm: "m-2",
|
|
@@ -4305,7 +4360,7 @@ const tt = ({
|
|
|
4305
4360
|
lg: "m-6",
|
|
4306
4361
|
xl: "m-8",
|
|
4307
4362
|
"2xl": "m-12"
|
|
4308
|
-
},
|
|
4363
|
+
}, Or = {
|
|
4309
4364
|
none: "",
|
|
4310
4365
|
primary: "bg-primary",
|
|
4311
4366
|
secondary: "bg-secondary",
|
|
@@ -4317,26 +4372,26 @@ const tt = ({
|
|
|
4317
4372
|
neutral: "bg-neutral",
|
|
4318
4373
|
white: "bg-white",
|
|
4319
4374
|
module: "bg-module"
|
|
4320
|
-
},
|
|
4375
|
+
}, _r = {
|
|
4321
4376
|
none: "rounded-none",
|
|
4322
4377
|
sm: "rounded-sm",
|
|
4323
4378
|
md: "rounded-md",
|
|
4324
4379
|
lg: "rounded-lg",
|
|
4325
4380
|
xl: "rounded-xl",
|
|
4326
4381
|
full: "rounded-full"
|
|
4327
|
-
},
|
|
4382
|
+
}, Vr = {
|
|
4328
4383
|
none: "shadow-none",
|
|
4329
4384
|
sm: "shadow-sm shadow-lvl-0",
|
|
4330
4385
|
md: "shadow-md shadow-lvl-0",
|
|
4331
4386
|
lg: "shadow-lg shadow-lvl-0",
|
|
4332
4387
|
xl: "shadow-xl shadow-lvl-0",
|
|
4333
4388
|
"2xl": "shadow-2xl shadow-lvl-0"
|
|
4334
|
-
},
|
|
4389
|
+
}, Fr = {
|
|
4335
4390
|
none: "border-0",
|
|
4336
4391
|
sm: "border",
|
|
4337
4392
|
md: "border-2",
|
|
4338
4393
|
lg: "border-4"
|
|
4339
|
-
},
|
|
4394
|
+
}, Wr = {
|
|
4340
4395
|
primary: "border-primary",
|
|
4341
4396
|
secondary: "border-secondary",
|
|
4342
4397
|
accent: "border-accent",
|
|
@@ -4349,7 +4404,7 @@ const tt = ({
|
|
|
4349
4404
|
}, De = ce(
|
|
4350
4405
|
({
|
|
4351
4406
|
padding: r,
|
|
4352
|
-
margin:
|
|
4407
|
+
margin: n,
|
|
4353
4408
|
background: t,
|
|
4354
4409
|
radius: a,
|
|
4355
4410
|
shadow: o,
|
|
@@ -4363,13 +4418,13 @@ const tt = ({
|
|
|
4363
4418
|
{
|
|
4364
4419
|
ref: m,
|
|
4365
4420
|
className: x(
|
|
4366
|
-
r &&
|
|
4367
|
-
|
|
4368
|
-
t &&
|
|
4369
|
-
a &&
|
|
4370
|
-
o &&
|
|
4371
|
-
i &&
|
|
4372
|
-
h &&
|
|
4421
|
+
r && Br[r],
|
|
4422
|
+
n && Pr[n],
|
|
4423
|
+
t && Or[t],
|
|
4424
|
+
a && _r[a],
|
|
4425
|
+
o && Vr[o],
|
|
4426
|
+
i && Fr[i],
|
|
4427
|
+
h && Wr[h],
|
|
4373
4428
|
g
|
|
4374
4429
|
),
|
|
4375
4430
|
...b,
|
|
@@ -4378,25 +4433,25 @@ const tt = ({
|
|
|
4378
4433
|
)
|
|
4379
4434
|
);
|
|
4380
4435
|
De.displayName = "Box";
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4436
|
+
const ut = ({ children: r, title: n, ...t }) => /* @__PURE__ */ c(De, { background: "module", radius: "xl", shadow: "sm", ...t, children: [
|
|
4437
|
+
n && /* @__PURE__ */ e("span", { className: "text-base font-medium text-gray-800 mb-2", children: n }),
|
|
4383
4438
|
r
|
|
4384
4439
|
] });
|
|
4385
|
-
function
|
|
4440
|
+
function mt({
|
|
4386
4441
|
identifier: r,
|
|
4387
|
-
resourceLoader:
|
|
4442
|
+
resourceLoader: n,
|
|
4388
4443
|
framework: t = "react",
|
|
4389
4444
|
fallback: a,
|
|
4390
4445
|
componentProps: o,
|
|
4391
4446
|
className: i
|
|
4392
4447
|
}) {
|
|
4393
|
-
const h =
|
|
4394
|
-
return
|
|
4448
|
+
const h = X(null), [g, f] = V(!0), [b, m] = V(null), l = X(null);
|
|
4449
|
+
return X(null), K(() => {
|
|
4395
4450
|
let d = !0;
|
|
4396
4451
|
return (async () => {
|
|
4397
4452
|
f(!0);
|
|
4398
4453
|
try {
|
|
4399
|
-
const N = await
|
|
4454
|
+
const N = await n();
|
|
4400
4455
|
if (!d) return;
|
|
4401
4456
|
const v = N.component || N.default || N;
|
|
4402
4457
|
m(t === "react" ? () => v : () => N);
|
|
@@ -4408,13 +4463,13 @@ function lt({
|
|
|
4408
4463
|
})(), () => {
|
|
4409
4464
|
d = !1;
|
|
4410
4465
|
};
|
|
4411
|
-
}, [r,
|
|
4466
|
+
}, [r, n]), K(() => {
|
|
4412
4467
|
if (g || !b || t === "react") return;
|
|
4413
4468
|
const d = h.current;
|
|
4414
4469
|
if (d) {
|
|
4415
4470
|
if (t === "svelte") {
|
|
4416
4471
|
const p = b.default || b, N = new p({ target: d, props: o || {} });
|
|
4417
|
-
return
|
|
4472
|
+
return l.current = N, () => N.$destroy();
|
|
4418
4473
|
}
|
|
4419
4474
|
if (b.mount) {
|
|
4420
4475
|
const p = b.mount({ container: d, props: o || {} });
|
|
@@ -4423,25 +4478,25 @@ function lt({
|
|
|
4423
4478
|
};
|
|
4424
4479
|
}
|
|
4425
4480
|
}
|
|
4426
|
-
}, [b, t, g]),
|
|
4427
|
-
t === "svelte" &&
|
|
4481
|
+
}, [b, t, g]), K(() => {
|
|
4482
|
+
t === "svelte" && l.current && l.current.$set?.(o);
|
|
4428
4483
|
}, [o, t]), /* @__PURE__ */ c("div", { ref: h, className: i, style: { display: "contents" }, children: [
|
|
4429
4484
|
g && a,
|
|
4430
4485
|
t === "react" && b && /* @__PURE__ */ e(b, { ...o })
|
|
4431
4486
|
] });
|
|
4432
4487
|
}
|
|
4433
|
-
class
|
|
4488
|
+
class ht extends qe {
|
|
4434
4489
|
constructor() {
|
|
4435
4490
|
super(...arguments), this.state = {
|
|
4436
4491
|
hasError: !1,
|
|
4437
4492
|
error: null
|
|
4438
4493
|
};
|
|
4439
4494
|
}
|
|
4440
|
-
static getDerivedStateFromError(
|
|
4441
|
-
return { hasError: !0, error:
|
|
4495
|
+
static getDerivedStateFromError(n) {
|
|
4496
|
+
return { hasError: !0, error: n };
|
|
4442
4497
|
}
|
|
4443
|
-
componentDidCatch(
|
|
4444
|
-
console.error(`[ErrorBoundary] Error in ${this.props.name || "Component"}:`,
|
|
4498
|
+
componentDidCatch(n, t) {
|
|
4499
|
+
console.error(`[ErrorBoundary] Error in ${this.props.name || "Component"}:`, n, t);
|
|
4445
4500
|
}
|
|
4446
4501
|
render() {
|
|
4447
4502
|
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ c("div", { className: "p-4 m-4 border border-red-200 bg-red-50 rounded-lg", children: [
|
|
@@ -4459,41 +4514,44 @@ class st extends Ie {
|
|
|
4459
4514
|
}
|
|
4460
4515
|
}
|
|
4461
4516
|
export {
|
|
4462
|
-
|
|
4517
|
+
tt as Badge,
|
|
4463
4518
|
De as Box,
|
|
4464
4519
|
ee as Button,
|
|
4465
|
-
|
|
4466
|
-
|
|
4520
|
+
Xr as ButtonGroup,
|
|
4521
|
+
ut as Card,
|
|
4467
4522
|
be as Checkbox,
|
|
4468
|
-
|
|
4469
|
-
|
|
4523
|
+
it as CommandPalette,
|
|
4524
|
+
ir as ContentLoading,
|
|
4470
4525
|
ye as DatePicker,
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4526
|
+
ur as Dropdown,
|
|
4527
|
+
ht as ErrorBoundary,
|
|
4528
|
+
mt as FederatedResource,
|
|
4529
|
+
rt as Form,
|
|
4530
|
+
ct as Heading,
|
|
4476
4531
|
oe as Icon,
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4532
|
+
nt as Image,
|
|
4533
|
+
Qr as Link,
|
|
4534
|
+
dt as List,
|
|
4535
|
+
Jr as MeetingGrid,
|
|
4536
|
+
wr as Modal,
|
|
4537
|
+
lt as PageHeader,
|
|
4538
|
+
Yr as ParticipantTile,
|
|
4539
|
+
lr as SearchableTextField,
|
|
4483
4540
|
ve as Select,
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4541
|
+
ot as SidebarMenu,
|
|
4542
|
+
at as Spinner,
|
|
4543
|
+
Ye as SplitButton,
|
|
4544
|
+
Sr as StorageInput,
|
|
4545
|
+
et as TabBar,
|
|
4489
4546
|
Se as Table,
|
|
4490
|
-
|
|
4547
|
+
kr as Tabs,
|
|
4491
4548
|
Z as Text,
|
|
4492
4549
|
ke as TextArea,
|
|
4493
4550
|
ue as TextField,
|
|
4494
|
-
|
|
4551
|
+
Zr as VideoSurface,
|
|
4552
|
+
st as View,
|
|
4495
4553
|
x as cn,
|
|
4496
|
-
|
|
4497
|
-
|
|
4554
|
+
Kr as createSizes,
|
|
4555
|
+
Gr as createVariants
|
|
4498
4556
|
};
|
|
4499
4557
|
//# sourceMappingURL=index.js.map
|