unifyedx-storybook-new 0.1.90 → 0.1.91
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.
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import re, { useState as L, useMemo as ne, useId as Qe, Fragment as J, useEffect as Q, useCallback as K, useRef as ue } from "react";
|
|
3
|
-
import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, b as Me, f as Be, d as pa, D as ga, F as
|
|
4
|
-
import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as
|
|
3
|
+
import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, b as Me, f as Be, d as pa, D as ga, F as ct, e as it, h as dt, T as Pe, u as ut, i as mt, I as ht, j as pt, k as gt, l as yt, m as ft, n as bt, S as ya, o as fa, M as vt, p as Nt, q as ba, r as xt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as $t, x as Ft, y as va, z as Tt, B as Na, G as xa, H as At, J as Et, K as Rt, N as Oe, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Ot, a0 as wa, a1 as Lt, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as _t, a9 as Yt, aa as Wt, ab as Jt, ac as Qt, ad as Xt, ae as Zt, af as Ht } from "./vendor-C8vzJvk7.js";
|
|
4
|
+
import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as cr, Switch as Ye, Menu as ir, MenuButton as dr, Portal as ur, MenuItems as mr, MenuItem as hr, DialogBackdrop as pr } from "@headlessui/react";
|
|
5
5
|
import { motion as te, AnimatePresence as fe } from "framer-motion";
|
|
6
6
|
import { d as gr } from "./vendor-lodash-CvM7_34d.js";
|
|
7
|
-
import { useFloating as Ca, offset as Sa, flip as Da, shift as
|
|
7
|
+
import { useFloating as Ca, offset as Sa, flip as Da, shift as $a, autoUpdate as Fa, useClick as yr, useDismiss as fr, useInteractions as br, FloatingPortal as vr } from "@floating-ui/react";
|
|
8
8
|
import We, { debounce as Nr } from "lodash";
|
|
9
9
|
import { toast as le, ToastContainer as xr, Slide as kr } from "react-toastify";
|
|
10
10
|
import "react-toastify/dist/ReactToastify.css";
|
|
11
|
-
import { P as wr, S as Cr, F as Sr, G as Dr, a as
|
|
11
|
+
import { P as wr, S as Cr, F as Sr, G as Dr, a as $r, E as Fr, b as Tr, C as Ar, R as Er, c as Rr, d as Ir, e as zr, f as Br, I as Pr, g as ra } from "./vendor-syncfusion-DGcZfoFG.js";
|
|
12
12
|
const Or = (t) => {
|
|
13
13
|
let r = 2166136261;
|
|
14
14
|
for (let s = 0; s < t.length; s++)
|
|
15
15
|
r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
|
|
16
16
|
return r >>> 0;
|
|
17
17
|
}, Lr = (t) => {
|
|
18
|
-
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20,
|
|
18
|
+
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, c = 30 + (o >>> 16) % 10, i = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${i}%)`, b = `hsl(${n}, ${u}%, ${c}%)`;
|
|
19
19
|
return { bg: y, text: b };
|
|
20
20
|
}, Mr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), Ta = ({
|
|
21
21
|
src: t,
|
|
@@ -27,9 +27,9 @@ const Or = (t) => {
|
|
|
27
27
|
textColor: n,
|
|
28
28
|
// ✅ New prop for text/icon color
|
|
29
29
|
className: u,
|
|
30
|
-
...
|
|
30
|
+
...c
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
32
|
+
const [i, y] = L(!1), b = ne(() => Lr(r), []), N = t && !i, a = !N && r, w = !N && !r, m = W(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
@@ -37,7 +37,7 @@ const Or = (t) => {
|
|
|
37
37
|
return /* @__PURE__ */ l("div", { className: m, style: {
|
|
38
38
|
backgroundColor: g,
|
|
39
39
|
color: $
|
|
40
|
-
}, ...
|
|
40
|
+
}, ...c, children: [
|
|
41
41
|
N && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
@@ -51,12 +51,12 @@ const Or = (t) => {
|
|
|
51
51
|
w && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
|
|
52
52
|
] });
|
|
53
53
|
}, Wn = ({ children: t, max: r = 4, truncatedMessage: s = "Members", ...o }) => {
|
|
54
|
-
const n = re.Children.toArray(t), u = n.slice(0, r),
|
|
54
|
+
const n = re.Children.toArray(t), u = n.slice(0, r), c = n.length - r;
|
|
55
55
|
return /* @__PURE__ */ l("div", { className: "avatar-group-container", ...o, children: [
|
|
56
56
|
u,
|
|
57
|
-
|
|
57
|
+
c > 0 && /* @__PURE__ */ l("div", { className: "avatar-container avatar--size-medium avatar-excess", children: [
|
|
58
58
|
"+",
|
|
59
|
-
|
|
59
|
+
c,
|
|
60
60
|
" ",
|
|
61
61
|
s
|
|
62
62
|
] })
|
|
@@ -70,8 +70,8 @@ const Or = (t) => {
|
|
|
70
70
|
icon: o,
|
|
71
71
|
onRemove: n,
|
|
72
72
|
bgColor: u,
|
|
73
|
-
textColor:
|
|
74
|
-
className:
|
|
73
|
+
textColor: c,
|
|
74
|
+
className: i,
|
|
75
75
|
...y
|
|
76
76
|
}) => {
|
|
77
77
|
const b = W(
|
|
@@ -79,11 +79,11 @@ const Or = (t) => {
|
|
|
79
79
|
`badge--variant-${r}`,
|
|
80
80
|
`badge--size-${s}`,
|
|
81
81
|
{ "badge--with-remove": !!n },
|
|
82
|
-
|
|
82
|
+
i
|
|
83
83
|
);
|
|
84
|
-
return /* @__PURE__ */ l("span", { className: b, style: u &&
|
|
84
|
+
return /* @__PURE__ */ l("span", { className: b, style: u && c ? {
|
|
85
85
|
backgroundColor: u,
|
|
86
|
-
color:
|
|
86
|
+
color: c,
|
|
87
87
|
borderColor: "#ff0000"
|
|
88
88
|
} : {}, ...y, children: [
|
|
89
89
|
o && /* @__PURE__ */ e(o, { className: "badge-icon" }),
|
|
@@ -145,8 +145,8 @@ const Ur = {
|
|
|
145
145
|
className: n = "",
|
|
146
146
|
// ✅ Default is now empty
|
|
147
147
|
loader: u = !1,
|
|
148
|
-
category:
|
|
149
|
-
icon:
|
|
148
|
+
category: c = "primary",
|
|
149
|
+
icon: i,
|
|
150
150
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
151
|
disabled: y = !1,
|
|
152
152
|
size: b = "medium",
|
|
@@ -156,10 +156,10 @@ const Ur = {
|
|
|
156
156
|
onClick: w,
|
|
157
157
|
...m
|
|
158
158
|
}) => {
|
|
159
|
-
const g = y || u, $ =
|
|
159
|
+
const g = y || u, $ = i && !N, O = W(
|
|
160
160
|
"btn-base",
|
|
161
161
|
Ur[b],
|
|
162
|
-
qr[
|
|
162
|
+
qr[c],
|
|
163
163
|
{
|
|
164
164
|
"is-loading": u,
|
|
165
165
|
"btn-icon-only": $
|
|
@@ -171,14 +171,14 @@ const Ur = {
|
|
|
171
171
|
{
|
|
172
172
|
"data-testid": t,
|
|
173
173
|
type: s,
|
|
174
|
-
className:
|
|
174
|
+
className: O,
|
|
175
175
|
disabled: g,
|
|
176
176
|
onClick: w,
|
|
177
177
|
title: r || $ && o || (typeof N == "string" ? N : void 0),
|
|
178
178
|
"aria-label": o || $ && r || (typeof N == "string" ? N : void 0),
|
|
179
179
|
...m,
|
|
180
180
|
children: u ? /* @__PURE__ */ e(ot, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
|
|
181
|
-
|
|
181
|
+
i && /* @__PURE__ */ e(i, { size: b === "large" ? 20 : 16 }),
|
|
182
182
|
N,
|
|
183
183
|
a,
|
|
184
184
|
" "
|
|
@@ -215,8 +215,8 @@ const Ur = {
|
|
|
215
215
|
className: o,
|
|
216
216
|
ref: n,
|
|
217
217
|
checked: u,
|
|
218
|
-
onChange:
|
|
219
|
-
...
|
|
218
|
+
onChange: c,
|
|
219
|
+
...i
|
|
220
220
|
}) => {
|
|
221
221
|
const y = Qe(), b = r || y;
|
|
222
222
|
return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
|
|
@@ -229,8 +229,8 @@ const Ur = {
|
|
|
229
229
|
ref: n,
|
|
230
230
|
className: "checkbox-input",
|
|
231
231
|
checked: u,
|
|
232
|
-
onChange:
|
|
233
|
-
...
|
|
232
|
+
onChange: c,
|
|
233
|
+
...i
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -255,14 +255,14 @@ const Ur = {
|
|
|
255
255
|
placeholder: o = "Select a date",
|
|
256
256
|
label: n,
|
|
257
257
|
error: u,
|
|
258
|
-
disabled:
|
|
259
|
-
className:
|
|
258
|
+
disabled: c = !1,
|
|
259
|
+
className: i,
|
|
260
260
|
...y
|
|
261
261
|
}) => {
|
|
262
262
|
const b = (N) => {
|
|
263
263
|
N.stopPropagation(), N.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
|
-
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper",
|
|
265
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", i), children: [
|
|
266
266
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
|
|
267
267
|
/* @__PURE__ */ l(Ea, { children: [
|
|
268
268
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -273,9 +273,9 @@ const Ur = {
|
|
|
273
273
|
type: "button",
|
|
274
274
|
className: W("datepicker-trigger", {
|
|
275
275
|
"datepicker-trigger--error": !!u,
|
|
276
|
-
"datepicker-trigger--disabled":
|
|
276
|
+
"datepicker-trigger--disabled": c
|
|
277
277
|
}),
|
|
278
|
-
disabled:
|
|
278
|
+
disabled: c,
|
|
279
279
|
"aria-label": t ? `Selected date is ${Be(t, "PPP")}` : o,
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
|
|
@@ -283,7 +283,7 @@ const Ur = {
|
|
|
283
283
|
]
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
|
-
t && s && !
|
|
286
|
+
t && s && !c && /* @__PURE__ */ e(
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
@@ -301,7 +301,7 @@ const Ur = {
|
|
|
301
301
|
selected: t,
|
|
302
302
|
onSelect: r,
|
|
303
303
|
initialFocus: !0,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: c,
|
|
305
305
|
...y
|
|
306
306
|
}
|
|
307
307
|
) })
|
|
@@ -315,8 +315,8 @@ const Ur = {
|
|
|
315
315
|
placeholder: o = "Select a date range",
|
|
316
316
|
label: n,
|
|
317
317
|
error: u,
|
|
318
|
-
disabled:
|
|
319
|
-
className:
|
|
318
|
+
disabled: c = !1,
|
|
319
|
+
className: i,
|
|
320
320
|
...y
|
|
321
321
|
}) => {
|
|
322
322
|
const b = t?.from, N = t?.to, a = (m) => {
|
|
@@ -326,7 +326,7 @@ const Ur = {
|
|
|
326
326
|
" - ",
|
|
327
327
|
Be(N, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
329
|
-
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper",
|
|
329
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", i), children: [
|
|
330
330
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
|
|
331
331
|
/* @__PURE__ */ l(Ea, { children: [
|
|
332
332
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -337,9 +337,9 @@ const Ur = {
|
|
|
337
337
|
type: "button",
|
|
338
338
|
className: W("datepicker-trigger", {
|
|
339
339
|
"datepicker-trigger--error": !!u,
|
|
340
|
-
"datepicker-trigger--disabled":
|
|
340
|
+
"datepicker-trigger--disabled": c
|
|
341
341
|
}),
|
|
342
|
-
disabled:
|
|
342
|
+
disabled: c,
|
|
343
343
|
"aria-label": b && N ? `Selected range is ${w}` : o,
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
|
|
@@ -347,7 +347,7 @@ const Ur = {
|
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
b && s && !
|
|
350
|
+
b && s && !c && /* @__PURE__ */ e(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
type: "button",
|
|
@@ -366,7 +366,7 @@ const Ur = {
|
|
|
366
366
|
onSelect: r,
|
|
367
367
|
numberOfMonths: 2,
|
|
368
368
|
initialFocus: !0,
|
|
369
|
-
disabled:
|
|
369
|
+
disabled: c,
|
|
370
370
|
...y
|
|
371
371
|
}
|
|
372
372
|
) })
|
|
@@ -591,7 +591,7 @@ const Ur = {
|
|
|
591
591
|
}, sa = ({ extension: t, size: r = 36 }) => {
|
|
592
592
|
const s = (t || "").toLowerCase(), o = _r[s];
|
|
593
593
|
return o ? /* @__PURE__ */ e("div", { style: { width: r }, className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
594
|
-
|
|
594
|
+
ct,
|
|
595
595
|
{
|
|
596
596
|
extension: s,
|
|
597
597
|
...o,
|
|
@@ -607,7 +607,7 @@ const Ur = {
|
|
|
607
607
|
{
|
|
608
608
|
style: { width: r, height: r },
|
|
609
609
|
className: "flex items-center justify-center bg-gray-100 rounded-sm border border-gray-300",
|
|
610
|
-
children: /* @__PURE__ */ e(
|
|
610
|
+
children: /* @__PURE__ */ e(it, { className: "text-gray-400", size: r * 0.75 })
|
|
611
611
|
}
|
|
612
612
|
);
|
|
613
613
|
}, la = (t, r = 2) => {
|
|
@@ -624,8 +624,8 @@ const Ur = {
|
|
|
624
624
|
isDragActive: n,
|
|
625
625
|
open: u,
|
|
626
626
|
// --- Form and File State ---
|
|
627
|
-
validFiles:
|
|
628
|
-
rejectedFiles:
|
|
627
|
+
validFiles: c = [],
|
|
628
|
+
rejectedFiles: i = [],
|
|
629
629
|
handleRemoveValidFile: y,
|
|
630
630
|
handleRemoveRejectedFile: b,
|
|
631
631
|
handleSubmit: N,
|
|
@@ -635,7 +635,7 @@ const Ur = {
|
|
|
635
635
|
title: m = "Upload Files",
|
|
636
636
|
subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
|
-
const $ =
|
|
638
|
+
const $ = c.length > 0 || i.length > 0;
|
|
639
639
|
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
|
|
640
640
|
me,
|
|
641
641
|
{
|
|
@@ -671,7 +671,7 @@ const Ur = {
|
|
|
671
671
|
ke,
|
|
672
672
|
{
|
|
673
673
|
className: "dialog-panel",
|
|
674
|
-
onClick: (
|
|
674
|
+
onClick: (O) => O.stopPropagation(),
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ e("input", { ...o() }),
|
|
677
677
|
/* @__PURE__ */ l("form", { onSubmit: N, className: "form-wrapper", children: [
|
|
@@ -714,7 +714,7 @@ const Ur = {
|
|
|
714
714
|
$ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
|
|
715
715
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
716
716
|
/* @__PURE__ */ l("ul", { className: "file-list", children: [
|
|
717
|
-
|
|
717
|
+
c.map((O, R) => /* @__PURE__ */ l(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item",
|
|
@@ -723,28 +723,28 @@ const Ur = {
|
|
|
723
723
|
/* @__PURE__ */ e(
|
|
724
724
|
sa,
|
|
725
725
|
{
|
|
726
|
-
extension:
|
|
726
|
+
extension: O.name.split(".").pop()
|
|
727
727
|
}
|
|
728
728
|
),
|
|
729
729
|
/* @__PURE__ */ l("div", { children: [
|
|
730
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
731
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: la(
|
|
730
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: O.name }),
|
|
731
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: la(O.size) })
|
|
732
732
|
] })
|
|
733
733
|
] }),
|
|
734
734
|
/* @__PURE__ */ e(
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
737
|
type: "button",
|
|
738
|
-
onClick: () => y(
|
|
738
|
+
onClick: () => y(R),
|
|
739
739
|
className: "remove-file-button",
|
|
740
740
|
children: /* @__PURE__ */ e(Pe, { size: 16 })
|
|
741
741
|
}
|
|
742
742
|
)
|
|
743
743
|
]
|
|
744
744
|
},
|
|
745
|
-
`${
|
|
745
|
+
`${O.name}-${R}`
|
|
746
746
|
)),
|
|
747
|
-
|
|
747
|
+
i.map(({ file: O, message: R }, S) => /* @__PURE__ */ l(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -753,13 +753,13 @@ const Ur = {
|
|
|
753
753
|
/* @__PURE__ */ e(
|
|
754
754
|
sa,
|
|
755
755
|
{
|
|
756
|
-
extension:
|
|
756
|
+
extension: O.name.split(".").pop()
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
/* @__PURE__ */ l("div", { children: [
|
|
760
|
-
/* @__PURE__ */ e("p", { className: "file-item-name", children:
|
|
761
|
-
/* @__PURE__ */ e("p", { className: "file-item-size", children: la(
|
|
762
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
760
|
+
/* @__PURE__ */ e("p", { className: "file-item-name", children: O.name }),
|
|
761
|
+
/* @__PURE__ */ e("p", { className: "file-item-size", children: la(O.size) }),
|
|
762
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: R })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
765
765
|
/* @__PURE__ */ e(
|
|
@@ -773,7 +773,7 @@ const Ur = {
|
|
|
773
773
|
)
|
|
774
774
|
]
|
|
775
775
|
},
|
|
776
|
-
`${
|
|
776
|
+
`${O.name}-${S}`
|
|
777
777
|
))
|
|
778
778
|
] })
|
|
779
779
|
] })
|
|
@@ -794,7 +794,7 @@ const Ur = {
|
|
|
794
794
|
type: "submit",
|
|
795
795
|
label: a ? "Uploading..." : "Upload Files",
|
|
796
796
|
loader: a,
|
|
797
|
-
disabled:
|
|
797
|
+
disabled: c.length === 0 || a
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
800
|
] })
|
|
@@ -814,10 +814,10 @@ const Ur = {
|
|
|
814
814
|
resetFilters: o,
|
|
815
815
|
filterConfig: n = [],
|
|
816
816
|
initialFormikValues: u,
|
|
817
|
-
fetchCreatedOrUpdatedByUsers:
|
|
817
|
+
fetchCreatedOrUpdatedByUsers: c = async () => []
|
|
818
818
|
// Mockable fetcher
|
|
819
819
|
}) => {
|
|
820
|
-
const [
|
|
820
|
+
const [i, y] = L({
|
|
821
821
|
createdBy: [],
|
|
822
822
|
updatedBy: []
|
|
823
823
|
}), [b, N] = L({
|
|
@@ -827,53 +827,53 @@ const Ur = {
|
|
|
827
827
|
initialValues: JSON.parse(JSON.stringify(u)),
|
|
828
828
|
// Deep copy
|
|
829
829
|
onSubmit: (S) => {
|
|
830
|
-
const
|
|
831
|
-
Object.keys(S).forEach((
|
|
832
|
-
|
|
833
|
-
operator: S[
|
|
834
|
-
values: Array.isArray(S[
|
|
835
|
-
range: S[
|
|
830
|
+
const B = {};
|
|
831
|
+
Object.keys(S).forEach((P) => {
|
|
832
|
+
B[P] = {
|
|
833
|
+
operator: S[P].operator || "in",
|
|
834
|
+
values: Array.isArray(S[P].values) ? S[P].values : [],
|
|
835
|
+
range: S[P].range || null
|
|
836
836
|
};
|
|
837
|
-
}), console.log("[storybook filter] Applied Filters:",
|
|
838
|
-
filters:
|
|
837
|
+
}), console.log("[storybook filter] Applied Filters:", B), typeof s == "function" && s({
|
|
838
|
+
filters: B,
|
|
839
839
|
activeCount: m
|
|
840
840
|
}), r();
|
|
841
841
|
},
|
|
842
842
|
enableReinitialize: !0
|
|
843
|
-
}), w = ne(() => n.reduce((S,
|
|
844
|
-
const
|
|
845
|
-
let
|
|
846
|
-
if (
|
|
847
|
-
switch (
|
|
843
|
+
}), w = ne(() => n.reduce((S, B) => {
|
|
844
|
+
const P = B.key, E = a.values[P];
|
|
845
|
+
let V = !1;
|
|
846
|
+
if (E)
|
|
847
|
+
switch (B.type) {
|
|
848
848
|
case "multiselect":
|
|
849
849
|
case "multiselect-users":
|
|
850
|
-
|
|
850
|
+
V = Array.isArray(E.values) && E.values.length > 0;
|
|
851
851
|
break;
|
|
852
852
|
case "date":
|
|
853
|
-
(
|
|
853
|
+
(E.range && E.range !== "" || Array.isArray(E.values) && E.values.length > 0) && (V = !0);
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
|
-
return S[
|
|
857
|
-
}, {}), [n, a.values]), m = Object.values(w).filter(Boolean).length, g = async (S,
|
|
856
|
+
return S[P] = V, S;
|
|
857
|
+
}, {}), [n, a.values]), m = Object.values(w).filter(Boolean).length, g = async (S, B) => {
|
|
858
858
|
try {
|
|
859
|
-
N((
|
|
860
|
-
const
|
|
861
|
-
y((
|
|
862
|
-
} catch (
|
|
863
|
-
console.error(`Error fetching ${S} users:`,
|
|
859
|
+
N((E) => ({ ...E, [S]: !0 }));
|
|
860
|
+
const P = await c(S, B);
|
|
861
|
+
y((E) => ({ ...E, [S]: P }));
|
|
862
|
+
} catch (P) {
|
|
863
|
+
console.error(`Error fetching ${S} users:`, P);
|
|
864
864
|
} finally {
|
|
865
|
-
N((
|
|
865
|
+
N((P) => ({ ...P, [S]: !1 }));
|
|
866
866
|
}
|
|
867
867
|
}, $ = (S) => {
|
|
868
|
-
const
|
|
869
|
-
n[S].type === "multiselect-users" &&
|
|
870
|
-
},
|
|
868
|
+
const B = n[S].key, P = n[S].url;
|
|
869
|
+
n[S].type === "multiselect-users" && i[B].length === 0 && !b[B] && g(B, P);
|
|
870
|
+
}, O = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
|
-
},
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
875
|
-
const
|
|
876
|
-
switch (
|
|
872
|
+
}, R = (S) => {
|
|
873
|
+
const B = n.find((V) => V.key === S);
|
|
874
|
+
if (!B) return null;
|
|
875
|
+
const P = a.values[S] || u[S], E = Array.isArray(P.values) ? P.values : [];
|
|
876
|
+
switch (B.type) {
|
|
877
877
|
case "multiselect":
|
|
878
878
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
879
879
|
/* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
|
|
@@ -881,10 +881,10 @@ const Ur = {
|
|
|
881
881
|
/* @__PURE__ */ e(
|
|
882
882
|
"select",
|
|
883
883
|
{
|
|
884
|
-
value:
|
|
884
|
+
value: P.operator || "in",
|
|
885
885
|
onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
|
|
886
886
|
className: "filter-select",
|
|
887
|
-
children:
|
|
887
|
+
children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
888
888
|
}
|
|
889
889
|
)
|
|
890
890
|
] }),
|
|
@@ -896,9 +896,9 @@ const Ur = {
|
|
|
896
896
|
type: "checkbox",
|
|
897
897
|
id: `select-all-${S}`,
|
|
898
898
|
className: "filter-checkbox-input",
|
|
899
|
-
checked:
|
|
899
|
+
checked: B.options.length > 0 && E.length === B.options.length,
|
|
900
900
|
onChange: (d) => {
|
|
901
|
-
const h = d.target.checked ?
|
|
901
|
+
const h = d.target.checked ? B.options.map((x) => x.value) : [];
|
|
902
902
|
a.setFieldValue(`${S}.values`, h);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
@@ -912,16 +912,16 @@ const Ur = {
|
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
] }),
|
|
915
|
-
|
|
915
|
+
B.options.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
916
916
|
/* @__PURE__ */ e(
|
|
917
917
|
"input",
|
|
918
918
|
{
|
|
919
919
|
type: "checkbox",
|
|
920
920
|
id: `${S}-${d.value}`,
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
|
-
checked:
|
|
922
|
+
checked: E.includes(d.value),
|
|
923
923
|
onChange: (h) => {
|
|
924
|
-
const x = h.target.checked ? [...
|
|
924
|
+
const x = h.target.checked ? [...E, d.value] : E.filter((F) => F !== d.value);
|
|
925
925
|
a.setFieldValue(`${S}.values`, x);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
@@ -938,21 +938,21 @@ const Ur = {
|
|
|
938
938
|
] })
|
|
939
939
|
] });
|
|
940
940
|
case "multiselect-users":
|
|
941
|
-
const
|
|
941
|
+
const V = i[S] || [], U = b[S];
|
|
942
942
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
943
943
|
/* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
|
|
944
944
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
945
945
|
/* @__PURE__ */ e(
|
|
946
946
|
"select",
|
|
947
947
|
{
|
|
948
|
-
value:
|
|
948
|
+
value: P.operator || "in",
|
|
949
949
|
onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
|
|
950
950
|
className: "filter-select",
|
|
951
|
-
children:
|
|
951
|
+
children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
] }),
|
|
955
|
-
U ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children:
|
|
955
|
+
U ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(ee, { children: [
|
|
956
956
|
/* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
957
957
|
/* @__PURE__ */ e(
|
|
958
958
|
"input",
|
|
@@ -960,9 +960,9 @@ const Ur = {
|
|
|
960
960
|
type: "checkbox",
|
|
961
961
|
id: `select-all-users-${S}`,
|
|
962
962
|
className: "filter-checkbox-input",
|
|
963
|
-
checked:
|
|
963
|
+
checked: V.length > 0 && E.length === V.length,
|
|
964
964
|
onChange: (d) => {
|
|
965
|
-
const h = d.target.checked ?
|
|
965
|
+
const h = d.target.checked ? V.map((x) => x.email) : [];
|
|
966
966
|
a.setFieldValue(
|
|
967
967
|
`${S}.values`,
|
|
968
968
|
h
|
|
@@ -979,16 +979,16 @@ const Ur = {
|
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
|
|
982
|
+
V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
983
983
|
/* @__PURE__ */ e(
|
|
984
984
|
"input",
|
|
985
985
|
{
|
|
986
986
|
type: "checkbox",
|
|
987
987
|
id: `${S}-${d.email}`,
|
|
988
988
|
className: "filter-checkbox-input",
|
|
989
|
-
checked:
|
|
989
|
+
checked: E.includes(d.email),
|
|
990
990
|
onChange: (h) => {
|
|
991
|
-
const x = h.target.checked ? [...
|
|
991
|
+
const x = h.target.checked ? [...E, d.email] : E.filter((F) => F !== d.email);
|
|
992
992
|
a.setFieldValue(
|
|
993
993
|
`${S}.values`,
|
|
994
994
|
x
|
|
@@ -1011,7 +1011,7 @@ const Ur = {
|
|
|
1011
1011
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1012
1012
|
] });
|
|
1013
1013
|
case "date":
|
|
1014
|
-
const
|
|
1014
|
+
const j = P.values || [], [v, p] = j, f = v && p, k = {
|
|
1015
1015
|
startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
|
|
1016
1016
|
// Fallback to today
|
|
1017
1017
|
endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
|
|
@@ -1024,10 +1024,10 @@ const Ur = {
|
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
"select",
|
|
1026
1026
|
{
|
|
1027
|
-
value:
|
|
1027
|
+
value: P.operator,
|
|
1028
1028
|
onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
|
|
1029
1029
|
className: "filter-select",
|
|
1030
|
-
children:
|
|
1030
|
+
children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
1033
|
f && /* @__PURE__ */ e(
|
|
@@ -1099,7 +1099,7 @@ const Ur = {
|
|
|
1099
1099
|
"button",
|
|
1100
1100
|
{
|
|
1101
1101
|
type: "button",
|
|
1102
|
-
onClick:
|
|
1102
|
+
onClick: O,
|
|
1103
1103
|
className: "filter-clear-button",
|
|
1104
1104
|
children: "Clear All Filters"
|
|
1105
1105
|
}
|
|
@@ -1137,7 +1137,7 @@ const Ur = {
|
|
|
1137
1137
|
animate: { opacity: 1, x: 0 },
|
|
1138
1138
|
transition: { duration: 0.3 },
|
|
1139
1139
|
className: "h-full",
|
|
1140
|
-
children:
|
|
1140
|
+
children: R(S.key)
|
|
1141
1141
|
},
|
|
1142
1142
|
S.key
|
|
1143
1143
|
)
|
|
@@ -1183,11 +1183,11 @@ const Ur = {
|
|
|
1183
1183
|
icon: o,
|
|
1184
1184
|
error: n,
|
|
1185
1185
|
className: u,
|
|
1186
|
-
ref:
|
|
1186
|
+
ref: c,
|
|
1187
1187
|
// ✅ 'ref' is now received directly as a prop
|
|
1188
|
-
...
|
|
1188
|
+
...i
|
|
1189
1189
|
}) => {
|
|
1190
|
-
const y = r ||
|
|
1190
|
+
const y = r || i.name;
|
|
1191
1191
|
return /* @__PURE__ */ l("div", { className: `input-wrapper ${u || ""}`, children: [
|
|
1192
1192
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "input-label", children: t }),
|
|
1193
1193
|
/* @__PURE__ */ l("div", { className: "input-field-container", children: [
|
|
@@ -1197,12 +1197,12 @@ const Ur = {
|
|
|
1197
1197
|
{
|
|
1198
1198
|
id: y,
|
|
1199
1199
|
type: s,
|
|
1200
|
-
ref:
|
|
1200
|
+
ref: c,
|
|
1201
1201
|
className: W("input-field", {
|
|
1202
1202
|
"input-field--error": !!n,
|
|
1203
1203
|
"input-field--with-icon": !!o
|
|
1204
1204
|
}),
|
|
1205
|
-
...
|
|
1205
|
+
...i
|
|
1206
1206
|
}
|
|
1207
1207
|
)
|
|
1208
1208
|
] }),
|
|
@@ -1234,12 +1234,12 @@ const Ur = {
|
|
|
1234
1234
|
// For the description/body content
|
|
1235
1235
|
primaryButtonText: n = "Confirm",
|
|
1236
1236
|
secondaryButtonText: u = "Cancel",
|
|
1237
|
-
variant:
|
|
1237
|
+
variant: c = "info",
|
|
1238
1238
|
// 'info', 'warning', 'delete'
|
|
1239
|
-
loading:
|
|
1239
|
+
loading: i = !1,
|
|
1240
1240
|
buttonProps: y = {}
|
|
1241
1241
|
}) => {
|
|
1242
|
-
const b = oa[
|
|
1242
|
+
const b = oa[c] || oa.info, N = b.icon, a = () => {
|
|
1243
1243
|
r({ primary: !0, secondary: !1 });
|
|
1244
1244
|
}, w = () => {
|
|
1245
1245
|
r({ primary: !1, secondary: !0 });
|
|
@@ -1306,14 +1306,14 @@ const Ur = {
|
|
|
1306
1306
|
onItemsPerPageChange: n,
|
|
1307
1307
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1308
1308
|
}) => {
|
|
1309
|
-
const
|
|
1309
|
+
const c = Math.ceil(r / s), [i, y] = L(t);
|
|
1310
1310
|
Q(() => {
|
|
1311
1311
|
y(t);
|
|
1312
1312
|
}, [t]);
|
|
1313
1313
|
const b = Math.min((t - 1) * s + 1, r), N = Math.min(t * s, r), a = (w) => {
|
|
1314
1314
|
w.preventDefault();
|
|
1315
|
-
let m = parseInt(
|
|
1316
|
-
isNaN(m) || m < 1 ? m = 1 : m >
|
|
1315
|
+
let m = parseInt(i, 10);
|
|
1316
|
+
isNaN(m) || m < 1 ? m = 1 : m > c && (m = c), y(m), m !== t && o(m);
|
|
1317
1317
|
};
|
|
1318
1318
|
return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
|
|
1319
1319
|
/* @__PURE__ */ l("div", { className: "pagination-left", children: [
|
|
@@ -1363,7 +1363,7 @@ const Ur = {
|
|
|
1363
1363
|
{
|
|
1364
1364
|
type: "number",
|
|
1365
1365
|
className: "page-input",
|
|
1366
|
-
value:
|
|
1366
|
+
value: i,
|
|
1367
1367
|
onChange: (w) => y(w.target.value),
|
|
1368
1368
|
onBlur: a,
|
|
1369
1369
|
"aria-label": `Current page, Page ${t}`
|
|
@@ -1371,7 +1371,7 @@ const Ur = {
|
|
|
1371
1371
|
),
|
|
1372
1372
|
/* @__PURE__ */ l("span", { className: "page-input-total", children: [
|
|
1373
1373
|
"of ",
|
|
1374
|
-
|
|
1374
|
+
c
|
|
1375
1375
|
] })
|
|
1376
1376
|
] }),
|
|
1377
1377
|
/* @__PURE__ */ e(
|
|
@@ -1379,7 +1379,7 @@ const Ur = {
|
|
|
1379
1379
|
{
|
|
1380
1380
|
className: "pagination-button",
|
|
1381
1381
|
onClick: () => o(t + 1),
|
|
1382
|
-
disabled: t ===
|
|
1382
|
+
disabled: t === c,
|
|
1383
1383
|
children: /* @__PURE__ */ e(Le, { size: 16 })
|
|
1384
1384
|
}
|
|
1385
1385
|
),
|
|
@@ -1387,8 +1387,8 @@ const Ur = {
|
|
|
1387
1387
|
"button",
|
|
1388
1388
|
{
|
|
1389
1389
|
className: "pagination-button",
|
|
1390
|
-
onClick: () => o(
|
|
1391
|
-
disabled: t ===
|
|
1390
|
+
onClick: () => o(c),
|
|
1391
|
+
disabled: t === c,
|
|
1392
1392
|
children: /* @__PURE__ */ e(ft, { size: 16 })
|
|
1393
1393
|
}
|
|
1394
1394
|
)
|
|
@@ -1411,31 +1411,31 @@ const Ur = {
|
|
|
1411
1411
|
onChange: s,
|
|
1412
1412
|
className: "radiogroup-container",
|
|
1413
1413
|
...u,
|
|
1414
|
-
children: o.map((
|
|
1414
|
+
children: o.map((c) => /* @__PURE__ */ e(
|
|
1415
1415
|
Te.Option,
|
|
1416
1416
|
{
|
|
1417
|
-
value:
|
|
1418
|
-
className: ({ active:
|
|
1419
|
-
"radiogroup-option--active":
|
|
1417
|
+
value: c.value,
|
|
1418
|
+
className: ({ active: i, checked: y }) => W("radiogroup-option", {
|
|
1419
|
+
"radiogroup-option--active": i,
|
|
1420
1420
|
"radiogroup-option--checked": y,
|
|
1421
1421
|
"radiogroup-option--error": !!n
|
|
1422
1422
|
}),
|
|
1423
|
-
children: ({ checked:
|
|
1423
|
+
children: ({ checked: i }) => /* @__PURE__ */ l(ee, { children: [
|
|
1424
1424
|
/* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
|
|
1425
|
-
/* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children:
|
|
1426
|
-
|
|
1425
|
+
/* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children: c.label }),
|
|
1426
|
+
c.description && /* @__PURE__ */ e(
|
|
1427
1427
|
Te.Description,
|
|
1428
1428
|
{
|
|
1429
1429
|
as: "span",
|
|
1430
1430
|
className: "option-description",
|
|
1431
|
-
children:
|
|
1431
|
+
children: c.description
|
|
1432
1432
|
}
|
|
1433
1433
|
)
|
|
1434
1434
|
] }),
|
|
1435
|
-
|
|
1435
|
+
i && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(bt, { size: 20 }) })
|
|
1436
1436
|
] })
|
|
1437
1437
|
},
|
|
1438
|
-
|
|
1438
|
+
c.value
|
|
1439
1439
|
))
|
|
1440
1440
|
}
|
|
1441
1441
|
),
|
|
@@ -1448,9 +1448,9 @@ const Ur = {
|
|
|
1448
1448
|
label: n = "Search",
|
|
1449
1449
|
// Added a default label for accessibility
|
|
1450
1450
|
customClass: u = "",
|
|
1451
|
-
...
|
|
1451
|
+
...c
|
|
1452
1452
|
}) => {
|
|
1453
|
-
const [
|
|
1453
|
+
const [i, y] = L(t);
|
|
1454
1454
|
Q(() => {
|
|
1455
1455
|
y(t);
|
|
1456
1456
|
}, [t]);
|
|
@@ -1460,9 +1460,9 @@ const Ur = {
|
|
|
1460
1460
|
}, s),
|
|
1461
1461
|
[s, r]
|
|
1462
1462
|
);
|
|
1463
|
-
Q(() => (
|
|
1463
|
+
Q(() => (i !== t && b(i), () => {
|
|
1464
1464
|
b.cancel();
|
|
1465
|
-
}), [
|
|
1465
|
+
}), [i, b, t]);
|
|
1466
1466
|
const N = (a) => {
|
|
1467
1467
|
y(a.target.value);
|
|
1468
1468
|
};
|
|
@@ -1477,9 +1477,9 @@ const Ur = {
|
|
|
1477
1477
|
placeholder: o,
|
|
1478
1478
|
type: "search",
|
|
1479
1479
|
name: "search",
|
|
1480
|
-
value:
|
|
1480
|
+
value: i,
|
|
1481
1481
|
onChange: N,
|
|
1482
|
-
...
|
|
1482
|
+
...c
|
|
1483
1483
|
}
|
|
1484
1484
|
)
|
|
1485
1485
|
] });
|
|
@@ -1492,22 +1492,22 @@ const Ur = {
|
|
|
1492
1492
|
options: o = [],
|
|
1493
1493
|
placeholder: n = "Select an option...",
|
|
1494
1494
|
disabled: u = !1,
|
|
1495
|
-
error:
|
|
1496
|
-
ref:
|
|
1495
|
+
error: c,
|
|
1496
|
+
ref: i,
|
|
1497
1497
|
// From RHF's <Controller>
|
|
1498
1498
|
showSearch: y = !0
|
|
1499
1499
|
}) => {
|
|
1500
1500
|
const [b, N] = L(""), a = b === "" ? o : o.filter(
|
|
1501
1501
|
(m) => m.label.toLowerCase().includes(b.toLowerCase())
|
|
1502
1502
|
), w = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
|
|
1503
|
-
return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref:
|
|
1503
|
+
return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: i, children: [
|
|
1504
1504
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1505
1505
|
/* @__PURE__ */ l("div", { className: "select-button-container", children: [
|
|
1506
1506
|
/* @__PURE__ */ l(
|
|
1507
1507
|
sr,
|
|
1508
1508
|
{
|
|
1509
1509
|
className: W("select-button", {
|
|
1510
|
-
"select-button--error": !!
|
|
1510
|
+
"select-button--error": !!c
|
|
1511
1511
|
}),
|
|
1512
1512
|
children: [
|
|
1513
1513
|
/* @__PURE__ */ e("span", { className: "select-value-display", children: w ? w.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
|
|
@@ -1561,7 +1561,7 @@ const Ur = {
|
|
|
1561
1561
|
}
|
|
1562
1562
|
)
|
|
1563
1563
|
] }),
|
|
1564
|
-
|
|
1564
|
+
c && /* @__PURE__ */ e("p", { className: "select-error-message", children: c })
|
|
1565
1565
|
] }) });
|
|
1566
1566
|
}, Wr = () => {
|
|
1567
1567
|
const [t, r] = L(window.location.pathname);
|
|
@@ -1579,12 +1579,12 @@ const Ur = {
|
|
|
1579
1579
|
return s;
|
|
1580
1580
|
return null;
|
|
1581
1581
|
}, Pa = ({ item: t, isCollapsed: r, level: s = 0 }) => {
|
|
1582
|
-
const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u,
|
|
1582
|
+
const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u, c] = L(!1), i = t.icon;
|
|
1583
1583
|
Q(() => {
|
|
1584
|
-
Ke([t], o) &&
|
|
1584
|
+
Ke([t], o) && c(!0);
|
|
1585
1585
|
}, [t, o]);
|
|
1586
1586
|
const y = o === n, b = !y && !!Ke([t], o), N = (a) => {
|
|
1587
|
-
a.preventDefault(),
|
|
1587
|
+
a.preventDefault(), c(!u);
|
|
1588
1588
|
};
|
|
1589
1589
|
return /* @__PURE__ */ l(
|
|
1590
1590
|
"div",
|
|
@@ -1606,7 +1606,7 @@ const Ur = {
|
|
|
1606
1606
|
}),
|
|
1607
1607
|
"aria-current": y ? "page" : void 0,
|
|
1608
1608
|
children: [
|
|
1609
|
-
|
|
1609
|
+
i && /* @__PURE__ */ e(i, { className: "nav-icon", "aria-hidden": "true" }),
|
|
1610
1610
|
/* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
|
|
1611
1611
|
t.children && /* @__PURE__ */ e(
|
|
1612
1612
|
"button",
|
|
@@ -1657,8 +1657,8 @@ const Ur = {
|
|
|
1657
1657
|
isMobileOpen: o = !1,
|
|
1658
1658
|
onToggleMobile: n,
|
|
1659
1659
|
logoSmall: u,
|
|
1660
|
-
logoLarge:
|
|
1661
|
-
user:
|
|
1660
|
+
logoLarge: c,
|
|
1661
|
+
user: i = { name: "", email: "" }
|
|
1662
1662
|
}) => /* @__PURE__ */ l(ee, { children: [
|
|
1663
1663
|
o && /* @__PURE__ */ e(
|
|
1664
1664
|
"div",
|
|
@@ -1678,7 +1678,7 @@ const Ur = {
|
|
|
1678
1678
|
"aria-label": "Main navigation",
|
|
1679
1679
|
children: [
|
|
1680
1680
|
/* @__PURE__ */ l("div", { className: "sidebar-header", children: [
|
|
1681
|
-
/* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u :
|
|
1681
|
+
/* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u : c }),
|
|
1682
1682
|
!r && /* @__PURE__ */ l("div", { className: "sidebar-search-container", children: [
|
|
1683
1683
|
/* @__PURE__ */ e(ya, { className: "sidebar-search-icon" }),
|
|
1684
1684
|
/* @__PURE__ */ e(
|
|
@@ -1703,10 +1703,10 @@ const Ur = {
|
|
|
1703
1703
|
] }),
|
|
1704
1704
|
/* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Pa, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
|
|
1705
1705
|
/* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
|
|
1706
|
-
/* @__PURE__ */ e(Ta, { src:
|
|
1706
|
+
/* @__PURE__ */ e(Ta, { src: i.avatar, name: i.name, size: "medium" }),
|
|
1707
1707
|
/* @__PURE__ */ l("div", { className: "user-info", children: [
|
|
1708
|
-
/* @__PURE__ */ e("span", { className: "user-name", children:
|
|
1709
|
-
/* @__PURE__ */ e("span", { className: "user-email", children:
|
|
1708
|
+
/* @__PURE__ */ e("span", { className: "user-name", children: i.name }),
|
|
1709
|
+
/* @__PURE__ */ e("span", { className: "user-email", children: i.email })
|
|
1710
1710
|
] }),
|
|
1711
1711
|
/* @__PURE__ */ e(
|
|
1712
1712
|
"button",
|
|
@@ -1765,19 +1765,19 @@ const Ur = {
|
|
|
1765
1765
|
ref: n,
|
|
1766
1766
|
maxLength: u,
|
|
1767
1767
|
// ✅ New prop for max length
|
|
1768
|
-
showCharCount:
|
|
1768
|
+
showCharCount: c = !1,
|
|
1769
1769
|
// ✅ New prop to control visibility
|
|
1770
|
-
...
|
|
1770
|
+
...i
|
|
1771
1771
|
}) => {
|
|
1772
|
-
const y = r ||
|
|
1773
|
-
|
|
1772
|
+
const y = r || i.name, [b, N] = L(
|
|
1773
|
+
i.value?.length || i.defaultValue?.length || 0
|
|
1774
1774
|
), a = (m) => {
|
|
1775
|
-
N(m.target.value.length),
|
|
1775
|
+
N(m.target.value.length), i.onChange && i.onChange(m);
|
|
1776
1776
|
}, w = u - b;
|
|
1777
1777
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1778
1778
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
1779
1779
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
|
|
1780
|
-
|
|
1780
|
+
c && u && /* @__PURE__ */ l("span", { className: "char-counter", children: [
|
|
1781
1781
|
w,
|
|
1782
1782
|
" characters remaining"
|
|
1783
1783
|
] })
|
|
@@ -1792,7 +1792,7 @@ const Ur = {
|
|
|
1792
1792
|
}),
|
|
1793
1793
|
maxLength: u,
|
|
1794
1794
|
onChange: a,
|
|
1795
|
-
...
|
|
1795
|
+
...i
|
|
1796
1796
|
}
|
|
1797
1797
|
),
|
|
1798
1798
|
s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
|
|
@@ -1805,7 +1805,7 @@ const Ur = {
|
|
|
1805
1805
|
error: n,
|
|
1806
1806
|
...u
|
|
1807
1807
|
}) => /* @__PURE__ */ l("div", { className: "switch-container", children: [
|
|
1808
|
-
/* @__PURE__ */ l(
|
|
1808
|
+
/* @__PURE__ */ l(cr, { as: "div", className: "switch-group", children: [
|
|
1809
1809
|
t && o === "left" && /* @__PURE__ */ e(Ye.Label, { className: "switch-label", passive: !0, children: t }),
|
|
1810
1810
|
/* @__PURE__ */ e(
|
|
1811
1811
|
Ye,
|
|
@@ -1834,20 +1834,20 @@ const Ur = {
|
|
|
1834
1834
|
// 'top', 'bottom', 'left', 'right'
|
|
1835
1835
|
className: u,
|
|
1836
1836
|
// For external styling of the tooltip itself
|
|
1837
|
-
...
|
|
1837
|
+
...c
|
|
1838
1838
|
}) => {
|
|
1839
|
-
const
|
|
1839
|
+
const i = re.useId();
|
|
1840
1840
|
return /* @__PURE__ */ l(ee, { children: [
|
|
1841
|
-
re.cloneElement(t, { "data-tooltip-id":
|
|
1841
|
+
re.cloneElement(t, { "data-tooltip-id": i }),
|
|
1842
1842
|
/* @__PURE__ */ e(
|
|
1843
1843
|
xt,
|
|
1844
1844
|
{
|
|
1845
|
-
id:
|
|
1845
|
+
id: i,
|
|
1846
1846
|
content: r,
|
|
1847
1847
|
place: n,
|
|
1848
1848
|
variant: s,
|
|
1849
1849
|
className: `custom-tooltip custom-tooltip--size-${o} ${u || ""}`,
|
|
1850
|
-
...
|
|
1850
|
+
...c
|
|
1851
1851
|
}
|
|
1852
1852
|
)
|
|
1853
1853
|
] });
|
|
@@ -1871,8 +1871,8 @@ const Ur = {
|
|
|
1871
1871
|
currentStep: o,
|
|
1872
1872
|
direction: n = 1,
|
|
1873
1873
|
stepProps: u = {},
|
|
1874
|
-
title:
|
|
1875
|
-
description:
|
|
1874
|
+
title: c,
|
|
1875
|
+
description: i,
|
|
1876
1876
|
showProgress: y = !0,
|
|
1877
1877
|
closeOnOverlayClick: b = !0
|
|
1878
1878
|
}) => {
|
|
@@ -1921,8 +1921,8 @@ const Ur = {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
),
|
|
1923
1923
|
/* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
|
|
1924
|
-
/* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children:
|
|
1925
|
-
|
|
1924
|
+
/* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: c }),
|
|
1925
|
+
i && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: i })
|
|
1926
1926
|
] })
|
|
1927
1927
|
] }),
|
|
1928
1928
|
/* @__PURE__ */ e(
|
|
@@ -1982,19 +1982,19 @@ const Ur = {
|
|
|
1982
1982
|
save: o,
|
|
1983
1983
|
cancel: n,
|
|
1984
1984
|
tertiary: u,
|
|
1985
|
-
fullHeight:
|
|
1985
|
+
fullHeight: c = !1,
|
|
1986
1986
|
// A clearer prop name
|
|
1987
|
-
...
|
|
1987
|
+
...i
|
|
1988
1988
|
}) => {
|
|
1989
1989
|
const y = W(
|
|
1990
1990
|
"page-layout",
|
|
1991
1991
|
{
|
|
1992
1992
|
"page-layout--with-footer": r,
|
|
1993
|
-
"page-layout--full-height":
|
|
1993
|
+
"page-layout--full-height": c
|
|
1994
1994
|
},
|
|
1995
|
-
|
|
1995
|
+
i.className
|
|
1996
1996
|
);
|
|
1997
|
-
return /* @__PURE__ */ l("div", { className: y, ...
|
|
1997
|
+
return /* @__PURE__ */ l("div", { className: y, ...i, children: [
|
|
1998
1998
|
/* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
|
|
1999
1999
|
r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
|
|
2000
2000
|
u?.show && /* @__PURE__ */ e(
|
|
@@ -2052,10 +2052,10 @@ const Ur = {
|
|
|
2052
2052
|
triggerIcon: s = Ct
|
|
2053
2053
|
}) => {
|
|
2054
2054
|
const { refs: o, floatingStyles: n } = Ca({
|
|
2055
|
-
whileElementsMounted:
|
|
2056
|
-
middleware: [Sa(5), Da(),
|
|
2055
|
+
whileElementsMounted: Fa,
|
|
2056
|
+
middleware: [Sa(5), Da(), $a({ padding: 5 })]
|
|
2057
2057
|
});
|
|
2058
|
-
return /* @__PURE__ */ l(
|
|
2058
|
+
return /* @__PURE__ */ l(ir, { as: "div", className: "options-menu-wrapper", children: [
|
|
2059
2059
|
/* @__PURE__ */ e(dr, { ref: o.setReference, className: "options-menu-trigger", children: /* @__PURE__ */ e(s, { size: 20 }) }),
|
|
2060
2060
|
/* @__PURE__ */ e(ur, { children: /* @__PURE__ */ e(
|
|
2061
2061
|
oe,
|
|
@@ -2075,11 +2075,11 @@ const Ur = {
|
|
|
2075
2075
|
className: "options-menu-panel",
|
|
2076
2076
|
children: t.map((u) => /* @__PURE__ */ l("div", { className: "options-menu-item-wrapper", children: [
|
|
2077
2077
|
u.dividerBefore && /* @__PURE__ */ e("div", { className: "menu-divider" }),
|
|
2078
|
-
/* @__PURE__ */ e(hr, { children: ({ active:
|
|
2078
|
+
/* @__PURE__ */ e(hr, { children: ({ active: c }) => /* @__PURE__ */ l(
|
|
2079
2079
|
"button",
|
|
2080
2080
|
{
|
|
2081
2081
|
onClick: () => r(u),
|
|
2082
|
-
className: `options-menu-item ${
|
|
2082
|
+
className: `options-menu-item ${c ? "active bg-gray-200 text-gray-900" : ""}`,
|
|
2083
2083
|
disabled: u.disabled,
|
|
2084
2084
|
children: [
|
|
2085
2085
|
u.icon && /* @__PURE__ */ e("span", { className: "item-icon", children: u.icon }),
|
|
@@ -2235,8 +2235,8 @@ function tn(t) {
|
|
|
2235
2235
|
return console.log("Error reading JSON from localStorage"), null;
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2239
|
-
const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "",
|
|
2238
|
+
function ca() {
|
|
2239
|
+
const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "", c = t.email || "";
|
|
2240
2240
|
return {
|
|
2241
2241
|
Authorization: r ? `Bearer ${r}` : void 0,
|
|
2242
2242
|
"x-tenant-id": o || void 0,
|
|
@@ -2244,19 +2244,19 @@ function ia() {
|
|
|
2244
2244
|
"site-id": s || void 0,
|
|
2245
2245
|
"Content-Type": "application/json",
|
|
2246
2246
|
"principal-user": u || void 0,
|
|
2247
|
-
"x-user-email":
|
|
2247
|
+
"x-user-email": c || void 0
|
|
2248
2248
|
};
|
|
2249
2249
|
}
|
|
2250
2250
|
function rn(t) {
|
|
2251
2251
|
if (t && t.isAxiosError) {
|
|
2252
|
-
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null,
|
|
2252
|
+
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, c = r?.data ?? null, i = typeof c == "string" && c || c?.message || c?.msg || c?.error || c?.errors?.[0]?.message || null;
|
|
2253
2253
|
return {
|
|
2254
2254
|
ok: !1,
|
|
2255
2255
|
status: n,
|
|
2256
2256
|
statusText: u,
|
|
2257
|
-
code:
|
|
2258
|
-
message:
|
|
2259
|
-
details:
|
|
2257
|
+
code: c?.code || null,
|
|
2258
|
+
message: i || o || "Request failed",
|
|
2259
|
+
details: c || null,
|
|
2260
2260
|
request: {
|
|
2261
2261
|
url: s?.url || null,
|
|
2262
2262
|
method: s?.method || null,
|
|
@@ -2296,12 +2296,12 @@ function nn({
|
|
|
2296
2296
|
);
|
|
2297
2297
|
function o({ open: b = !1, customHeader: N = {} } = {}) {
|
|
2298
2298
|
if (b) {
|
|
2299
|
-
const { Authorization: a, ...w } =
|
|
2299
|
+
const { Authorization: a, ...w } = ca();
|
|
2300
2300
|
return {
|
|
2301
2301
|
headers: { ...w, ...r, ...N }
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
|
-
return { headers: { ...
|
|
2304
|
+
return { headers: { ...ca(), ...N } };
|
|
2305
2305
|
}
|
|
2306
2306
|
async function n(b, N, a = !1, w = {}) {
|
|
2307
2307
|
return s.get(b, {
|
|
@@ -2313,10 +2313,10 @@ function nn({
|
|
|
2313
2313
|
const m = { ...o({ open: a, customHeader: w }) };
|
|
2314
2314
|
return N !== void 0 && (m.data = N), s.delete(b, m);
|
|
2315
2315
|
}
|
|
2316
|
-
async function
|
|
2316
|
+
async function c(b, N = {}, a = !1, w = {}) {
|
|
2317
2317
|
return s.post(b, N, o({ open: a, customHeader: w }));
|
|
2318
2318
|
}
|
|
2319
|
-
async function
|
|
2319
|
+
async function i(b, N = {}, a = !1, w = {}) {
|
|
2320
2320
|
return s.put(b, N, o({ open: a, customHeader: w }));
|
|
2321
2321
|
}
|
|
2322
2322
|
async function y(b, N = {}, a = !1, w = {}) {
|
|
@@ -2327,12 +2327,12 @@ function nn({
|
|
|
2327
2327
|
// exported in case you want advanced usage
|
|
2328
2328
|
axiosGet: n,
|
|
2329
2329
|
axiosDelete: u,
|
|
2330
|
-
axiosPost:
|
|
2331
|
-
axiosPut:
|
|
2330
|
+
axiosPost: c,
|
|
2331
|
+
axiosPut: i,
|
|
2332
2332
|
axiosPatch: y
|
|
2333
2333
|
};
|
|
2334
2334
|
}
|
|
2335
|
-
const we = nn(),
|
|
2335
|
+
const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln = we.axiosPut, ls = we.axiosPatch, os = we.instance, on = async (t, r) => {
|
|
2336
2336
|
try {
|
|
2337
2337
|
switch (t) {
|
|
2338
2338
|
case Ne.USER: {
|
|
@@ -2359,7 +2359,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2359
2359
|
type: "User",
|
|
2360
2360
|
avatarUrl: r?.profileImage || Re(n)
|
|
2361
2361
|
};
|
|
2362
|
-
}),
|
|
2362
|
+
}), ia = (t) => {
|
|
2363
2363
|
try {
|
|
2364
2364
|
const r = JSON.parse(t);
|
|
2365
2365
|
return Array.isArray(r) ? r : [];
|
|
@@ -2368,7 +2368,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2368
2368
|
}
|
|
2369
2369
|
}, Ie = {
|
|
2370
2370
|
userSearch: async (t) => {
|
|
2371
|
-
const { data: r } = await
|
|
2371
|
+
const { data: r } = await $e(`${ja()}`, t);
|
|
2372
2372
|
return console.log("User search response:", r), r.length ? r.map((s) => ({
|
|
2373
2373
|
id: s.email,
|
|
2374
2374
|
name: `${s?.firstName} ${s?.lastName}`.trim(),
|
|
@@ -2377,7 +2377,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2377
2377
|
})) : [];
|
|
2378
2378
|
},
|
|
2379
2379
|
getAdGroups: async (t) => {
|
|
2380
|
-
const { data: r } = await
|
|
2380
|
+
const { data: r } = await Fe(`${Ga()}`, {
|
|
2381
2381
|
q: t
|
|
2382
2382
|
});
|
|
2383
2383
|
if (r.length)
|
|
@@ -2389,7 +2389,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2389
2389
|
}));
|
|
2390
2390
|
},
|
|
2391
2391
|
searchRoles: async (t) => {
|
|
2392
|
-
const { data: r } = await
|
|
2392
|
+
const { data: r } = await Fe(`${Wa()}`, {
|
|
2393
2393
|
page: 0,
|
|
2394
2394
|
size: 20,
|
|
2395
2395
|
q: t ?? "",
|
|
@@ -2405,15 +2405,15 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2405
2405
|
}));
|
|
2406
2406
|
},
|
|
2407
2407
|
getMembersForGroup: async (t) => {
|
|
2408
|
-
const r = `${be()}/unifydidentity/open/usersforgroup?groupName=${encodeURIComponent(t)}&isGroupWithSpecChar=true&isPaging=true&page=0&size=999&deepSearch=`, { data: s } = await
|
|
2408
|
+
const r = `${be()}/unifydidentity/open/usersforgroup?groupName=${encodeURIComponent(t)}&isGroupWithSpecChar=true&isPaging=true&page=0&size=999&deepSearch=`, { data: s } = await $e(r);
|
|
2409
2409
|
let o = [];
|
|
2410
2410
|
if (Array.isArray(s))
|
|
2411
2411
|
o = s;
|
|
2412
2412
|
else if (typeof s == "string")
|
|
2413
|
-
o =
|
|
2413
|
+
o = ia(s.trim());
|
|
2414
2414
|
else if (s && typeof s == "object") {
|
|
2415
2415
|
const n = s.data;
|
|
2416
|
-
Array.isArray(n) ? o = n : typeof n == "string" && (o =
|
|
2416
|
+
Array.isArray(n) ? o = n : typeof n == "string" && (o = ia(n.trim()));
|
|
2417
2417
|
}
|
|
2418
2418
|
return cn(o);
|
|
2419
2419
|
}
|
|
@@ -2439,9 +2439,9 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2439
2439
|
}) => {
|
|
2440
2440
|
const n = t.slice(0, 2), u = [];
|
|
2441
2441
|
t.length > 0 && u.push(t[0].name), r.length > 0 && u.push(r[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
|
|
2442
|
-
const
|
|
2442
|
+
const c = t.length + r.length + s.length, i = c - u.length;
|
|
2443
2443
|
let y = u.join(", ");
|
|
2444
|
-
return
|
|
2444
|
+
return i > 0 && (y += ` and ${i} others`), c === 0 ? /* @__PURE__ */ e(
|
|
2445
2445
|
"div",
|
|
2446
2446
|
{
|
|
2447
2447
|
className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
|
|
@@ -2471,14 +2471,14 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2471
2471
|
}
|
|
2472
2472
|
);
|
|
2473
2473
|
}, da = [
|
|
2474
|
-
{ id: 1, name: Ne.USER, icon:
|
|
2474
|
+
{ id: 1, name: Ne.USER, icon: Ft, code: "users" },
|
|
2475
2475
|
{ id: 2, name: Ne.GROUP, icon: va, code: "groups" },
|
|
2476
2476
|
{ id: 3, name: Ne.ROLE, icon: Tt, code: "roles" }
|
|
2477
2477
|
], ua = [
|
|
2478
2478
|
{ id: 1, name: na.View, icon: Na },
|
|
2479
2479
|
{ id: 2, name: na.Manage, icon: xa }
|
|
2480
2480
|
], un = Dt().shape({
|
|
2481
|
-
pendingInvites:
|
|
2481
|
+
pendingInvites: $t().min(1, "You must add at least one person to invite.")
|
|
2482
2482
|
}), mn = ({
|
|
2483
2483
|
entity: t,
|
|
2484
2484
|
onManage: r,
|
|
@@ -2486,85 +2486,85 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2486
2486
|
existingShares: o = { users: [], groups: [], roles: [] },
|
|
2487
2487
|
calledBy: n,
|
|
2488
2488
|
showExistingShares: u = !1,
|
|
2489
|
-
onFinalSubmit:
|
|
2489
|
+
onFinalSubmit: c = () => {
|
|
2490
2490
|
},
|
|
2491
|
-
isChanged:
|
|
2491
|
+
isChanged: i = !1
|
|
2492
2492
|
}) => {
|
|
2493
|
-
const [y, b] = L(da[0]), [N, a] = L(""), w = ta(N, 400), [m, g] = L([]), [$,
|
|
2494
|
-
control:
|
|
2495
|
-
handleSubmit:
|
|
2493
|
+
const [y, b] = L(da[0]), [N, a] = L(""), w = ta(N, 400), [m, g] = L([]), [$, O] = L(/* @__PURE__ */ new Set()), [R, S] = L(!1), [B, P] = L(ua[0]), {
|
|
2494
|
+
control: E,
|
|
2495
|
+
handleSubmit: V,
|
|
2496
2496
|
watch: U,
|
|
2497
|
-
formState: { errors:
|
|
2497
|
+
formState: { errors: j, isSubmitting: v }
|
|
2498
2498
|
} = At({
|
|
2499
2499
|
defaultValues: { pendingInvites: [] },
|
|
2500
2500
|
resolver: It(un)
|
|
2501
2501
|
}), { fields: p, append: f, remove: k, update: d } = Et({
|
|
2502
|
-
control:
|
|
2502
|
+
control: E,
|
|
2503
2503
|
name: "pendingInvites"
|
|
2504
2504
|
}), h = U("pendingInvites");
|
|
2505
2505
|
Q(() => {
|
|
2506
2506
|
w.length > 1 ? (S(!0), on(y.name, w).then((T) => {
|
|
2507
2507
|
g(T);
|
|
2508
|
-
}).catch((T) => console.error("Search failed:", T)).finally(() => S(!1))) : (g([]),
|
|
2508
|
+
}).catch((T) => console.error("Search failed:", T)).finally(() => S(!1))) : (g([]), O(/* @__PURE__ */ new Set()));
|
|
2509
2509
|
}, [w, y]);
|
|
2510
2510
|
const x = (T) => {
|
|
2511
|
-
|
|
2512
|
-
const
|
|
2513
|
-
return
|
|
2511
|
+
O((C) => {
|
|
2512
|
+
const I = new Set(C);
|
|
2513
|
+
return I.has(T) ? I.delete(T) : I.add(T), I;
|
|
2514
2514
|
});
|
|
2515
|
-
},
|
|
2515
|
+
}, F = () => {
|
|
2516
2516
|
m.filter((T) => $.has(T.id)).forEach((T) => {
|
|
2517
|
-
p.find((C) => C.id === T.id) || f({ ...T, permission:
|
|
2518
|
-
}),
|
|
2519
|
-
},
|
|
2520
|
-
|
|
2521
|
-
(C,
|
|
2517
|
+
p.find((C) => C.id === T.id) || f({ ...T, permission: B.name });
|
|
2518
|
+
}), O(/* @__PURE__ */ new Set()), a("");
|
|
2519
|
+
}, z = (T) => {
|
|
2520
|
+
P(T), p.forEach(
|
|
2521
|
+
(C, I) => d(I, { ...p[I], permission: T.name })
|
|
2522
2522
|
);
|
|
2523
|
-
},
|
|
2523
|
+
}, q = async (T) => {
|
|
2524
2524
|
try {
|
|
2525
2525
|
if (n === se.DRIVE) {
|
|
2526
2526
|
const C = {
|
|
2527
2527
|
entity: t,
|
|
2528
|
-
userGroupRolesObj: T.pendingInvites.map((
|
|
2529
|
-
id:
|
|
2530
|
-
permission:
|
|
2531
|
-
type:
|
|
2528
|
+
userGroupRolesObj: T.pendingInvites.map((I) => ({
|
|
2529
|
+
id: I.id,
|
|
2530
|
+
permission: I.permission,
|
|
2531
|
+
type: I.type.toLowerCase()
|
|
2532
2532
|
}))
|
|
2533
2533
|
};
|
|
2534
|
-
|
|
2534
|
+
c(C, o);
|
|
2535
2535
|
} else if (n === se.INTEREST) {
|
|
2536
|
-
const C = T.pendingInvites.map((
|
|
2537
|
-
identity:
|
|
2538
|
-
type:
|
|
2536
|
+
const C = T.pendingInvites.map((I) => ({
|
|
2537
|
+
identity: I.id,
|
|
2538
|
+
type: I.type.toLowerCase(),
|
|
2539
2539
|
opt: !0,
|
|
2540
2540
|
lock: !1,
|
|
2541
2541
|
moderator: !1,
|
|
2542
|
-
userName:
|
|
2542
|
+
userName: I.name,
|
|
2543
2543
|
interestId: t?.data?.id
|
|
2544
2544
|
}));
|
|
2545
|
-
|
|
2545
|
+
c(C, o);
|
|
2546
2546
|
} else if (n === se.ARTICLE) {
|
|
2547
2547
|
const C = {
|
|
2548
2548
|
entity: t,
|
|
2549
|
-
userGroupRolesObj: T.pendingInvites.map((
|
|
2550
|
-
id:
|
|
2551
|
-
permission:
|
|
2552
|
-
type:
|
|
2549
|
+
userGroupRolesObj: T.pendingInvites.map((I) => ({
|
|
2550
|
+
id: I.id,
|
|
2551
|
+
permission: I.permission,
|
|
2552
|
+
type: I.type.toLowerCase()
|
|
2553
2553
|
}))
|
|
2554
2554
|
};
|
|
2555
|
-
|
|
2555
|
+
c(C, o);
|
|
2556
2556
|
} else
|
|
2557
|
-
|
|
2557
|
+
c(T, o);
|
|
2558
2558
|
setTimeout(() => {
|
|
2559
2559
|
s();
|
|
2560
2560
|
}, 1e3);
|
|
2561
2561
|
} catch (C) {
|
|
2562
2562
|
throw console.error("Failed to submit invites:", C), C;
|
|
2563
2563
|
}
|
|
2564
|
-
},
|
|
2565
|
-
const C = o[y.code].find((
|
|
2564
|
+
}, D = (T) => {
|
|
2565
|
+
const C = o[y.code].find((I) => I.name === T.name) || h.find((I) => I.name === T.name);
|
|
2566
2566
|
return C ? `${C.permission}` : "";
|
|
2567
|
-
},
|
|
2567
|
+
}, A = () => {
|
|
2568
2568
|
switch (n) {
|
|
2569
2569
|
case se.DRIVE:
|
|
2570
2570
|
return "Share with others";
|
|
@@ -2575,10 +2575,10 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2575
2575
|
default:
|
|
2576
2576
|
return "Add User, Groups or Roles test";
|
|
2577
2577
|
}
|
|
2578
|
-
},
|
|
2578
|
+
}, M = ne(() => $.size === 0 && !i, [$, i]);
|
|
2579
2579
|
return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2580
2580
|
/* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2581
|
-
/* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children:
|
|
2581
|
+
/* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
|
|
2582
2582
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
2583
2583
|
n === se.DRIVE && /* @__PURE__ */ l("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
|
|
2584
2584
|
/* @__PURE__ */ e(Rt, { className: "h-5 w-5" }),
|
|
@@ -2657,7 +2657,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2657
2657
|
value: N
|
|
2658
2658
|
}
|
|
2659
2659
|
) }),
|
|
2660
|
-
/* @__PURE__ */ e(fe, { children: (m?.length > 0 ||
|
|
2660
|
+
/* @__PURE__ */ e(fe, { children: (m?.length > 0 || R) && /* @__PURE__ */ e(
|
|
2661
2661
|
te.div,
|
|
2662
2662
|
{
|
|
2663
2663
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2665,9 +2665,9 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2665
2665
|
exit: { opacity: 0, y: -10 },
|
|
2666
2666
|
transition: { duration: 0.2 },
|
|
2667
2667
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2668
|
-
children:
|
|
2668
|
+
children: R ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
|
|
2669
2669
|
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((T) => {
|
|
2670
|
-
const C =
|
|
2670
|
+
const C = D(T);
|
|
2671
2671
|
return /* @__PURE__ */ l(
|
|
2672
2672
|
"div",
|
|
2673
2673
|
{
|
|
@@ -2714,7 +2714,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2714
2714
|
/* @__PURE__ */ e(
|
|
2715
2715
|
"button",
|
|
2716
2716
|
{
|
|
2717
|
-
onClick:
|
|
2717
|
+
onClick: F,
|
|
2718
2718
|
disabled: $.size === 0,
|
|
2719
2719
|
className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
|
|
2720
2720
|
children: "Add"
|
|
@@ -2741,15 +2741,15 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2741
2741
|
n === se.DRIVE && /* @__PURE__ */ e(
|
|
2742
2742
|
X,
|
|
2743
2743
|
{
|
|
2744
|
-
value:
|
|
2745
|
-
onChange:
|
|
2744
|
+
value: B,
|
|
2745
|
+
onChange: z,
|
|
2746
2746
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2747
2747
|
/* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2748
2748
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2749
|
-
/* @__PURE__ */ e(
|
|
2749
|
+
/* @__PURE__ */ e(B.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2750
2750
|
/* @__PURE__ */ l("span", { className: "truncate", children: [
|
|
2751
2751
|
"Can ",
|
|
2752
|
-
|
|
2752
|
+
B.name
|
|
2753
2753
|
] })
|
|
2754
2754
|
] }),
|
|
2755
2755
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(Xe, { className: "h-5 w-5 text-gray-400" }) })
|
|
@@ -2766,7 +2766,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2766
2766
|
{
|
|
2767
2767
|
value: T,
|
|
2768
2768
|
className: ({ active: C }) => `${C ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2769
|
-
children: ({ selected: C, active:
|
|
2769
|
+
children: ({ selected: C, active: I }) => /* @__PURE__ */ l(ee, { children: [
|
|
2770
2770
|
/* @__PURE__ */ l(
|
|
2771
2771
|
"span",
|
|
2772
2772
|
{
|
|
@@ -2775,7 +2775,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2775
2775
|
/* @__PURE__ */ e(
|
|
2776
2776
|
T.icon,
|
|
2777
2777
|
{
|
|
2778
|
-
className: `h-5 w-5 mr-2 ${
|
|
2778
|
+
className: `h-5 w-5 mr-2 ${I ? "text-white" : "text-gray-400"}`
|
|
2779
2779
|
}
|
|
2780
2780
|
),
|
|
2781
2781
|
"Can ",
|
|
@@ -2861,8 +2861,8 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2861
2861
|
/* @__PURE__ */ e(
|
|
2862
2862
|
"button",
|
|
2863
2863
|
{
|
|
2864
|
-
onClick:
|
|
2865
|
-
disabled: v || h.length === 0 &&
|
|
2864
|
+
onClick: V(q),
|
|
2865
|
+
disabled: v || h.length === 0 && M,
|
|
2866
2866
|
className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
|
|
2867
2867
|
children: v ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
|
|
2868
2868
|
}
|
|
@@ -2875,13 +2875,13 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2875
2875
|
{ name: "Can manage", icon: xa, value: "edit" },
|
|
2876
2876
|
{ name: "Remove", icon: zt, isDestructive: !0, value: "remove" }
|
|
2877
2877
|
], hn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
|
|
2878
|
-
const [o, n] = L(!1), { refs: u, floatingStyles:
|
|
2878
|
+
const [o, n] = L(!1), { refs: u, floatingStyles: c, context: i } = Ca({
|
|
2879
2879
|
open: o,
|
|
2880
2880
|
onOpenChange: n,
|
|
2881
|
-
middleware: [Sa(8), Da(),
|
|
2882
|
-
whileElementsMounted:
|
|
2881
|
+
middleware: [Sa(8), Da(), $a({ padding: 8 })],
|
|
2882
|
+
whileElementsMounted: Fa,
|
|
2883
2883
|
placement: "bottom-end"
|
|
2884
|
-
}), y = yr(
|
|
2884
|
+
}), y = yr(i), b = fr(i), { getReferenceProps: N, getFloatingProps: a } = br([
|
|
2885
2885
|
y,
|
|
2886
2886
|
b
|
|
2887
2887
|
]), w = Je.find((g) => g.name === t.permission || g.value === t.permission) || Je[0];
|
|
@@ -2918,7 +2918,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2918
2918
|
X.Options,
|
|
2919
2919
|
{
|
|
2920
2920
|
ref: u.setFloating,
|
|
2921
|
-
style:
|
|
2921
|
+
style: c,
|
|
2922
2922
|
...a(),
|
|
2923
2923
|
static: !0,
|
|
2924
2924
|
className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
|
|
@@ -2963,28 +2963,28 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2963
2963
|
existingShares: n,
|
|
2964
2964
|
allowedPermissions: u
|
|
2965
2965
|
}) => {
|
|
2966
|
-
const [
|
|
2967
|
-
users:
|
|
2968
|
-
(
|
|
2966
|
+
const [c, i] = L(n), [y, b] = L(0), [N, a] = L(""), w = ta(N, 300), m = {
|
|
2967
|
+
users: c.users.filter(
|
|
2968
|
+
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2969
2969
|
),
|
|
2970
|
-
groups:
|
|
2971
|
-
(
|
|
2970
|
+
groups: c.groups.filter(
|
|
2971
|
+
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2972
2972
|
),
|
|
2973
|
-
roles:
|
|
2974
|
-
(
|
|
2973
|
+
roles: c.roles.filter(
|
|
2974
|
+
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2975
2975
|
)
|
|
2976
|
-
}, g = async (
|
|
2977
|
-
const
|
|
2978
|
-
|
|
2979
|
-
...
|
|
2980
|
-
[
|
|
2981
|
-
}) : (
|
|
2982
|
-
...
|
|
2983
|
-
[
|
|
2984
|
-
(U) => U.id ===
|
|
2976
|
+
}, g = async (R, S, B, P) => {
|
|
2977
|
+
const E = S.value;
|
|
2978
|
+
i(E === "Remove" ? (V) => ({
|
|
2979
|
+
...V,
|
|
2980
|
+
[B]: V[B].filter((U) => U.id !== R.id)
|
|
2981
|
+
}) : (V) => ({
|
|
2982
|
+
...V,
|
|
2983
|
+
[B]: V[B].map(
|
|
2984
|
+
(U) => U.id === R.id ? { ...U, permission: E } : U
|
|
2985
2985
|
)
|
|
2986
2986
|
}));
|
|
2987
|
-
}, $ = ["users", "groups", "roles"],
|
|
2987
|
+
}, $ = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
|
|
2988
2988
|
return (
|
|
2989
2989
|
// The main structure remains the same...
|
|
2990
2990
|
/* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -2992,7 +2992,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
2992
2992
|
/* @__PURE__ */ l(
|
|
2993
2993
|
"button",
|
|
2994
2994
|
{
|
|
2995
|
-
onClick: () => r(
|
|
2995
|
+
onClick: () => r(c),
|
|
2996
2996
|
className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 hover:cursor-pointer p-2 rounded-md hover:bg-gray-100",
|
|
2997
2997
|
children: [
|
|
2998
2998
|
/* @__PURE__ */ e(ka, { className: "h-5 w-5" }),
|
|
@@ -3012,7 +3012,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3012
3012
|
] }),
|
|
3013
3013
|
/* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ l(ae.Group, { selectedIndex: y, onChange: b, children: [
|
|
3014
3014
|
/* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3015
|
-
/* @__PURE__ */ e(ae.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3015
|
+
/* @__PURE__ */ e(ae.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((R) => /* @__PURE__ */ e(
|
|
3016
3016
|
ae,
|
|
3017
3017
|
{
|
|
3018
3018
|
className: ({
|
|
@@ -3020,16 +3020,16 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3020
3020
|
}) => `w-full py-2 text-sm font-medium leading-5 rounded-md
|
|
3021
3021
|
focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
|
|
3022
3022
|
${S ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
|
|
3023
|
-
children:
|
|
3023
|
+
children: R
|
|
3024
3024
|
},
|
|
3025
|
-
|
|
3025
|
+
R
|
|
3026
3026
|
)) }),
|
|
3027
3027
|
/* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
|
|
3028
3028
|
he,
|
|
3029
3029
|
{
|
|
3030
3030
|
onDebouncedChange: a,
|
|
3031
3031
|
value: N,
|
|
3032
|
-
placeholder: `Search in ${
|
|
3032
|
+
placeholder: `Search in ${O[y]}...`
|
|
3033
3033
|
}
|
|
3034
3034
|
) })
|
|
3035
3035
|
] }),
|
|
@@ -3040,11 +3040,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3040
3040
|
animate: { y: 0, opacity: 1 },
|
|
3041
3041
|
exit: { y: -10, opacity: 0 },
|
|
3042
3042
|
transition: { duration: 0.2 },
|
|
3043
|
-
children: /* @__PURE__ */ e(ae.Panels, { as: J, children: $.map((
|
|
3043
|
+
children: /* @__PURE__ */ e(ae.Panels, { as: J, children: $.map((R) => /* @__PURE__ */ e(
|
|
3044
3044
|
ae.Panel,
|
|
3045
3045
|
{
|
|
3046
3046
|
className: "space-y-3 focus:outline-none",
|
|
3047
|
-
children: /* @__PURE__ */ e(fe, { children: m[
|
|
3047
|
+
children: /* @__PURE__ */ e(fe, { children: m[R].length > 0 ? m[R].map((S) => /* @__PURE__ */ l(
|
|
3048
3048
|
te.div,
|
|
3049
3049
|
{
|
|
3050
3050
|
layout: !0,
|
|
@@ -3068,12 +3068,12 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3068
3068
|
),
|
|
3069
3069
|
/* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
|
|
3070
3070
|
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: S.name }),
|
|
3071
|
-
|
|
3071
|
+
R !== "users" && /* @__PURE__ */ e(
|
|
3072
3072
|
"button",
|
|
3073
3073
|
{
|
|
3074
3074
|
onClick: () => o({
|
|
3075
3075
|
id: S.id,
|
|
3076
|
-
type:
|
|
3076
|
+
type: R,
|
|
3077
3077
|
name: S.name
|
|
3078
3078
|
}),
|
|
3079
3079
|
className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
|
|
@@ -3087,10 +3087,10 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3087
3087
|
{
|
|
3088
3088
|
item: S,
|
|
3089
3089
|
allowedPermissions: u,
|
|
3090
|
-
onPermissionChange: (
|
|
3090
|
+
onPermissionChange: (B) => g(
|
|
3091
3091
|
S,
|
|
3092
|
-
|
|
3093
|
-
|
|
3092
|
+
B,
|
|
3093
|
+
R
|
|
3094
3094
|
)
|
|
3095
3095
|
}
|
|
3096
3096
|
)
|
|
@@ -3109,16 +3109,16 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3109
3109
|
/* @__PURE__ */ e(va, { className: "h-12 w-12 text-gray-400" }),
|
|
3110
3110
|
/* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3111
3111
|
"No ",
|
|
3112
|
-
|
|
3112
|
+
O[y],
|
|
3113
3113
|
" Found"
|
|
3114
3114
|
] }),
|
|
3115
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${
|
|
3115
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${O[y].toLowerCase()} with access.` })
|
|
3116
3116
|
]
|
|
3117
3117
|
}
|
|
3118
3118
|
)
|
|
3119
3119
|
) })
|
|
3120
3120
|
},
|
|
3121
|
-
|
|
3121
|
+
R
|
|
3122
3122
|
)) })
|
|
3123
3123
|
},
|
|
3124
3124
|
y
|
|
@@ -3139,7 +3139,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3139
3139
|
onClose: s,
|
|
3140
3140
|
members: o
|
|
3141
3141
|
}) => {
|
|
3142
|
-
const [n, u] = L(!0), [
|
|
3142
|
+
const [n, u] = L(!0), [c, i] = L(""), y = ta(c, 300), b = o.filter(
|
|
3143
3143
|
(m) => m.name.toLowerCase().includes(y.toLowerCase())
|
|
3144
3144
|
), N = {
|
|
3145
3145
|
hidden: { opacity: 0 },
|
|
@@ -3232,8 +3232,8 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3232
3232
|
/* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
3233
3233
|
he,
|
|
3234
3234
|
{
|
|
3235
|
-
onDebouncedChange:
|
|
3236
|
-
value:
|
|
3235
|
+
onDebouncedChange: i,
|
|
3236
|
+
value: c,
|
|
3237
3237
|
placeholder: "Search members..."
|
|
3238
3238
|
}
|
|
3239
3239
|
) }),
|
|
@@ -3256,33 +3256,33 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3256
3256
|
calledBy: n,
|
|
3257
3257
|
onClose: u = () => {
|
|
3258
3258
|
},
|
|
3259
|
-
showExistingShares:
|
|
3260
|
-
allowedPermissions:
|
|
3259
|
+
showExistingShares: c = !0,
|
|
3260
|
+
allowedPermissions: i = [],
|
|
3261
3261
|
...y
|
|
3262
3262
|
}) => {
|
|
3263
|
-
const [b, N] = L(de.INVITE), [a, w] = L(t), [m, g] = L(null), [$,
|
|
3263
|
+
const [b, N] = L(de.INVITE), [a, w] = L(t), [m, g] = L(null), [$, O] = L(!1), [R, S] = L([]), [B, P] = L(de.MANAGE), E = () => {
|
|
3264
3264
|
N(de.INVITE), g(null), u();
|
|
3265
|
-
},
|
|
3265
|
+
}, V = () => {
|
|
3266
3266
|
N(de.MANAGE);
|
|
3267
3267
|
}, U = async ({ id: p, name: f, type: k }) => {
|
|
3268
3268
|
if (console.log("handleToMembers", { id: p, name: f, type: k }), k === "groups") {
|
|
3269
3269
|
try {
|
|
3270
|
-
const d = await
|
|
3270
|
+
const d = await $e(`${Ie.getMembersForGroup(f)}`);
|
|
3271
3271
|
} catch (d) {
|
|
3272
3272
|
console.log("Error searching entities:", d);
|
|
3273
3273
|
}
|
|
3274
3274
|
S(resp);
|
|
3275
3275
|
}
|
|
3276
|
-
g({ id: p, type: k, name: f }),
|
|
3277
|
-
},
|
|
3276
|
+
g({ id: p, type: k, name: f }), P(b), N(de.MEMBERS);
|
|
3277
|
+
}, j = (p) => {
|
|
3278
3278
|
console.log("changedExistingShares", p), w(p);
|
|
3279
3279
|
const f = !We.isEqual(
|
|
3280
3280
|
We.mapValues(t, (k) => k.map((d) => ({ id: d.id, permission: d.permission }))),
|
|
3281
3281
|
We.mapValues(p, (k) => k.map((d) => ({ id: d.id, permission: d.permission })))
|
|
3282
3282
|
);
|
|
3283
|
-
|
|
3283
|
+
O(f), N(b === de.MEMBERS ? B : de.INVITE);
|
|
3284
3284
|
};
|
|
3285
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose:
|
|
3285
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: E, children: [
|
|
3286
3286
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3287
3287
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(ke, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3288
3288
|
switch (b) {
|
|
@@ -3299,12 +3299,12 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3299
3299
|
pn,
|
|
3300
3300
|
{
|
|
3301
3301
|
entity: o,
|
|
3302
|
-
onBack:
|
|
3303
|
-
onClose:
|
|
3302
|
+
onBack: j,
|
|
3303
|
+
onClose: E,
|
|
3304
3304
|
onOpenMembers: U,
|
|
3305
3305
|
existingShares: a,
|
|
3306
3306
|
calledBy: n,
|
|
3307
|
-
allowedPermissions:
|
|
3307
|
+
allowedPermissions: i
|
|
3308
3308
|
}
|
|
3309
3309
|
)
|
|
3310
3310
|
},
|
|
@@ -3323,11 +3323,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3323
3323
|
yn,
|
|
3324
3324
|
{
|
|
3325
3325
|
entity: m,
|
|
3326
|
-
onBack:
|
|
3327
|
-
onClose:
|
|
3326
|
+
onBack: j,
|
|
3327
|
+
onClose: E,
|
|
3328
3328
|
calledBy: n,
|
|
3329
3329
|
existingShares: a,
|
|
3330
|
-
members:
|
|
3330
|
+
members: R
|
|
3331
3331
|
}
|
|
3332
3332
|
)
|
|
3333
3333
|
},
|
|
@@ -3346,11 +3346,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
|
|
|
3346
3346
|
mn,
|
|
3347
3347
|
{
|
|
3348
3348
|
entity: o,
|
|
3349
|
-
onManage:
|
|
3350
|
-
onClose:
|
|
3349
|
+
onManage: V,
|
|
3350
|
+
onClose: E,
|
|
3351
3351
|
existingShares: a,
|
|
3352
3352
|
calledBy: n,
|
|
3353
|
-
showExistingShares:
|
|
3353
|
+
showExistingShares: c,
|
|
3354
3354
|
onFinalSubmit: (p) => {
|
|
3355
3355
|
s(p, a);
|
|
3356
3356
|
},
|
|
@@ -3376,8 +3376,8 @@ function qe({
|
|
|
3376
3376
|
onBlur: n = () => {
|
|
3377
3377
|
},
|
|
3378
3378
|
placeholder: u = "Select options",
|
|
3379
|
-
error:
|
|
3380
|
-
displayLimit:
|
|
3379
|
+
error: c = null,
|
|
3380
|
+
displayLimit: i = 3,
|
|
3381
3381
|
selectionLimit: y = -1,
|
|
3382
3382
|
// NEW: search behavior
|
|
3383
3383
|
searchMode: b = "client",
|
|
@@ -3390,22 +3390,22 @@ function qe({
|
|
|
3390
3390
|
getOptionId: m = ($) => String($.id),
|
|
3391
3391
|
getOptionLabel: g = ($) => $.name
|
|
3392
3392
|
}) {
|
|
3393
|
-
const $ = Qe(),
|
|
3393
|
+
const $ = Qe(), O = Qe(), [R, S] = L(""), B = ue(""), P = ne(() => {
|
|
3394
3394
|
const p = /* @__PURE__ */ new Map();
|
|
3395
3395
|
for (const f of r) p.set(m(f), f);
|
|
3396
3396
|
return p;
|
|
3397
|
-
}, [r, m]),
|
|
3398
|
-
if (!
|
|
3399
|
-
const p =
|
|
3397
|
+
}, [r, m]), E = ne(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? P.get(m(p)) || null : P.get(String(p))).filter(Boolean) : [], [s, P, m]), V = ne(() => {
|
|
3398
|
+
if (!R) return r;
|
|
3399
|
+
const p = R.toLowerCase();
|
|
3400
3400
|
return r.filter((f) => g(f).toLowerCase().includes(p));
|
|
3401
|
-
}, [r,
|
|
3401
|
+
}, [r, R, g]);
|
|
3402
3402
|
Q(() => {
|
|
3403
|
-
b === "server" &&
|
|
3404
|
-
}, [
|
|
3405
|
-
const U = b === "client" ?
|
|
3406
|
-
if (!
|
|
3403
|
+
b === "server" && R.length >= w && R !== B.current && (B.current = R, N && N(R));
|
|
3404
|
+
}, [R, b, w, N]);
|
|
3405
|
+
const U = b === "client" ? V : r, j = () => {
|
|
3406
|
+
if (!E.length)
|
|
3407
3407
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3408
|
-
const p =
|
|
3408
|
+
const p = E.slice(0, i), f = E.length - i;
|
|
3409
3409
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3410
3410
|
p.map((k) => /* @__PURE__ */ e(
|
|
3411
3411
|
"span",
|
|
@@ -3422,7 +3422,7 @@ function qe({
|
|
|
3422
3422
|
] })
|
|
3423
3423
|
] });
|
|
3424
3424
|
};
|
|
3425
|
-
return /* @__PURE__ */ e(X, { value:
|
|
3425
|
+
return /* @__PURE__ */ e(X, { value: E, onChange: (p) => {
|
|
3426
3426
|
const f = Array.from(new Set(p.map((k) => m(k))));
|
|
3427
3427
|
y !== -1 && f.length > y || o(f);
|
|
3428
3428
|
}, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
|
|
@@ -3439,15 +3439,15 @@ function qe({
|
|
|
3439
3439
|
X.Button,
|
|
3440
3440
|
{
|
|
3441
3441
|
"aria-labelledby": $,
|
|
3442
|
-
"aria-invalid": !!
|
|
3443
|
-
"aria-describedby":
|
|
3442
|
+
"aria-invalid": !!c,
|
|
3443
|
+
"aria-describedby": c ? O : void 0,
|
|
3444
3444
|
onBlur: n,
|
|
3445
3445
|
className: Ae(
|
|
3446
3446
|
"relative w-full min-h-[38px] cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset focus:outline-none focus:ring-2 focus:ring-gray-600 sm:text-sm sm:leading-6",
|
|
3447
|
-
|
|
3447
|
+
c ? "ring-red-500" : "ring-gray-300"
|
|
3448
3448
|
),
|
|
3449
3449
|
children: [
|
|
3450
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3450
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: j() }),
|
|
3451
3451
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(fa, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3452
3452
|
]
|
|
3453
3453
|
}
|
|
@@ -3464,39 +3464,39 @@ function qe({
|
|
|
3464
3464
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3465
3465
|
he,
|
|
3466
3466
|
{
|
|
3467
|
-
value:
|
|
3467
|
+
value: R,
|
|
3468
3468
|
onDebouncedChange: S,
|
|
3469
3469
|
placeholder: b === "server" ? `Search (min ${w})…` : "Search options…"
|
|
3470
3470
|
}
|
|
3471
3471
|
) }),
|
|
3472
3472
|
b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3473
|
-
U.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ?
|
|
3474
|
-
const k = m(f), d = g(f), h =
|
|
3473
|
+
U.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? R.length < w ? `Type at least ${w} characters to search.` : "No results." : "No options found." }) : U.map((f) => {
|
|
3474
|
+
const k = m(f), d = g(f), h = E.some((F) => m(F) === k), x = y !== -1 && E.length >= y && !h;
|
|
3475
3475
|
return /* @__PURE__ */ e(
|
|
3476
3476
|
X.Option,
|
|
3477
3477
|
{
|
|
3478
3478
|
value: f,
|
|
3479
3479
|
disabled: x,
|
|
3480
|
-
className: ({ active:
|
|
3481
|
-
x ? " text-gray-400 bg-white cursor-not-allowed" :
|
|
3480
|
+
className: ({ active: F }) => Ae(
|
|
3481
|
+
x ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3482
3482
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3483
3483
|
),
|
|
3484
|
-
children: ({ selected:
|
|
3484
|
+
children: ({ selected: F, active: z }) => /* @__PURE__ */ l(ee, { children: [
|
|
3485
3485
|
/* @__PURE__ */ e(
|
|
3486
3486
|
"span",
|
|
3487
3487
|
{
|
|
3488
3488
|
className: Ae(
|
|
3489
|
-
|
|
3489
|
+
F ? "font-semibold" : "font-normal",
|
|
3490
3490
|
"block truncate"
|
|
3491
3491
|
),
|
|
3492
3492
|
children: d
|
|
3493
3493
|
}
|
|
3494
3494
|
),
|
|
3495
|
-
|
|
3495
|
+
F && /* @__PURE__ */ e(
|
|
3496
3496
|
"span",
|
|
3497
3497
|
{
|
|
3498
3498
|
className: Ae(
|
|
3499
|
-
|
|
3499
|
+
z ? " text-gray-900" : " text-gray-600",
|
|
3500
3500
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3501
3501
|
),
|
|
3502
3502
|
children: /* @__PURE__ */ e(Me, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3510,7 +3510,7 @@ function qe({
|
|
|
3510
3510
|
] })
|
|
3511
3511
|
}
|
|
3512
3512
|
),
|
|
3513
|
-
|
|
3513
|
+
c && /* @__PURE__ */ e("p", { id: O, className: "mt-1 text-sm text-red-600", children: c })
|
|
3514
3514
|
] })
|
|
3515
3515
|
] }) });
|
|
3516
3516
|
}
|
|
@@ -3556,15 +3556,15 @@ qe.defaultProps = {
|
|
|
3556
3556
|
getOptionId: (t) => String(t.id),
|
|
3557
3557
|
getOptionLabel: (t) => t.name
|
|
3558
3558
|
};
|
|
3559
|
-
const
|
|
3559
|
+
const cs = ({
|
|
3560
3560
|
isOpen: t = !1,
|
|
3561
3561
|
setIsOpen: r,
|
|
3562
3562
|
content: s,
|
|
3563
3563
|
header: o = { title: "", customHeader: null, isCrossShow: !0 },
|
|
3564
3564
|
footer: n = { show: !0, customFooter: null },
|
|
3565
3565
|
primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
|
|
3566
|
-
secondaryAction:
|
|
3567
|
-
dialogPanelClass:
|
|
3566
|
+
secondaryAction: c = { onCancel: null, label: "Cancel" },
|
|
3567
|
+
dialogPanelClass: i = ""
|
|
3568
3568
|
}) => {
|
|
3569
3569
|
const y = (N) => {
|
|
3570
3570
|
N.target === N.currentTarget && r(!1);
|
|
@@ -3588,7 +3588,7 @@ const is = ({
|
|
|
3588
3588
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ l(
|
|
3589
3589
|
ke,
|
|
3590
3590
|
{
|
|
3591
|
-
className: `${
|
|
3591
|
+
className: `${i} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
|
|
3592
3592
|
onClick: b,
|
|
3593
3593
|
children: [
|
|
3594
3594
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
@@ -3605,15 +3605,15 @@ const is = ({
|
|
|
3605
3605
|
}
|
|
3606
3606
|
),
|
|
3607
3607
|
n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
|
|
3608
|
-
|
|
3608
|
+
c?.onCancel && /* @__PURE__ */ e(
|
|
3609
3609
|
Z,
|
|
3610
3610
|
{
|
|
3611
3611
|
"data-testid": "cancel-button",
|
|
3612
|
-
label:
|
|
3612
|
+
label: c?.label,
|
|
3613
3613
|
loader: !1,
|
|
3614
3614
|
ariaLabel: "Cancel Button",
|
|
3615
3615
|
className: "p-3 mr-3 secondaryButton !w-[70px]",
|
|
3616
|
-
onClick: () =>
|
|
3616
|
+
onClick: () => c?.onCancel(),
|
|
3617
3617
|
category: "secondary"
|
|
3618
3618
|
}
|
|
3619
3619
|
),
|
|
@@ -3660,17 +3660,17 @@ function vn({
|
|
|
3660
3660
|
onToggle: o,
|
|
3661
3661
|
onSelect: n,
|
|
3662
3662
|
onCreateChild: u,
|
|
3663
|
-
onRename:
|
|
3664
|
-
onDelete:
|
|
3663
|
+
onRename: c,
|
|
3664
|
+
onDelete: i,
|
|
3665
3665
|
renderActions: y,
|
|
3666
3666
|
// optional override
|
|
3667
3667
|
dragId: b,
|
|
3668
3668
|
dropId: N,
|
|
3669
3669
|
indent: a = 24
|
|
3670
3670
|
}) {
|
|
3671
|
-
const { setNodeRef: w, isOver: m } = Pt({ id: N }), { attributes: g, listeners: $, setNodeRef:
|
|
3672
|
-
const p =
|
|
3673
|
-
|
|
3671
|
+
const { setNodeRef: w, isOver: m } = Pt({ id: N }), { attributes: g, listeners: $, setNodeRef: O, transform: R, isDragging: S } = Ot({ id: b }), B = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [P, E] = L(!1), [V, U] = L(t.name), j = () => {
|
|
3672
|
+
const p = V.trim();
|
|
3673
|
+
E(!1), p && p !== t.name ? c?.(t, p) : U(t.name);
|
|
3674
3674
|
}, v = ne(() => /* @__PURE__ */ e(
|
|
3675
3675
|
Xr,
|
|
3676
3676
|
{
|
|
@@ -3680,40 +3680,40 @@ function vn({
|
|
|
3680
3680
|
{ action: "delete", label: "Delete" }
|
|
3681
3681
|
],
|
|
3682
3682
|
onSelect: (f) => {
|
|
3683
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ?
|
|
3683
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && i?.(t);
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
|
-
), [t, u,
|
|
3686
|
+
), [t, u, i]);
|
|
3687
3687
|
return /* @__PURE__ */ l(
|
|
3688
3688
|
"div",
|
|
3689
3689
|
{
|
|
3690
3690
|
ref: w,
|
|
3691
3691
|
className: `tv-row ${m ? "tv-drop-over" : ""} ${S ? "dragging" : ""}`,
|
|
3692
|
-
style: { ...
|
|
3692
|
+
style: { ...B, paddingLeft: 8 + r * a },
|
|
3693
3693
|
onClick: (p) => {
|
|
3694
3694
|
p.target.closest(".tv-toggle") || p.target.tagName === "INPUT" || n?.(t);
|
|
3695
3695
|
},
|
|
3696
3696
|
children: [
|
|
3697
3697
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(ba, { size: 16 }) : /* @__PURE__ */ e(Le, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3698
3698
|
/* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
|
|
3699
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref:
|
|
3699
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: O, children: P ? /* @__PURE__ */ e(
|
|
3700
3700
|
"input",
|
|
3701
3701
|
{
|
|
3702
3702
|
className: "tv-input",
|
|
3703
|
-
value:
|
|
3703
|
+
value: V,
|
|
3704
3704
|
onChange: (p) => U(p.target.value),
|
|
3705
|
-
onBlur:
|
|
3705
|
+
onBlur: j,
|
|
3706
3706
|
onKeyDown: (p) => {
|
|
3707
|
-
p.key === "Enter" &&
|
|
3707
|
+
p.key === "Enter" && j(), p.key === "Escape" && (E(!1), U(t.name));
|
|
3708
3708
|
},
|
|
3709
3709
|
autoFocus: !0
|
|
3710
3710
|
}
|
|
3711
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3711
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => E(!0), children: t.name }) }),
|
|
3712
3712
|
/* @__PURE__ */ e(bn, { listeners: $, attributes: g }),
|
|
3713
3713
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3714
3714
|
onCreateChild: () => u?.(t),
|
|
3715
|
-
onRename: () =>
|
|
3716
|
-
onDelete: () =>
|
|
3715
|
+
onRename: () => E(!0),
|
|
3716
|
+
onDelete: () => i?.(t)
|
|
3717
3717
|
}) : v })
|
|
3718
3718
|
]
|
|
3719
3719
|
}
|
|
@@ -3722,60 +3722,60 @@ function vn({
|
|
|
3722
3722
|
const Nn = (t) => String(t.id ?? t._id), xn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", kn = (t) => t.name ?? t.label ?? "", wn = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
|
|
3723
3723
|
function Cn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
3724
3724
|
const u = /* @__PURE__ */ new Map();
|
|
3725
|
-
t.forEach((
|
|
3726
|
-
const y = s(
|
|
3725
|
+
t.forEach((i) => {
|
|
3726
|
+
const y = s(i);
|
|
3727
3727
|
u.set(y, {
|
|
3728
|
-
...
|
|
3728
|
+
...i,
|
|
3729
3729
|
id: y,
|
|
3730
|
-
name: n(
|
|
3731
|
-
parentId: o(
|
|
3730
|
+
name: n(i),
|
|
3731
|
+
parentId: o(i) || r,
|
|
3732
3732
|
children: []
|
|
3733
3733
|
});
|
|
3734
3734
|
});
|
|
3735
|
-
const
|
|
3736
|
-
return u.forEach((
|
|
3737
|
-
const y =
|
|
3738
|
-
y !== r && u.has(y) ? u.get(y).children.push(
|
|
3739
|
-
}), { roots:
|
|
3735
|
+
const c = [];
|
|
3736
|
+
return u.forEach((i) => {
|
|
3737
|
+
const y = i.parentId || r;
|
|
3738
|
+
y !== r && u.has(y) ? u.get(y).children.push(i) : c.push(i);
|
|
3739
|
+
}), { roots: c, byId: u };
|
|
3740
3740
|
}
|
|
3741
3741
|
function Sn(t, { rootId: r, getId: s, getName: o }) {
|
|
3742
3742
|
const n = /* @__PURE__ */ new Map();
|
|
3743
|
-
function u(
|
|
3744
|
-
const b = s(
|
|
3745
|
-
...
|
|
3743
|
+
function u(i, y) {
|
|
3744
|
+
const b = s(i), N = {
|
|
3745
|
+
...i,
|
|
3746
3746
|
id: b,
|
|
3747
|
-
name: o(
|
|
3747
|
+
name: o(i),
|
|
3748
3748
|
parentId: y || r,
|
|
3749
|
-
children: (
|
|
3749
|
+
children: (i.children || []).map((a) => u(a, b))
|
|
3750
3750
|
};
|
|
3751
3751
|
return n.set(b, N), N;
|
|
3752
3752
|
}
|
|
3753
|
-
return { roots: t.map((
|
|
3753
|
+
return { roots: t.map((i) => u(i, null)), byId: n };
|
|
3754
3754
|
}
|
|
3755
3755
|
const De = (t) => t.map((r) => ({ ...r, children: De(r.children || []) }));
|
|
3756
3756
|
function Dn(t, r) {
|
|
3757
3757
|
let s = null;
|
|
3758
3758
|
function o(u) {
|
|
3759
|
-
return u.map((
|
|
3760
|
-
if (
|
|
3761
|
-
return s =
|
|
3762
|
-
if (
|
|
3763
|
-
const
|
|
3764
|
-
if (
|
|
3759
|
+
return u.map((c) => {
|
|
3760
|
+
if (c.id === r)
|
|
3761
|
+
return s = c, null;
|
|
3762
|
+
if (c.children?.length) {
|
|
3763
|
+
const i = o(c.children);
|
|
3764
|
+
if (i !== c.children) return { ...c, children: i };
|
|
3765
3765
|
}
|
|
3766
|
-
return
|
|
3766
|
+
return c;
|
|
3767
3767
|
}).filter(Boolean);
|
|
3768
3768
|
}
|
|
3769
3769
|
return { newRoots: o(t), removed: s };
|
|
3770
3770
|
}
|
|
3771
|
-
function
|
|
3771
|
+
function $n(t, r, s) {
|
|
3772
3772
|
function o(n) {
|
|
3773
3773
|
return n.map((u) => {
|
|
3774
3774
|
if (u.id === r)
|
|
3775
3775
|
return { ...u, children: [...u.children || [], { ...s, parentId: r }] };
|
|
3776
3776
|
if (u.children?.length) {
|
|
3777
|
-
const
|
|
3778
|
-
if (
|
|
3777
|
+
const c = o(u.children);
|
|
3778
|
+
if (c !== u.children) return { ...u, children: c };
|
|
3779
3779
|
}
|
|
3780
3780
|
return u;
|
|
3781
3781
|
});
|
|
@@ -3792,15 +3792,15 @@ function Ja(t, r, s = null) {
|
|
|
3792
3792
|
}
|
|
3793
3793
|
return null;
|
|
3794
3794
|
}
|
|
3795
|
-
function
|
|
3795
|
+
function is({
|
|
3796
3796
|
data: t = [],
|
|
3797
3797
|
rootId: r = "root",
|
|
3798
3798
|
title: s = "Folders",
|
|
3799
3799
|
getId: o = Nn,
|
|
3800
3800
|
getParent: n = xn,
|
|
3801
3801
|
getName: u = kn,
|
|
3802
|
-
onSelect:
|
|
3803
|
-
onCreateRoot:
|
|
3802
|
+
onSelect: c,
|
|
3803
|
+
onCreateRoot: i,
|
|
3804
3804
|
onCreateChild: y,
|
|
3805
3805
|
onRename: b,
|
|
3806
3806
|
onDelete: N,
|
|
@@ -3813,112 +3813,112 @@ function cs({
|
|
|
3813
3813
|
const { roots: $ } = ne(() => wn(t) ? Sn(t, { rootId: r, getId: o, getName: u }) : Cn(
|
|
3814
3814
|
t.map((x) => ({ ...x })),
|
|
3815
3815
|
{ rootId: r, getId: o, getParent: n, getName: u }
|
|
3816
|
-
), [t, r, o, n, u]), [
|
|
3817
|
-
const
|
|
3818
|
-
return (function
|
|
3819
|
-
|
|
3820
|
-
D
|
|
3816
|
+
), [t, r, o, n, u]), [O, R] = L({}), S = K((x) => {
|
|
3817
|
+
const F = {};
|
|
3818
|
+
return (function z(q) {
|
|
3819
|
+
q.forEach((D) => {
|
|
3820
|
+
F[D.id] = !0, D.children?.length && z(D.children);
|
|
3821
3821
|
});
|
|
3822
|
-
})(x),
|
|
3822
|
+
})(x), F;
|
|
3823
3823
|
}, []);
|
|
3824
3824
|
re.useEffect(() => {
|
|
3825
|
-
|
|
3825
|
+
R(S($));
|
|
3826
3826
|
}, [$, S]);
|
|
3827
|
-
const
|
|
3828
|
-
(x) =>
|
|
3827
|
+
const B = K(
|
|
3828
|
+
(x) => R((F) => ({ ...F, [x]: !F[x] })),
|
|
3829
3829
|
[]
|
|
3830
|
-
), [
|
|
3831
|
-
re.useEffect(() =>
|
|
3832
|
-
const
|
|
3830
|
+
), [P, E] = L(() => De($));
|
|
3831
|
+
re.useEffect(() => E(De($)), [$]);
|
|
3832
|
+
const V = Lt(
|
|
3833
3833
|
Mt(jt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3834
|
-
), U = ue(null), [
|
|
3834
|
+
), U = ue(null), [j, v] = L(null), p = ue(0), f = () => {
|
|
3835
3835
|
}, k = ({ delta: x }) => {
|
|
3836
3836
|
p.current = x?.x ?? 0;
|
|
3837
3837
|
}, d = K(
|
|
3838
|
-
({ active: x, over:
|
|
3839
|
-
const
|
|
3840
|
-
if (p.current = 0, v(null), !x || !
|
|
3841
|
-
const
|
|
3842
|
-
if (!
|
|
3843
|
-
let
|
|
3844
|
-
const
|
|
3845
|
-
if (
|
|
3846
|
-
let H =
|
|
3847
|
-
for (let
|
|
3848
|
-
const
|
|
3849
|
-
if (!
|
|
3850
|
-
if (!
|
|
3851
|
-
|
|
3838
|
+
({ active: x, over: F }) => {
|
|
3839
|
+
const z = p.current;
|
|
3840
|
+
if (p.current = 0, v(null), !x || !F) return;
|
|
3841
|
+
const q = String(x.id).replace(/^drag-/, ""), D = String(F.id).replace(/^drop-/, "");
|
|
3842
|
+
if (!q || !D || q === D) return;
|
|
3843
|
+
let A = D;
|
|
3844
|
+
const M = Math.max(0, Math.floor(-z / g));
|
|
3845
|
+
if (M > 0) {
|
|
3846
|
+
let H = D;
|
|
3847
|
+
for (let ce = 0; ce < M; ce++) {
|
|
3848
|
+
const ie = Ja(P, H, null);
|
|
3849
|
+
if (!ie) break;
|
|
3850
|
+
if (!ie.parentId) {
|
|
3851
|
+
A = r;
|
|
3852
3852
|
break;
|
|
3853
3853
|
}
|
|
3854
|
-
|
|
3854
|
+
A = ie.parentId, H = ie.parentId;
|
|
3855
3855
|
}
|
|
3856
3856
|
}
|
|
3857
|
-
if (m &&
|
|
3858
|
-
|
|
3857
|
+
if (m && A === r) {
|
|
3858
|
+
E(De($));
|
|
3859
3859
|
return;
|
|
3860
3860
|
}
|
|
3861
|
-
const T = De(
|
|
3862
|
-
if (!
|
|
3863
|
-
const
|
|
3864
|
-
|
|
3861
|
+
const T = De(P), { newRoots: C, removed: I } = Dn(T, q);
|
|
3862
|
+
if (!I) return;
|
|
3863
|
+
const G = $n(C, A, I);
|
|
3864
|
+
E(G), a?.({ sourceId: q, destParentId: A, newTree: G });
|
|
3865
3865
|
},
|
|
3866
|
-
[
|
|
3866
|
+
[P, $, r, m, g, a]
|
|
3867
3867
|
), h = K(
|
|
3868
|
-
(x,
|
|
3868
|
+
(x, F = 0) => x.map((z) => /* @__PURE__ */ l(re.Fragment, { children: [
|
|
3869
3869
|
/* @__PURE__ */ e(
|
|
3870
3870
|
vn,
|
|
3871
3871
|
{
|
|
3872
|
-
node:
|
|
3873
|
-
depth:
|
|
3874
|
-
expanded: !!
|
|
3875
|
-
onToggle: () =>
|
|
3876
|
-
onSelect:
|
|
3872
|
+
node: z,
|
|
3873
|
+
depth: F,
|
|
3874
|
+
expanded: !!O[z.id],
|
|
3875
|
+
onToggle: () => B(z.id),
|
|
3876
|
+
onSelect: c,
|
|
3877
3877
|
onCreateChild: y,
|
|
3878
3878
|
onRename: b,
|
|
3879
3879
|
onDelete: N,
|
|
3880
3880
|
renderActions: w,
|
|
3881
|
-
dragId: `drag-${
|
|
3882
|
-
dropId: `drop-${
|
|
3881
|
+
dragId: `drag-${z.id}`,
|
|
3882
|
+
dropId: `drop-${z.id}`,
|
|
3883
3883
|
indent: g
|
|
3884
3884
|
}
|
|
3885
3885
|
),
|
|
3886
|
-
|
|
3887
|
-
] },
|
|
3888
|
-
[
|
|
3886
|
+
O[z.id] && z.children?.length > 0 ? h(z.children, F + 1) : null
|
|
3887
|
+
] }, z.id)),
|
|
3888
|
+
[O, g, y, N, b, c, w, B]
|
|
3889
3889
|
);
|
|
3890
3890
|
return re.useMemo(() => {
|
|
3891
|
-
if (!
|
|
3892
|
-
const x = String(
|
|
3893
|
-
function
|
|
3894
|
-
for (const
|
|
3895
|
-
if (
|
|
3896
|
-
const
|
|
3897
|
-
if (
|
|
3891
|
+
if (!j) return null;
|
|
3892
|
+
const x = String(j).replace(/^drag-/, "");
|
|
3893
|
+
function F(z) {
|
|
3894
|
+
for (const q of z) {
|
|
3895
|
+
if (q.id === x) return q;
|
|
3896
|
+
const D = q.children?.length ? F(q.children) : null;
|
|
3897
|
+
if (D) return D;
|
|
3898
3898
|
}
|
|
3899
3899
|
return null;
|
|
3900
3900
|
}
|
|
3901
|
-
return
|
|
3902
|
-
}, [
|
|
3901
|
+
return F(P);
|
|
3902
|
+
}, [j, P]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3903
3903
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3904
3904
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3905
|
-
/* @__PURE__ */ e("button", { className: "tv-btn", onClick:
|
|
3905
|
+
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: i, children: "+ New folder" })
|
|
3906
3906
|
] }),
|
|
3907
3907
|
/* @__PURE__ */ l("div", { className: "tv-root-row", children: [
|
|
3908
3908
|
/* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
|
|
3909
3909
|
/* @__PURE__ */ e("strong", { children: "ROOT" }),
|
|
3910
|
-
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick:
|
|
3910
|
+
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: i, children: "+" })
|
|
3911
3911
|
] }),
|
|
3912
3912
|
/* @__PURE__ */ e(
|
|
3913
3913
|
Vt,
|
|
3914
3914
|
{
|
|
3915
3915
|
collisionDetection: qt,
|
|
3916
|
-
sensors:
|
|
3916
|
+
sensors: V,
|
|
3917
3917
|
onDragStart: f,
|
|
3918
3918
|
onDragMove: k,
|
|
3919
3919
|
onDragEnd: d,
|
|
3920
3920
|
modifiers: [Ut],
|
|
3921
|
-
children: /* @__PURE__ */ e("div", { ref: U, className: "tv-list", children: h(
|
|
3921
|
+
children: /* @__PURE__ */ e("div", { ref: U, className: "tv-list", children: h(P, 0) })
|
|
3922
3922
|
}
|
|
3923
3923
|
)
|
|
3924
3924
|
] });
|
|
@@ -3933,8 +3933,8 @@ const ds = ({
|
|
|
3933
3933
|
containerClassName: o = "",
|
|
3934
3934
|
listClassName: n = "",
|
|
3935
3935
|
panelClassName: u = "",
|
|
3936
|
-
tabClassName:
|
|
3937
|
-
...
|
|
3936
|
+
tabClassName: c,
|
|
3937
|
+
...i
|
|
3938
3938
|
// Pass remaining props to Tab.Group
|
|
3939
3939
|
}) => {
|
|
3940
3940
|
const y = s === "vertical", b = (w) => ye(
|
|
@@ -3943,8 +3943,8 @@ const ds = ({
|
|
|
3943
3943
|
), N = (w) => ye(
|
|
3944
3944
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3945
3945
|
w ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3946
|
-
), a = ({ selected: w }) =>
|
|
3947
|
-
return /* @__PURE__ */ e(ae.Group, { vertical: y, ...
|
|
3946
|
+
), a = ({ selected: w }) => c ? typeof c == "function" ? c(w) : c : y ? b(w) : N(w);
|
|
3947
|
+
return /* @__PURE__ */ e(ae.Group, { vertical: y, ...i, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
|
|
3948
3948
|
/* @__PURE__ */ e(ae.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((w) => /* @__PURE__ */ e(ae, { className: a, children: w.label }, w.key)) }),
|
|
3949
3949
|
/* @__PURE__ */ e(ae.Panels, { unmount: !r, className: ye("flex-1", u), children: t.map((w) => /* @__PURE__ */ e(ae.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: w.content }) }, w.key)) })
|
|
3950
3950
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
@@ -3952,9 +3952,9 @@ const ds = ({
|
|
|
3952
3952
|
/* @__PURE__ */ e(ae.Panels, { unmount: !r, className: ye("mt-2", u), children: t.map((w) => /* @__PURE__ */ e(ae.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: w.content }) }, w.key)) })
|
|
3953
3953
|
] }) });
|
|
3954
3954
|
};
|
|
3955
|
-
function
|
|
3955
|
+
function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
3956
3956
|
console.log(t);
|
|
3957
|
-
const [n, u] = re.useState(t), [
|
|
3957
|
+
const [n, u] = re.useState(t), [c, i] = re.useState(() => {
|
|
3958
3958
|
const a = r && r[t.key] || {};
|
|
3959
3959
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3960
3960
|
}), y = ue(r);
|
|
@@ -3962,16 +3962,16 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3962
3962
|
if (y.current !== r) {
|
|
3963
3963
|
y.current = r;
|
|
3964
3964
|
const a = r && r[t.key] || {};
|
|
3965
|
-
console.log("Updated Section data for", t.key, a),
|
|
3965
|
+
console.log("Updated Section data for", t.key, a), i(a);
|
|
3966
3966
|
}
|
|
3967
|
-
}, [r, t.key]), console.log("Section data",
|
|
3968
|
-
const b = ue(
|
|
3967
|
+
}, [r, t.key]), console.log("Section data", c);
|
|
3968
|
+
const b = ue(c);
|
|
3969
3969
|
Q(() => {
|
|
3970
|
-
b.current !==
|
|
3971
|
-
}, [n.key,
|
|
3970
|
+
b.current !== c && s && typeof s == "function" && (b.current = c, s(n.key, c));
|
|
3971
|
+
}, [n.key, c, s]);
|
|
3972
3972
|
const N = (a) => {
|
|
3973
3973
|
if (!a.dependsOn) return !0;
|
|
3974
|
-
const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ =
|
|
3974
|
+
const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ = c[w];
|
|
3975
3975
|
switch (g) {
|
|
3976
3976
|
case "equals":
|
|
3977
3977
|
return $ === m;
|
|
@@ -4030,10 +4030,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4030
4030
|
name: a.key,
|
|
4031
4031
|
defaultValue: a.default,
|
|
4032
4032
|
placeholder: a.placeholder,
|
|
4033
|
-
value:
|
|
4033
|
+
value: c[a.key] || "",
|
|
4034
4034
|
onChange: (m) => {
|
|
4035
|
-
const g = { ...
|
|
4036
|
-
|
|
4035
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4036
|
+
i(g), s && s(n.key, g);
|
|
4037
4037
|
},
|
|
4038
4038
|
required: a.required,
|
|
4039
4039
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4049,10 +4049,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4049
4049
|
name: a.key,
|
|
4050
4050
|
defaultValue: a.default,
|
|
4051
4051
|
placeholder: a.placeholder,
|
|
4052
|
-
value:
|
|
4052
|
+
value: c[a.key] || "",
|
|
4053
4053
|
onChange: (m) => {
|
|
4054
|
-
const g = { ...
|
|
4055
|
-
|
|
4054
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4055
|
+
i(g), s && s(n.key, g);
|
|
4056
4056
|
},
|
|
4057
4057
|
rows: 3,
|
|
4058
4058
|
required: a.required,
|
|
@@ -4070,10 +4070,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4070
4070
|
name: a.key,
|
|
4071
4071
|
defaultValue: a.default,
|
|
4072
4072
|
placeholder: a.placeholder,
|
|
4073
|
-
value:
|
|
4073
|
+
value: c[a.key] || "",
|
|
4074
4074
|
onChange: (m) => {
|
|
4075
|
-
const g = { ...
|
|
4076
|
-
|
|
4075
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4076
|
+
i(g), s && s(n.key, g);
|
|
4077
4077
|
},
|
|
4078
4078
|
required: a.required,
|
|
4079
4079
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4087,10 +4087,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4087
4087
|
Aa,
|
|
4088
4088
|
{
|
|
4089
4089
|
name: a.key,
|
|
4090
|
-
checked: !!(
|
|
4090
|
+
checked: !!(c[a.key] || a.default),
|
|
4091
4091
|
onChange: (m) => {
|
|
4092
|
-
const g = { ...
|
|
4093
|
-
|
|
4092
|
+
const g = { ...c, [a.key]: m };
|
|
4093
|
+
i(g), s && s(n.key, g);
|
|
4094
4094
|
},
|
|
4095
4095
|
label: a.placeholder || a.label,
|
|
4096
4096
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4105,10 +4105,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4105
4105
|
{
|
|
4106
4106
|
name: a.key,
|
|
4107
4107
|
defaultValue: a.default,
|
|
4108
|
-
value:
|
|
4108
|
+
value: c[a.key] || "",
|
|
4109
4109
|
onChange: (m) => {
|
|
4110
|
-
const g = { ...
|
|
4111
|
-
|
|
4110
|
+
const g = { ...c, [a.key]: m };
|
|
4111
|
+
i(g);
|
|
4112
4112
|
},
|
|
4113
4113
|
options: a.options || [],
|
|
4114
4114
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4127,10 +4127,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4127
4127
|
name: a.key,
|
|
4128
4128
|
defaultValue: a.default,
|
|
4129
4129
|
placeholder: a.placeholder || "Enter email address",
|
|
4130
|
-
value:
|
|
4130
|
+
value: c[a.key] || "",
|
|
4131
4131
|
onChange: (m) => {
|
|
4132
|
-
const g = { ...
|
|
4133
|
-
|
|
4132
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4133
|
+
i(g), s && s(n.key, g);
|
|
4134
4134
|
},
|
|
4135
4135
|
required: a.required,
|
|
4136
4136
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4147,10 +4147,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4147
4147
|
name: a.key,
|
|
4148
4148
|
defaultValue: a.default,
|
|
4149
4149
|
placeholder: a.placeholder || "Enter URL",
|
|
4150
|
-
value:
|
|
4150
|
+
value: c[a.key] || "",
|
|
4151
4151
|
onChange: (m) => {
|
|
4152
|
-
const g = { ...
|
|
4153
|
-
|
|
4152
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4153
|
+
i(g), s && s(n.key, g);
|
|
4154
4154
|
},
|
|
4155
4155
|
required: a.required,
|
|
4156
4156
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4167,10 +4167,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4167
4167
|
name: a.key,
|
|
4168
4168
|
defaultValue: a.default,
|
|
4169
4169
|
placeholder: a.placeholder || "Enter password",
|
|
4170
|
-
value:
|
|
4170
|
+
value: c[a.key] || "",
|
|
4171
4171
|
onChange: (m) => {
|
|
4172
|
-
const g = { ...
|
|
4173
|
-
|
|
4172
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4173
|
+
i(g), s && s(n.key, g);
|
|
4174
4174
|
},
|
|
4175
4175
|
required: a.required,
|
|
4176
4176
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4183,10 +4183,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4183
4183
|
/* @__PURE__ */ e(
|
|
4184
4184
|
qe,
|
|
4185
4185
|
{
|
|
4186
|
-
selectedItems:
|
|
4186
|
+
selectedItems: c[a.key] || [],
|
|
4187
4187
|
onSelectionChange: (m) => {
|
|
4188
|
-
const g = { ...
|
|
4189
|
-
|
|
4188
|
+
const g = { ...c, [a.key]: m };
|
|
4189
|
+
i(g), s && s(n.key, g);
|
|
4190
4190
|
},
|
|
4191
4191
|
options: a.options || [],
|
|
4192
4192
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4200,11 +4200,11 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4200
4200
|
/* @__PURE__ */ e(
|
|
4201
4201
|
Ma,
|
|
4202
4202
|
{
|
|
4203
|
-
checked: typeof
|
|
4203
|
+
checked: typeof c[a.key] == "boolean" ? c[a.key] : a.default,
|
|
4204
4204
|
onChange: (m) => {
|
|
4205
4205
|
console.log("Toggle changed:", a.key, m);
|
|
4206
|
-
const g = { ...
|
|
4207
|
-
|
|
4206
|
+
const g = { ...c, [a.key]: m };
|
|
4207
|
+
i(g), s && s(n.key, g);
|
|
4208
4208
|
},
|
|
4209
4209
|
label: a.placeholder || a.label,
|
|
4210
4210
|
disabled: a.disabled ? a.disabled : !1
|
|
@@ -4216,10 +4216,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4216
4216
|
za,
|
|
4217
4217
|
{
|
|
4218
4218
|
label: a.label,
|
|
4219
|
-
value:
|
|
4219
|
+
value: c[a.key] ? new Date(c[a.key]) : null,
|
|
4220
4220
|
onChange: (m) => {
|
|
4221
|
-
const g = { ...
|
|
4222
|
-
|
|
4221
|
+
const g = { ...c, [a.key]: m ? m.toISOString().split("T")[0] : "" };
|
|
4222
|
+
i(g), s && s(n.key, g);
|
|
4223
4223
|
},
|
|
4224
4224
|
placeholder: a.placeholder || "Select date",
|
|
4225
4225
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4231,10 +4231,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4231
4231
|
Gr,
|
|
4232
4232
|
{
|
|
4233
4233
|
label: a.label,
|
|
4234
|
-
value:
|
|
4234
|
+
value: c[a.key] || { from: null, to: null },
|
|
4235
4235
|
onChange: (m) => {
|
|
4236
|
-
const g = { ...
|
|
4237
|
-
|
|
4236
|
+
const g = { ...c, [a.key]: m };
|
|
4237
|
+
i(g), s && s(n.key, g);
|
|
4238
4238
|
},
|
|
4239
4239
|
placeholder: a.placeholder || "Select date range",
|
|
4240
4240
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4246,10 +4246,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4246
4246
|
/* @__PURE__ */ e(
|
|
4247
4247
|
Ba,
|
|
4248
4248
|
{
|
|
4249
|
-
selectedValue: typeof
|
|
4249
|
+
selectedValue: typeof c[a.key] < "u" ? c[a.key] : a.default || "",
|
|
4250
4250
|
onValueChange: (m) => {
|
|
4251
|
-
const g = { ...
|
|
4252
|
-
|
|
4251
|
+
const g = { ...c, [a.key]: m };
|
|
4252
|
+
i(g), s && s(n.key, g);
|
|
4253
4253
|
},
|
|
4254
4254
|
options: a.options || [],
|
|
4255
4255
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4267,10 +4267,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4267
4267
|
id: `${a.key}-${m.value}`,
|
|
4268
4268
|
name: a.key,
|
|
4269
4269
|
value: m.value,
|
|
4270
|
-
checked:
|
|
4270
|
+
checked: c[a.key] === m.value,
|
|
4271
4271
|
onChange: (g) => {
|
|
4272
|
-
const $ = { ...
|
|
4273
|
-
|
|
4272
|
+
const $ = { ...c, [a.key]: g.target.value };
|
|
4273
|
+
i($), s && s(n.key, $);
|
|
4274
4274
|
},
|
|
4275
4275
|
disabled: a.disabled
|
|
4276
4276
|
}
|
|
@@ -4286,10 +4286,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4286
4286
|
/* @__PURE__ */ e(
|
|
4287
4287
|
he,
|
|
4288
4288
|
{
|
|
4289
|
-
value:
|
|
4289
|
+
value: c[a.key] || "",
|
|
4290
4290
|
onChange: (m) => {
|
|
4291
|
-
const g = { ...
|
|
4292
|
-
|
|
4291
|
+
const g = { ...c, [a.key]: m };
|
|
4292
|
+
i(g), s && s(n.key, g);
|
|
4293
4293
|
},
|
|
4294
4294
|
placeholder: a.placeholder || `Search ${a.label}`,
|
|
4295
4295
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4305,10 +4305,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4305
4305
|
name: a.key,
|
|
4306
4306
|
defaultValue: a.default,
|
|
4307
4307
|
placeholder: a.placeholder || "Select date and time",
|
|
4308
|
-
value:
|
|
4308
|
+
value: c[a.key] || "",
|
|
4309
4309
|
onChange: (m) => {
|
|
4310
|
-
const g = { ...
|
|
4311
|
-
|
|
4310
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4311
|
+
i(g), s && s(n.key, g);
|
|
4312
4312
|
},
|
|
4313
4313
|
required: a.required,
|
|
4314
4314
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4324,10 +4324,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4324
4324
|
name: a.key,
|
|
4325
4325
|
defaultValue: a.default,
|
|
4326
4326
|
placeholder: a.placeholder || "Select time",
|
|
4327
|
-
value:
|
|
4327
|
+
value: c[a.key] || "",
|
|
4328
4328
|
onChange: (m) => {
|
|
4329
|
-
const g = { ...
|
|
4330
|
-
|
|
4329
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4330
|
+
i(g), s && s(n.key, g);
|
|
4331
4331
|
},
|
|
4332
4332
|
required: a.required,
|
|
4333
4333
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4342,10 +4342,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4342
4342
|
type: "color",
|
|
4343
4343
|
name: a.key,
|
|
4344
4344
|
defaultValue: a.default || "#000000",
|
|
4345
|
-
value:
|
|
4345
|
+
value: c[a.key] || "#000000",
|
|
4346
4346
|
onChange: (m) => {
|
|
4347
|
-
const g = { ...
|
|
4348
|
-
|
|
4347
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4348
|
+
i(g), s && s(n.key, g);
|
|
4349
4349
|
},
|
|
4350
4350
|
className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
4351
4351
|
}
|
|
@@ -4359,10 +4359,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4359
4359
|
type: "range",
|
|
4360
4360
|
name: a.key,
|
|
4361
4361
|
defaultValue: a.default || a.min || 0,
|
|
4362
|
-
value:
|
|
4362
|
+
value: c[a.key] || a.min || 0,
|
|
4363
4363
|
onChange: (m) => {
|
|
4364
|
-
const g = { ...
|
|
4365
|
-
|
|
4364
|
+
const g = { ...c, [a.key]: m.target.value };
|
|
4365
|
+
i(g), s && s(n.key, g);
|
|
4366
4366
|
},
|
|
4367
4367
|
min: a.min || 0,
|
|
4368
4368
|
max: a.max || 100,
|
|
@@ -4374,7 +4374,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4374
4374
|
/* @__PURE__ */ e("span", { children: a.min || 0 }),
|
|
4375
4375
|
/* @__PURE__ */ l("span", { children: [
|
|
4376
4376
|
"Current: ",
|
|
4377
|
-
|
|
4377
|
+
c[a.key] || a.min || 0
|
|
4378
4378
|
] }),
|
|
4379
4379
|
/* @__PURE__ */ e("span", { children: a.max || 100 })
|
|
4380
4380
|
] }),
|
|
@@ -4387,8 +4387,8 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4387
4387
|
type: "file",
|
|
4388
4388
|
name: a.key,
|
|
4389
4389
|
onChange: (m) => {
|
|
4390
|
-
const g = m.target.files[0], $ = { ...
|
|
4391
|
-
|
|
4390
|
+
const g = m.target.files[0], $ = { ...c, [a.key]: g ? g.name : "" };
|
|
4391
|
+
i($), s && s(n.key, $);
|
|
4392
4392
|
},
|
|
4393
4393
|
accept: a.accept,
|
|
4394
4394
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4401,11 +4401,11 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4401
4401
|
Qa,
|
|
4402
4402
|
{
|
|
4403
4403
|
endpoints: a.endpoints || {},
|
|
4404
|
-
initialData:
|
|
4404
|
+
initialData: c[a.key] || a.initialData || [],
|
|
4405
4405
|
className: a.className || "",
|
|
4406
4406
|
onCollectionChange: (m) => {
|
|
4407
|
-
const g = { ...
|
|
4408
|
-
|
|
4407
|
+
const g = { ...c, [a.key]: m };
|
|
4408
|
+
i(g), s && s(n.key, g);
|
|
4409
4409
|
},
|
|
4410
4410
|
showSearch: a.showSearch !== !1,
|
|
4411
4411
|
allowAdd: a.allowAdd !== !1,
|
|
@@ -4433,7 +4433,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4433
4433
|
const Tn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4434
4434
|
function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
4435
4435
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4436
|
-
const [n, u] = L(t), [
|
|
4436
|
+
const [n, u] = L(t), [c, i] = L(null), [y, b] = L(null);
|
|
4437
4437
|
console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
|
|
4438
4438
|
const [N, a] = L(() => {
|
|
4439
4439
|
const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
|
|
@@ -4457,8 +4457,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4457
4457
|
const $ = (v) => {
|
|
4458
4458
|
const p = (d, h) => {
|
|
4459
4459
|
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: h, type: typeof h }), a((x) => {
|
|
4460
|
-
const
|
|
4461
|
-
return
|
|
4460
|
+
const F = [...x];
|
|
4461
|
+
return F[d][v.key] = h, F;
|
|
4462
4462
|
});
|
|
4463
4463
|
}, f = (d) => o[n.key]?.[d]?.[v.key], k = (d) => {
|
|
4464
4464
|
const h = f(d);
|
|
@@ -4574,12 +4574,12 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4574
4574
|
return (d, h) => {
|
|
4575
4575
|
const x = () => {
|
|
4576
4576
|
if (v.optionsFrom && r) {
|
|
4577
|
-
const { config:
|
|
4578
|
-
if (Array.isArray(
|
|
4579
|
-
return
|
|
4580
|
-
id:
|
|
4581
|
-
value:
|
|
4582
|
-
label:
|
|
4577
|
+
const { config: F, valueField: z, labelField: q } = v.optionsFrom, D = r[F] || [];
|
|
4578
|
+
if (Array.isArray(D))
|
|
4579
|
+
return D.map((A) => ({
|
|
4580
|
+
id: A[z] || "",
|
|
4581
|
+
value: A[z] || "",
|
|
4582
|
+
label: A[q] || ""
|
|
4583
4583
|
}));
|
|
4584
4584
|
}
|
|
4585
4585
|
return v.options || [];
|
|
@@ -4590,7 +4590,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4590
4590
|
{
|
|
4591
4591
|
index: h,
|
|
4592
4592
|
value: d[v.key] || "",
|
|
4593
|
-
onChange: (
|
|
4593
|
+
onChange: (F) => p(h, F),
|
|
4594
4594
|
options: x(),
|
|
4595
4595
|
placeholder: v.placeholder || `Select ${v.label}`,
|
|
4596
4596
|
required: v.required,
|
|
@@ -4608,7 +4608,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4608
4608
|
qe,
|
|
4609
4609
|
{
|
|
4610
4610
|
selectedItems: x,
|
|
4611
|
-
onSelectionChange: (
|
|
4611
|
+
onSelectionChange: (F) => p(h, F),
|
|
4612
4612
|
options: v.options || [],
|
|
4613
4613
|
placeholder: v.placeholder || `Select ${v.label}`,
|
|
4614
4614
|
className: "w-full"
|
|
@@ -4693,29 +4693,29 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4693
4693
|
);
|
|
4694
4694
|
case "audience":
|
|
4695
4695
|
return (d, h) => {
|
|
4696
|
-
const x = d[v.key] || { users: [], groups: [], roles: [] },
|
|
4696
|
+
const x = d[v.key] || { users: [], groups: [], roles: [] }, F = [
|
|
4697
4697
|
...x.users || [],
|
|
4698
4698
|
...x.groups || [],
|
|
4699
4699
|
...x.roles || []
|
|
4700
4700
|
];
|
|
4701
4701
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4702
|
-
/* @__PURE__ */ e(Tn, { children:
|
|
4702
|
+
/* @__PURE__ */ e(Tn, { children: F.length > 0 ? F.slice(0, 3).map((z, q) => /* @__PURE__ */ e(
|
|
4703
4703
|
Ta,
|
|
4704
4704
|
{
|
|
4705
4705
|
size: "small",
|
|
4706
|
-
name:
|
|
4707
|
-
src:
|
|
4706
|
+
name: z.name || z.displayName || z.id,
|
|
4707
|
+
src: z.avatarUrl
|
|
4708
4708
|
},
|
|
4709
|
-
|
|
4709
|
+
q
|
|
4710
4710
|
)) : null }),
|
|
4711
4711
|
/* @__PURE__ */ e(
|
|
4712
4712
|
"button",
|
|
4713
4713
|
{
|
|
4714
4714
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4715
4715
|
onClick: () => {
|
|
4716
|
-
b(v.key),
|
|
4716
|
+
b(v.key), i(h);
|
|
4717
4717
|
},
|
|
4718
|
-
children:
|
|
4718
|
+
children: F.length > 0 ? "Edit" : "Assign"
|
|
4719
4719
|
}
|
|
4720
4720
|
)
|
|
4721
4721
|
] });
|
|
@@ -4752,8 +4752,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4752
4752
|
{
|
|
4753
4753
|
type: "file",
|
|
4754
4754
|
onChange: (x) => {
|
|
4755
|
-
const
|
|
4756
|
-
p(h,
|
|
4755
|
+
const F = x.target.files[0];
|
|
4756
|
+
p(h, F ? F.name : "");
|
|
4757
4757
|
},
|
|
4758
4758
|
accept: v.accept,
|
|
4759
4759
|
className: "w-full"
|
|
@@ -4784,7 +4784,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4784
4784
|
k(h)
|
|
4785
4785
|
] });
|
|
4786
4786
|
}
|
|
4787
|
-
},
|
|
4787
|
+
}, O = K(() => {
|
|
4788
4788
|
console.log("[DataTableRenderer] Adding blank row"), a((v) => {
|
|
4789
4789
|
console.log("[DataTableRenderer] Current data before add:", v);
|
|
4790
4790
|
const p = {
|
|
@@ -4797,38 +4797,38 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4797
4797
|
const f = [...v, p];
|
|
4798
4798
|
return console.log("[DataTableRenderer] Updated data:", f), f;
|
|
4799
4799
|
});
|
|
4800
|
-
}, [n.fields]),
|
|
4800
|
+
}, [n.fields]), R = K((v) => {
|
|
4801
4801
|
a((p) => {
|
|
4802
4802
|
if (p.length <= 1)
|
|
4803
4803
|
return p;
|
|
4804
4804
|
const f = [...p];
|
|
4805
4805
|
return f.splice(v, 1), f;
|
|
4806
4806
|
});
|
|
4807
|
-
}, []), [S,
|
|
4808
|
-
|
|
4809
|
-
}, []),
|
|
4807
|
+
}, []), [S, B] = L(null), P = K((v, p) => {
|
|
4808
|
+
B(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
|
|
4809
|
+
}, []), E = K((v) => {
|
|
4810
4810
|
v.preventDefault(), v.dataTransfer.dropEffect = "move";
|
|
4811
|
-
}, []),
|
|
4811
|
+
}, []), V = K((v, p) => {
|
|
4812
4812
|
v.preventDefault(), !(S === null || S === p) && (a((f) => {
|
|
4813
4813
|
const k = [...f], d = k[S];
|
|
4814
4814
|
return k.splice(S, 1), k.splice(p, 0, d), k;
|
|
4815
|
-
}),
|
|
4815
|
+
}), B(null));
|
|
4816
4816
|
}, [S]), U = K(() => {
|
|
4817
|
-
|
|
4818
|
-
}, []),
|
|
4817
|
+
B(null);
|
|
4818
|
+
}, []), j = K((v) => {
|
|
4819
4819
|
console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
|
|
4820
4820
|
const f = [...p];
|
|
4821
|
-
if (
|
|
4822
|
-
const k = v.pendingInvites || [], d = k.filter((
|
|
4823
|
-
f[
|
|
4824
|
-
users: [...f[
|
|
4825
|
-
groups: [...f[
|
|
4826
|
-
roles: [...f[
|
|
4827
|
-
}, console.log("[DataTableRenderer] Updated audience data:", f[
|
|
4821
|
+
if (c !== null && y && f[c]) {
|
|
4822
|
+
const k = v.pendingInvites || [], d = k.filter((F) => F.type === "User"), h = k.filter((F) => F.type === "Group"), x = k.filter((F) => F.type === "Role");
|
|
4823
|
+
f[c][y] = {
|
|
4824
|
+
users: [...f[c][y]?.users || [], ...d],
|
|
4825
|
+
groups: [...f[c][y]?.groups || [], ...h],
|
|
4826
|
+
roles: [...f[c][y]?.roles || [], ...x]
|
|
4827
|
+
}, console.log("[DataTableRenderer] Updated audience data:", f[c][y]);
|
|
4828
4828
|
}
|
|
4829
4829
|
return f;
|
|
4830
|
-
}),
|
|
4831
|
-
}, [
|
|
4830
|
+
}), i(null), b(null);
|
|
4831
|
+
}, [c, y]);
|
|
4832
4832
|
return /* @__PURE__ */ l("div", { children: [
|
|
4833
4833
|
/* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
|
|
4834
4834
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4837,7 +4837,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4837
4837
|
"button",
|
|
4838
4838
|
{
|
|
4839
4839
|
className: "btn btn-primary text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
|
|
4840
|
-
onClick:
|
|
4840
|
+
onClick: O,
|
|
4841
4841
|
children: "Add"
|
|
4842
4842
|
}
|
|
4843
4843
|
)
|
|
@@ -4862,9 +4862,9 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4862
4862
|
{
|
|
4863
4863
|
className: `hover:bg-gray-50 ${S === p ? "opacity-50" : ""}`,
|
|
4864
4864
|
draggable: !0,
|
|
4865
|
-
onDragStart: (f) =>
|
|
4866
|
-
onDragOver:
|
|
4867
|
-
onDrop: (f) =>
|
|
4865
|
+
onDragStart: (f) => P(f, p),
|
|
4866
|
+
onDragOver: E,
|
|
4867
|
+
onDrop: (f) => V(f, p),
|
|
4868
4868
|
onDragEnd: U,
|
|
4869
4869
|
children: [
|
|
4870
4870
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(ea, { size: 16 }) }) }),
|
|
@@ -4872,7 +4872,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4872
4872
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
4873
4873
|
"button",
|
|
4874
4874
|
{
|
|
4875
|
-
onClick: () =>
|
|
4875
|
+
onClick: () => R(p),
|
|
4876
4876
|
className: "text-red-500 hover:text-red-700",
|
|
4877
4877
|
title: "Delete row",
|
|
4878
4878
|
children: /* @__PURE__ */ e(Gt, { size: 16 })
|
|
@@ -4883,20 +4883,20 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4883
4883
|
p
|
|
4884
4884
|
)) })
|
|
4885
4885
|
] }) }),
|
|
4886
|
-
|
|
4887
|
-
const v = N[
|
|
4888
|
-
users: N[
|
|
4889
|
-
groups: N[
|
|
4890
|
-
roles: N[
|
|
4886
|
+
c !== null && (() => {
|
|
4887
|
+
const v = N[c] && N[c][y] ? {
|
|
4888
|
+
users: N[c][y].users || [],
|
|
4889
|
+
groups: N[c][y].groups || [],
|
|
4890
|
+
roles: N[c][y].roles || []
|
|
4891
4891
|
} : { users: [], groups: [], roles: [] };
|
|
4892
|
-
return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[
|
|
4892
|
+
return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[c]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
|
|
4893
4893
|
fn,
|
|
4894
4894
|
{
|
|
4895
4895
|
isOpen: !0,
|
|
4896
4896
|
onClose: () => {
|
|
4897
|
-
|
|
4897
|
+
i(null), b(null);
|
|
4898
4898
|
},
|
|
4899
|
-
onFinalSubmit:
|
|
4899
|
+
onFinalSubmit: j,
|
|
4900
4900
|
existingShares: v,
|
|
4901
4901
|
allowedPermissions: ["view", "remove"]
|
|
4902
4902
|
}
|
|
@@ -4966,127 +4966,127 @@ const ma = () => {
|
|
|
4966
4966
|
showSearch: o = !0,
|
|
4967
4967
|
allowAdd: n = !0,
|
|
4968
4968
|
allowEdit: u = !0,
|
|
4969
|
-
allowDelete:
|
|
4970
|
-
allowReorder:
|
|
4969
|
+
allowDelete: c = !0,
|
|
4970
|
+
allowReorder: i = !0,
|
|
4971
4971
|
initialData: y = null
|
|
4972
4972
|
// Add prop for initial demo data
|
|
4973
4973
|
}) => {
|
|
4974
|
-
const [b, N] = L(null), [a, w] = L(""), [m, g] = L(() => Array.isArray(y) ? y : []), [$,
|
|
4974
|
+
const [b, N] = L(null), [a, w] = L(""), [m, g] = L(() => Array.isArray(y) ? y : []), [$, O] = L(null), [R, S] = L(null), [B, P] = L(""), E = async () => {
|
|
4975
4975
|
try {
|
|
4976
|
-
const
|
|
4977
|
-
if (
|
|
4978
|
-
const
|
|
4979
|
-
...
|
|
4980
|
-
order: typeof
|
|
4976
|
+
const D = await $e(t.collectionList);
|
|
4977
|
+
if (D) {
|
|
4978
|
+
const A = D.map((M, T) => ({
|
|
4979
|
+
...M,
|
|
4980
|
+
order: typeof M.order == "number" ? M.order : T + 1
|
|
4981
4981
|
}));
|
|
4982
|
-
|
|
4982
|
+
A.sort((M, T) => (M.order ?? 0) - (T.order ?? 0)), g(A), s?.(A);
|
|
4983
4983
|
}
|
|
4984
|
-
} catch (
|
|
4985
|
-
console.log("Error loading collections:",
|
|
4984
|
+
} catch (D) {
|
|
4985
|
+
console.log("Error loading collections:", D), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
|
|
4986
4986
|
}
|
|
4987
4987
|
};
|
|
4988
4988
|
Q(() => {
|
|
4989
|
-
(!y || y.length === 0) &&
|
|
4989
|
+
(!y || y.length === 0) && E();
|
|
4990
4990
|
}, [y]), Q(() => {
|
|
4991
4991
|
Array.isArray(y) && g(y);
|
|
4992
4992
|
}, [y]);
|
|
4993
|
-
const
|
|
4994
|
-
u && (N(
|
|
4993
|
+
const V = (D) => {
|
|
4994
|
+
u && (N(D.id), w(D.categoryName || ""));
|
|
4995
4995
|
}, U = () => {
|
|
4996
4996
|
if (!n || b !== null) return;
|
|
4997
|
-
const
|
|
4998
|
-
g((
|
|
4999
|
-
...
|
|
4997
|
+
const D = `temp-${Date.now()}`;
|
|
4998
|
+
g((A) => [
|
|
4999
|
+
...A,
|
|
5000
5000
|
{
|
|
5001
|
-
id:
|
|
5001
|
+
id: D,
|
|
5002
5002
|
categoryName: "",
|
|
5003
5003
|
links: [],
|
|
5004
|
-
order: (
|
|
5004
|
+
order: (A.at(-1)?.order ?? 0) + 1,
|
|
5005
5005
|
_temp: !0
|
|
5006
5006
|
}
|
|
5007
|
-
]), N(
|
|
5008
|
-
},
|
|
5009
|
-
b != null && (g((
|
|
5010
|
-
const
|
|
5011
|
-
return s?.(
|
|
5007
|
+
]), N(D), w("");
|
|
5008
|
+
}, j = () => {
|
|
5009
|
+
b != null && (g((D) => {
|
|
5010
|
+
const A = D.find((T) => T.id === b), M = A && A._temp ? D.filter((T) => T.id !== b) : D;
|
|
5011
|
+
return s?.(M), M;
|
|
5012
5012
|
}), N(null), w(""));
|
|
5013
5013
|
}, v = async () => {
|
|
5014
5014
|
if (b == null || !a.trim()) return;
|
|
5015
|
-
const
|
|
5015
|
+
const D = typeof b == "string" && b.startsWith("temp-");
|
|
5016
5016
|
try {
|
|
5017
|
-
if (
|
|
5018
|
-
const
|
|
5017
|
+
if (D) {
|
|
5018
|
+
const A = await Fe(t.collectionCreate, {
|
|
5019
5019
|
categoryName: a.trim(),
|
|
5020
5020
|
order: (Array.isArray(m) && m.length > 0 ? m.at(-1)?.order ?? 0 : 0) + 1
|
|
5021
5021
|
});
|
|
5022
|
-
|
|
5023
|
-
const T =
|
|
5022
|
+
A && (g((M) => {
|
|
5023
|
+
const T = M.map((C) => C.id === b ? A : C);
|
|
5024
5024
|
return s?.(T), T;
|
|
5025
5025
|
}), ve.success("Collection created successfully"));
|
|
5026
5026
|
} else {
|
|
5027
|
-
const
|
|
5027
|
+
const A = await ln(
|
|
5028
5028
|
`${t.collectionUpdate}/${b}?newName=${a.trim()}`
|
|
5029
5029
|
);
|
|
5030
|
-
g((
|
|
5031
|
-
const T =
|
|
5032
|
-
(C) => C.id === b ?
|
|
5030
|
+
g((M) => {
|
|
5031
|
+
const T = M.map(
|
|
5032
|
+
(C) => C.id === b ? A && A.id ? { ...C, ...A } : { ...C, categoryName: a.trim() } : C
|
|
5033
5033
|
);
|
|
5034
5034
|
return s?.(T), T;
|
|
5035
5035
|
}), le.success("Collection updated successfully");
|
|
5036
5036
|
}
|
|
5037
5037
|
N(null), w("");
|
|
5038
|
-
} catch (
|
|
5039
|
-
console.log(
|
|
5038
|
+
} catch (A) {
|
|
5039
|
+
console.log(A), le.error("Failed to save collection");
|
|
5040
5040
|
}
|
|
5041
|
-
}, p = async (
|
|
5042
|
-
if (
|
|
5041
|
+
}, p = async (D) => {
|
|
5042
|
+
if (c)
|
|
5043
5043
|
try {
|
|
5044
|
-
await sn(`${t.collectionUpdate}/${
|
|
5045
|
-
} catch (
|
|
5046
|
-
console.log(
|
|
5044
|
+
await sn(`${t.collectionUpdate}/${D.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
|
|
5045
|
+
} catch (A) {
|
|
5046
|
+
console.log(A), le.error("Failed to delete collection");
|
|
5047
5047
|
}
|
|
5048
|
-
}, f = (
|
|
5049
|
-
if (!
|
|
5050
|
-
const T =
|
|
5051
|
-
if (T === -1 || C === -1) return
|
|
5052
|
-
const
|
|
5053
|
-
return
|
|
5054
|
-
}, k = async (
|
|
5055
|
-
const
|
|
5056
|
-
id:
|
|
5057
|
-
order:
|
|
5058
|
-
categoryName:
|
|
5048
|
+
}, f = (D, A, M) => {
|
|
5049
|
+
if (!i || !A || !M || A === M) return D;
|
|
5050
|
+
const T = D.findIndex((H) => H.id === A), C = D.findIndex((H) => H.id === M);
|
|
5051
|
+
if (T === -1 || C === -1) return D;
|
|
5052
|
+
const I = [...D], [G] = I.splice(T, 1);
|
|
5053
|
+
return I.splice(C, 0, G), I.map((H, ce) => ({ ...H, order: ce + 1 }));
|
|
5054
|
+
}, k = async (D) => {
|
|
5055
|
+
const A = D.map((M) => ({
|
|
5056
|
+
id: M.id,
|
|
5057
|
+
order: M.order,
|
|
5058
|
+
categoryName: M.categoryName
|
|
5059
5059
|
}));
|
|
5060
5060
|
try {
|
|
5061
|
-
await
|
|
5062
|
-
} catch (
|
|
5063
|
-
console.log(
|
|
5061
|
+
await Fe(t.updateCollection, A);
|
|
5062
|
+
} catch (M) {
|
|
5063
|
+
console.log(M), le.error("Failed to save order", { autoClose: 2500 });
|
|
5064
5064
|
}
|
|
5065
|
-
}, d = (
|
|
5066
|
-
|
|
5067
|
-
}, h = (
|
|
5068
|
-
$ &&
|
|
5069
|
-
}, x = (
|
|
5070
|
-
|
|
5071
|
-
},
|
|
5072
|
-
|
|
5073
|
-
const
|
|
5074
|
-
|
|
5075
|
-
const C = f(T,
|
|
5065
|
+
}, d = (D, A) => {
|
|
5066
|
+
i && (D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", String(A)), O(A));
|
|
5067
|
+
}, h = (D) => {
|
|
5068
|
+
$ && D !== R && S(D);
|
|
5069
|
+
}, x = (D) => {
|
|
5070
|
+
D.preventDefault();
|
|
5071
|
+
}, F = async (D, A) => {
|
|
5072
|
+
D.preventDefault();
|
|
5073
|
+
const M = D.dataTransfer.getData("text/plain");
|
|
5074
|
+
M && (g((T) => {
|
|
5075
|
+
const C = f(T, M, A);
|
|
5076
5076
|
return console.log("Reordered", C), k(C), s?.(C), C;
|
|
5077
|
-
}),
|
|
5078
|
-
},
|
|
5079
|
-
|
|
5080
|
-
},
|
|
5081
|
-
(
|
|
5077
|
+
}), O(null), S(null));
|
|
5078
|
+
}, z = () => {
|
|
5079
|
+
O(null), S(null);
|
|
5080
|
+
}, q = Array.isArray(m) ? m.filter(
|
|
5081
|
+
(D) => D.categoryName?.toLowerCase().includes(B.toLowerCase())
|
|
5082
5082
|
) : [];
|
|
5083
5083
|
return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
|
|
5084
5084
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
|
|
5085
5085
|
o && /* @__PURE__ */ e(
|
|
5086
5086
|
he,
|
|
5087
5087
|
{
|
|
5088
|
-
value:
|
|
5089
|
-
onDebouncedChange:
|
|
5088
|
+
value: B,
|
|
5089
|
+
onDebouncedChange: P,
|
|
5090
5090
|
placeholder: "Search Collection",
|
|
5091
5091
|
customClass: "mr-4 searchmanagecollection"
|
|
5092
5092
|
}
|
|
@@ -5104,32 +5104,32 @@ const ma = () => {
|
|
|
5104
5104
|
}
|
|
5105
5105
|
)
|
|
5106
5106
|
] }) }),
|
|
5107
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5108
|
-
const
|
|
5107
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: q.map((D) => {
|
|
5108
|
+
const A = b === D.id, M = D?.links?.length ?? 0, T = $ === D.id, C = R === D.id && $ !== D.id;
|
|
5109
5109
|
return /* @__PURE__ */ e(
|
|
5110
5110
|
"div",
|
|
5111
5111
|
{
|
|
5112
|
-
onDragEnter: () => h(
|
|
5112
|
+
onDragEnter: () => h(D.id),
|
|
5113
5113
|
onDragOver: x,
|
|
5114
|
-
onDrop: (
|
|
5115
|
-
onDragEnd:
|
|
5114
|
+
onDrop: (I) => F(I, D.id),
|
|
5115
|
+
onDragEnd: z,
|
|
5116
5116
|
className: [
|
|
5117
5117
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5118
5118
|
"border-gray-300",
|
|
5119
5119
|
C ? "ring-2 ring-gray-800/20" : "",
|
|
5120
5120
|
T ? "opacity-60" : ""
|
|
5121
5121
|
].join(" "),
|
|
5122
|
-
children:
|
|
5122
|
+
children: A ? /* @__PURE__ */ l(ee, { children: [
|
|
5123
5123
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
5124
5124
|
"input",
|
|
5125
5125
|
{
|
|
5126
5126
|
type: "text",
|
|
5127
5127
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5128
5128
|
value: a,
|
|
5129
|
-
placeholder:
|
|
5130
|
-
onChange: (
|
|
5131
|
-
onKeyDown: (
|
|
5132
|
-
|
|
5129
|
+
placeholder: D._temp ? "New collection name" : "Edit collection name",
|
|
5130
|
+
onChange: (I) => w(I.target.value),
|
|
5131
|
+
onKeyDown: (I) => {
|
|
5132
|
+
I.key === "Enter" && v(), I.key === "Escape" && j();
|
|
5133
5133
|
},
|
|
5134
5134
|
autoFocus: !0
|
|
5135
5135
|
}
|
|
@@ -5139,7 +5139,7 @@ const ma = () => {
|
|
|
5139
5139
|
"button",
|
|
5140
5140
|
{
|
|
5141
5141
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5142
|
-
onClick:
|
|
5142
|
+
onClick: j,
|
|
5143
5143
|
"aria-label": "Cancel edit",
|
|
5144
5144
|
children: /* @__PURE__ */ e(ge, { color: "#767676" })
|
|
5145
5145
|
}
|
|
@@ -5161,43 +5161,43 @@ const ma = () => {
|
|
|
5161
5161
|
] })
|
|
5162
5162
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
5163
5163
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5164
|
-
|
|
5164
|
+
i && /* @__PURE__ */ e(
|
|
5165
5165
|
"span",
|
|
5166
5166
|
{
|
|
5167
5167
|
role: "button",
|
|
5168
5168
|
"aria-label": "Drag to reorder",
|
|
5169
5169
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5170
5170
|
draggable: !0,
|
|
5171
|
-
onDragStart: (
|
|
5171
|
+
onDragStart: (I) => d(I, D.id),
|
|
5172
5172
|
children: /* @__PURE__ */ e(ea, {})
|
|
5173
5173
|
}
|
|
5174
5174
|
),
|
|
5175
|
-
/* @__PURE__ */ e("span", { children:
|
|
5175
|
+
/* @__PURE__ */ e("span", { children: D.categoryName })
|
|
5176
5176
|
] }),
|
|
5177
5177
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5178
|
-
|
|
5178
|
+
D.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: D.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${M} ${M === 1 ? "link" : "links"}` }),
|
|
5179
5179
|
u && /* @__PURE__ */ e(
|
|
5180
5180
|
"button",
|
|
5181
5181
|
{
|
|
5182
5182
|
className: "cursor-pointer",
|
|
5183
|
-
onClick: () =>
|
|
5184
|
-
"aria-label": `Edit ${
|
|
5183
|
+
onClick: () => V(D),
|
|
5184
|
+
"aria-label": `Edit ${D.categoryName}`,
|
|
5185
5185
|
children: /* @__PURE__ */ e(_t, { color: "#767676" })
|
|
5186
5186
|
}
|
|
5187
5187
|
),
|
|
5188
|
-
|
|
5188
|
+
c && /* @__PURE__ */ e(
|
|
5189
5189
|
"span",
|
|
5190
5190
|
{
|
|
5191
|
-
className:
|
|
5192
|
-
title:
|
|
5193
|
-
onClick:
|
|
5194
|
-
children: /* @__PURE__ */ e(Pe, { color:
|
|
5191
|
+
className: M === 0 && !D.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5192
|
+
title: M === 0 && !D.protected ? "Delete" : "Cannot delete this collection",
|
|
5193
|
+
onClick: M === 0 ? () => p(D) : null,
|
|
5194
|
+
children: /* @__PURE__ */ e(Pe, { color: M === 0 ? "#767676" : "#C2C2C2" })
|
|
5195
5195
|
}
|
|
5196
5196
|
)
|
|
5197
5197
|
] })
|
|
5198
5198
|
] })
|
|
5199
5199
|
},
|
|
5200
|
-
|
|
5200
|
+
D.id
|
|
5201
5201
|
);
|
|
5202
5202
|
}) })
|
|
5203
5203
|
] });
|
|
@@ -5206,14 +5206,14 @@ const ma = () => {
|
|
|
5206
5206
|
label: o = "Manage Collections",
|
|
5207
5207
|
description: n = "",
|
|
5208
5208
|
endpoints: u = {},
|
|
5209
|
-
initialData:
|
|
5210
|
-
showSearch:
|
|
5209
|
+
initialData: c = null,
|
|
5210
|
+
showSearch: i = !0,
|
|
5211
5211
|
allowAdd: y = !0,
|
|
5212
5212
|
allowEdit: b = !0,
|
|
5213
5213
|
allowDelete: N = !0,
|
|
5214
5214
|
allowReorder: a = !0,
|
|
5215
5215
|
className: w = ""
|
|
5216
|
-
} = t, m = r?.[t.key] ||
|
|
5216
|
+
} = t, m = r?.[t.key] || c || [], g = Array.isArray(m) ? m : [];
|
|
5217
5217
|
return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5218
5218
|
(o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
5219
5219
|
o && /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 mb-1", children: o }),
|
|
@@ -5225,10 +5225,10 @@ const ma = () => {
|
|
|
5225
5225
|
endpoints: u,
|
|
5226
5226
|
initialData: g,
|
|
5227
5227
|
className: w,
|
|
5228
|
-
onCollectionChange: (
|
|
5229
|
-
s && s(t.key,
|
|
5228
|
+
onCollectionChange: (O) => {
|
|
5229
|
+
s && s(t.key, O);
|
|
5230
5230
|
},
|
|
5231
|
-
showSearch:
|
|
5231
|
+
showSearch: i,
|
|
5232
5232
|
allowAdd: y,
|
|
5233
5233
|
allowEdit: b,
|
|
5234
5234
|
allowDelete: N,
|
|
@@ -5241,7 +5241,7 @@ const ma = () => {
|
|
|
5241
5241
|
" ",
|
|
5242
5242
|
/* @__PURE__ */ e("span", { className: "font-mono", children: String(t?.type ?? "N/A") })
|
|
5243
5243
|
] }), xe = /* @__PURE__ */ Object.create(null);
|
|
5244
|
-
xe.section =
|
|
5244
|
+
xe.section = Fn;
|
|
5245
5245
|
xe.datatable = An;
|
|
5246
5246
|
xe.managecollectionlist = Xa;
|
|
5247
5247
|
xe["manage-collection-list"] = Xa;
|
|
@@ -5259,36 +5259,36 @@ function Bn({
|
|
|
5259
5259
|
onCancel: o,
|
|
5260
5260
|
onSave: n
|
|
5261
5261
|
}) {
|
|
5262
|
-
const [u,
|
|
5262
|
+
const [u, c] = re.useState(r), [i, y] = re.useState(null), [b, N] = L(!1), [a, w] = L(!1), [m, g] = L({}), $ = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, O = $, [R, S] = L(1), B = (f) => {
|
|
5263
5263
|
if (!r || !r.configuration)
|
|
5264
5264
|
return f;
|
|
5265
5265
|
const k = {}, d = f?.configuration || {};
|
|
5266
5266
|
return r.configuration.forEach((h) => {
|
|
5267
|
-
if (h.key && h.type === "datatable"
|
|
5268
|
-
const
|
|
5269
|
-
|
|
5270
|
-
return
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
};
|
|
5267
|
+
if (h.key && h.type === "datatable") {
|
|
5268
|
+
const F = (d[h.key] || []).map((z, q) => {
|
|
5269
|
+
const D = { id: z.id || 0 };
|
|
5270
|
+
return h.fields && h.fields.forEach((A) => {
|
|
5271
|
+
if (A.fieldtype === "audience") {
|
|
5272
|
+
let M = { users: [], groups: [], roles: [] };
|
|
5273
|
+
z[A.key] && (Array.isArray(z[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof z[A.key] == "object" && (M = {
|
|
5274
|
+
users: z[A.key].users || [],
|
|
5275
|
+
groups: z[A.key].groups || [],
|
|
5276
|
+
roles: z[A.key].roles || []
|
|
5277
|
+
})), D[A.key] = M;
|
|
5278
|
+
} else
|
|
5279
|
+
D[A.key] = z[A.key] || A.default || "";
|
|
5280
|
+
}), D;
|
|
5281
5281
|
});
|
|
5282
|
-
if (
|
|
5283
|
-
const
|
|
5284
|
-
h.fields && h.fields.forEach((
|
|
5285
|
-
|
|
5286
|
-
}),
|
|
5282
|
+
if (F.length === 0) {
|
|
5283
|
+
const z = { id: 0 };
|
|
5284
|
+
h.fields && h.fields.forEach((q) => {
|
|
5285
|
+
q.fieldtype === "audience" ? z[q.key] = { users: [], groups: [], roles: [] } : z[q.key] = q.default || "";
|
|
5286
|
+
}), F.push(z);
|
|
5287
5287
|
}
|
|
5288
|
-
k[h.key] =
|
|
5288
|
+
k[h.key] = F;
|
|
5289
5289
|
} else h.key && (k[h.key] = d[h.key] || {});
|
|
5290
5290
|
}), k;
|
|
5291
|
-
},
|
|
5291
|
+
}, P = () => {
|
|
5292
5292
|
if (r && r.configuration) {
|
|
5293
5293
|
const f = {};
|
|
5294
5294
|
r.configuration.forEach((k) => {
|
|
@@ -5316,12 +5316,12 @@ function Bn({
|
|
|
5316
5316
|
const f = async () => {
|
|
5317
5317
|
try {
|
|
5318
5318
|
N(!0);
|
|
5319
|
-
let k = await
|
|
5319
|
+
let k = await $e($);
|
|
5320
5320
|
if (k) {
|
|
5321
|
-
const d =
|
|
5321
|
+
const d = B(k);
|
|
5322
5322
|
y(d);
|
|
5323
5323
|
} else
|
|
5324
|
-
|
|
5324
|
+
P();
|
|
5325
5325
|
} catch (k) {
|
|
5326
5326
|
console.error("Error fetching configuration:", k);
|
|
5327
5327
|
let d = "Failed to load configuration";
|
|
@@ -5329,14 +5329,14 @@ function Bn({
|
|
|
5329
5329
|
const h = k.response.status, x = k.response.data?.message || k.response.data?.error;
|
|
5330
5330
|
h === 400 ? d = x || "Invalid request. Please check the application ID." : h === 401 ? d = "You are not authorized to access this configuration." : h === 403 ? d = "Access denied. You don't have permission to view this configuration." : h === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? d = x || "Server error. Please try again later." : d = x || `Failed to load configuration (Error ${h})`;
|
|
5331
5331
|
} else k.request ? d = "Network error. Please check your connection and try again." : d = k.message || "An unexpected error occurred while loading configuration.";
|
|
5332
|
-
ve.error(d),
|
|
5332
|
+
ve.error(d), P();
|
|
5333
5333
|
} finally {
|
|
5334
5334
|
N(!1);
|
|
5335
5335
|
}
|
|
5336
5336
|
};
|
|
5337
|
-
r && (
|
|
5338
|
-
}, [r,
|
|
5339
|
-
const
|
|
5337
|
+
r && (c(r), t ? f() : P());
|
|
5338
|
+
}, [r, R, t, s]);
|
|
5339
|
+
const E = (f, k) => {
|
|
5340
5340
|
y((d) => ({
|
|
5341
5341
|
...d,
|
|
5342
5342
|
[f]: k
|
|
@@ -5344,36 +5344,36 @@ function Bn({
|
|
|
5344
5344
|
const h = { ...d };
|
|
5345
5345
|
return h[f] && delete h[f], h;
|
|
5346
5346
|
});
|
|
5347
|
-
},
|
|
5347
|
+
}, V = () => {
|
|
5348
5348
|
const f = {};
|
|
5349
|
-
return !u || !
|
|
5349
|
+
return !u || !i || u.configuration.forEach((k) => {
|
|
5350
5350
|
if (k.type === "section")
|
|
5351
5351
|
k.fields.forEach((d) => {
|
|
5352
5352
|
if (d.required) {
|
|
5353
|
-
const h =
|
|
5353
|
+
const h = i[k.key]?.[d.key];
|
|
5354
5354
|
(!h || typeof h == "string" && h.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][d.key] = `${d.label} is required`);
|
|
5355
5355
|
}
|
|
5356
5356
|
});
|
|
5357
5357
|
else if (k.type === "datatable") {
|
|
5358
|
-
const d =
|
|
5358
|
+
const d = i[k.key];
|
|
5359
5359
|
Array.isArray(d) && d.forEach((h, x) => {
|
|
5360
|
-
k.fields.forEach((
|
|
5361
|
-
if (
|
|
5362
|
-
const
|
|
5363
|
-
(!
|
|
5360
|
+
k.fields.forEach((F) => {
|
|
5361
|
+
if (F.required) {
|
|
5362
|
+
const z = h[F.key];
|
|
5363
|
+
(!z || typeof z == "string" && z.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][x] || (f[k.key][x] = {}), f[k.key][x][F.key] = `${F.label} is required`);
|
|
5364
5364
|
}
|
|
5365
5365
|
});
|
|
5366
5366
|
});
|
|
5367
5367
|
}
|
|
5368
5368
|
}), f;
|
|
5369
|
-
}, U = (f) => Object.keys(f).length > 0,
|
|
5370
|
-
const f =
|
|
5369
|
+
}, U = (f) => Object.keys(f).length > 0, j = () => {
|
|
5370
|
+
const f = V();
|
|
5371
5371
|
if (g(f), U(f)) {
|
|
5372
5372
|
let d = [];
|
|
5373
5373
|
Object.keys(f).forEach((h) => {
|
|
5374
5374
|
typeof f[h] == "object" && Object.keys(f[h]).forEach((x) => {
|
|
5375
|
-
typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((
|
|
5376
|
-
d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][
|
|
5375
|
+
typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((F) => {
|
|
5376
|
+
d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][F]}`);
|
|
5377
5377
|
}) : d.push(`${h}: ${f[h][x]}`);
|
|
5378
5378
|
});
|
|
5379
5379
|
});
|
|
@@ -5383,27 +5383,30 @@ function Bn({
|
|
|
5383
5383
|
try {
|
|
5384
5384
|
w(!0);
|
|
5385
5385
|
const d = {};
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5386
|
+
i && Object.keys(i).forEach((x) => {
|
|
5387
|
+
const F = r?.configuration?.find(
|
|
5388
|
+
(z) => z.key === x && z.type === "datatable"
|
|
5389
|
+
);
|
|
5390
|
+
F && Array.isArray(i[x]) ? d[x] = i[x].map((z) => {
|
|
5391
|
+
const q = { id: z.id || 0 };
|
|
5392
|
+
return F.fields && F.fields.forEach((D) => {
|
|
5393
|
+
if (D.fieldtype === "audience") {
|
|
5394
|
+
let A = { users: [], groups: [], roles: [] };
|
|
5395
|
+
z[D.key] && typeof z[D.key] == "object" && !Array.isArray(z[D.key]) && (A = {
|
|
5396
|
+
users: z[D.key].users || [],
|
|
5397
|
+
groups: z[D.key].groups || [],
|
|
5398
|
+
roles: z[D.key].roles || []
|
|
5399
|
+
}), q[D.key] = A;
|
|
5400
|
+
} else
|
|
5401
|
+
q[D.key] = z[D.key] || "";
|
|
5402
|
+
}), q;
|
|
5403
|
+
}) : d[x] = i[x];
|
|
5401
5404
|
});
|
|
5402
|
-
let h = await
|
|
5405
|
+
let h = await Fe(O, d);
|
|
5403
5406
|
if (console.log(), h && h.status != "fail") {
|
|
5404
5407
|
g({});
|
|
5405
5408
|
const x = h.message || "Configuration has been saved successfully";
|
|
5406
|
-
ve.success(x), n && typeof n == "function" && n(
|
|
5409
|
+
ve.success(x), n && typeof n == "function" && n(i);
|
|
5407
5410
|
} else
|
|
5408
5411
|
throw ve.error(h?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5409
5412
|
} catch (d) {
|
|
@@ -5425,7 +5428,7 @@ function Bn({
|
|
|
5425
5428
|
return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
|
|
5426
5429
|
const p = r?.configuration || u?.configuration;
|
|
5427
5430
|
return Q(() => {
|
|
5428
|
-
s && r ? (!
|
|
5431
|
+
s && r ? (!i || Object.keys(i).length === 0) && P() : s && !r && P();
|
|
5429
5432
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5430
5433
|
/* @__PURE__ */ l(
|
|
5431
5434
|
"div",
|
|
@@ -5441,8 +5444,8 @@ function Bn({
|
|
|
5441
5444
|
d,
|
|
5442
5445
|
{
|
|
5443
5446
|
item: f,
|
|
5444
|
-
data:
|
|
5445
|
-
updateHandler:
|
|
5447
|
+
data: i,
|
|
5448
|
+
updateHandler: E,
|
|
5446
5449
|
validationErrors: m
|
|
5447
5450
|
},
|
|
5448
5451
|
k
|
|
@@ -5465,7 +5468,7 @@ function Bn({
|
|
|
5465
5468
|
Z,
|
|
5466
5469
|
{
|
|
5467
5470
|
category: "primary",
|
|
5468
|
-
onClick:
|
|
5471
|
+
onClick: j,
|
|
5469
5472
|
disabled: a,
|
|
5470
5473
|
label: a ? "Saving..." : "Apply",
|
|
5471
5474
|
type: "submit"
|
|
@@ -5479,7 +5482,7 @@ const us = ({
|
|
|
5479
5482
|
appid: r = "Configuration-Page",
|
|
5480
5483
|
disableApi: s = !1
|
|
5481
5484
|
}) => {
|
|
5482
|
-
const [o, n] = L(0), [u,
|
|
5485
|
+
const [o, n] = L(0), [u, c] = L(!1), [i, y] = L(r), {
|
|
5483
5486
|
pageHeader: b = {},
|
|
5484
5487
|
appletHeader: N = {},
|
|
5485
5488
|
breadcrumb: a = [],
|
|
@@ -5497,7 +5500,7 @@ const us = ({
|
|
|
5497
5500
|
disabled: !0,
|
|
5498
5501
|
placeholder: r
|
|
5499
5502
|
}, f.some((x) => x.key === "displayname")) {
|
|
5500
|
-
const x = f.findIndex((
|
|
5503
|
+
const x = f.findIndex((F) => F.key === "displayname");
|
|
5501
5504
|
f[x] = {
|
|
5502
5505
|
...f[x],
|
|
5503
5506
|
default: r,
|
|
@@ -5528,14 +5531,14 @@ const us = ({
|
|
|
5528
5531
|
isLeftArrow: !0,
|
|
5529
5532
|
onBackClick: () => window.history.back(),
|
|
5530
5533
|
...b
|
|
5531
|
-
},
|
|
5534
|
+
}, O = a.map((p) => ({
|
|
5532
5535
|
label: p.text,
|
|
5533
5536
|
href: p.href || "#"
|
|
5534
|
-
})),
|
|
5535
|
-
console.log("handleCancelRequest called - showing modal"),
|
|
5537
|
+
})), R = K(() => {
|
|
5538
|
+
console.log("handleCancelRequest called - showing modal"), c(!0);
|
|
5536
5539
|
}, []), S = K((p) => {
|
|
5537
|
-
|
|
5538
|
-
}, []),
|
|
5540
|
+
c(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5541
|
+
}, []), B = () => {
|
|
5539
5542
|
for (const p of g)
|
|
5540
5543
|
if (p.type === "section" && p.fields) {
|
|
5541
5544
|
const f = p.fields.find((k) => k.key === "displayname");
|
|
@@ -5545,20 +5548,20 @@ const us = ({
|
|
|
5545
5548
|
return r;
|
|
5546
5549
|
};
|
|
5547
5550
|
re.useEffect(() => {
|
|
5548
|
-
y(
|
|
5551
|
+
y(B());
|
|
5549
5552
|
}, [g]);
|
|
5550
|
-
const
|
|
5553
|
+
const P = K((p) => {
|
|
5551
5554
|
console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
|
|
5552
5555
|
const k = p[f];
|
|
5553
5556
|
console.log(`Checking section ${f}:`, k), k && k.displayname && (console.log("Found displayname:", k.displayname), y(k.displayname));
|
|
5554
5557
|
});
|
|
5555
|
-
}, []),
|
|
5558
|
+
}, []), E = {
|
|
5556
5559
|
subHeading: "Application configuration and details",
|
|
5557
5560
|
tags: [],
|
|
5558
5561
|
...N,
|
|
5559
|
-
heading:
|
|
5562
|
+
heading: i
|
|
5560
5563
|
// Ensure displayname always overrides config heading
|
|
5561
|
-
},
|
|
5564
|
+
}, V = {
|
|
5562
5565
|
about: "This application provides comprehensive functionality for your organization.",
|
|
5563
5566
|
images: {
|
|
5564
5567
|
desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
|
|
@@ -5577,10 +5580,10 @@ const us = ({
|
|
|
5577
5580
|
],
|
|
5578
5581
|
...w
|
|
5579
5582
|
}, U = [
|
|
5580
|
-
{ label: "Overview", content: v(
|
|
5581
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel:
|
|
5583
|
+
{ label: "Overview", content: v(V) },
|
|
5584
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: R, onSave: P }) }
|
|
5582
5585
|
];
|
|
5583
|
-
function
|
|
5586
|
+
function j(p) {
|
|
5584
5587
|
return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
|
|
5585
5588
|
}
|
|
5586
5589
|
function v(p) {
|
|
@@ -5630,18 +5633,18 @@ const us = ({
|
|
|
5630
5633
|
Qr,
|
|
5631
5634
|
{
|
|
5632
5635
|
heading: $.heading,
|
|
5633
|
-
subHeading:
|
|
5634
|
-
breadcrumbItems:
|
|
5636
|
+
subHeading: O.length > 0 ? void 0 : $.subHeading,
|
|
5637
|
+
breadcrumbItems: O,
|
|
5635
5638
|
isLeftArrow: $.isLeftArrow,
|
|
5636
5639
|
onBackClick: $.onBackClick
|
|
5637
5640
|
}
|
|
5638
5641
|
),
|
|
5639
5642
|
/* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5640
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children:
|
|
5643
|
+
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: j(E.icon) }),
|
|
5641
5644
|
/* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
|
|
5642
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5643
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5644
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5645
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: E.heading }),
|
|
5646
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: E.subHeading }),
|
|
5647
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: E.tags && E.tags.map((p, f) => /* @__PURE__ */ e(
|
|
5645
5648
|
"span",
|
|
5646
5649
|
{
|
|
5647
5650
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5712,8 +5715,8 @@ const hs = ({
|
|
|
5712
5715
|
apiRef: n,
|
|
5713
5716
|
// preferred
|
|
5714
5717
|
onAdd: u,
|
|
5715
|
-
onFilterOpen:
|
|
5716
|
-
addBtnText:
|
|
5718
|
+
onFilterOpen: c,
|
|
5719
|
+
addBtnText: i = "Add",
|
|
5717
5720
|
// Feature toggles
|
|
5718
5721
|
showSearch: y = !0,
|
|
5719
5722
|
showColumnChooser: b = !0,
|
|
@@ -5724,30 +5727,30 @@ const hs = ({
|
|
|
5724
5727
|
showRefresh: g = !1,
|
|
5725
5728
|
showAdd: $ = !1,
|
|
5726
5729
|
// Additional props
|
|
5727
|
-
searchPlaceholder:
|
|
5728
|
-
handleRefreshClick:
|
|
5730
|
+
searchPlaceholder: O = "Search...",
|
|
5731
|
+
handleRefreshClick: R = () => {
|
|
5729
5732
|
},
|
|
5730
5733
|
handleSearchChange: S = () => {
|
|
5731
5734
|
},
|
|
5732
5735
|
// Optional: override export file names
|
|
5733
|
-
excelFileName:
|
|
5734
|
-
pdfFileName:
|
|
5736
|
+
excelFileName: B,
|
|
5737
|
+
pdfFileName: P
|
|
5735
5738
|
}) => {
|
|
5736
|
-
const
|
|
5739
|
+
const E = () => n?.current || o?.current, [V, U] = re.useState(""), j = (t || "export").toString().trim() || "export", v = `${B || j}.xlsx`, p = `${P || j}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), k = K(
|
|
5737
5740
|
(h) => {
|
|
5738
|
-
const x =
|
|
5741
|
+
const x = E();
|
|
5739
5742
|
if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
|
|
5740
5743
|
if (typeof window > "u" || !h?.currentTarget) {
|
|
5741
5744
|
x.openColumnChooser();
|
|
5742
5745
|
return;
|
|
5743
5746
|
}
|
|
5744
5747
|
try {
|
|
5745
|
-
const
|
|
5746
|
-
let
|
|
5747
|
-
const
|
|
5748
|
-
|
|
5749
|
-
} catch (
|
|
5750
|
-
console.log("coloumn choose error",
|
|
5748
|
+
const F = h.currentTarget.getBoundingClientRect(), z = F.left + window.scrollX, q = F.bottom + window.scrollY;
|
|
5749
|
+
let D = z - 120, A = q - 120;
|
|
5750
|
+
const M = window.innerWidth, T = window.innerHeight;
|
|
5751
|
+
D = f(D, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + T - 120), console.log("openColumnChooserNear", D, A), x.openColumnChooser(D, A);
|
|
5752
|
+
} catch (F) {
|
|
5753
|
+
console.log("coloumn choose error", F);
|
|
5751
5754
|
}
|
|
5752
5755
|
}
|
|
5753
5756
|
},
|
|
@@ -5755,27 +5758,27 @@ const hs = ({
|
|
|
5755
5758
|
// no external deps; reads ref at call time
|
|
5756
5759
|
), d = K(
|
|
5757
5760
|
(h, x) => {
|
|
5758
|
-
const
|
|
5759
|
-
if (
|
|
5761
|
+
const F = E();
|
|
5762
|
+
if (F)
|
|
5760
5763
|
switch (h) {
|
|
5761
5764
|
case "ColumnChooser":
|
|
5762
|
-
b && (console.log("openColumnChooser", x), x ? k(x) :
|
|
5765
|
+
b && (console.log("openColumnChooser", x), x ? k(x) : F.openColumnChooser?.()), console.log("openColumnChooser out", x);
|
|
5763
5766
|
break;
|
|
5764
5767
|
case "Print":
|
|
5765
|
-
a &&
|
|
5768
|
+
a && F.print?.();
|
|
5766
5769
|
break;
|
|
5767
5770
|
case "Excel":
|
|
5768
|
-
w &&
|
|
5771
|
+
w && F.excelExport?.({ fileName: v });
|
|
5769
5772
|
break;
|
|
5770
5773
|
case "Pdf":
|
|
5771
|
-
m &&
|
|
5774
|
+
m && F.pdfExport?.({ fileName: p });
|
|
5772
5775
|
break;
|
|
5773
5776
|
case "Refresh":
|
|
5774
|
-
g &&
|
|
5777
|
+
g && R();
|
|
5775
5778
|
break;
|
|
5776
5779
|
}
|
|
5777
5780
|
},
|
|
5778
|
-
[b, a, w, m, g, v, p,
|
|
5781
|
+
[b, a, w, m, g, v, p, R, k]
|
|
5779
5782
|
);
|
|
5780
5783
|
return /* @__PURE__ */ l("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
|
|
5781
5784
|
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
@@ -5790,8 +5793,8 @@ const hs = ({
|
|
|
5790
5793
|
y && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
5791
5794
|
he,
|
|
5792
5795
|
{
|
|
5793
|
-
placeholder:
|
|
5794
|
-
value:
|
|
5796
|
+
placeholder: O,
|
|
5797
|
+
value: V,
|
|
5795
5798
|
onDebouncedChange: (h) => {
|
|
5796
5799
|
U(h), S(h);
|
|
5797
5800
|
}
|
|
@@ -5814,7 +5817,7 @@ const hs = ({
|
|
|
5814
5817
|
Z,
|
|
5815
5818
|
{
|
|
5816
5819
|
icon: Wt,
|
|
5817
|
-
onClick:
|
|
5820
|
+
onClick: c,
|
|
5818
5821
|
size: "small",
|
|
5819
5822
|
ariaLabel: "Filters",
|
|
5820
5823
|
category: "secondary",
|
|
@@ -5869,12 +5872,12 @@ const hs = ({
|
|
|
5869
5872
|
$ && u && /* @__PURE__ */ e(
|
|
5870
5873
|
Z,
|
|
5871
5874
|
{
|
|
5872
|
-
label:
|
|
5875
|
+
label: i,
|
|
5873
5876
|
icon: Ht,
|
|
5874
5877
|
onClick: u,
|
|
5875
5878
|
size: "small",
|
|
5876
5879
|
ariaLabel: "Add New",
|
|
5877
|
-
title:
|
|
5880
|
+
title: i
|
|
5878
5881
|
}
|
|
5879
5882
|
)
|
|
5880
5883
|
] })
|
|
@@ -5889,8 +5892,8 @@ function ps(t) {
|
|
|
5889
5892
|
pageIndex: n = 1,
|
|
5890
5893
|
// 1-based
|
|
5891
5894
|
pageSize: u = 10,
|
|
5892
|
-
allowPaging:
|
|
5893
|
-
allowSorting:
|
|
5895
|
+
allowPaging: c = !0,
|
|
5896
|
+
allowSorting: i = !0,
|
|
5894
5897
|
allowFiltering: y = !1,
|
|
5895
5898
|
allowGrouping: b = !1,
|
|
5896
5899
|
allowReordering: N = !0,
|
|
@@ -5899,15 +5902,15 @@ function ps(t) {
|
|
|
5899
5902
|
allowPdfExport: m = !1,
|
|
5900
5903
|
showColumnChooser: g = !1,
|
|
5901
5904
|
enableSearchApi: $ = !1,
|
|
5902
|
-
height:
|
|
5903
|
-
selectionSettings:
|
|
5905
|
+
height: O = "600",
|
|
5906
|
+
selectionSettings: R = { type: "Multiple", mode: "Row" },
|
|
5904
5907
|
enableCheckbox: S = !1,
|
|
5905
|
-
columns:
|
|
5906
|
-
onGridStateChange:
|
|
5907
|
-
onRowSelected:
|
|
5908
|
-
onRowDeselected:
|
|
5908
|
+
columns: B = [],
|
|
5909
|
+
onGridStateChange: P,
|
|
5910
|
+
onRowSelected: E,
|
|
5911
|
+
onRowDeselected: V,
|
|
5909
5912
|
onRowDoubleClick: U,
|
|
5910
|
-
apiRef:
|
|
5913
|
+
apiRef: j,
|
|
5911
5914
|
gridProps: v = {}
|
|
5912
5915
|
} = t, p = ue(null), {
|
|
5913
5916
|
pageSettings: f,
|
|
@@ -5915,62 +5918,62 @@ function ps(t) {
|
|
|
5915
5918
|
...d
|
|
5916
5919
|
} = v || {}, h = ne(() => {
|
|
5917
5920
|
const C = [wr];
|
|
5918
|
-
return
|
|
5919
|
-
}, [
|
|
5920
|
-
const C = () => p.current,
|
|
5921
|
-
!H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${
|
|
5921
|
+
return i && C.push(Cr), y && C.push(Sr), b && C.push(Dr), $ && C.push($r), w && C.push(Fr), m && C.push(Tr), g && C.push(Ar), a && C.push(Er), N && C.push(Rr), C.push(Ir), C;
|
|
5922
|
+
}, [i, y, b, $, w, m, g, a, N]), x = ne(() => {
|
|
5923
|
+
const C = () => p.current, I = (G, H) => {
|
|
5924
|
+
!H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${G} requested but related service/feature is disabled.`);
|
|
5922
5925
|
};
|
|
5923
5926
|
return {
|
|
5924
5927
|
getInstance: () => C(),
|
|
5925
5928
|
refresh: () => C()?.refresh?.(),
|
|
5926
5929
|
getSelectedRecords: () => C()?.getSelectedRecords?.() ?? [],
|
|
5927
5930
|
clearSelection: () => C()?.clearSelection?.(),
|
|
5928
|
-
selectRow: (
|
|
5929
|
-
selectRows: (
|
|
5930
|
-
search: (
|
|
5931
|
-
|
|
5931
|
+
selectRow: (G) => C()?.selectRow?.(G),
|
|
5932
|
+
selectRows: (G) => C()?.selectRows?.(G),
|
|
5933
|
+
search: (G) => {
|
|
5934
|
+
I("search()", $), C()?.search?.(G);
|
|
5932
5935
|
},
|
|
5933
5936
|
print: () => C()?.print?.(),
|
|
5934
|
-
excelExport: (
|
|
5935
|
-
|
|
5937
|
+
excelExport: (G) => {
|
|
5938
|
+
I("excelExport()", w), C()?.excelExport?.(G);
|
|
5936
5939
|
},
|
|
5937
|
-
pdfExport: (
|
|
5938
|
-
|
|
5940
|
+
pdfExport: (G) => {
|
|
5941
|
+
I("pdfExport()", m), C()?.pdfExport?.(G);
|
|
5939
5942
|
},
|
|
5940
|
-
openColumnChooser: (
|
|
5941
|
-
|
|
5943
|
+
openColumnChooser: (G, H) => {
|
|
5944
|
+
I("openColumnChooser()", g), C()?.columnChooserModule?.openColumnChooser?.(G, H);
|
|
5942
5945
|
}
|
|
5943
5946
|
};
|
|
5944
5947
|
}, []);
|
|
5945
5948
|
Q(() => {
|
|
5946
|
-
|
|
5947
|
-
}, [
|
|
5948
|
-
|
|
5949
|
+
j && (j.current = x);
|
|
5950
|
+
}, [j, x]), Q(() => () => {
|
|
5951
|
+
j && (j.current = null);
|
|
5949
5952
|
}, []);
|
|
5950
|
-
const
|
|
5951
|
-
const
|
|
5952
|
-
return
|
|
5953
|
-
},
|
|
5953
|
+
const F = (C) => {
|
|
5954
|
+
const I = String(C || "");
|
|
5955
|
+
return I === "Ascending" || I === "Descending" ? I : I.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
5956
|
+
}, z = ne(() => ({
|
|
5954
5957
|
pageSize: u,
|
|
5955
5958
|
currentPage: n,
|
|
5956
5959
|
totalRecordsCount: s,
|
|
5957
5960
|
pageSizes: !0,
|
|
5958
5961
|
...f || {}
|
|
5959
|
-
}), [n, u, s, f]),
|
|
5960
|
-
if (!
|
|
5961
|
-
const C = (k.columns || []).map((
|
|
5962
|
-
...
|
|
5963
|
-
direction:
|
|
5962
|
+
}), [n, u, s, f]), q = ne(() => {
|
|
5963
|
+
if (!i || !k) return;
|
|
5964
|
+
const C = (k.columns || []).map((I) => ({
|
|
5965
|
+
...I,
|
|
5966
|
+
direction: F(I.direction || I.dir)
|
|
5964
5967
|
}));
|
|
5965
5968
|
return { allowUnsort: !0, ...k, columns: C };
|
|
5966
|
-
}, [k,
|
|
5967
|
-
const
|
|
5969
|
+
}, [k, i]), D = (C) => {
|
|
5970
|
+
const I = p.current, G = C?.requestType, H = G === "paging" ? "paging" : G === "sorting" ? "sorting" : G === "searching" ? "searching" : G === "filtering" ? "filtering" : G === "grouping" ? "grouping" : G === "reorder" ? "reorder" : G === "columnstate" ? "columnstate" : "other", ce = C?.pageSize ?? I?.pageSettings?.pageSize ?? u, ie = C?.currentPage ?? I?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: F(C.direction) }] : (I?.sortSettings?.columns || []).map((Ce) => ({
|
|
5968
5971
|
field: Ce.field,
|
|
5969
|
-
dir:
|
|
5970
|
-
})), Ge = C?.searchString ?? "", _e = C?.columns ??
|
|
5972
|
+
dir: F(Ce.direction ?? Ce.dir)
|
|
5973
|
+
})), Ge = C?.searchString ?? "", _e = C?.columns ?? I?.filterSettings?.columns ?? [];
|
|
5971
5974
|
return {
|
|
5972
5975
|
reason: H,
|
|
5973
|
-
page: { index:
|
|
5976
|
+
page: { index: ie, size: ce, skip: (ie - 1) * ce, take: ce },
|
|
5974
5977
|
sort: je,
|
|
5975
5978
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
5976
5979
|
search: Ge,
|
|
@@ -5984,25 +5987,25 @@ function ps(t) {
|
|
|
5984
5987
|
id: o,
|
|
5985
5988
|
ref: p,
|
|
5986
5989
|
dataSource: r,
|
|
5987
|
-
height:
|
|
5988
|
-
allowPaging:
|
|
5989
|
-
allowSorting:
|
|
5990
|
+
height: O,
|
|
5991
|
+
allowPaging: c,
|
|
5992
|
+
allowSorting: i,
|
|
5990
5993
|
allowFiltering: y,
|
|
5991
5994
|
allowGrouping: b,
|
|
5992
5995
|
allowReordering: N,
|
|
5993
5996
|
allowResizing: a,
|
|
5994
5997
|
showColumnChooser: g,
|
|
5995
|
-
selectionSettings:
|
|
5996
|
-
pageSettings:
|
|
5997
|
-
sortSettings:
|
|
5998
|
+
selectionSettings: R,
|
|
5999
|
+
pageSettings: z,
|
|
6000
|
+
sortSettings: q,
|
|
5998
6001
|
actionBegin: (C) => {
|
|
5999
|
-
if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof
|
|
6000
|
-
const
|
|
6001
|
-
|
|
6002
|
+
if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof P == "function") {
|
|
6003
|
+
const G = D(C);
|
|
6004
|
+
P(G, C);
|
|
6002
6005
|
}
|
|
6003
6006
|
},
|
|
6004
|
-
rowSelected:
|
|
6005
|
-
rowDeselected:
|
|
6007
|
+
rowSelected: E,
|
|
6008
|
+
rowDeselected: V,
|
|
6006
6009
|
recordDoubleClick: (C) => {
|
|
6007
6010
|
typeof U == "function" && U(C?.rowData, C);
|
|
6008
6011
|
},
|
|
@@ -6010,11 +6013,11 @@ function ps(t) {
|
|
|
6010
6013
|
children: [
|
|
6011
6014
|
/* @__PURE__ */ e(Br, { children: (() => {
|
|
6012
6015
|
const C = [];
|
|
6013
|
-
return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")),
|
|
6016
|
+
return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), B.forEach((I, G) => {
|
|
6014
6017
|
const {
|
|
6015
6018
|
field: H,
|
|
6016
|
-
headerText:
|
|
6017
|
-
width:
|
|
6019
|
+
headerText: ce,
|
|
6020
|
+
width: ie,
|
|
6018
6021
|
textAlign: je = "Left",
|
|
6019
6022
|
template: Ge,
|
|
6020
6023
|
isPrimaryKey: _e,
|
|
@@ -6028,14 +6031,14 @@ function ps(t) {
|
|
|
6028
6031
|
maxWidth: rt,
|
|
6029
6032
|
customAttributes: nt,
|
|
6030
6033
|
...st
|
|
6031
|
-
} =
|
|
6034
|
+
} = I || {};
|
|
6032
6035
|
C.push(
|
|
6033
6036
|
/* @__PURE__ */ e(
|
|
6034
6037
|
ra,
|
|
6035
6038
|
{
|
|
6036
6039
|
field: H,
|
|
6037
|
-
headerText:
|
|
6038
|
-
width:
|
|
6040
|
+
headerText: ce,
|
|
6041
|
+
width: ie,
|
|
6039
6042
|
textAlign: je,
|
|
6040
6043
|
template: Ge,
|
|
6041
6044
|
isPrimaryKey: _e,
|
|
@@ -6050,7 +6053,7 @@ function ps(t) {
|
|
|
6050
6053
|
customAttributes: nt,
|
|
6051
6054
|
...st
|
|
6052
6055
|
},
|
|
6053
|
-
H || `col-${
|
|
6056
|
+
H || `col-${G}`
|
|
6054
6057
|
)
|
|
6055
6058
|
);
|
|
6056
6059
|
}), C;
|
|
@@ -6069,7 +6072,7 @@ export {
|
|
|
6069
6072
|
Vr as Button,
|
|
6070
6073
|
Aa as Checkbox,
|
|
6071
6074
|
ps as CustomDataGrid,
|
|
6072
|
-
|
|
6075
|
+
cs as CustomDialog,
|
|
6073
6076
|
hs as CustomGridToolbar,
|
|
6074
6077
|
ds as CustomTab,
|
|
6075
6078
|
za as DatePicker,
|
|
@@ -6096,14 +6099,14 @@ export {
|
|
|
6096
6099
|
ms as ToastProvider,
|
|
6097
6100
|
Ma as ToggleSwitch,
|
|
6098
6101
|
es as Tooltip,
|
|
6099
|
-
|
|
6102
|
+
is as TreeView,
|
|
6100
6103
|
Z as UnifyedCoreButton,
|
|
6101
6104
|
as as WizardModal,
|
|
6102
6105
|
Ga as adGroupsListSearchApi,
|
|
6103
6106
|
sn as axiosDelete,
|
|
6104
|
-
|
|
6107
|
+
$e as axiosGet,
|
|
6105
6108
|
ls as axiosPatch,
|
|
6106
|
-
|
|
6109
|
+
Fe as axiosPost,
|
|
6107
6110
|
ln as axiosPut,
|
|
6108
6111
|
ns as cookies,
|
|
6109
6112
|
nn as createHttpClient,
|