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